chore: 🤖 rip out all existing projects, orgs, and sub scopes
This commit is contained in:
203 files changed
+68
-6575
No files matched your search
@@ -1,53 +0,0 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@name="name"
|
||||
@type="name"
|
||||
@value={{@model.name}}
|
||||
@label={{t "form.name.label"}}
|
||||
@helperText={{t "form.name.help"}}
|
||||
@error={{@model.errors.name}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name="description"
|
||||
@type="description"
|
||||
@value={{@model.description}}
|
||||
@label={{t "form.description.label"}}
|
||||
@helperText={{t "form.description.help"}}
|
||||
@error={{@model.errors.description}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t "actions.edit-form"}}
|
||||
@submitText={{t "actions.save"}}
|
||||
@cancelText={{t "actions.cancel"}} />
|
||||
|
||||
</Rose::Form>
|
||||
@@ -1,56 +0,0 @@
|
||||
{{#if this.hasAvailableHosts}}
|
||||
<Rose::Form
|
||||
class="full-width"
|
||||
@onSubmit={{fn this.submit @submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.actions
|
||||
@submitText={{t "actions.add-hosts"}}
|
||||
@cancelText={{t "actions.cancel"}} />
|
||||
|
||||
<Rose::Table as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>{{t "form.name.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "form.type.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "form.id.label"}}</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each this.filteredHosts as |host|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.checkbox
|
||||
@label={{host.id}}
|
||||
@description={{host.description}}
|
||||
onChange={{fn this.toggleHost host}} />
|
||||
</row.cell>
|
||||
<row.cell>{{host.name}}</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{host.type}}</Rose::Badge>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
|
||||
</Rose::Form>
|
||||
{{/if}}
|
||||
|
||||
{{#unless this.hasAvailableHosts}}
|
||||
<Rose::Layout::Centered>
|
||||
<Rose::Message @title={{t "resources.host-set.host.messages.add-none.title"}} as |message|>
|
||||
<message.description>
|
||||
{{t "resources.host-set.host.messages.add-none.description"}}
|
||||
</message.description>
|
||||
<message.link @route="scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set.hosts">
|
||||
<Rose::Icon @name="chevron-left" />
|
||||
{{t "actions.back"}}
|
||||
</message.link>
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
{{/unless}}
|
||||
@@ -1,57 +0,0 @@
|
||||
import Component from '@glimmer/component';
|
||||
import { computed, action } from '@ember/object';
|
||||
import { A } from '@ember/array';
|
||||
|
||||
export default class FormHostSetAddHostsIndexComponent extends Component {
|
||||
// =properties
|
||||
|
||||
/**
|
||||
* Array of selected host IDs.
|
||||
* @type {EmberArray}
|
||||
*/
|
||||
selectedHostIDs = A();
|
||||
|
||||
/**
|
||||
* Checks for unassigned hosts.
|
||||
* @param {[HostModel]} filteredHosts
|
||||
* @type {boolean}
|
||||
*/
|
||||
@computed('filteredHosts.length')
|
||||
get hasAvailableHosts() {
|
||||
return this.filteredHosts.length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hosts currently not assigned to current host set.
|
||||
* @type {[HostModel]}
|
||||
*/
|
||||
@computed('args.{model,model.host_ids,hosts}')
|
||||
get filteredHosts() {
|
||||
const currentHostIDs = this.args.model.host_ids.map((host) => host.value);
|
||||
return this.args.hosts.filter(({ id }) => !currentHostIDs.includes(id));
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
* Toggle host selection
|
||||
* @param {HostModel} host
|
||||
*/
|
||||
@action
|
||||
toggleHost(host) {
|
||||
if (!this.selectedHostIDs.includes(host.id)) {
|
||||
this.selectedHostIDs.addObject(host.id);
|
||||
} else {
|
||||
this.selectedHostIDs.removeObject(host.id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback submit with selected host ids
|
||||
* @param {requestCallback} fn
|
||||
*/
|
||||
@action
|
||||
submit(fn) {
|
||||
fn(this.selectedHostIDs);
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.host.isSaving}}
|
||||
@error={{@model.host.errors.base}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{@model.hostSet.displayName}}
|
||||
@label={{t "form.host_set.label"}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}} />
|
||||
|
||||
<form.input
|
||||
@value={{@model.host.type}}
|
||||
@label={{t "form.type.label"}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}} />
|
||||
|
||||
<form.input
|
||||
@name="name"
|
||||
@type="name"
|
||||
@value={{@model.host.name}}
|
||||
@label={{t "form.name.label"}}
|
||||
@error={{@model.host.errors.name}}
|
||||
@helperText={{t "form.name.help"}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.host.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.host.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name="description"
|
||||
@type="description"
|
||||
@value={{@model.host.description}}
|
||||
@label={{t "form.description.label"}}
|
||||
@error={{@model.host.errors.description}}
|
||||
@helperText={{t "form.description.help"}}
|
||||
disabled={{@model.host.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.host.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.host.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.input
|
||||
@name="address"
|
||||
@type="text"
|
||||
@value={{@model.host.attributes.address}}
|
||||
@label={{t "form.address.label"}}
|
||||
@error={{@model.host.errors.name}}
|
||||
@helperText={{t "form.address.help"}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.host.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.host.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.actions
|
||||
@disabled={{if @model.host.cannotSave @model.host.cannotSave}}
|
||||
@enableEditText={{t "actions.edit-form"}}
|
||||
@submitText={{t "actions.save"}}
|
||||
@cancelText={{t "actions.cancel"}} />
|
||||
|
||||
</Rose::Form>
|
||||
@@ -1,59 +0,0 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{@model.type}}
|
||||
@label={{t "form.type.label"}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}} />
|
||||
|
||||
<form.input
|
||||
@name="name"
|
||||
@type="name"
|
||||
@value={{@model.name}}
|
||||
@label={{t "form.name.label"}}
|
||||
@helperText={{t "form.name.help"}}
|
||||
@error={{@model.errors.name}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name="description"
|
||||
@type="description"
|
||||
@value={{@model.description}}
|
||||
@label={{t "form.description.label"}}
|
||||
@helperText={{t "form.description.help"}}
|
||||
@error={{@model.errors.description}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t "actions.edit-form"}}
|
||||
@submitText={{t "actions.save"}}
|
||||
@cancelText={{t "actions.cancel"}} />
|
||||
|
||||
</Rose::Form>
|
||||
@@ -1,77 +0,0 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{@model.type}}
|
||||
@label={{t "form.type.label"}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}} />
|
||||
|
||||
<form.input
|
||||
@name="name"
|
||||
@type="name"
|
||||
@value={{@model.name}}
|
||||
@label={{t "form.name.label"}}
|
||||
@error={{@model.errors.name}}
|
||||
@helperText={{t "form.name.help"}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name="description"
|
||||
@type="description"
|
||||
@value={{@model.description}}
|
||||
@label={{t "form.description.label"}}
|
||||
@error={{@model.errors.description}}
|
||||
@helperText={{t "form.description.help"}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.input
|
||||
@name="address"
|
||||
@type="text"
|
||||
@value={{@model.attributes.address}}
|
||||
@label={{t "form.address.label"}}
|
||||
@error={{@model.errors.name}}
|
||||
@helperText={{t "form.address.help"}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t "actions.edit-form"}}
|
||||
@submitText={{t "actions.save"}}
|
||||
@cancelText={{t "actions.cancel"}} />
|
||||
|
||||
</Rose::Form>
|
||||
@@ -1,53 +0,0 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@name="name"
|
||||
@type="name"
|
||||
@value={{@model.name}}
|
||||
@label={{t "form.name.label"}}
|
||||
@helperText={{t "form.name.help"}}
|
||||
@error={{@model.errors.name}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name="description"
|
||||
@type="description"
|
||||
@value={{@model.description}}
|
||||
@label={{t "form.description.label"}}
|
||||
@helperText={{t "form.description.help"}}
|
||||
@error={{@model.errors.description}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t "actions.edit-form"}}
|
||||
@submitText={{t "actions.save"}}
|
||||
@cancelText={{t "actions.cancel"}} />
|
||||
|
||||
</Rose::Form>
|
||||
@@ -1,53 +0,0 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@name="name"
|
||||
@type="name"
|
||||
@value={{@model.name}}
|
||||
@label={{t "form.name.label"}}
|
||||
@helperText={{t "form.name.help"}}
|
||||
@error={{@model.errors.name}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name="description"
|
||||
@type="description"
|
||||
@value={{@model.description}}
|
||||
@label={{t "form.description.label"}}
|
||||
@helperText={{t "form.description.help"}}
|
||||
@error={{@model.errors.description}}
|
||||
disabled={{@model.isSaving}}
|
||||
readonly={{false}}
|
||||
as |field|>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t "actions.edit-form"}}
|
||||
@submitText={{t "actions.save"}}
|
||||
@cancelText={{t "actions.cancel"}} />
|
||||
|
||||
</Rose::Form>
|
||||
@@ -1,60 +0,0 @@
|
||||
{{#if this.hasAvailableHostSets}}
|
||||
<Rose::Form
|
||||
class="full-width"
|
||||
@onSubmit={{fn this.submit @submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.actions
|
||||
@submitText={{t "actions.add-host-sets"}}
|
||||
@cancelText={{t "actions.cancel"}} />
|
||||
|
||||
<Rose::Table as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'form.type.label'}}</row.headerCell>
|
||||
<row.headerCell>{{t 'resources.host-catalog.title'}}</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each this.filteredHostSets as |hostSet|}}
|
||||
<body.row as |row|>
|
||||
<row.cell>
|
||||
<form.checkbox
|
||||
@label={{hostSet.id}}
|
||||
@description={{hostSet.description}}
|
||||
onChange={{fn this.toggleHostSet hostSet}} />
|
||||
</row.cell>
|
||||
<row.cell>{{hostSet.name}}</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{t (concat 'resources.host-set.types.' hostSet.type)}}</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<code>{{hostSet.host_catalog_id}}</code>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
|
||||
</Rose::Form>
|
||||
{{/if}}
|
||||
|
||||
{{#unless this.hasAvailableHostSets}}
|
||||
<Rose::Layout::Centered>
|
||||
<Rose::Message @title={{t "resources.target.host-set.messages.none.title"}} as |message|>
|
||||
<message.description>
|
||||
{{t "resources.target.host-set.messages.none.description"}}
|
||||
</message.description>
|
||||
<message.link @route="scopes.scope.projects.project.targets.target.host-sets">
|
||||
<Rose::Icon @name="chevron-left" />
|
||||
{{t "actions.back"}}
|
||||
</message.link>
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
{{/unless}}
|
||||
@@ -1,55 +0,0 @@
|
||||
import Component from '@glimmer/component';
|
||||
import { computed, action } from '@ember/object';
|
||||
import { A } from '@ember/array';
|
||||
|
||||
export default class FormTargetAddHostSetsComponent extends Component {
|
||||
// =properties
|
||||
|
||||
/**
|
||||
* Array of selected host set IDs.
|
||||
* @type {EmberArray}
|
||||
*/
|
||||
selectedHostSetIDs = A();
|
||||
|
||||
/**
|
||||
* Checks for unassigned hostsets.
|
||||
* @param {[HostSetModel]} filteredHostSets
|
||||
* @type {boolean}
|
||||
*/
|
||||
@computed('filteredHostSets.length')
|
||||
get hasAvailableHostSets() {
|
||||
return this.filteredHostSets.length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Host sets not already added to the target.
|
||||
* @type {[HostSetModel]}
|
||||
*/
|
||||
@computed('args.{hostSets.[],model.host_sets.[]}')
|
||||
get filteredHostSets() {
|
||||
// Get IDs for host sets already added to the current target
|
||||
const alreadyAddedHostSetIDs = this.args.model.host_sets.map(
|
||||
({ host_set_id }) => host_set_id
|
||||
);
|
||||
const notAddedHostSets = this.args.hostSets.filter(
|
||||
({ id }) => !alreadyAddedHostSetIDs.includes(id)
|
||||
);
|
||||
return notAddedHostSets;
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
@action
|
||||
toggleHostSet(hostSet) {
|
||||
if (!this.selectedHostSetIDs.includes(hostSet.id)) {
|
||||
this.selectedHostSetIDs.addObject(hostSet.id);
|
||||
} else {
|
||||
this.selectedHostSetIDs.removeObject(hostSet.id);
|
||||
}
|
||||
}
|
||||
|
||||
@action
|
||||
submit(fn) {
|
||||
fn(this.selectedHostSetIDs);
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
<Rose::Form
|
||||
@onSubmit={{@submit}}
|
||||
@cancel={{@cancel}}
|
||||
@disabled={{@model.isSaving}}
|
||||
@error={{@model.errors.base}}
|
||||
@showEditToggle={{if @model.isNew false true}}
|
||||
as |form|
|
||||
>
|
||||
|
||||
<form.input
|
||||
@value={{@model.type}}
|
||||
@label={{t "form.type.label"}}
|
||||
readonly={{true}}
|
||||
@disabled={{true}} />
|
||||
|
||||
<form.input
|
||||
@name="name"
|
||||
@type="text"
|
||||
@value={{@model.name}}
|
||||
@label={{t "form.name.label"}}
|
||||
@helperText={{t "form.name.help"}}
|
||||
@error={{@model.errors.name}}
|
||||
as |field|>
|
||||
{{#if @model.errors.name}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.name as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.textarea
|
||||
@name="description"
|
||||
@type="text"
|
||||
@value={{@model.description}}
|
||||
@label={{t "form.description.label"}}
|
||||
@helperText={{t "form.description.help"}}
|
||||
@error={{@model.errors.description}}
|
||||
as |field|>
|
||||
{{#if @model.errors.description}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.description as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.textarea>
|
||||
|
||||
<form.input
|
||||
@name="session_max_seconds"
|
||||
@type="number"
|
||||
@value={{@model.session_max_seconds}}
|
||||
@label={{t "form.session_max_seconds.label"}}
|
||||
@error={{@model.errors.session_max_seconds}}
|
||||
@helperText={{t "form.session_max_seconds.help"}}
|
||||
min="0"
|
||||
step="1"
|
||||
as |field|>
|
||||
{{#if @model.errors.session_max_seconds}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.session_max_seconds as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.input
|
||||
@name="session_connection_limit"
|
||||
@type="number"
|
||||
@value={{@model.session_connection_limit}}
|
||||
@label={{t "form.session_connection_limit.label"}}
|
||||
@error={{@model.errors.session_connection_limit}}
|
||||
@helperText={{t "form.session_connection_limit.help"}}
|
||||
min="-1"
|
||||
step="1"
|
||||
as |field|>
|
||||
{{#if @model.errors.session_connection_limit}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.session_connection_limit as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
{{!-- TODO this is a type-specific field --}}
|
||||
<form.input
|
||||
@name="default_port"
|
||||
@type="number"
|
||||
@value={{@model.attributes.default_port}}
|
||||
@label={{t "form.default_port.label"}}
|
||||
@error={{@model.errors.default_port}}
|
||||
@helperText={{t "form.default_port.help"}}
|
||||
min="0"
|
||||
step="1"
|
||||
as |field|>
|
||||
{{!-- TODO need to figure out how to reference `attributes.errors` here --}}
|
||||
{{#if @model.errors.default_port}}
|
||||
<field.errors as |errors|>
|
||||
{{#each @model.errors.default_port as |error|}}
|
||||
<errors.message>{{error.message}}</errors.message>
|
||||
{{/each}}
|
||||
</field.errors>
|
||||
{{/if}}
|
||||
</form.input>
|
||||
|
||||
<form.actions
|
||||
@disabled={{if @model.cannotSave @model.cannotSave}}
|
||||
@enableEditText={{t "actions.edit-form"}}
|
||||
@submitText={{t "actions.save"}}
|
||||
@cancelText={{t "actions.cancel"}} />
|
||||
|
||||
</Rose::Form>
|
||||
@@ -1,17 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeOrgsController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('resources.org.title_plural');
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeOrgsNewController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('titles.new');
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('resources.project.title_plural');
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsNewController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('titles.new');
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
|
||||
export default class ScopesScopeProjectsProjectController extends Controller {
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.model.displayName;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('resources.host-catalog.title_plural');
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogController extends Controller {
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.model.displayName;
|
||||
}
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Host sets breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('resources.host-set.title_plural');
|
||||
}
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHostSetController extends Controller {
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Host set breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.model.displayName;
|
||||
}
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHostSetCreateHostController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Translated new host set breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('resources.host-set.actions.create-host');
|
||||
}
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsNewController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Translated new host set breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('titles.new');
|
||||
}
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Hosts breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('resources.host.title_plural');
|
||||
}
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsHostController extends Controller {
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Host breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.model.displayName;
|
||||
}
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsNewController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Translated new host breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('titles.new');
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsNewController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Translated new role breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('titles.new');
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectSessionsController extends Controller {
|
||||
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('resources.session.title_plural');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Targets breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('resources.target.title_plural');
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsNewController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Translated new target breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('titles.new');
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsTargetController extends Controller {
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* A target breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.model.displayName;
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsTargetAddHostSetsController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('resources.target.actions.add-host-sets');
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsTargetHostSetsController extends Controller {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* Host sets breadcrumb
|
||||
* @type {string}
|
||||
*/
|
||||
get breadCrumb() {
|
||||
return this.intl.t('resources.host-set.title_plural');
|
||||
}
|
||||
}
|
||||
@@ -17,47 +17,6 @@ Router.map(function () {
|
||||
this.route('new');
|
||||
});
|
||||
|
||||
this.route('projects', function () {
|
||||
this.route('project', { path: ':project_id' }, function () {
|
||||
this.route('host-catalogs', function () {
|
||||
this.route('new');
|
||||
this.route(
|
||||
'host-catalog',
|
||||
{ path: ':host_catalog_id' },
|
||||
function () {
|
||||
this.route('host-sets', function () {
|
||||
this.route('host-set', { path: ':host_set_id' }, function () {
|
||||
this.route('hosts');
|
||||
this.route('add-hosts');
|
||||
this.route('create-host');
|
||||
});
|
||||
this.route('new');
|
||||
});
|
||||
this.route('hosts', function () {
|
||||
this.route('host', { path: ':host_id' }, function () {});
|
||||
this.route('new');
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
this.route('targets', function () {
|
||||
this.route('target', { path: ':target_id' }, function () {
|
||||
this.route('host-sets', function () {
|
||||
this.route(
|
||||
'host-set',
|
||||
{ path: ':host_set_id' },
|
||||
function () {}
|
||||
);
|
||||
});
|
||||
this.route('add-host-sets');
|
||||
});
|
||||
this.route('new');
|
||||
});
|
||||
this.route('sessions', function() {});
|
||||
});
|
||||
this.route('new');
|
||||
});
|
||||
|
||||
this.route('users', function () {
|
||||
this.route('user', { path: ':user_id' }, function () {
|
||||
this.route('accounts');
|
||||
|
||||
@@ -76,18 +76,11 @@ export default class ScopesScopeRoute extends Route {
|
||||
* @param {object} controller
|
||||
* @param {object} model
|
||||
*/
|
||||
renderTemplate(controller, model) {
|
||||
renderTemplate() {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render('scopes/scope/-header-nav', {
|
||||
into: 'application',
|
||||
outlet: 'header-nav',
|
||||
});
|
||||
|
||||
this.render('scopes/scope/-sidebar', {
|
||||
into: 'scopes/scope',
|
||||
outlet: 'sidebar',
|
||||
model: model,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -10,14 +10,7 @@ export default class ScopesScopeAuthenticateRoute extends Route {
|
||||
// =methods
|
||||
|
||||
beforeModel() {
|
||||
if (this.session.isAuthenticated) {
|
||||
const scope = this.modelFor('scopes.scope');
|
||||
if (scope.isGlobal) {
|
||||
this.transitionTo('scopes.scope.orgs');
|
||||
} else {
|
||||
this.transitionTo('scopes.scope.projects');
|
||||
}
|
||||
}
|
||||
if (this.session.isAuthenticated) this.transitionTo('scopes.scope.index');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default class ScopesScopeIndexRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service session;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Redirects to scopes/scope/authenticate for further processing.
|
||||
*/
|
||||
redirect() {
|
||||
this.transitionTo('scopes.scope.authenticate');
|
||||
if (!this.session.isAuthenticated) {
|
||||
this.transitionTo('scopes.scope.authenticate');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { notifySuccess, notifyError } from '../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeOrgsRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service session;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* If arriving here unauthenticated or from a non-global scope,
|
||||
* redirect to index for further processing.
|
||||
*/
|
||||
beforeModel() {
|
||||
if (!this.session.isAuthenticated) this.transitionTo('index');
|
||||
const scope = this.modelFor('scopes.scope');
|
||||
if(!scope.isGlobal) this.transitionTo('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all scopes under the global scope.
|
||||
* @return {Promise{[ScopeModel]}}
|
||||
*/
|
||||
async model() {
|
||||
return this.store.query('scope', { scope_id: 'global' });
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
* Rollback changes on org.
|
||||
* @param {ScopeModel} org
|
||||
*/
|
||||
@action
|
||||
cancel(org) {
|
||||
org.rollbackAttributes();
|
||||
this.transitionTo('scopes.scope.orgs');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle save org.
|
||||
* @param {ScopeModel} org
|
||||
* @param {Event} e
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.create-success')
|
||||
async save(org) {
|
||||
await org.save();
|
||||
await this.transitionTo('scopes.scope.projects', org);
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeOrgsIndexRoute extends Route {}
|
||||
@@ -1,16 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeOrgsNewRoute extends Route {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Creates a new unsaved org scope belonging to the global scope.
|
||||
* @return {ScopeModel}
|
||||
*/
|
||||
model() {
|
||||
return this.store.createRecord('scope', {
|
||||
type: 'org',
|
||||
scopeID: 'global',
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { confirm } from '../../../decorators/confirm';
|
||||
import { notifySuccess, notifyError } from '../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeProjectsRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
@service session;
|
||||
@service confirm;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* If arriving here unauthenticated, redirect to index for further processing.
|
||||
*/
|
||||
beforeModel() {
|
||||
if (!this.session.isAuthenticated) this.transitionTo('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads all scopes under the current scope.
|
||||
* @return {Promise{[ScopeModel]}}
|
||||
*/
|
||||
async model() {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope');
|
||||
return this.store.query('scope', { scope_id });
|
||||
}
|
||||
|
||||
/**
|
||||
* If arriving here within a verifiable project scope, redirect to its
|
||||
* parent, which is necessarily an org, in order to list projects.
|
||||
*
|
||||
* TODO: this conditional redirect based on the scope type is probably
|
||||
* necessary for many routes directly under scope, so we may want
|
||||
* to move this into a mixin.
|
||||
* @param {ScopeModel}
|
||||
*/
|
||||
redirect() {
|
||||
const { isProject, scopeID } = this.modelFor('scopes.scope');
|
||||
if (isProject) this.transitionTo('scopes.scope.projects', scopeID);
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
* Rollback changes on project.
|
||||
* @param {ProjectModel} project
|
||||
*/
|
||||
@action
|
||||
cancel(project) {
|
||||
const { isNew } = project;
|
||||
project.rollbackAttributes();
|
||||
if (isNew) this.transitionTo('scopes.scope.projects');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle save project.
|
||||
* @param {ProjectModel} project
|
||||
* @param {Event} e
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
async save(project) {
|
||||
await project.save();
|
||||
await this.transitionTo('scopes.scope.projects.project', project);
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the project and redirects to index.
|
||||
* @param {ProjectModel} project
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@confirm('questions.delete-confirm')
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async delete(project) {
|
||||
await project.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.projects');
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsIndexRoute extends Route {}
|
||||
@@ -1,17 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsNewRoute extends Route {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Creates a new unsaved project scope belonging to the current org scope.
|
||||
* @return {ScopeModel}
|
||||
*/
|
||||
model() {
|
||||
const { id } = this.modelFor('scopes.scope');
|
||||
return this.store.createRecord('scope', {
|
||||
type: 'project',
|
||||
scopeID: id,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectRoute extends Route {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Loads a scope by ID (ostensibly a project scope).
|
||||
* @param {object} params
|
||||
* @param {string} params.project_id
|
||||
* @return {ScopeModel}
|
||||
*/
|
||||
model({ project_id }) {
|
||||
return this.store.findRecord('scope', project_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the project-specific sidebar template.
|
||||
* @override
|
||||
* @param {object} controller
|
||||
* @param {object} model
|
||||
*/
|
||||
renderTemplate(controller, model) {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render('scopes/scope/projects/project/-sidebar', {
|
||||
into: 'scopes/scope',
|
||||
outlet: 'sidebar',
|
||||
model: model,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { confirm } from '../../../../../decorators/confirm';
|
||||
import { notifySuccess, notifyError } from '../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Loads all host catalogs under the current scope.
|
||||
* @return {Promise{[HostCatalogModel]}}
|
||||
*/
|
||||
async model() {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope.projects.project');
|
||||
return this.store.query('host-catalog', { scope_id });
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
* Rollback changes on project.
|
||||
* @param {HostCatalogModel} hostCatalog
|
||||
*/
|
||||
@action
|
||||
cancel(hostCatalog) {
|
||||
const { isNew } = hostCatalog;
|
||||
hostCatalog.rollbackAttributes();
|
||||
if (isNew) this.transitionTo('scopes.scope.projects.project.host-catalogs');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle save.
|
||||
* @param {HostCatalogModel} hostCatalog
|
||||
* @param {Event} e
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
async save(hostCatalog) {
|
||||
await hostCatalog.save();
|
||||
await this.transitionTo(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog',
|
||||
hostCatalog
|
||||
);
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the host catalog and redirects to index.
|
||||
* @param {HostCatalogModel} hostCatalog
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@confirm('questions.delete-confirm')
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async delete(hostCatalog) {
|
||||
await hostCatalog.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.projects.project.host-catalogs');
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogRoute extends Route {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Load a host catalog.
|
||||
* @param {object} params
|
||||
* @param {string} params.host_catalog_id
|
||||
* @return {HostCatalogModel}
|
||||
*/
|
||||
async model({ host_catalog_id }) {
|
||||
return this.store.findRecord('host-catalog', host_catalog_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the host-catalog specific templates for header, navigation, and actions page sections.
|
||||
* @override
|
||||
* @param {object} controller
|
||||
* @param {object} model
|
||||
*/
|
||||
renderTemplate(controller, model) {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/-header',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/-navigation',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'navigation',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/-actions',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { confirm } from '../../../../../../../decorators/confirm';
|
||||
import { notifySuccess, notifyError } from '../../../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Loads all host-sets under the current host catalog and it's parent scope.
|
||||
* @return {Promise{[HostSetModel]}}
|
||||
*/
|
||||
model() {
|
||||
const { id: host_catalog_id } = this.modelFor(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog'
|
||||
);
|
||||
return this.store.query('host-set', { host_catalog_id });
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
* Rollback changes on a host set.
|
||||
* @param {HostSetModel} hostSet
|
||||
*/
|
||||
@action
|
||||
cancel(hostSet) {
|
||||
const { isNew } = hostSet;
|
||||
hostSet.rollbackAttributes();
|
||||
if (isNew)
|
||||
this.transitionTo(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.host-sets'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle save of a host set.
|
||||
* @param {HostSetModel} hostSet
|
||||
* @param {Event} e
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
async save(hostSet) {
|
||||
await hostSet.save();
|
||||
await this.transitionTo(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set',
|
||||
hostSet
|
||||
);
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete host set in current scope and redirect to index.
|
||||
* @param {HostSetModel} hostSet
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@confirm('questions.delete-confirm')
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async deleteHostSet(hostSet) {
|
||||
await hostSet.destroyRecord();
|
||||
await this.replaceWith(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.host-sets'
|
||||
);
|
||||
}
|
||||
}
|
||||
-52
@@ -1,52 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHostSetRoute extends Route {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Load a host-set using current host-catalog and it's parent project scope.
|
||||
* @param {object} params
|
||||
* @param {string} params.host_set_id
|
||||
* @return {HostSetModel}
|
||||
*/
|
||||
async model({ host_set_id }) {
|
||||
return this.store.findRecord('host-set', host_set_id, { reload: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the host-set specific templates for header, navigation, and action page sections.
|
||||
* @override
|
||||
* @param {object} controller
|
||||
* @param {object} model
|
||||
*/
|
||||
renderTemplate(controller, model) {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/-header',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/-navigation',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'navigation',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/-actions',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
-92
@@ -1,92 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import { hash } from 'rsvp';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { notifySuccess, notifyError } from '../../../../../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHostSetAddHostsRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Empty out any previously loaded hosts.
|
||||
*/
|
||||
beforeModel() {
|
||||
this.store.unloadAll('host');
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads current host set and all hosts under the current host catalog.
|
||||
* @return {Promise{HostSetModel,[HostModel]}}
|
||||
*/
|
||||
async model() {
|
||||
const { id: host_catalog_id } = this.modelFor(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog'
|
||||
);
|
||||
return hash({
|
||||
hostSet: this.modelFor(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set'
|
||||
),
|
||||
hosts: this.store.query('host', { host_catalog_id }),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the add-hosts-specific header template.
|
||||
* Empties the actions and navigation outlets and renders a custom empty header.
|
||||
* @override
|
||||
*/
|
||||
renderTemplate() {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/add-hosts/-header',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
}
|
||||
);
|
||||
|
||||
this.render('-empty', {
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'navigation',
|
||||
});
|
||||
|
||||
this.render('-empty', {
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
});
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
* Saves host IDs on the host set.
|
||||
* @param {HostSetModel} hostSet
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.add-success')
|
||||
async addHosts(hostSet, hostIDs) {
|
||||
await hostSet.addHosts(hostIDs);
|
||||
await this.replaceWith(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set.hosts'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to hosts as if nothing ever happened.
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
this.replaceWith(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set.hosts'
|
||||
);
|
||||
}
|
||||
}
|
||||
-90
@@ -1,90 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import { hash } from 'rsvp';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { notifySuccess, notifyError } from '../../../../../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHostSetCreateHostRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Creates a new unsaved host in current host catalog scope.
|
||||
* @return {Promise{HostSetModel,HostModel}}
|
||||
*/
|
||||
async model() {
|
||||
const { id: host_catalog_id } = this.modelFor(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog'
|
||||
);
|
||||
|
||||
return hash({
|
||||
hostSet: this.modelFor(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set'
|
||||
),
|
||||
host: this.store.createRecord('host', {
|
||||
type: 'static',
|
||||
host_catalog_id,
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the create-host-specific header template.
|
||||
* Empties the actions and navigation outlets and renders a custom empty header.
|
||||
* @override
|
||||
*/
|
||||
renderTemplate() {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/host-set/create-host/-header',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
}
|
||||
);
|
||||
|
||||
this.render('-empty', {
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'navigation',
|
||||
});
|
||||
|
||||
this.render('-empty', {
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
});
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
* Saves host and add it to current host set.
|
||||
* @param {HostSetModel,HostModel} model
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.add-success')
|
||||
async save(model) {
|
||||
await model.host.save();
|
||||
await model.hostSet.addHost(model.host.id);
|
||||
await this.replaceWith(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set.hosts'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to hosts in host set as if nothing ever happened.
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
this.replaceWith(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set.hosts'
|
||||
);
|
||||
}
|
||||
}
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { hash, all } from 'rsvp';
|
||||
import { action } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { confirm } from '../../../../../../../../../decorators/confirm';
|
||||
import { notifySuccess, notifyError } from '../../../../../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHostSetHostsRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Loads all hosts under the current host set.
|
||||
* @return {Promise{HostSetModel,[HostModel]}}
|
||||
*/
|
||||
async model() {
|
||||
const hostSet = this.modelFor(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set'
|
||||
);
|
||||
return hash({
|
||||
hostSet,
|
||||
hosts: all(
|
||||
hostSet.host_ids.map((host) =>
|
||||
this.store.findRecord('host', host.value, { reload: true })
|
||||
)
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a host from the current host set and redirect to hosts index.
|
||||
* @param {HostSetModel} hostSet
|
||||
* @param {HostModel} host
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@confirm('questions.remove-confirm')
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.remove-success')
|
||||
async removeHost(hostSet, host) {
|
||||
const scopeID = this.modelFor('scopes.scope.projects.project').id;
|
||||
const hostCatalogID = this.modelFor(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog'
|
||||
).id;
|
||||
await hostSet.removeHost(host.id, {
|
||||
adapterOptions: { scopeID, hostCatalogID },
|
||||
});
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsHostSetIndexRoute extends Route {}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsIndexRoute extends Route {}
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostSetsNewRoute extends Route {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Creates a new unsaved host set in current host catalog scope.
|
||||
* @return {HostSetModel}
|
||||
*/
|
||||
model() {
|
||||
const { id: host_catalog_id } = this.modelFor(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog'
|
||||
);
|
||||
return this.store.createRecord('host-set', {
|
||||
type: 'static',
|
||||
host_catalog_id,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders new host-set specific templates for header, navigation, and action page sections.
|
||||
* @override
|
||||
* @param {object} controller
|
||||
* @param {object} model
|
||||
*/
|
||||
renderTemplate(controller, model) {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/host-sets/new/-header',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
|
||||
this.render('_empty', {
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'navigation',
|
||||
model: model,
|
||||
});
|
||||
|
||||
this.render('_empty', {
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
model: model,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { confirm } from '../../../../../../../decorators/confirm';
|
||||
import { notifySuccess, notifyError } from '../../../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Loads all hosts under the current host catalog and it's parent project scope.
|
||||
* @return {Promise{[HostModel]}}
|
||||
*/
|
||||
model() {
|
||||
const { id: host_catalog_id } = this.modelFor(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog'
|
||||
);
|
||||
return this.store.query('host', { host_catalog_id });
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
* Rollback changes on a host.
|
||||
* @param {HostModel} host
|
||||
*/
|
||||
@action
|
||||
cancel(host) {
|
||||
const { isNew } = host;
|
||||
host.rollbackAttributes();
|
||||
if (isNew)
|
||||
this.transitionTo(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.hosts'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle save of a host.
|
||||
* @param {HostModel} host
|
||||
* @param {Event} e
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
async save(host) {
|
||||
await host.save();
|
||||
await this.transitionTo(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.hosts.host',
|
||||
host
|
||||
);
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete host in current scope and redirect to index.
|
||||
* @param {HostModel} host
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@confirm('questions.delete-confirm')
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async deleteHost(host) {
|
||||
await host.destroyRecord();
|
||||
await this.replaceWith(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog.hosts'
|
||||
);
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
-52
@@ -1,52 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsHostRoute extends Route {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Load a host using current host-catalog and it's parent project scope.
|
||||
* @param {object} params
|
||||
* @param {string} params.host_id
|
||||
* @return {HostModel}
|
||||
*/
|
||||
async model({ host_id }) {
|
||||
return this.store.findRecord('host', host_id, { reload: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the host specific templates for header, navigation, and action page sections.
|
||||
* @override
|
||||
* @param {object} controller
|
||||
* @param {object} model
|
||||
*/
|
||||
renderTemplate(controller, model) {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host/-header',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host/-navigation',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'navigation',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/hosts/host/-actions',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsHostIndexRoute extends Route {}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsIndexRoute extends Route {}
|
||||
-50
@@ -1,50 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogHostsNewRoute extends Route {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Creates a new unsaved host in current host catalog scope.
|
||||
* @return {HostModel}
|
||||
*/
|
||||
model() {
|
||||
const { id: host_catalog_id } = this.modelFor(
|
||||
'scopes.scope.projects.project.host-catalogs.host-catalog'
|
||||
);
|
||||
return this.store.createRecord('host', {
|
||||
type: 'static',
|
||||
host_catalog_id,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders new host specific templates for header, navigation, and action page sections.
|
||||
* @override
|
||||
* @param {object} controller
|
||||
* @param {object} model
|
||||
*/
|
||||
renderTemplate(controller, model) {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/host-catalogs/host-catalog/hosts/new/-header',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'header',
|
||||
model: model,
|
||||
}
|
||||
);
|
||||
|
||||
this.render('_empty', {
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'navigation',
|
||||
model: model,
|
||||
});
|
||||
|
||||
this.render('_empty', {
|
||||
into: 'scopes/scope/projects/project/host-catalogs/host-catalog',
|
||||
outlet: 'actions',
|
||||
model: model,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsHostCatalogIndexRoute extends Route {}
|
||||
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsIndexRoute extends Route {}
|
||||
@@ -1,17 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectHostCatalogsNewRoute extends Route {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Creates a new unsaved host catalog belonging to the current project scope.
|
||||
* @return {HostCatalogModel}
|
||||
*/
|
||||
model() {
|
||||
const scopeModel = this.modelFor('scopes.scope.projects.project');
|
||||
return this.store.createRecord('host-catalog', {
|
||||
type: 'static',
|
||||
scopeModel,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectIndexRoute extends Route {}
|
||||
@@ -1,103 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import { all, hash } from 'rsvp';
|
||||
import { task, timeout } from 'ember-concurrency';
|
||||
import { A } from '@ember/array';
|
||||
import { notifySuccess, notifyError } from '../../../../../decorators/notify';
|
||||
import config from '../../../../../config/environment';
|
||||
|
||||
const POLL_TIMEOUT_SECONDS = config.sessionPollingTimeoutSeconds;
|
||||
|
||||
export default class ScopesScopeProjectsProjectSessionsRoute extends Route {
|
||||
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
|
||||
// =attributes
|
||||
|
||||
/**
|
||||
* A simple Ember Concurrency-based polling task that refreshes the route
|
||||
* every POLL_TIMEOUT_SECONDS seconds. This is necessary to display changes
|
||||
* to session `status` that may occur.
|
||||
*
|
||||
* NOTE: tasks are sort of attributes and sort of methods, but they are not
|
||||
* language-level constructs. Thus we annotate this task as if it
|
||||
* is an attribute.
|
||||
* @type {Task}
|
||||
*/
|
||||
@task(function * () {
|
||||
while(true) {
|
||||
yield timeout(POLL_TIMEOUT_SECONDS * 1000);
|
||||
yield this.refresh();
|
||||
}
|
||||
}).drop() poller;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Loads all sessions under the current scope and encapsulates them into
|
||||
* an array of objects containing their associated users and targets.
|
||||
* @return {Promise{[{session: SessionModel, user: UserModel, target: TargetModel}]}}
|
||||
*/
|
||||
async model() {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope.projects.project');
|
||||
const sessions = await this.store.query('session', { scope_id });
|
||||
const sessionAggregates = await all(
|
||||
sessions.map(session => hash({
|
||||
session,
|
||||
user: session.user_id
|
||||
? (
|
||||
this.store.peekRecord('user', session.user_id) ||
|
||||
this.store.findRecord('user', session.user_id)
|
||||
)
|
||||
: null,
|
||||
target: session.target_id
|
||||
? (
|
||||
this.store.peekRecord('target', session.target_id) ||
|
||||
this.store.findRecord('target', session.target_id)
|
||||
)
|
||||
: null,
|
||||
}))
|
||||
);
|
||||
// Sort sessions by time created...
|
||||
let sortedSessionAggregates =
|
||||
A(sessionAggregates).sortBy('session.created_time').reverse();
|
||||
// Then move active sessions to the top...
|
||||
sortedSessionAggregates = [
|
||||
...sortedSessionAggregates.filter((aggregate) => aggregate.session.status === 'active'),
|
||||
...sortedSessionAggregates.filter((aggregate) => aggregate.session.status !== 'active'),
|
||||
];
|
||||
return sortedSessionAggregates;
|
||||
}
|
||||
|
||||
/**
|
||||
* When this route is activated (entered), begin polling for changes.
|
||||
*/
|
||||
activate() {
|
||||
this.poller.perform();
|
||||
}
|
||||
|
||||
/**
|
||||
* When this route is deactivated (exited), stop polling for changes.
|
||||
*/
|
||||
deactivate() {
|
||||
this.poller.cancelAll();
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
* Cancels the specified session and notifies user of success or error.
|
||||
* @param {SessionModel}
|
||||
*/
|
||||
@action
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.canceled-success')
|
||||
async cancelSession(session) {
|
||||
await session.cancelSession();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectSessionsIndexRoute extends Route {
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { confirm } from '../../../../../decorators/confirm';
|
||||
import { notifySuccess, notifyError } from '../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Loads all targets under current project scope.
|
||||
* @return {Promise{[TargetModel]}}
|
||||
*/
|
||||
async model() {
|
||||
const { id: scope_id } = this.modelFor('scopes.scope.projects.project');
|
||||
return this.store.query('target', { scope_id });
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
* Rollback changes on a target.
|
||||
* @param {TargetModel} target
|
||||
*/
|
||||
@action
|
||||
cancel(target) {
|
||||
const { isNew } = target;
|
||||
target.rollbackAttributes();
|
||||
if (isNew) this.transitionTo('scopes.scope.projects.project.targets');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle save.
|
||||
* @param {TargetModel} target
|
||||
* @param {Event} e
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message)
|
||||
@notifySuccess(({ isNew }) => isNew ? 'notifications.create-success' : 'notifications.save-success')
|
||||
async save(target) {
|
||||
await target.save();
|
||||
await this.transitionTo('scopes.scope.projects.project.targets.target', target);
|
||||
this.refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a target and redirects to targets index.
|
||||
* @param {TargetModel} target
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@confirm('questions.delete-confirm')
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.delete-success')
|
||||
async delete(target) {
|
||||
await target.destroyRecord();
|
||||
await this.replaceWith('scopes.scope.projects.project.targets');
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsIndexRoute extends Route {}
|
||||
@@ -1,17 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsNewRoute extends Route {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Creates a new unsaved target in current project scope.
|
||||
* @return {TargetModel}
|
||||
*/
|
||||
model() {
|
||||
const scopeModel = this.modelFor('scopes.scope.projects.project');
|
||||
return this.store.createRecord('target', {
|
||||
type: 'tcp',
|
||||
scopeModel,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsTargetRoute extends Route {
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Load a target.
|
||||
* @param {object} params
|
||||
* @param {string} params.target_id
|
||||
* @return {TargetModel}
|
||||
*/
|
||||
async model({ target_id }) {
|
||||
return this.store.findRecord('target', target_id, { reload: true });
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the target-specific templates for header, navigation,
|
||||
* and actions page sections.
|
||||
* @override
|
||||
*/
|
||||
renderTemplate() {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render('scopes/scope/projects/project/targets/target/-header', {
|
||||
into: 'scopes/scope/projects/project/targets/target',
|
||||
outlet: 'header',
|
||||
});
|
||||
|
||||
this.render('scopes/scope/projects/project/targets/target/-navigation', {
|
||||
into: 'scopes/scope/projects/project/targets/target',
|
||||
outlet: 'navigation',
|
||||
});
|
||||
|
||||
this.render('scopes/scope/projects/project/targets/target/-actions', {
|
||||
into: 'scopes/scope/projects/project/targets/target',
|
||||
outlet: 'actions',
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
import { all } from 'rsvp';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { notifySuccess, notifyError } from '../../../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsTargetAddHostSetsRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Empty out any previously loaded host sets.
|
||||
*/
|
||||
beforeModel() {
|
||||
this.store.unloadAll('host-set');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current target, all host catalogs, and all host sets.
|
||||
* @return {{target: TargetModel, hostCatalogs: [HostCatalogModel], hostSets: [HostSetModel]}}
|
||||
*/
|
||||
async model() {
|
||||
const target = this.modelFor(
|
||||
'scopes.scope.projects.project.targets.target'
|
||||
);
|
||||
const { id: scope_id } = this.modelFor('scopes.scope.projects.project');
|
||||
const hostCatalogs = await this.store.query('host-catalog', { scope_id });
|
||||
await all(
|
||||
hostCatalogs.map(({ id: host_catalog_id }) =>
|
||||
this.store.query('host-set', { host_catalog_id })
|
||||
)
|
||||
);
|
||||
const hostSets = this.store.peekAll('host-set');
|
||||
return {
|
||||
target,
|
||||
hostCatalogs,
|
||||
hostSets,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the add-host-sets-specific header template.
|
||||
* @override
|
||||
*/
|
||||
renderTemplate() {
|
||||
super.renderTemplate(...arguments);
|
||||
|
||||
this.render(
|
||||
'scopes/scope/projects/project/targets/target/add-host-sets/-header',
|
||||
{
|
||||
into: 'scopes/scope/projects/project/targets/target',
|
||||
outlet: 'header',
|
||||
}
|
||||
);
|
||||
|
||||
this.render('-empty', {
|
||||
into: 'scopes/scope/projects/project/targets/target',
|
||||
outlet: 'navigation',
|
||||
});
|
||||
|
||||
this.render('-empty', {
|
||||
into: 'scopes/scope/projects/project/targets/target',
|
||||
outlet: 'actions',
|
||||
});
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
@action
|
||||
@loading
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.add-success')
|
||||
async save(target, hostSetIDs) {
|
||||
await target.addHostSets(hostSetIDs);
|
||||
this.replaceWith(
|
||||
'scopes.scope.projects.project.targets.target.host-sets'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to target host sets as if nothing ever happened.
|
||||
*/
|
||||
@action
|
||||
cancel() {
|
||||
this.replaceWith('scopes.scope.projects.project.targets.target.host-sets');
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { all, hash } from 'rsvp';
|
||||
import { action } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import loading from 'ember-loading/decorator';
|
||||
import { confirm } from '../../../../../../../decorators/confirm';
|
||||
import { notifySuccess, notifyError } from '../../../../../../../decorators/notify';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsTargetHostSetsRoute extends Route {
|
||||
// =services
|
||||
|
||||
@service intl;
|
||||
@service notify;
|
||||
|
||||
// =methods
|
||||
|
||||
/**
|
||||
* Loads all host-sets and associated host-catalogs under the current target
|
||||
* and it's parent scope.
|
||||
* @return {Promise{[HostSetModel, HostCatalogModel]}}
|
||||
*/
|
||||
beforeModel() {
|
||||
const { scopeID, host_sets } = this.modelFor(
|
||||
'scopes.scope.projects.project.targets.target'
|
||||
);
|
||||
const promises = host_sets.map(
|
||||
({ host_set_id, host_catalog_id: hostCatalogID }) =>
|
||||
hash({
|
||||
// TODO: multiple host sets may belong to the same catalog,
|
||||
// resulting in the catalog being loaded multiple times.
|
||||
// An improvement would be to find the unique set of catalogs first.
|
||||
hostCatalog: this.store.findRecord('host-catalog', hostCatalogID, {
|
||||
adapterOptions: { scopeID },
|
||||
}),
|
||||
hostSet: this.store.findRecord('host-set', host_set_id, {
|
||||
adapterOptions: { scopeID, hostCatalogID },
|
||||
}),
|
||||
})
|
||||
);
|
||||
return all(promises);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the previously loaded target instance.
|
||||
* @return {TargetModel}
|
||||
*/
|
||||
model() {
|
||||
return this.modelFor('scopes.scope.projects.project.targets.target');
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
/**
|
||||
* Removes a host set from the current target and redirects to index.
|
||||
* @param {TargetModel} target
|
||||
* @param {HostSetModel} hostSet
|
||||
*/
|
||||
@action
|
||||
@loading
|
||||
@confirm('questions.remove-confirm')
|
||||
@notifyError(({ message }) => message, { catch: true })
|
||||
@notifySuccess('notifications.remove-success')
|
||||
async removeHostSet(target, hostSet) {
|
||||
await target.removeHostSet(hostSet.id);
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsTargetHostSetsHostSetRoute extends Route {}
|
||||
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsTargetHostSetsIndexRoute extends Route {}
|
||||
@@ -1,3 +0,0 @@
|
||||
import Route from '@ember/routing/route';
|
||||
|
||||
export default class ScopesScopeProjectsProjectTargetsTargetIndexRoute extends Route {}
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
{{#if @model.isGlobal}}
|
||||
<Rose::Nav::Sidebar @title={{t "titles.general"}} as |nav|>
|
||||
<nav.link @route="scopes.scope.orgs">
|
||||
<nav.link @route="scopes.scope">
|
||||
<Rose::Icon
|
||||
@name="app-icons/org"
|
||||
@size="medium" />
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
{{#if @model.isOrg}}
|
||||
<Rose::Nav::Sidebar @title={{t "titles.general"}} as |nav|>
|
||||
<nav.link @route="scopes.scope.projects">
|
||||
<nav.link @route="scopes.scope">
|
||||
<Rose::Icon
|
||||
@name="app-icons/project"
|
||||
@size="medium" />
|
||||
@@ -25,7 +25,51 @@
|
||||
</Rose::Nav::Sidebar>
|
||||
{{/if}}
|
||||
|
||||
{{outlet "sidebar"}}
|
||||
{{#unless @model.isProject}}
|
||||
<Rose::Nav::Sidebar @title={{t "titles.iam"}} as |nav|>
|
||||
<nav.link @route="scopes.scope.users">
|
||||
<Rose::Icon
|
||||
@name="app-icons/users"
|
||||
@size="medium" />
|
||||
{{t "resources.user.title_plural"}}
|
||||
</nav.link>
|
||||
<nav.link @route="scopes.scope.groups">
|
||||
<Rose::Icon
|
||||
@name="app-icons/group"
|
||||
@size="medium" />
|
||||
{{t "resources.group.title_plural"}}
|
||||
</nav.link>
|
||||
<nav.link @route="scopes.scope.roles">
|
||||
<Rose::Icon
|
||||
@name="app-icons/roles"
|
||||
@size="medium" />
|
||||
{{t "resources.role.title_plural"}}
|
||||
</nav.link>
|
||||
<nav.link @route="scopes.scope.auth-methods">
|
||||
<Rose::Icon
|
||||
@name="app-icons/auth-method"
|
||||
@size="medium" />
|
||||
{{t "resources.auth-method.title_plural"}}
|
||||
</nav.link>
|
||||
</Rose::Nav::Sidebar>
|
||||
{{/unless}}
|
||||
|
||||
{{#if @model.isProject}}
|
||||
<Rose::Nav::Sidebar @title={{t "titles.iam"}} as |nav|>
|
||||
<nav.link @route="scopes.scope.groups">
|
||||
<Rose::Icon
|
||||
@name="app-icons/group"
|
||||
@size="medium" />
|
||||
{{t "resources.group.title_plural"}}
|
||||
</nav.link>
|
||||
<nav.link @route="scopes.scope.roles">
|
||||
<Rose::Icon
|
||||
@name="app-icons/roles"
|
||||
@size="medium" />
|
||||
{{t "resources.role.title_plural"}}
|
||||
</nav.link>
|
||||
</Rose::Nav::Sidebar>
|
||||
{{/if}}
|
||||
|
||||
</sidebarLayout.sidebar>
|
||||
{{/if}}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{{title (t "resources.org.title_plural")}}
|
||||
|
||||
{{outlet}}
|
||||
@@ -1,63 +0,0 @@
|
||||
<Rose::Layout::Page as |page|>
|
||||
|
||||
<page.breadcrumbs>
|
||||
<BreadCrumbs />
|
||||
</page.breadcrumbs>
|
||||
|
||||
<page.header>
|
||||
<h2>
|
||||
{{t "resources.org.title_plural"}}
|
||||
<DocLink @doc="org" @iconSize="large" />
|
||||
</h2>
|
||||
{{#if @model}}
|
||||
<p>{{t "resources.org.description"}}</p>
|
||||
{{/if}}
|
||||
</page.header>
|
||||
|
||||
<page.actions>
|
||||
{{#if @model}}
|
||||
<Rose::LinkButton
|
||||
@route="scopes.scope.orgs.new"
|
||||
@style="primary"
|
||||
>
|
||||
{{t 'titles.new'}}
|
||||
</Rose::LinkButton>
|
||||
{{/if}}
|
||||
</page.actions>
|
||||
|
||||
<page.body>
|
||||
|
||||
{{#if @model}}
|
||||
|
||||
<Rose::Cards as |cards|>
|
||||
{{#each @model as |org|}}
|
||||
<cards.link
|
||||
@title={{org.name}}
|
||||
@description={{org.description}}
|
||||
@id={{org.id}}
|
||||
@icon="app-icons/org"
|
||||
@route="scopes.scope"
|
||||
@model={{org.id}}
|
||||
/>
|
||||
{{/each}}
|
||||
</Rose::Cards>
|
||||
|
||||
{{else}}
|
||||
|
||||
<Rose::Layout::Centered>
|
||||
<Rose::Message @title={{t 'resources.org.messages.welcome.title'}} as |message|>
|
||||
<message.description>
|
||||
{{t 'resources.org.description'}}
|
||||
</message.description>
|
||||
<message.link @route="scopes.scope.orgs.new">
|
||||
<Rose::Icon @name="plus-circle-outline" />
|
||||
{{t 'titles.new'}}
|
||||
</message.link>
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
|
||||
{{/if}}
|
||||
|
||||
</page.body>
|
||||
|
||||
</Rose::Layout::Page>
|
||||
@@ -1,24 +0,0 @@
|
||||
{{title (t 'titles.new')}}
|
||||
|
||||
<Rose::Layout::Page as |page|>
|
||||
|
||||
<page.breadcrumbs>
|
||||
<BreadCrumbs />
|
||||
</page.breadcrumbs>
|
||||
|
||||
<page.header>
|
||||
<h2>
|
||||
{{t "titles.new"}}
|
||||
<DocLink @doc="org.new" @iconSize="large" />
|
||||
</h2>
|
||||
</page.header>
|
||||
|
||||
<page.body>
|
||||
<Form::Org
|
||||
@model={{@model}}
|
||||
@submit={{route-action "save" @model}}
|
||||
@cancel={{route-action "cancel" @model}}
|
||||
/>
|
||||
</page.body>
|
||||
|
||||
</Rose::Layout::Page>
|
||||
@@ -1,3 +0,0 @@
|
||||
{{title (t "resources.project.title_plural")}}
|
||||
|
||||
{{outlet}}
|
||||
@@ -1,63 +0,0 @@
|
||||
<Rose::Layout::Page as |page|>
|
||||
|
||||
<page.breadcrumbs>
|
||||
<BreadCrumbs />
|
||||
</page.breadcrumbs>
|
||||
|
||||
<page.header>
|
||||
<h2>
|
||||
{{t "resources.project.title_plural"}}
|
||||
<DocLink @doc="project" @iconSize="large" />
|
||||
</h2>
|
||||
{{#if @model}}
|
||||
<p>{{t "resources.project.description"}}</p>
|
||||
{{/if}}
|
||||
</page.header>
|
||||
|
||||
<page.actions>
|
||||
{{#if @model}}
|
||||
<Rose::LinkButton
|
||||
@route="scopes.scope.projects.new"
|
||||
@style="primary"
|
||||
>
|
||||
{{t 'titles.new'}}
|
||||
</Rose::LinkButton>
|
||||
{{/if}}
|
||||
</page.actions>
|
||||
|
||||
<page.body>
|
||||
|
||||
{{#if @model}}
|
||||
|
||||
<Rose::Cards as |cards|>
|
||||
{{#each @model as |project|}}
|
||||
<cards.link
|
||||
@title={{project.name}}
|
||||
@description={{project.description}}
|
||||
@id={{project.id}}
|
||||
@icon="app-icons/project"
|
||||
@route="scopes.scope.projects.project"
|
||||
@model={{project.id}}
|
||||
/>
|
||||
{{/each}}
|
||||
</Rose::Cards>
|
||||
|
||||
{{else}}
|
||||
|
||||
<Rose::Layout::Centered>
|
||||
<Rose::Message @title={{t 'resources.project.messages.welcome.title'}} as |message|>
|
||||
<message.description>
|
||||
{{t 'resources.project.description'}}
|
||||
</message.description>
|
||||
<message.link @route="scopes.scope.projects.new">
|
||||
<Rose::Icon @name="plus-circle-outline" />
|
||||
{{t 'titles.new'}}
|
||||
</message.link>
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
|
||||
{{/if}}
|
||||
|
||||
</page.body>
|
||||
|
||||
</Rose::Layout::Page>
|
||||
@@ -1,24 +0,0 @@
|
||||
{{title (t 'titles.new')}}
|
||||
|
||||
<Rose::Layout::Page as |page|>
|
||||
|
||||
<page.breadcrumbs>
|
||||
<BreadCrumbs />
|
||||
</page.breadcrumbs>
|
||||
|
||||
<page.header>
|
||||
<h2>
|
||||
{{t "titles.new"}}
|
||||
<DocLink @doc="project.new" @iconSize="large" />
|
||||
</h2>
|
||||
</page.header>
|
||||
|
||||
<page.body>
|
||||
<Form::Project
|
||||
@model={{@model}}
|
||||
@submit={{route-action "save" @model}}
|
||||
@cancel={{route-action "cancel" @model}}
|
||||
/>
|
||||
</page.body>
|
||||
|
||||
</Rose::Layout::Page>
|
||||
@@ -1,3 +0,0 @@
|
||||
{{title @model.displayName}}
|
||||
|
||||
{{outlet}}
|
||||
@@ -1,20 +0,0 @@
|
||||
<Rose::Nav::Sidebar @title={{t "titles.resources"}} as |nav|>
|
||||
<nav.link @route="scopes.scope.projects.project.sessions">
|
||||
<Rose::Icon
|
||||
@name="app-icons/action-session"
|
||||
@size="medium" />
|
||||
{{t "resources.session.title_plural"}}
|
||||
</nav.link>
|
||||
<nav.link @route="scopes.scope.projects.project.targets">
|
||||
<Rose::Icon
|
||||
@name="app-icons/target"
|
||||
@size="medium" />
|
||||
{{t "resources.target.title_plural"}}
|
||||
</nav.link>
|
||||
<nav.link @route="scopes.scope.projects.project.host-catalogs">
|
||||
<Rose::Icon
|
||||
@name="app-icons/host-catalogs"
|
||||
@size="medium" />
|
||||
{{t "resources.host-catalog.title_plural"}}
|
||||
</nav.link>
|
||||
</Rose::Nav::Sidebar>
|
||||
@@ -1,3 +0,0 @@
|
||||
{{title (t "resources.host-catalog.title_plural")}}
|
||||
|
||||
{{outlet}}
|
||||
@@ -1,25 +0,0 @@
|
||||
{{title @model.displayName}}
|
||||
|
||||
<Rose::Layout::Page as |page|>
|
||||
|
||||
<page.breadcrumbs>
|
||||
<BreadCrumbs />
|
||||
</page.breadcrumbs>
|
||||
|
||||
<page.header>
|
||||
{{outlet "header"}}
|
||||
</page.header>
|
||||
|
||||
<page.actions>
|
||||
{{outlet "actions"}}
|
||||
</page.actions>
|
||||
|
||||
<page.navigation>
|
||||
{{outlet "navigation"}}
|
||||
</page.navigation>
|
||||
|
||||
<page.body>
|
||||
{{outlet}}
|
||||
</page.body>
|
||||
|
||||
</Rose::Layout::Page>
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
<Rose::Dropdown @text="{{t 'actions.manage'}}" @dropdownRight={{true}} as |dropdown|>
|
||||
<dropdown.link
|
||||
@route="scopes.scope.projects.project.host-catalogs.host-catalog.hosts.new"
|
||||
@model={{@model}}
|
||||
>
|
||||
{{t "resources.host.actions.create"}}
|
||||
</dropdown.link>
|
||||
<dropdown.link
|
||||
@route="scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.new"
|
||||
@model={{@model}}
|
||||
>
|
||||
{{t "resources.host-set.actions.create"}}
|
||||
</dropdown.link>
|
||||
<dropdown.separator />
|
||||
<dropdown.button
|
||||
@style="danger"
|
||||
@disabled={{@model.canSave}}
|
||||
{{on "click" (route-action "delete" @model)}}
|
||||
>
|
||||
{{t "resources.host-catalog.actions.delete"}}
|
||||
</dropdown.button>
|
||||
</Rose::Dropdown>
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
<h2>
|
||||
{{t "resources.host-catalog.title"}}
|
||||
<DocLink @doc="host-catalog" @iconSize="large" />
|
||||
</h2>
|
||||
<p>{{t "resources.host-catalog.description"}}</p>
|
||||
<Copyable
|
||||
@text={{@model.id}}
|
||||
@buttonText={{t "actions.copy-to-clipboard"}}
|
||||
@acknowledgeText={{t "states.copied"}}
|
||||
>
|
||||
<code>{{@model.id}}</code>
|
||||
</Copyable>
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
<Rose::Nav::Tabs as |nav|>
|
||||
<nav.link @route='scopes.scope.projects.project.host-catalogs.host-catalog.index'>
|
||||
{{t 'titles.details'}}
|
||||
</nav.link>
|
||||
<nav.link @route='scopes.scope.projects.project.host-catalogs.host-catalog.host-sets'>
|
||||
{{t 'resources.host-set.title_plural'}}
|
||||
</nav.link>
|
||||
<nav.link @route='scopes.scope.projects.project.host-catalogs.host-catalog.hosts'>
|
||||
{{t 'resources.host.title_plural'}}
|
||||
</nav.link>
|
||||
</Rose::Nav::Tabs>
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
{{title (t "resources.host-set.title_plural")}}
|
||||
|
||||
{{outlet}}
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
{{title @model.displayName}}
|
||||
|
||||
{{outlet}}
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
<Rose::Dropdown @text="{{t 'actions.manage'}}" @dropdownRight={{true}} as |dropdown|>
|
||||
<dropdown.link @route="scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set.create-host">
|
||||
{{t 'resources.host-set.actions.create-host'}}
|
||||
</dropdown.link>
|
||||
<dropdown.link @route="scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set.add-hosts">
|
||||
{{t 'resources.host-set.actions.add-hosts'}}
|
||||
</dropdown.link>
|
||||
<dropdown.separator />
|
||||
<dropdown.button
|
||||
@style="danger"
|
||||
@disabled={{@model.canSave}}
|
||||
{{on "click" (route-action "deleteHostSet" @model)}}
|
||||
>
|
||||
{{t 'resources.host-set.actions.delete'}}
|
||||
</dropdown.button>
|
||||
</Rose::Dropdown>
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
<h2>
|
||||
{{t "resources.host-set.title"}}
|
||||
<DocLink @doc="host-set" @iconSize="large" />
|
||||
</h2>
|
||||
<p>{{t "resources.host-set.description"}}</p>
|
||||
<Copyable
|
||||
@text={{@model.id}}
|
||||
@buttonText={{t "actions.copy-to-clipboard"}}
|
||||
@acknowledgeText={{t "states.copied"}}
|
||||
>
|
||||
<code>{{@model.id}}</code>
|
||||
</Copyable>
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
<Rose::Nav::Tabs as |nav|>
|
||||
<nav.link @route='scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set.index'>
|
||||
{{t 'titles.details'}}
|
||||
</nav.link>
|
||||
<nav.link @route='scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set.hosts'>
|
||||
{{t 'resources.host.title_plural'}}
|
||||
</nav.link>
|
||||
</Rose::Nav::Tabs>
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
{{title (t "resources.host-set.actions.add-hosts")}}
|
||||
|
||||
<Form::HostSet::AddHosts
|
||||
@model={{@model.hostSet}}
|
||||
@hosts={{@model.hosts}}
|
||||
@submit={{route-action "addHosts" @model.hostSet}}
|
||||
@cancel={{route-action "cancel"}}
|
||||
/>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<h2>
|
||||
{{t "resources.host-set.host.messages.add.title"}}
|
||||
<DocLink @doc="host-set.add-hosts" @iconSize="large" />
|
||||
</h2>
|
||||
<p>{{t "resources.host-set.host.messages.add.description"}}</p>
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
{{title (t 'resources.host-set.actions.create-host')}}
|
||||
|
||||
<Form::HostSet::CreateHost
|
||||
@model={{@model}}
|
||||
@submit={{route-action "save" @model}}
|
||||
@cancel={{route-action "cancel" @model}}
|
||||
/>
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
<h2>
|
||||
{{t "resources.host-set.actions.create-host"}}
|
||||
<DocLink @doc="host.new" @iconSize="large" />
|
||||
</h2>
|
||||
-71
@@ -1,71 +0,0 @@
|
||||
{{#if @model.hosts}}
|
||||
|
||||
<Rose::Table as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>{{t "form.name.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "form.type.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "form.id.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "titles.actions"}}</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model.hosts as |host|}}
|
||||
<body.row as |row|>
|
||||
<row.headerCell>
|
||||
<LinkTo
|
||||
@route="scopes.scope.projects.project.host-catalogs.host-catalog.hosts.host"
|
||||
@model={{host.id}}
|
||||
>
|
||||
{{host.displayName}}
|
||||
</LinkTo>
|
||||
<p>{{host.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
<Rose::Badge>{{host.type}}</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
@text={{host.id}}
|
||||
@buttonText={{t "actions.copy-to-clipboard"}}
|
||||
@acknowledgeText={{t "states.copied"}}
|
||||
>
|
||||
<code>{{host.id}}</code>
|
||||
</Copyable>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Rose::Dropdown
|
||||
@icon="more-horizontal"
|
||||
@iconOnly={{true}}
|
||||
@showCaret={{false}}
|
||||
@dropdownRight={{true}}
|
||||
@text="{{t "actions.manage"}}" as |dropdown|
|
||||
>
|
||||
<dropdown.button
|
||||
@style="danger"
|
||||
{{on "click" (route-action "removeHost" @model.hostSet host)}}
|
||||
>
|
||||
{{t "actions.remove"}}
|
||||
</dropdown.button>
|
||||
</Rose::Dropdown>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
|
||||
{{/if}}
|
||||
|
||||
{{#unless @model.hosts}}
|
||||
<Rose::Layout::Centered>
|
||||
<Rose::Message @title={{t "resources.host-set.host.messages.none.title"}} as |message|>
|
||||
<message.description>
|
||||
{{t "resources.host-set.host.messages.none.description"}}
|
||||
</message.description>
|
||||
<message.link @route="scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set.create-host">
|
||||
<Rose::Icon @name="plus-circle-outline" />
|
||||
{{t "resources.host-set.actions.create-host"}}
|
||||
</message.link>
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
{{/unless}}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<Form::HostSet
|
||||
@model={{@model}}
|
||||
@submit={{route-action "save" @model}}
|
||||
@cancel={{route-action "cancel" @model}}
|
||||
/>
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
{{#if @model}}
|
||||
|
||||
<Rose::Table as |table|>
|
||||
<table.header as |header|>
|
||||
<header.row as |row|>
|
||||
<row.headerCell>{{t "form.name.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "form.type.label"}}</row.headerCell>
|
||||
<row.headerCell>{{t "form.id.label"}}</row.headerCell>
|
||||
</header.row>
|
||||
</table.header>
|
||||
<table.body as |body|>
|
||||
{{#each @model as |hostSet|}}
|
||||
<body.row as |row|>
|
||||
<row.headerCell>
|
||||
<LinkTo
|
||||
@route="scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.host-set"
|
||||
@model={{hostSet.id}}
|
||||
>
|
||||
{{hostSet.displayName}}
|
||||
</LinkTo>
|
||||
<p>{{hostSet.description}}</p>
|
||||
</row.headerCell>
|
||||
<row.cell>
|
||||
<Rose::Badge>
|
||||
{{t (concat 'resources.host-set.types.' hostSet.type)}}
|
||||
</Rose::Badge>
|
||||
</row.cell>
|
||||
<row.cell>
|
||||
<Copyable
|
||||
@text={{hostSet.id}}
|
||||
@buttonText={{t "actions.copy-to-clipboard"}}
|
||||
@acknowledgeText={{t "states.copied"}}
|
||||
>
|
||||
<code>{{hostSet.id}}</code>
|
||||
</Copyable>
|
||||
</row.cell>
|
||||
</body.row>
|
||||
{{/each}}
|
||||
</table.body>
|
||||
</Rose::Table>
|
||||
|
||||
{{else}}
|
||||
|
||||
<Rose::Layout::Centered>
|
||||
<Rose::Message @title={{t "resources.host-set.messages.welcome.title"}} as |message|>
|
||||
<message.description>
|
||||
{{t "resources.host-set.description"}}
|
||||
</message.description>
|
||||
<message.link @route="scopes.scope.projects.project.host-catalogs.host-catalog.host-sets.new">
|
||||
<Rose::Icon @name="plus-circle-outline" />
|
||||
{{t "titles.new"}}
|
||||
</message.link>
|
||||
</Rose::Message>
|
||||
</Rose::Layout::Centered>
|
||||
|
||||
{{/if}}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
{{title (t 'titles.new')}}
|
||||
|
||||
<Form::HostSet
|
||||
@model={{@model}}
|
||||
@submit={{route-action "save" @model}}
|
||||
@cancel={{route-action "cancel" @model}}
|
||||
/>
|
||||
Loaded 100 of 203 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user