diff --git a/app/admin-tab/index/route.js b/app/admin-tab/index/route.js index ff115e642..7b24aba18 100644 --- a/app/admin-tab/index/route.js +++ b/app/admin-tab/index/route.js @@ -2,6 +2,6 @@ import Ember from 'ember'; export default Ember.Route.extend({ beforeModel: function() { - this.transitionTo('admin-tab.accounts'); + this.transitionTo('admin-tab.audit-logs'); } }); diff --git a/app/admin-tab/processes/process/template.hbs b/app/admin-tab/processes/process/template.hbs index 11dfbe712..476d7d673 100644 --- a/app/admin-tab/processes/process/template.hbs +++ b/app/admin-tab/processes/process/template.hbs @@ -1,5 +1,5 @@
- {{#link-to "admin-tab.processes" tagName="h1" href=false}}Proccesses{{/link-to}} +

{{#link-to "admin-tab.processes"}}Proccesses:{{/link-to}}

{{model.processInstance.id}}
diff --git a/app/admin-tab/settings/route.js b/app/admin-tab/settings/route.js index 542f61d04..596a966d2 100644 --- a/app/admin-tab/settings/route.js +++ b/app/admin-tab/settings/route.js @@ -3,32 +3,30 @@ import C from 'ui/utils/constants'; import {denormalizeName} from 'ui/services/settings'; export default Ember.Route.extend({ - endpoint: Ember.inject.service(), settings: Ember.inject.service(), - model: function() { + beforeModel() { + var store = this.get('store'); return Ember.RSVP.all([ - this.get('store').find('setting', denormalizeName(C.SETTING.API_HOST)), - this.get('store').find('setting', denormalizeName(C.SETTING.CATALOG_URL)), - this.get('store').find('setting', denormalizeName(C.SETTING.VM_ENABLED)), - ]).then((/* response */) => { - return Ember.Object.create({ - host: this.get('settings').get(C.SETTING.API_HOST), - catalog: this.get('settings').get(C.SETTING.CATALOG_URL), - vm: this.get('settings').get(C.SETTING.VM_ENABLED) || false, - }); + store.find('setting', denormalizeName(C.SETTING.API_HOST)), + store.find('setting', denormalizeName(C.SETTING.CATALOG_URL)), + store.find('setting', denormalizeName(C.SETTING.VM_ENABLED)), + ]); + }, + + model() { + var settings = this.get('settings'); + return Ember.Object.create({ + host: settings.get(C.SETTING.API_HOST), + catalog: settings.get(C.SETTING.CATALOG_URL), + vm: settings.get(C.SETTING.VM_ENABLED) || false, }); }, - setupController: function(controller, model) { - /*not sure we need this anymore except maybe to set error to null?*/ - controller.set('model', model); - controller.set('error', null); - }, - - resetController: function(controller, isExiting /*, transition*/ ) { + resetController(controller, isExiting /*, transition*/ ) { if (isExiting) { controller.set('backToAdd', false); + controller.set('error', null); } } }); diff --git a/app/admin-tab/settings/template.hbs b/app/admin-tab/settings/template.hbs index e6cc9e1ed..47b2992b4 100644 --- a/app/admin-tab/settings/template.hbs +++ b/app/admin-tab/settings/template.hbs @@ -18,26 +18,21 @@
-

Virtual Machine

+

Virtual Machines


-
Here you can enable access to virtual machines.
-
-
- +
Enable Virtual Machine support in the UI. Requires hosts that have KVM loaded.
+
+
+
-
-
- -
-
- -
+
+
diff --git a/app/applications-tab/catalog/controller.js b/app/applications-tab/catalog/controller.js index c0989cbd9..d633b8d02 100644 --- a/app/applications-tab/catalog/controller.js +++ b/app/applications-tab/catalog/controller.js @@ -1,7 +1,7 @@ import Ember from 'ember'; export default Ember.Controller.extend({ - queryParams: ['category', 'catalogid'], + queryParams: ['category', 'catalogId'], category: 'all', - catalogid: 'library' + catalogId: 'all' }); diff --git a/app/applications-tab/catalog/index/controller.js b/app/applications-tab/catalog/index/controller.js index 0dfc14c32..c27e8ef00 100644 --- a/app/applications-tab/catalog/index/controller.js +++ b/app/applications-tab/catalog/index/controller.js @@ -4,7 +4,12 @@ export default Ember.Controller.extend({ application: Ember.inject.controller(), catalogController: Ember.inject.controller('applications-tab.catalog'), category: Ember.computed.alias('catalogController.category'), - selectedCatalog: Ember.computed.alias('catalogController.catalogid'), + selectedCatalog: Ember.computed.alias('catalogController.catalogId'), + categories: Ember.computed.alias('model.categories'), + catalogIds: Ember.computed.alias('model.catalogIds'), + + // > 2 because 'all' is one of them. + showCatalogDropdown: Ember.computed.gt('catalogIds.length',2), search: '', actions: { @@ -17,10 +22,6 @@ export default Ember.Controller.extend({ } }, - categories: Ember.computed.alias('model.categories'), - - catalogIds: Ember.computed.alias('model.catalogIds'), - arrangedContent: function() { var search = this.get('search').toUpperCase(); var result = []; diff --git a/app/applications-tab/catalog/index/template.hbs b/app/applications-tab/catalog/index/template.hbs index 4e3cea92e..cdcfb541c 100644 --- a/app/applications-tab/catalog/index/template.hbs +++ b/app/applications-tab/catalog/index/template.hbs @@ -3,18 +3,20 @@ Catalog -
- - -
+ {{#if showCatalogDropdown}} +
+ + +
+ {{/if}}
@@ -38,7 +40,12 @@
{{#each arrangedContent as |catalogItem|}}
-
{{catalogItem.name}}
+
+ {{catalogItem.name}} + {{#if showCatalogDropdown}} + in {{catalogItem.catalogId}} + {{/if}} +
diff --git a/app/applications-tab/catalog/route.js b/app/applications-tab/catalog/route.js index 81c7bfa5d..8110bc5a5 100644 --- a/app/applications-tab/catalog/route.js +++ b/app/applications-tab/catalog/route.js @@ -17,7 +17,7 @@ export default Ember.Route.extend({ category: { refreshModel: true }, - catalogid: { + catalogId: { refreshModel: true } }, @@ -40,13 +40,13 @@ export default Ember.Route.extend({ var cache = this.get('cache'); // If the catalogIds dont match we need to go get the other catalog from the store since we do not cache all catalogs - if ( cache && cache.catalogId === params.catalogid) + if ( cache && cache.catalogId === params.catalogId) { return filter(cache, params.category, this.get('catalogIds')); } - if (params.catalogid) { - this.controllerFor('applications-tab.catalog.index').set('selectedCatalog', params.catalogid); + if (params.catalogId) { + this.controllerFor('applications-tab.catalog.index').set('selectedCatalog', params.catalogId); } var version = this.get('settings.rancherVersion'); @@ -54,8 +54,8 @@ export default Ember.Route.extend({ 'category_ne': 'system', }; - if (params.catalogid !== 'all') { - qp['catalogId'] = params.catalogid; + if (params.catalogId !== 'all') { + qp['catalogId'] = params.catalogId; } if ( version ) @@ -66,7 +66,7 @@ export default Ember.Route.extend({ var url = addQueryParams(this.get('app.catalogEndpoint')+'/templates', qp); return this.get('store').request({url: url}).then((response) => { - response.catalogId = params.catalogid; + response.catalogId = params.catalogId; this.set('cache', response); return filter(response, params.category, this.get('catalogIds')); }); @@ -77,7 +77,6 @@ export default Ember.Route.extend({ var out = Ember.Object.create({ categories: uniqKeys(data, 'category'), catalogIds: catalogIds, - }); if ( category === 'all' ) { @@ -89,4 +88,12 @@ export default Ember.Route.extend({ return out; } }, + + resetController: function (controller, isExiting/*, transition*/) { + if (isExiting) + { + controller.set('category', 'all'); + controller.set('catalogId', 'all'); + } + } }); diff --git a/app/certificates/detail/controller.js b/app/certificates/detail/controller.js index f5985fd85..b9d8f4e83 100644 --- a/app/certificates/detail/controller.js +++ b/app/certificates/detail/controller.js @@ -3,7 +3,7 @@ import Ember from 'ember'; export default Ember.Controller.extend({ actions: { changeCertificate(cert) { - this.get('application').transitionToRoute('certificate.detail', cert.get('id')); + this.transitionToRoute('certificates.detail', cert.get('id')); }, }, }); diff --git a/app/certificates/detail/template.hbs b/app/certificates/detail/template.hbs index 5bf10ff05..b50368324 100644 --- a/app/certificates/detail/template.hbs +++ b/app/certificates/detail/template.hbs @@ -1,19 +1,23 @@
-

- {{#link-to "certificates" tagName="h1" href=false}}Certificates{{/link-to}} - - {{#power-select options=model.allCertificates selected=model.certificate onchange=(action "changeCertificate") searchField="displayName" as |obj|}} -
{{obj.displayName}}
- {{/power-select}} - -

+

{{#link-to "certificates"}}Certificate:{{/link-to}}

+ + {{#power-select options=model.allCertificates selected=model.certificate onchange=(action "changeCertificate") searchField="displayName" as |obj|}} +
{{obj.displayName}}
+ {{/power-select}} {{action-menu model=model.certificate size="sm"}}
-
- {{partial "description"}} +{{#if model.certificate.description}} +
+
+ +

{{model.certificate.description}}

+
+
+{{/if}} +
diff --git a/app/components/catalog-settings/template.hbs b/app/components/catalog-settings/template.hbs index 5415f6dca..b3c03fcd9 100644 --- a/app/components/catalog-settings/template.hbs +++ b/app/components/catalog-settings/template.hbs @@ -1,6 +1,6 @@

Catalog


-
You can add and remove catalogs here. When adding ensure you give your catalog a name and git url. The correct format of git urls can be found here.
+
The catalog can retrieve templates from multiple sources. Each one needs a unique name and any URL that git clone can handle (see docs for more info).
{{form-key-value nameLabel="Catalog URL" diff --git a/app/components/compose-yaml/component.js b/app/components/compose-yaml/component.js new file mode 100644 index 000000000..994cb19f6 --- /dev/null +++ b/app/components/compose-yaml/component.js @@ -0,0 +1,28 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + dockerCompose: null, + rancherCompose: null, + + classNames: ['row'], + + didReceiveAttrs() { + this.highlightAll(); + }, + + highlightAll() { + Ember.run.next(() => { + this.$('CODE').each(function(idx, elem) { + Prism.highlightElement(elem); + }); + }); + }, + + // The highlighting breaks Ember's link to the content, so it's not automatically updated + // when the content change.. manually trigger that. + yamlChanged: function() { + this.$('CODE.docker-compose').html(this.get('dockerCompose')); + this.$('CODE.rancher-compose').html(this.get('rancherCompose')); + this.highlightAll(); + }.observes('dockerCompose','rancherCompose'), +}); diff --git a/app/components/compose-yaml/template.hbs b/app/components/compose-yaml/template.hbs new file mode 100644 index 000000000..674fbd461 --- /dev/null +++ b/app/components/compose-yaml/template.hbs @@ -0,0 +1,8 @@ +
+ docker-compose.yml {{zero-clipboard text=dockerCompose}} +
{{dockerCompose}}
+
+
+ rancher-compose.yml {{zero-clipboard text=rancherCompose}} +
{{rancherCompose}}
+
diff --git a/app/components/edit-externalservice/component.js b/app/components/edit-externalservice/component.js index cd1330aff..49ccc21c3 100644 --- a/app/components/edit-externalservice/component.js +++ b/app/components/edit-externalservice/component.js @@ -1,11 +1,12 @@ -import NewAlias from 'ui/components/new-aliasservice/component'; +import NewOrEdit from 'ui/mixins/new-or-edit'; import Ember from 'ember'; -export default NewAlias.extend({ +export default Ember.Component.extend(NewOrEdit, { existing: Ember.computed.alias('originalModel'), editing: true, service: null, + primaryResource: Ember.computed.alias('service'), actions: { done() { @@ -21,4 +22,12 @@ export default NewAlias.extend({ var original = this.get('originalModel'); this.set('service', original.clone()); }, + + doneSaving: function() { + this.send('done'); + }, + + didInsertElement() { + this.$('INPUT')[0].focus(); + }, }); diff --git a/app/components/environment-header/template.hbs b/app/components/environment-header/template.hbs index 34d3839f5..4ec16078b 100644 --- a/app/components/environment-header/template.hbs +++ b/app/components/environment-header/template.hbs @@ -1,14 +1,11 @@
- {{#link-to "environments" tagName="h1" href=false}}Stack:{{/link-to}} +

{{#link-to "environments"}}Stack:{{/link-to}}

+ {{#power-select options=all selected=model onchange=(action "changeStack") searchField="displayName" as |obj|}}
{{obj.displayName}}
{{/power-select}} -
- {{#link-to "environment.index" classNames="btn btn-sm btn-default"}}{{/link-to}} - {{#link-to "environment.graph" classNames="btn btn-sm btn-default"}}{{/link-to}} - {{#link-to "environment.code" classNames="btn btn-sm btn-default"}}{{/link-to}} -
+ {{header-state model=model}}
{{#if outputs.length}} @@ -43,13 +40,11 @@ {{action-menu model=model classNames="left-divider r-ml5" size="sm"}} +
+ {{#link-to "environment.index" classNames="btn btn-sm btn-default"}}{{/link-to}} + {{#link-to "environment.graph" classNames="btn btn-sm btn-default"}}{{/link-to}} + {{#link-to "environment.code" classNames="btn btn-sm btn-default"}}{{/link-to}} +
+ {{upgrade-btn environmentResource=model classNames="left-divider"}} - - {{#if (and model.isError model.showTransitioningMessage)}} -
- {{model.transitioningMessage}} -
- {{/if}} - - {{header-state model=model}}
diff --git a/app/components/form-engine-opts/template.hbs b/app/components/form-engine-opts/template.hbs index 7d16640e0..a1cc59d35 100644 --- a/app/components/form-engine-opts/template.hbs +++ b/app/components/form-engine-opts/template.hbs @@ -43,7 +43,7 @@ {{form-key-value initialMap=machine.engineLabel changed=(action (mut machine.engineLabel)) - nameLabel="Label" + nameLabel="Engine Label" keyLabel="Label" }}
diff --git a/app/components/form-networking/template.hbs b/app/components/form-networking/template.hbs index 5dbc41f4b..20d297f0b 100644 --- a/app/components/form-networking/template.hbs +++ b/app/components/form-networking/template.hbs @@ -96,7 +96,7 @@
- +
{{#if dnsResolverArray.length}} diff --git a/app/components/header-state/component.js b/app/components/header-state/component.js index b9514f42d..8dd875c07 100644 --- a/app/components/header-state/component.js +++ b/app/components/header-state/component.js @@ -1,6 +1,6 @@ import Ember from 'ember'; export default Ember.Component.extend({ - classNames: ['pull-right','section','r-mt5'], + classNames: ['header-state','pull-right','section','r-mt5'], classNameBindings: ['model.stateColor'], -}); \ No newline at end of file +}); diff --git a/app/components/host-settings/template.hbs b/app/components/host-settings/template.hbs index 968fb7f49..8cce2e028 100644 --- a/app/components/host-settings/template.hbs +++ b/app/components/host-settings/template.hbs @@ -1,6 +1,6 @@ -

Host

+

Host Registration URL


-
We need to know a little about how your environment is set up before you can register hosts. What base URL should hosts use to connect to the Rancher API?
+
What base URL should hosts use to connect to the Rancher API?
diff --git a/app/components/new-catalog/component.js b/app/components/new-catalog/component.js index 657014411..a00f22d3b 100644 --- a/app/components/new-catalog/component.js +++ b/app/components/new-catalog/component.js @@ -21,7 +21,6 @@ export default Ember.Component.extend(NewOrEdit, { questionsArray: null, selectedTemplateUrl: null, selectedTemplateModel: null, - showReadme: true, readmeContent: null, actions: { @@ -44,10 +43,6 @@ export default Ember.Component.extend(NewOrEdit, { changeTemplate: function(tpl) { this.get('application').transitionToRoute('applications-tab.catalog.launch', tpl.id); }, - - toggleReadMe: function() { - this.toggleProperty('showReadme'); - } }, didReceiveAttrs() { diff --git a/app/components/new-catalog/template.hbs b/app/components/new-catalog/template.hbs index 053c0e69e..b05e3c6b0 100644 --- a/app/components/new-catalog/template.hbs +++ b/app/components/new-catalog/template.hbs @@ -1,61 +1,45 @@
- - {{#link-to "applications-tab.catalog" tagName="h1" href=false}}Catalog{{/link-to}} - - {{#if editing}} - {{templateResource.name}} - {{else}} - {{#power-select options=allTemplates selected=templateResource onchange=(action "changeTemplate") searchField="name" as |obj|}} -
{{obj.name}}
- {{/power-select}} - {{/if}} - - +

{{#link-to "applications-tab.catalog"}}Catalog:{{/link-to}}

+ + {{#if editing}} + {{templateResource.name}} + {{else}} + {{#power-select options=allTemplates selected=templateResource onchange=(action "changeTemplate") searchField="name" as |obj|}} +
{{obj.name}}
+ {{/power-select}} + {{/if}}
-
+
{{#if templateResource.links.icon}} {{templateResource.name}} {{/if}} + +
+ Catalog: {{templateResource.catalogId}} +
Category: {{templateResource.category}}
- Release By: {{templateResource.maintainer}} + Maintainer: {{templateResource.maintainer}}
- Requires: {{templateResource.minimumRancherVersion}} -
-
- License: {{templateResource.license}} + License: {{#if templateResource.license}}{{templateResource.license}}{{else}}?{{/if}}
-
+ {{#if readmeContent}} +
+ {{common-mark markdown=readmeContent}} +
+ {{else}}

{{if editing "Upgrade" "Add"}} {{templateResource.name}} Stack {{#if editing}}"{{environmentResource.name}}"{{/if}}

{{templateResource.description}}

-
- {{#if readmeContent}} -
- - {{#liquid-if showReadme}} - {{common-mark markdown=readmeContent}} - {{/liquid-if}} -
{{/if}}
diff --git a/app/components/new-container/template.hbs b/app/components/new-container/template.hbs index b596d5c95..16b22bb7c 100644 --- a/app/components/new-container/template.hbs +++ b/app/components/new-container/template.hbs @@ -103,6 +103,7 @@
{{/if}} {{#if isAdminTab}} + {{#link-to "admin-tab.audit-logs"}}Audit Log{{/link-to}} + {{#link-to "admin-tab.processes"}}Processes{{/link-to}} {{#link-to "admin-tab.accounts"}}Accounts{{/link-to}} {{#link-to "admin-tab.auth"}}Access Control{{/link-to}} {{#link-to "admin-tab.settings"}}Settings{{/link-to}} - {{#link-to "admin-tab.processes"}}Processes{{/link-to}} - {{#link-to "admin-tab.audit-logs"}}Audit Logs{{/link-to}} {{/if}}
diff --git a/app/components/stack-section/template.hbs b/app/components/stack-section/template.hbs index 9f53c9bfa..1785ca20d 100644 --- a/app/components/stack-section/template.hbs +++ b/app/components/stack-section/template.hbs @@ -1,64 +1,47 @@ -
- {{#unless single}} +{{#unless single}} +
- {{/unless}} -
- {{#unless single}} +
- {{/unless}} -
+
-
- {{#if single}} - - {{else}} +

{{#link-to "environment" model.id}}{{model.name}}{{/link-to}}

- {{/if}} -
- - {{#if (and (not single) outputs.length)}} -
-
- - -
- {{/if}} -
- {{#unless single}} + {{#if outputs.length}} +
+
+ + +
+
+ {{/if}} + +
{{action-menu model=model}} - {{/unless}} -
+
-
-

{{instanceCount}}

- -
+
+

{{instanceCount}}

+ +
-
-

{{model.unremovedServices.length}}

- -
+
+

{{model.unremovedServices.length}}

+ +
-
- {{#unless single}} +
{{upgrade-btn environmentResource=model}}
{{#link-to "service.new" (query-params environmentId=model.id) classNames="btn btn-default btn-sm"}}Add Service{{/link-to}} @@ -75,10 +58,9 @@ {{/if}}
- {{/unless}} - +
-
+{{/unless}} {{#liquid-if (not collapsed)}}
diff --git a/app/container/template.hbs b/app/container/template.hbs index cd701ff10..82b68e7c5 100644 --- a/app/container/template.hbs +++ b/app/container/template.hbs @@ -1,15 +1,13 @@
- {{#link-to "containers" tagName="h1" href=false}}Container:{{/link-to}} +

{{#link-to "containers"}}Container:{{/link-to}}

{{#power-select options=model.primaryHost.instances selected=model onchange=(action "changeContainer") searchField="displayName" as |obj|}}
{{obj.displayName}}
{{/power-select}} + on {{#link-to "host" model.primaryHost.id}}{{model.primaryHost.displayName}}{{/link-to}} - on {{#link-to "host" model.primaryHost.id href=false}}{{model.primaryHost.displayName}}{{/link-to}} - {{action-menu model=model size="sm"}} - {{header-state model=model}}
diff --git a/app/environment/code/route.js b/app/environment/code/route.js index 8aa7d02f2..aff68cbf5 100644 --- a/app/environment/code/route.js +++ b/app/environment/code/route.js @@ -6,13 +6,14 @@ export default Ember.Route.extend({ var stack = par.get('stack'); return stack.doAction('exportconfig').then((config) => { // Windows needs CRLFs - config.dockerComposeConfig = config.dockerComposeConfig.split(/\r?\n/).join('\r\n'); - config.rancherComposeConfig = config.rancherComposeConfig.split(/\r?\n/).join('\r\n'); + var dockerCompose = config.dockerComposeConfig.split(/\r?\n/).join('\r\n'); + var rancherCompose = config.rancherComposeConfig.split(/\r?\n/).join('\r\n'); return Ember.Object.create({ stack: stack, all: par.get('all'), - composeConfig: config + dockerCompose: dockerCompose, + rancherCompose: rancherCompose, }); }); }, diff --git a/app/environment/code/template.hbs b/app/environment/code/template.hbs index 3a7b344cf..e8e6dba03 100644 --- a/app/environment/code/template.hbs +++ b/app/environment/code/template.hbs @@ -1,16 +1,8 @@ {{environment-header model=model.stack all=model.all}}
-
-
- docker-compose.yml {{zero-clipboard text=model.composeConfig.dockerComposeConfig}} -

-{{model.composeConfig.dockerComposeConfig}}
-
-
- rancher-compose.yml {{zero-clipboard text=model.composeConfig.rancherComposeConfig}} -

-{{model.composeConfig.rancherComposeConfig}}
-
-
+ {{compose-yaml + dockerCompose=model.dockerCompose + rancherCompose=model.rancherCompose + }}
diff --git a/app/environment/code/view.js b/app/environment/code/view.js deleted file mode 100644 index fc702dd01..000000000 --- a/app/environment/code/view.js +++ /dev/null @@ -1,18 +0,0 @@ -import Ember from 'ember'; - -export default Ember.View.extend({ - didInsertElement: function() { - this._super(); - this.highlightAll(); - }, - - highlightAll: function() { - this.$('CODE').each(function(idx, elem) { - Prism.highlightElement(elem); - }); - }, - - yamlChanged: function() { - this.highlightAll(); - }.observes('context.model.composeConfig.{dockerComposeConfig,rancherComposeConfig}'), -}); diff --git a/app/host/template.hbs b/app/host/template.hbs index ffd61be9a..fbd25777f 100644 --- a/app/host/template.hbs +++ b/app/host/template.hbs @@ -1,10 +1,10 @@
- {{#link-to "hosts" tagName="h1" href=false}}Host:{{/link-to}} - +

{{#link-to "hosts"}}Host:{{/link-to}}

+ {{#power-select options=model.all selected=host onchange=(action "changeHost") searchField="displayName" as |obj|}}
{{obj.displayName}}
{{/power-select}} - + {{#action-menu model=host size="sm" classNames="left-divider"}} {{#link-to "containers.new" (query-params hostId=host.id) classNames="btn btn-sm btn-primary"}}Add Container{{/link-to}} {{/action-menu}} diff --git a/app/hosts/new/template.hbs b/app/hosts/new/template.hbs index 8acddccc5..5b308286c 100644 --- a/app/hosts/new/template.hbs +++ b/app/hosts/new/template.hbs @@ -1,6 +1,6 @@

- {{#link-to "infrastructure-tab" tagName="li" href=false}}Hosts{{/link-to}} + {{#link-to "infrastructure-tab"}}Hosts:{{/link-to}} Add Host

diff --git a/app/models/auditlog.js b/app/models/auditlog.js index 6ffad3491..73d314e59 100644 --- a/app/models/auditlog.js +++ b/app/models/auditlog.js @@ -19,14 +19,15 @@ function serialize(obj) { } } -var auditLog = Resource.extend({}); +var AuditLog = Resource.extend({}); -auditLog.reopenClass({ +AuditLog.reopenClass({ headers: { [C.HEADER.PROJECT]: undefined, // Requests for projects use the user's scope, not the project }, mangleIn: function(data) { + // request and responseObject should be plain JSON objects, not typeified. if ( data.requestObject ) { data.requestObject = serialize(data.requestObject); @@ -42,4 +43,4 @@ auditLog.reopenClass({ }); -export default auditLog; +export default AuditLog; diff --git a/app/models/container.js b/app/models/container.js index 8d51cc7d2..76ba9634d 100644 --- a/app/models/container.js +++ b/app/models/container.js @@ -106,7 +106,7 @@ var Container = Resource.extend({ var resource = this.get('state'); var health = this.get('healthState'); - if ( ['running','active','updating-active'].indexOf(resource) >= 0 ) + if ( C.ACTIVEISH_STATES.indexOf(resource) >= 0 ) { if ( health === null || health === 'healthy' ) { diff --git a/app/models/environment.js b/app/models/environment.js index cd31713db..823626b0a 100644 --- a/app/models/environment.js +++ b/app/models/environment.js @@ -126,7 +126,7 @@ var Environment = Resource.extend({ unremoved++; - if ( ['running','active','updating-active'].indexOf(resource) >= 0 && health === 'healthy' ) + if ( C.ACTIVEISH_STATES.indexOf(resource) >= 0 && health === 'healthy' ) { healthy++; } diff --git a/app/models/service.js b/app/models/service.js index 817b5a98e..66d7689b1 100644 --- a/app/models/service.js +++ b/app/models/service.js @@ -306,8 +306,9 @@ var Service = Resource.extend({ instances.forEach((instance) => { var resource = instance.get('state'); var health = instance.get('healthState'); + var startOnce = instance.get('labels')[C.LABEL.START_ONCE] === true; - if ( ['running','active','updating-active'].indexOf(resource) >= 0 && (health === 'healthy' || health === null) ) + if ( C.ACTIVEISH_STATES.indexOf(resource) >= 0 && (health === 'healthy' || health === null) ) { healthy++; } diff --git a/app/service/template.hbs b/app/service/template.hbs index ac5e904e6..dea769118 100644 --- a/app/service/template.hbs +++ b/app/service/template.hbs @@ -1,12 +1,10 @@
-

- Service: -

- +

Service:

{{#power-select options=model.stack.services selected=service onchange=(action "changeService") searchField="displayName" as |obj|}}
{{obj.displayName}}
{{/power-select}} - + in {{#link-to "environment" model.stack.id}}{{model.stack.displayName}}{{/link-to}} + {{action-menu model=service classNames="r-ml5" size="sm"}} {{header-state model=service}}
diff --git a/app/services/settings.js b/app/services/settings.js index 9e90a210a..4f225248f 100644 --- a/app/services/settings.js +++ b/app/services/settings.js @@ -16,7 +16,7 @@ export default Ember.Service.extend(Ember.Evented, { init() { this._super(); - this.set('all', this.get('store').allUnremoved('activesetting')); + this.set('all', this.get('store').all('activesetting')); }, unknownProperty(key) { diff --git a/app/styles/catalog.scss b/app/styles/catalog.scss index fdc9b1442..3b9cc7866 100644 --- a/app/styles/catalog.scss +++ b/app/styles/catalog.scss @@ -21,7 +21,7 @@ $lines-to-show: 4; h5 { border-bottom: solid thin $lightGray; text-align: left; - padding: 15px; + padding: 15px 0; margin: 0 15px; } diff --git a/app/styles/layout.scss b/app/styles/layout.scss index a9defd3d3..7bf07c321 100644 --- a/app/styles/layout.scss +++ b/app/styles/layout.scss @@ -763,6 +763,10 @@ SECTION.header { } } +.header-state { + margin-left: 10px; +} + .sad-ie { background-image: url('images/sad-ie.png'); width: 300px; diff --git a/app/utils/active-array-proxy.js b/app/utils/active-array-proxy.js index baca0f27a..dc4ec6572 100644 --- a/app/utils/active-array-proxy.js +++ b/app/utils/active-array-proxy.js @@ -1,15 +1,16 @@ import Ember from 'ember'; -export default Ember.ArrayProxy.extend(Ember.SortableMixin, { +export default Ember.ArrayProxy.extend({ sourceContent: null, + sortProperties: null, init: function() { if ( !this.get('sortProperties') ) { - this.set('sortProperties', ['name','id']); + this.set('sortProperties', ['displayName','name','id']); } + this.sourceContentChanged(); this._super(); - this.set('content', []); }, sourceContentChanged: function() { @@ -17,5 +18,8 @@ export default Ember.ArrayProxy.extend(Ember.SortableMixin, { return (Ember.get(item,'state')||'').toLowerCase() === 'active'; }); this.set('content', x); - }.observes('sourceContent.@each.state').on('init'), + }.observes('sourceContent.@each.state'), + + // The array proxy reads this property + arrangedContent: Ember.computed.sort('content','sortProperties'), }); diff --git a/app/utils/constants.js b/app/utils/constants.js index ab92cd575..82bc936cf 100644 --- a/app/utils/constants.js +++ b/app/utils/constants.js @@ -1,40 +1,17 @@ var C = { - PREFS: { - ACCESS_WARNING: 'accessWarning', - PROJECT_DEFAULT: 'defaultProjectId', - I_HATE_SPINNERS: 'iHateSpinners', - EXPANDED_STACKS: 'expandedStacks', - SORT_STACKS_BY: 'sortStacksBy', - }, - COOKIE: { TOKEN: 'token', }, - SESSION: { - BACK_TO: 'backTo', - USER_ID: 'user', - ACCOUNT_ID: 'accountId', - USER_TYPE: 'userType', - PROJECT: 'projectId', - IDENTITY: 'userIdentity', - IDENTITY_TYPE: 'userType', - GITHUB_CACHE: 'githubCache', - GITHUB_ORGS: 'orgs', - GITHUB_TEAMS: 'teams', - }, - - HEADER: { - PROJECT: 'x-api-project-id', - NO_CHALLENGE: 'x-api-no-challenge', - NO_CHALLENGE_VALUE: 'true', - ACCOUNT_ID: 'x-api-account-id', - }, - - USER: { - TYPE_NORMAL: 'user', - TYPE_ADMIN: 'admin', - BASIC_BEARER: 'x-api-bearer', + EXTERNALID: { + KIND_SEPARATOR: '://', + GROUP_SEPARATOR: ':', + KIND_ALL: 'all', + KIND_USER: 'user', + KIND_CATALOG: 'catalog', + KIND_SYSTEM: 'system', + KIND_KUBERNETES: 'kubernetes', + CATALOG_DEFAULT_GROUP: 'library', }, GITHUB: { @@ -44,35 +21,11 @@ var C = { SCOPE: 'read:org', }, - PROJECT: { - TYPE_RANCHER: 'rancher_id', - TYPE_GITHUB_USER: 'github_user', - TYPE_GITHUB_TEAM: 'github_team', - TYPE_GITHUB_ORG: 'github_org', - TYPE_LDAP_USER: 'ldap_user', - TYPE_LDAP_GROUP: 'ldap_group', - TYPE_OPENLDAP_USER: 'openldap_user', - TYPE_OPENLDAP_GROUP: 'openldap_group', - - PERSON: 'person', - TEAM: 'team', - ORG: 'org', - - ROLE_MEMBER: 'member', - ROLE_OWNER: 'owner', - }, - - SETTING: { - // Dots in key names do not mix well with Ember, so use $ in their place. - DOT_CHAR: '$', - VERSION_RANCHER: 'rancher$server$image', - VERSION_COMPOSE: 'rancher$compose$version', - VERSION_CATTLE: 'cattle$version', - VERSION_MACHINE: 'docker$machine$version', - VERSION_GMS: 'go$machine$service$version', - API_HOST: 'api$host', - CATALOG_URL: 'catalog$url', - VM_ENABLED: 'vm$enabled', + HEADER: { + PROJECT: 'x-api-project-id', + NO_CHALLENGE: 'x-api-no-challenge', + NO_CHALLENGE_VALUE: 'true', + ACCOUNT_ID: 'x-api-account-id', }, KEY: { @@ -113,15 +66,62 @@ var C = { KVM: 'io.rancher.host.kvm', }, - EXTERNALID: { - KIND_SEPARATOR: '://', - GROUP_SEPARATOR: ':', - KIND_ALL: 'all', - KIND_USER: 'user', - KIND_CATALOG: 'catalog', - KIND_SYSTEM: 'system', - KIND_KUBERNETES: 'kubernetes', - CATALOG_DEFAULT_GROUP: 'library', + PREFS: { + ACCESS_WARNING: 'accessWarning', + PROJECT_DEFAULT: 'defaultProjectId', + I_HATE_SPINNERS: 'iHateSpinners', + EXPANDED_STACKS: 'expandedStacks', + SORT_STACKS_BY: 'sortStacksBy', + }, + + PROJECT: { + TYPE_RANCHER: 'rancher_id', + TYPE_GITHUB_USER: 'github_user', + TYPE_GITHUB_TEAM: 'github_team', + TYPE_GITHUB_ORG: 'github_org', + TYPE_LDAP_USER: 'ldap_user', + TYPE_LDAP_GROUP: 'ldap_group', + TYPE_OPENLDAP_USER: 'openldap_user', + TYPE_OPENLDAP_GROUP: 'openldap_group', + + PERSON: 'person', + TEAM: 'team', + ORG: 'org', + + ROLE_MEMBER: 'member', + ROLE_OWNER: 'owner', + }, + + SESSION: { + BACK_TO: 'backTo', + USER_ID: 'user', + ACCOUNT_ID: 'accountId', + USER_TYPE: 'userType', + PROJECT: 'projectId', + IDENTITY: 'userIdentity', + IDENTITY_TYPE: 'userType', + GITHUB_CACHE: 'githubCache', + GITHUB_ORGS: 'orgs', + GITHUB_TEAMS: 'teams', + }, + + SETTING: { + // Dots in key names do not mix well with Ember, so use $ in their place. + DOT_CHAR: '$', + VERSION_RANCHER: 'rancher$server$image', + VERSION_COMPOSE: 'rancher$compose$version', + VERSION_CATTLE: 'cattle$version', + VERSION_MACHINE: 'docker$machine$version', + VERSION_GMS: 'go$machine$service$version', + API_HOST: 'api$host', + CATALOG_URL: 'catalog$url', + VM_ENABLED: 'vm$enabled', + }, + + USER: { + TYPE_NORMAL: 'user', + TYPE_ADMIN: 'admin', + BASIC_BEARER: 'x-api-bearer', }, }; @@ -148,4 +148,14 @@ C.SYSTEM_LABELS_WITH_CONTROL = [ C.LABEL.PULL_IMAGE, ]; +C.ACTIVEISH_STATES = [ + 'running', + 'active', + 'updating-active', + 'updating-running', + 'healthy', + 'degraded', + 'unhealthy' +]; + export default C; diff --git a/app/utils/multi-stats.js b/app/utils/multi-stats.js index 6dc05bc81..85999dd9d 100644 --- a/app/utils/multi-stats.js +++ b/app/utils/multi-stats.js @@ -1,5 +1,6 @@ import Ember from "ember"; import Socket from "ui/utils/socket"; +import C from 'ui/utils/constants'; /* Usage: @@ -27,7 +28,7 @@ export default Ember.Object.extend(Ember.Evented, { }, available: function() { - return ['running','updating-running','active','updating-active','unhealthy'].indexOf(this.get('resource.state')) >= 0; + return C.ACTIVEISH_STATES.indexOf(this.get('resource.state')) >= 0; }.property('resource.state'), active: Ember.computed.and('available', 'connected'), diff --git a/app/utils/unpurged-array-proxy.js b/app/utils/unpurged-array-proxy.js index fe11f83f3..bc32e039e 100644 --- a/app/utils/unpurged-array-proxy.js +++ b/app/utils/unpurged-array-proxy.js @@ -1,15 +1,16 @@ import Ember from 'ember'; -export default Ember.ArrayProxy.extend(Ember.SortableMixin, { +export default Ember.ArrayProxy.extend({ sourceContent: null, + sortProperties: null, init: function() { if ( !this.get('sortProperties') ) { - this.set('sortProperties', ['name','id']); + this.set('sortProperties', ['displayName','name','id']); } + this.sourceContentChanged(); this._super(); - this.set('content', []); }, sourceContentChanged: function() { @@ -17,5 +18,8 @@ export default Ember.ArrayProxy.extend(Ember.SortableMixin, { return (Ember.get(item,'state')||'').toLowerCase() !== 'purged'; }); this.set('content', x); - }.observes('sourceContent.@each.state').on('init'), + }.observes('sourceContent.@each.state'), + + // The array proxy gets it's data from here + arrangedContent: Ember.computed.sort('content','sortProperties'), }); diff --git a/app/utils/unremoved-array-proxy.js b/app/utils/unremoved-array-proxy.js index f795726e9..9769c3427 100644 --- a/app/utils/unremoved-array-proxy.js +++ b/app/utils/unremoved-array-proxy.js @@ -1,21 +1,27 @@ import Ember from 'ember'; -export default Ember.ArrayProxy.extend(Ember.SortableMixin, { +var undesireable = ['removed','purging','purged']; + +export default Ember.ArrayProxy.extend({ sourceContent: null, + sortProperties: null, init: function() { if ( !this.get('sortProperties') ) { - this.set('sortProperties', ['name','id']); + this.set('sortProperties', ['displayName','name','id']); } + this.sourceContentChanged(); this._super(); - this.set('content', []); }, sourceContentChanged: function() { var x = (this.get('sourceContent')||[]).filter(function(item) { - return ['removed','purging','purged'].indexOf((Ember.get(item,'state')||'').toLowerCase()) === -1; + return undesireable.indexOf((Ember.get(item,'state')||'').toLowerCase()) === -1; }); this.set('content', x); - }.observes('sourceContent.@each.state').on('init'), + }.observes('sourceContent.@each.state'), + + // The array proxy reads this property + arrangedContent: Ember.computed.sort('content','sortProperties'), }); diff --git a/app/virtualmachine/route.js b/app/virtualmachine/route.js index 8da409fe2..b1c2447c7 100644 --- a/app/virtualmachine/route.js +++ b/app/virtualmachine/route.js @@ -6,7 +6,7 @@ export default Ember.Route.extend({ return store.find('virtualmachine', params.virtualmachine_id).then(function(vm) { var host = vm.get('primaryHost'); - if ( host.get('instances') ) + if ( !host || host.get('instances') ) { return vm; } diff --git a/app/virtualmachine/template.hbs b/app/virtualmachine/template.hbs index 40e14905a..c51cecdbe 100644 --- a/app/virtualmachine/template.hbs +++ b/app/virtualmachine/template.hbs @@ -1,19 +1,16 @@
-

- {{#if model.vm.primaryHost}} - {{#link-to "hosts" tagName="li" href=false}}Hosts{{/link-to}} - {{#link-to "host" model.vm.primaryHost.id tagName="li" href=false}}{{model.vm.primaryHost.displayName}}{{/link-to}} - {{else}} - {{#link-to "virtualmachines" tagName="li" href=false}}Virtual Machines{{/link-to}} - {{/if}} - - {{#power-select options=model.vm.primaryHost.instances selected=model.vm onchange=(action "changeVirtualMachine") searchField="displayName" as |obj|}} -
{{obj.displayName}}
- {{/power-select}} - -

+

{{#link-to "virtualmachines"}}Virtual Machine:{{/link-to}}

+ + {{#power-select options=model.vm.primaryHost.instances selected=model.vm onchange=(action "changeVirtualMachine") searchField="displayName" as |obj|}} +
{{obj.displayName}}
+ {{/power-select}} + + {{#if model.vm.primaryHost}} + on {{#link-to "host" model.vm.primaryHost.id}}{{model.vm.primaryHost.displayName}}{{/link-to}} + {{/if}} {{action-menu model=model.vm size="sm"}} + {{header-state model=model.vm}}
diff --git a/vendor/bootswatch-cosmo/_variables.scss b/vendor/bootswatch-cosmo/_variables.scss index 8c4bd88ed..1b55f28ac 100644 --- a/vendor/bootswatch-cosmo/_variables.scss +++ b/vendor/bootswatch-cosmo/_variables.scss @@ -908,9 +908,9 @@ $text-muted: #999; //** Abbreviations and acronyms border color $abbr-border-color: $gray-light; //** Headings small color -$headings-small-color: $gray-light; +$headings-small-color: $gray; //** Blockquote small color -$blockquote-small-color: $gray-light; +$blockquote-small-color: $gray; //** Blockquote font size $blockquote-font-size: ($font-size-base * 1.25); //** Blockquote border color