diff --git a/ui/desktop/app/router.js b/ui/desktop/app/router.js index 3d7c64eb5..f374cef57 100644 --- a/ui/desktop/app/router.js +++ b/ui/desktop/app/router.js @@ -9,7 +9,7 @@ export default class Router extends EmberRouter { Router.map(function () { this.route('scopes', function() { this.route('scope', { path: ':scope_id' }, function() { - this.route('targets'); + this.route('targets', function() {}); }); }); }); diff --git a/ui/desktop/app/routes/scopes/scope/targets.js b/ui/desktop/app/routes/scopes/scope/targets.js index aefdb89e9..554a714cc 100644 --- a/ui/desktop/app/routes/scopes/scope/targets.js +++ b/ui/desktop/app/routes/scopes/scope/targets.js @@ -17,8 +17,13 @@ export default class ScopesScopeTargetsRoute extends Route { let projectTargets = await all(this.scope.projects.map(({ id: scope_id }) => this.store.query('target', { scope_id }) )) - - return projectTargets.map((target) => target.toArray()).flat(); + let targets = projectTargets.map((target) => target.toArray()).flat(); + return targets.map((target) => { + return { + target, + project: this.store.peekRecord('scope', target.scopeID), + } + }) } } diff --git a/ui/desktop/app/routes/scopes/scope/targets/index.js b/ui/desktop/app/routes/scopes/scope/targets/index.js new file mode 100644 index 000000000..3902b6c03 --- /dev/null +++ b/ui/desktop/app/routes/scopes/scope/targets/index.js @@ -0,0 +1,4 @@ +import Route from '@ember/routing/route'; + +export default class ScopesScopeTargetsIndexRoute extends Route { +} diff --git a/ui/desktop/app/templates/scopes.hbs b/ui/desktop/app/templates/scopes.hbs index c24cd6895..53d1e87e5 100644 --- a/ui/desktop/app/templates/scopes.hbs +++ b/ui/desktop/app/templates/scopes.hbs @@ -1 +1,11 @@ -{{outlet}} +{{page-title (t 'scope.title_plural')}} + + + + +
+ {{outlet}} +
+
+ +
diff --git a/ui/desktop/app/templates/scopes/index.hbs b/ui/desktop/app/templates/scopes/index.hbs index bcb29e68f..cfb863937 100644 --- a/ui/desktop/app/templates/scopes/index.hbs +++ b/ui/desktop/app/templates/scopes/index.hbs @@ -1,26 +1,36 @@ -{{outlet}} + - - - - {{t 'scope.title'}} - - - - {{#each @model as |scope|}} - - - - {{scope.name}} - - - - {{scope.id}} - - - {{/each}} - - + +

+ {{t "scope.title_plural"}} +

+
+ + + + + + {{t 'scope.title'}} + + + + {{#each @model as |scope|}} + + + + {{scope.name}} + + + + {{scope.id}} + + + {{/each}} + + + + +
diff --git a/ui/desktop/app/templates/scopes/scope/targets.hbs b/ui/desktop/app/templates/scopes/scope/targets.hbs index f9f7ea6f3..74c1be2af 100644 --- a/ui/desktop/app/templates/scopes/scope/targets.hbs +++ b/ui/desktop/app/templates/scopes/scope/targets.hbs @@ -1,27 +1,3 @@ -{{outlet}} +{{page-title (t 'target.title_plural')}} - - - - {{t "name.label"}} - {{t "type.label"}} - {{t "id.label"}} - - - - {{#each @model as |target|}} - - - {{target.name}} -

{{target.description}}

-
- - {{target.type}} - - - {{target.id}} - -
- {{/each}} -
-
+{{outlet}} diff --git a/ui/desktop/app/templates/scopes/scope/targets/index.hbs b/ui/desktop/app/templates/scopes/scope/targets/index.hbs new file mode 100644 index 000000000..b0779fa23 --- /dev/null +++ b/ui/desktop/app/templates/scopes/scope/targets/index.hbs @@ -0,0 +1,49 @@ + + + +

+ {{t "target.title_plural"}} +

+
+ + + + + + {{t "name.label"}} + {{t "id.label"}} + {{t "type.label"}} + {{t "project.label"}} + + + + + {{#each @model as |model|}} + + + {{model.target.name}} +

{{model.target.description}}

+
+ + {{model.target.id}} + + + {{model.target.type}} + + + + {{model.project.name}} + + + + + {{t "session.actions.connect"}} + + +
+ {{/each}} +
+
+
+ +
diff --git a/ui/desktop/tests/unit/routes/scopes/scope/targets/index-test.js b/ui/desktop/tests/unit/routes/scopes/scope/targets/index-test.js new file mode 100644 index 000000000..fea08576c --- /dev/null +++ b/ui/desktop/tests/unit/routes/scopes/scope/targets/index-test.js @@ -0,0 +1,11 @@ +import { module, test } from 'qunit'; +import { setupTest } from 'ember-qunit'; + +module('Unit | Route | scopes/scope/targets/index', function(hooks) { + setupTest(hooks); + + test('it exists', function(assert) { + let route = this.owner.lookup('route:scopes/scope/targets/index'); + assert.ok(route); + }); +}); diff --git a/ui/desktop/translations/form/en-us.yaml b/ui/desktop/translations/form/en-us.yaml index cb3590c05..b126880d9 100644 --- a/ui/desktop/translations/form/en-us.yaml +++ b/ui/desktop/translations/form/en-us.yaml @@ -8,4 +8,6 @@ description: help: Description for identification purposes type: label: Type - help: The type of the resource, to help differentiate schemas \ No newline at end of file + help: The type of the resource, to help differentiate schemas +project: + label: Project diff --git a/ui/desktop/translations/resources/en-us.yaml b/ui/desktop/translations/resources/en-us.yaml index 01e8eef0f..22e1826b1 100644 --- a/ui/desktop/translations/resources/en-us.yaml +++ b/ui/desktop/translations/resources/en-us.yaml @@ -5,4 +5,9 @@ scope: title: Global target: title: Target - title_plural: Targets \ No newline at end of file + title_plural: Targets +session: + title: Session + title_plural: Sessions + actions: + connect: Connect