Merge pull request #1839 from loganhz/fixes

Catalog and Fixes
This commit is contained in:
Vincent Fiduccia 2018-04-20 19:46:20 -07:00 committed by GitHub
commit c6abf5fe63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 202 additions and 111 deletions

View File

@ -42,11 +42,12 @@
expand=(action expandFn)
expandOnInit=false
}}
<pre class="log-body" style="margin:0; font-size: 80%; color: whitesmoke;">{{model.app.status.notes}}</pre>
{{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

View File

@ -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

View File

@ -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');

View File

@ -42,6 +42,7 @@
<section>
{{#accordion-list as |al expandFn|}}
{{resource-condition-list
resourceType=(t 'generic.node')
conditions=model.node.conditions
expandAll=al.expandAll
expandFn=expandFn

View File

@ -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);

View File

@ -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
}}
<hr class="mt-30 mb-30" />
{{container/form-sources
namespace=service.namespace
sources=activeLaunchConfig.environmentFrom
editing=false
}}
{{/accordion-list-item}}
{{/if}}

View File

@ -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);
});
}
});

View File

@ -8,8 +8,12 @@
</div>
<div class="copy-pre mt-20 mb-20">
{{copy-to-clipboard clipboardText=token.command tagName="div" classNames="copy-to-pre"}}
<pre id="registration-command" style="font-size: 14px;">{{token.command}}</pre>
{{#if loading}}
<div class="text-center"><i class="icon icon-spinner icon-spin"></i> {{t 'generic.loading'}}</div>
{{else}}
{{copy-to-clipboard clipboardText=token.command tagName="div" classNames="copy-to-pre"}}
<pre id="registration-command" style="font-size: 14px;">{{token.command}}</pre>
{{/if}}
</div>
<div class="mt-20">
@ -21,8 +25,12 @@
</div>
<div class="copy-pre mt-20 mb-20">
{{copy-to-clipboard clipboardText=token.insecureCommand tagName="div" classNames="copy-to-pre"}}
<pre id="registration-command" style="font-size: 14px;">{{token.insecureCommand}}</pre>
{{#if loading}}
<div class="text-center"><i class="icon icon-spinner icon-spin"></i> {{t 'generic.loading'}}</div>
{{else}}
{{copy-to-clipboard clipboardText=token.insecureCommand tagName="div" classNames="copy-to-pre"}}
<pre id="registration-command" style="font-size: 14px;">{{token.insecureCommand}}</pre>
{{/if}}
</div>
{{#if isEdit}}

View File

@ -68,7 +68,7 @@
{{/if}}
{{t 'formScale.scaleMode.scaleSuffix' scale=asInteger}}
{{else if (eq scaleMode "statefulSet")}}
<i class="icon icon-lg icon-service"></i>
<i class="icon icon-lg icon-database"></i>
{{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}}

View File

@ -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() {

View File

@ -1,41 +1,73 @@
<div class="clearfix">
<label class="acc-label">{{t 'newContainer.environment.from'}}</label>
</div>
<div>
{{#if sources.length}}
<table class="table fixed no-lines small mb-10">
<thead>
<tr class="hidden-sm">
<th width="140" class="{{unless editing 'acc-label'}}">{{t 'formSources.type.label'}}{{#if editing}}{{field-required}}{{/if}}</th>
<th width="10"></th>
<th width="220" class="{{unless editing 'acc-label'}}">{{t 'formSources.source.label'}}{{#if editing}}{{field-required}}{{/if}}</th>
<th width="10"></th>
<th class="{{unless editing 'acc-label'}}">{{t 'formSources.prefixOrKey.label'}}{{#if editing}}{{field-required}}{{/if}}</th>
<th width="70"></th>
<th class="{{unless editing 'acc-label'}}">{{t 'formSources.prefix.label'}}</th>
<th width="40">&nbsp;</th>
</tr>
</thead>
<tbody>
{{#each sources as |source|}}
{{form-sources-row
source=source
namespace=namespace
editing=editing
remove=(action "removeSource")
}}
{{/each}}
</tbody>
</table>
{{else}}
{{#unless editing}}
<span class="text-center text-muted">{{t 'formSources.noData'}}</span>
{{/unless}}
{{/if}}
{{#if editing}}
{{#if editing}}
<div class="clearfix">
<label class="acc-label">{{t 'newContainer.environment.from'}}</label>
</div>
<div>
{{#if sources.length}}
<table class="table fixed no-lines small mb-10">
<thead>
<tr class="hidden-sm">
<th width="140">{{t 'formSources.type.label'}}{{field-required}}</th>
<th width="10"></th>
<th width="220">{{t 'formSources.source.label'}}{{field-required}}</th>
<th width="10"></th>
<th>{{t 'formSources.prefixOrKey.label'}}{{field-required}}</th>
<th width="70"></th>
<th>{{t 'formSources.prefix.label'}}</th>
<th width="40">&nbsp;</th>
</tr>
</thead>
<tbody>
{{#each sources as |source|}}
{{form-sources-row
source=source
namespace=namespace
remove=(action "removeSource")
}}
{{/each}}
</tbody>
</table>
{{/if}}
<button type="button" class="btn bg-link icon-btn" {{action "addSource"}}>
<span class="darken"><i class="icon icon-plus icon-small"></i></span>
<span>{{t 'newContainer.environment.addFrom'}}</span>
</button>
{{/if}}
</div>
</div>
{{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")}}
<tr>
<td data-title="{{t 'formSources.type.label'}}:" class="force-wrap">{{source.source}}</td>
<td data-title="{{t 'formSources.source.label'}}:" class="force-wrap">{{source.sourceName}}</td>
<td data-title="{{t 'formSources.prefixOrKey.label'}}:" class="force-wrap">
{{#if source.sourceKey}}
{{source.sourceKey}}
{{else}}
{{t 'generic.all'}}
{{/if}}
</td>
<td data-title="{{t 'formSources.prefix.label'}}:" class="force-wrap">{{source.targetKey}}</td>
</tr>
{{else if (eq kind "nomatch")}}
<tr>
<td colspan="{{sortable.fullColspan}}" class="text-center text-muted pt-20 pb-20">{{t 'formSources.noMatch'}}</td>
</tr>
{{else if (eq kind "norows")}}
<tr>
<td colspan="{{sortable.fullColspan}}" class="text-center text-muted pt-20 pb-20">{{t 'formSources.noData'}}</td>
</tr>
{{/if}}
{{/sortable-table}}
{{/if}}

View File

@ -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 {

View File

@ -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")}}
<tr>
<td data-title="{{t 'formEnvVar.labels.key'}}:" class="force-wrap">{{label.key}}</td>
<td data-title="{{t 'formEnvVar.labels.value'}}:" class="force-wrap">{{label.value}}</td>
</tr>
{{else if (eq kind "norows")}}
<tr>
<td colspan="{{sortable.fullColspan}}" class="text-center text-muted pt-20 pb-20">{{t 'labelsSection.noData'}}</td>
</tr>
{{/if}}
{{/component}}
{{/accordion-list-item}}
{{#if (eq kind "row")}}
<tr>
<td data-title="{{t 'formEnvVar.labels.key'}}:" class="force-wrap">{{label.key}}</td>
<td data-title="{{t 'formEnvVar.labels.value'}}:" class="force-wrap">{{label.value}}</td>
</tr>
{{else if (eq kind "norows")}}
<tr>
<td colspan="{{sortable.fullColspan}}" class="text-center text-muted pt-20 pb-20">{{t 'formEnvVar.noData'}}</td>
</tr>
{{/if}}
{{/sortable-table}}

View File

@ -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();
}

View File

@ -8,6 +8,7 @@ export default Component.extend({
sortBy: 'type',
descending: false,
resourceType: null,
headers: [
{

View File

@ -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'

View File

@ -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 ));
});

View File

@ -20,7 +20,7 @@
</div>
{{else}}
<div class="">
<pre class="">
<pre class="bg-setting">
{{~#if row.obj.value~}}
{{~#if (or (not row.obj) (eq row.obj.default row.obj.value))~}}
{{~row.obj.value~}}

View File

@ -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