diff --git a/app/apps-tab/detail/template.hbs b/app/apps-tab/detail/template.hbs index 07685b5d5..001f1a5ef 100644 --- a/app/apps-tab/detail/template.hbs +++ b/app/apps-tab/detail/template.hbs @@ -42,11 +42,12 @@ expand=(action expandFn) expandOnInit=false }} -
{{model.app.status.notes}}
+ {{marked-down markdown=model.app.status.notes}} {{/accordion-list-item}} {{/if}} {{resource-condition-list + resourceType=(t 'generic.application') conditions=model.app.status.conditions expandAll=al.expandAll expandFn=expandFn diff --git a/app/container/template.hbs b/app/container/template.hbs index c23d9038a..0e5500542 100644 --- a/app/container/template.hbs +++ b/app/container/template.hbs @@ -87,6 +87,7 @@ }} {{resource-condition-list + resourceType=(t 'generic.pod') conditions=model.status.conditions expandAll=al.expandAll expandFn=expandFn @@ -119,11 +120,16 @@ }} {{/accordion-list-item}} - {{form-env-var - model=displayEnvironmentVars + {{#accordion-list-item + title=(t 'containerPage.portsTab.header') + detail=(t 'containerPage.portsTab.detail') expandAll=al.expandAll - expandFn=expandFn + expand=(action expandFn) }} + {{form-env-var + model=displayEnvironmentVars + }} + {{/accordion-list-item}} {{container/form-command instance=container diff --git a/app/models/app.js b/app/models/app.js index b1d1bf4b8..5be9e5a0d 100644 --- a/app/models/app.js +++ b/app/models/app.js @@ -34,7 +34,7 @@ const App = Resource.extend(StateCounts, { } }); }), - workloads: computed('namespace.workloads', function() { + workloads: computed('namespace.workloads.@each.workloadLabels', function() { return (get(this, 'namespace.workloads') || []).filter((item) => { if ( item['workloadLabels'] ) { return item['workloadLabels']['io.cattle.field/appId'] === get(this, 'name'); diff --git a/app/node/template.hbs b/app/node/template.hbs index 39998c63c..ae242ebc1 100644 --- a/app/node/template.hbs +++ b/app/node/template.hbs @@ -42,6 +42,7 @@
{{#accordion-list as |al expandFn|}} {{resource-condition-list + resourceType=(t 'generic.node') conditions=model.node.conditions expandAll=al.expandAll expandFn=expandFn diff --git a/app/styles/components/_code.scss b/app/styles/components/_code.scss index ac9fbe978..38f082c14 100644 --- a/app/styles/components/_code.scss +++ b/app/styles/components/_code.scss @@ -1,9 +1,10 @@ // Code $code-color : $info !default; $code-bg : $text-color !default; -$pre-bg : rgba($light-grey, .3) !default; +$pre-bg : $text-color !default; $pre-color : $dark-grey !default; $pre-border-color : $light-grey !default; +$setting-bg : rgba($light-grey, .3) !default; code { padding: 5px 10px; @@ -32,6 +33,11 @@ pre { } } +.bg-setting { + @include bg-color($setting-bg); + @include contrasted($setting-bg); +} + .bg-code { @include bg-color($code-bg); @include contrasted($code-bg); diff --git a/app/workload/template.hbs b/app/workload/template.hbs index dacd83e7a..88b0f67d7 100644 --- a/app/workload/template.hbs +++ b/app/workload/template.hbs @@ -84,27 +84,21 @@ }} {{#if service.canHaveEnvironment}} - {{form-env-var - model=displayEnvironmentVars - expandAll=al.expandAll - expandFn=expandFn - }} - {{/if}} - - {{#if service.canHaveSecrets}} {{#accordion-list-item - title=(t 'formSources.title') - detail=(t 'formSources.detail') + title=(t 'formEnvVar.title') + detail=(t 'formEnvVar.detail') expandAll=al.expandAll expand=(action expandFn) }} - {{container/form-sources - sources=activeLaunchConfig.environmentFrom - editing=false - expandAll=al.expandAll - expandFn=expandFn - classNames="accordion" - }} + {{form-env-var + model=displayEnvironmentVars + }} +
+ {{container/form-sources + namespace=service.namespace + sources=activeLaunchConfig.environmentFrom + editing=false + }} {{/accordion-list-item}} {{/if}} diff --git a/lib/shared/addon/components/cluster-driver/driver-import/component.js b/lib/shared/addon/components/cluster-driver/driver-import/component.js index a7f2b90ef..12294e27c 100644 --- a/lib/shared/addon/components/cluster-driver/driver-import/component.js +++ b/lib/shared/addon/components/cluster-driver/driver-import/component.js @@ -16,6 +16,7 @@ export default Component.extend(ClusterDriver, { clusterState: alias('model.originalCluster.state'), step: 1, + loading: false, didReceiveAttrs() { if ( get(this,'isEdit') && @@ -34,7 +35,7 @@ export default Component.extend(ClusterDriver, { }, clusterChanged: observer('cluster.state', function() { - if ( get(this, 'step') >= 2 ) { + if ( get(this, 'step') >= 2 ) { const state = get(this, 'cluster.state') if ( ! ['pending','initializing'].includes(state) ) { this.sendAction('close'); @@ -44,9 +45,15 @@ export default Component.extend(ClusterDriver, { loadToken() { const cluster = get(this,'cluster'); + set(this, 'step', 2); + set(this, 'loading', true); return cluster.getOrCreateToken().then((token) => { + if ( this.isDestroyed || this.isDestroying ) { + return; + } + set(this, 'token', token); - set(this, 'step', 2); + set(this, 'loading', false); }); } }); diff --git a/lib/shared/addon/components/cluster-driver/driver-import/template.hbs b/lib/shared/addon/components/cluster-driver/driver-import/template.hbs index 8daa7b195..3a53113b9 100644 --- a/lib/shared/addon/components/cluster-driver/driver-import/template.hbs +++ b/lib/shared/addon/components/cluster-driver/driver-import/template.hbs @@ -8,8 +8,12 @@
- {{copy-to-clipboard clipboardText=token.command tagName="div" classNames="copy-to-pre"}} -
{{token.command}}
+ {{#if loading}} +
{{t 'generic.loading'}}
+ {{else}} + {{copy-to-clipboard clipboardText=token.command tagName="div" classNames="copy-to-pre"}} +
{{token.command}}
+ {{/if}}
@@ -21,8 +25,12 @@
- {{copy-to-clipboard clipboardText=token.insecureCommand tagName="div" classNames="copy-to-pre"}} -
{{token.insecureCommand}}
+ {{#if loading}} +
{{t 'generic.loading'}}
+ {{else}} + {{copy-to-clipboard clipboardText=token.insecureCommand tagName="div" classNames="copy-to-pre"}} +
{{token.insecureCommand}}
+ {{/if}}
{{#if isEdit}} diff --git a/lib/shared/addon/components/container/form-scale/template.hbs b/lib/shared/addon/components/container/form-scale/template.hbs index e3a77682e..ca21dfe6e 100644 --- a/lib/shared/addon/components/container/form-scale/template.hbs +++ b/lib/shared/addon/components/container/form-scale/template.hbs @@ -68,7 +68,7 @@ {{/if}} {{t 'formScale.scaleMode.scaleSuffix' scale=asInteger}} {{else if (eq scaleMode "statefulSet")}} - + {{t 'formScale.scaleMode.statefulSetPrefix' scale=asInteger}} {{#if editing}} {{input-integer safeStyle="width: 60px; padding: 0 2px; display: inline-block" value=userInput min=min max=max}} diff --git a/lib/shared/addon/components/container/form-sources/component.js b/lib/shared/addon/components/container/form-sources/component.js index 7a5444628..2994017c8 100644 --- a/lib/shared/addon/components/container/form-sources/component.js +++ b/lib/shared/addon/components/container/form-sources/component.js @@ -1,7 +1,7 @@ import { inject as service } from '@ember/service'; import Component from '@ember/component'; import layout from './template'; -import { get, set, computed } from '@ember/object'; +import { get, set } from '@ember/object'; export default Component.extend({ layout, @@ -11,6 +11,32 @@ export default Component.extend({ statusClass: null, fetching: false, editing: true, + headers: [ + { + name: 'source', + sort: ['source'], + translationKey: 'formSources.type.label', + searchField: 'source', + }, + { + name: 'sourceName', + sort: ['sourceName','source'], + searchField: 'sourceName', + translationKey: 'formSources.source.label', + }, + { + name: 'sourceKey', + sort: ['sourceKey', 'sourceName','source'], + searchField: 'sourceKey', + translationKey: 'formSources.prefixOrKey.label', + }, + { + name: 'targetKey', + sort: ['targetKey', 'sourceKey', 'sourceName','source'], + searchField: 'targetKey', + translationKey: 'formSources.prefix.label', + } + ], actions: { addSource() { diff --git a/lib/shared/addon/components/container/form-sources/template.hbs b/lib/shared/addon/components/container/form-sources/template.hbs index 6e8a95d6b..7217b4149 100644 --- a/lib/shared/addon/components/container/form-sources/template.hbs +++ b/lib/shared/addon/components/container/form-sources/template.hbs @@ -1,41 +1,73 @@ -
- -
-
- {{#if sources.length}} - - - - - - - - - - - - - - - {{#each sources as |source|}} - {{form-sources-row - source=source - namespace=namespace - editing=editing - remove=(action "removeSource") - }} - {{/each}} - -
- {{else}} - {{#unless editing}} - {{t 'formSources.noData'}} - {{/unless}} - {{/if}} - {{#if editing}} +{{#if editing}} +
+ +
+
+ {{#if sources.length}} + + + + + + + + + + + + + + + {{#each sources as |source|}} + {{form-sources-row + source=source + namespace=namespace + remove=(action "removeSource") + }} + {{/each}} + +
+ {{/if}} - {{/if}} -
+
+{{else}} + {{#sortable-table + classNames="grid fixed mb-0 sortable-table" + bulkActions=false + rowActions=false + paging=false + search=true + sortBy=sortBy + stickyHeader=false + descending=descending + headers=headers + body=sources + as |sortable kind source| + }} + {{#if (eq kind "row")}} + + {{source.source}} + {{source.sourceName}} + + {{#if source.sourceKey}} + {{source.sourceKey}} + {{else}} + {{t 'generic.all'}} + {{/if}} + + {{source.targetKey}} + + {{else if (eq kind "nomatch")}} + + {{t 'formSources.noMatch'}} + + {{else if (eq kind "norows")}} + + {{t 'formSources.noData'}} + + {{/if}} + {{/sortable-table}} +{{/if}} diff --git a/lib/shared/addon/components/cru-cloud-provider/component.js b/lib/shared/addon/components/cru-cloud-provider/component.js index b3b026dc4..5979fd973 100644 --- a/lib/shared/addon/components/cru-cloud-provider/component.js +++ b/lib/shared/addon/components/cru-cloud-provider/component.js @@ -33,7 +33,9 @@ export default Component.extend({ set(this, 'configAnswers', get(this, AWS_PATH)); } else if ( cloudProviderName === 'azure' ) { set(this, 'selectedCloudProvider', 'azure'); - set(this, 'configAnswers', get(this, AZURE_PATH)); + const answers = get(this, AZURE_PATH); + delete answers.type; + set(this, 'configAnswers', answers); } else if ( !cloudProviderName ) { set(this, 'selectedCloudProvider', 'none'); } else { diff --git a/lib/shared/addon/components/form-env-var/template.hbs b/lib/shared/addon/components/form-env-var/template.hbs index a31d43ac0..32c04a8d6 100644 --- a/lib/shared/addon/components/form-env-var/template.hbs +++ b/lib/shared/addon/components/form-env-var/template.hbs @@ -1,35 +1,24 @@ -{{#accordion-list-item - title=(t 'formEnvVar.title') - detail=(t 'formEnvVar.detail' appName=settings.appName) - status=(t 'formEnvVar.status' count=(or model.length 0)) - statusClass=(if model.length 'bg-success' 'text-muted') - expandAll=expandAll - expand=(action expandFn) - componentName='sortable-table' - as | parent | +{{#sortable-table + classNames="grid fixed mb-0 sortable-table" + bulkActions=false + rowActions=false + paging=false + search=true + sortBy=sortBy + stickyHeader=false + descending=descending + headers=headers + body=model + as |sortable kind label| }} - {{#component parent.intent - classNames="grid fixed mb-0 sortable-table" - bulkActions=false - rowActions=false - paging=false - search=true - sortBy=sortBy - stickyHeader=false - descending=descending - headers=headers - body=model - as |sortable kind label| - }} - {{#if (eq kind "row")}} - - {{label.key}} - {{label.value}} - - {{else if (eq kind "norows")}} - - {{t 'labelsSection.noData'}} - - {{/if}} - {{/component}} -{{/accordion-list-item}} + {{#if (eq kind "row")}} + + {{label.key}} + {{label.value}} + + {{else if (eq kind "norows")}} + + {{t 'formEnvVar.noData'}} + + {{/if}} +{{/sortable-table}} \ No newline at end of file diff --git a/lib/shared/addon/components/modal-rollback-app/component.js b/lib/shared/addon/components/modal-rollback-app/component.js index 9562cb87a..eccf48457 100644 --- a/lib/shared/addon/components/modal-rollback-app/component.js +++ b/lib/shared/addon/components/modal-rollback-app/component.js @@ -3,6 +3,17 @@ import Component from '@ember/component'; import ModalBase from 'shared/mixins/modal-base'; import layout from './template'; +const HIDDEN_FIELDS = ['digest']; + +function sanitize(config) { + HIDDEN_FIELDS.forEach(key => { + if (config.hasOwnProperty(key)) { + delete config[key]; + } + }); + return config; +} + export default Component.extend(ModalBase, { layout, @@ -67,7 +78,7 @@ export default Component.extend(ModalBase, { if (get(this, 'current') && get(this, 'selected')) { let left = get(this, 'current.status'); let right = get(this, 'selected.status'); - var delta = jsondiffpatch.diff(left, right); + var delta = jsondiffpatch.diff(sanitize(left), sanitize(right)); jsondiffpatch.formatters.html.hideUnchanged(); return jsondiffpatch.formatters.html.format(delta, left).htmlSafe(); } diff --git a/lib/shared/addon/components/resource-condition-list/component.js b/lib/shared/addon/components/resource-condition-list/component.js index 04a76fbca..16abe398e 100644 --- a/lib/shared/addon/components/resource-condition-list/component.js +++ b/lib/shared/addon/components/resource-condition-list/component.js @@ -8,6 +8,7 @@ export default Component.extend({ sortBy: 'type', descending: false, + resourceType: null, headers: [ { diff --git a/lib/shared/addon/components/resource-condition-list/template.hbs b/lib/shared/addon/components/resource-condition-list/template.hbs index fc0c819a9..352333037 100644 --- a/lib/shared/addon/components/resource-condition-list/template.hbs +++ b/lib/shared/addon/components/resource-condition-list/template.hbs @@ -1,6 +1,6 @@ {{#accordion-list-item title=(t 'conditionSections.title') - detail=(t 'conditionSections.detail') + detail=(t 'conditionSections.detail' resourceType=resourceType) expandAll=expandAll expand=(action expandFn) componentName='sortable-table' diff --git a/lib/shared/addon/components/save-cancel/component.js b/lib/shared/addon/components/save-cancel/component.js index cb955111c..3fb32f497 100644 --- a/lib/shared/addon/components/save-cancel/component.js +++ b/lib/shared/addon/components/save-cancel/component.js @@ -31,6 +31,10 @@ export default Component.extend({ this.set('saving', true); this.set('saved', false); this.sendAction('save', (success) => { + if ( this.isDestroyed || this.isDestroying ) { + return; + } + this.set('saving', false); this.set('saved', ( success === true )); }); diff --git a/lib/shared/addon/components/settings/danger-zone/template.hbs b/lib/shared/addon/components/settings/danger-zone/template.hbs index a62554d0a..43f87ad93 100644 --- a/lib/shared/addon/components/settings/danger-zone/template.hbs +++ b/lib/shared/addon/components/settings/danger-zone/template.hbs @@ -20,7 +20,7 @@ {{else}}
-
+              
                 {{~#if row.obj.value~}}
                   {{~#if (or (not row.obj) (eq row.obj.default row.obj.value))~}}
                     {{~row.obj.value~}}
diff --git a/translations/en-us.yaml b/translations/en-us.yaml
index 772b0e945..f2276aaa6 100644
--- a/translations/en-us.yaml
+++ b/translations/en-us.yaml
@@ -11,6 +11,7 @@ generic:
   all: All
   any: Any
   as: as
+  application: application
   cancel: Cancel
   closeModal: Close
   cluster: Cluster
@@ -67,6 +68,7 @@ generic:
   none: None
   owner: Owner
   paste: Paste
+  pod: pod
   port: Port
   ports: Ports
   project: Project
@@ -176,7 +178,7 @@ appDetailPage:
   header: "App: {appName}"
   notes:
     title: Notes
-    detail: 'Notes for this application'
+    detail: 'Instructions on how to use this application'
   workloads:
     title: Workloads
     detail: Workloads created for this application.
@@ -1926,8 +1928,8 @@ clusterNew:
       instructionsInsecure: "If you get an error about 'certificate signed by unknown authority' because your {appName} installation is running with an untrusted/self-signed SSL certificate, run the command below instead to bypass the certificate check:"
 
 conditionSections:
-  title: Conditions
-  detail: Current conditions
+  title: Status
+  detail: Status of current {resourceType}
   table:
     type: Type
     status: Status
@@ -3462,7 +3464,8 @@ formScheduling:
 formSources:
   title: Environments From Sources
   detail: Environments from sources allow you to inject passwords, keys, or other information into the containers that need them.
-  noData: No Sources
+  noData: No Environments From Sources
+  noMatch: No Environments From Sources match the current search
   addLabel: Add Source
   type:
     label: Type
@@ -4254,7 +4257,7 @@ newCatalog:
   maintainer: "Maintainer:"
   newNamespace: New Namespace
   newAppDetail: Choose application version and namespace for the application
-  appInfo: Detailed Description
+  appInfo: Detailed Descriptions
   appInfoDetail: Application information and user guid
   noConfig: This template has no configuration options
   official: Officially Certified