mirror of https://github.com/rancher/ui.git
Merge pull request #4213 from westlywright/upgrade.dependencies.2.5.1
Upgrade Ember & Dependencies for LTS support >3.12
This commit is contained in:
commit
2ff05e1d77
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
root = true
|
||||
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
|
|
|
|||
12
.eslintrc.js
12
.eslintrc.js
|
|
@ -1,3 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
const propertyOrder = [
|
||||
'service',
|
||||
'controller',
|
||||
|
|
@ -31,7 +33,8 @@ module.exports = {
|
|||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
allowImportExportEverywhere: true
|
||||
allowImportExportEverywhere: true,
|
||||
ecmaFeatures: { legacyDecorators: true }
|
||||
},
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
|
|
@ -77,6 +80,13 @@ module.exports = {
|
|||
'ember/use-brace-expansion': 'off',
|
||||
'ember/use-ember-get-and-set': 'off',
|
||||
'ember/new-module-imports': 'error',
|
||||
// >3.12
|
||||
'ember/no-new-mixins': 'off', // https://discuss.emberjs.com/t/best-way-to-replace-mixins/17395/2
|
||||
'ember/no-arrow-function-computed-properties': ['error', { onlyThisContexts: true }],
|
||||
'ember/no-get': 'off',
|
||||
'ember/no-jquery': 'off',
|
||||
'ember/no-mixins': 'off',
|
||||
'no-prototype-builtins': 'off',
|
||||
'eqeqeq': 'error',
|
||||
'generator-star-spacing': 'off',
|
||||
'guard-for-in': 'off',
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
extends: 'recommended',
|
||||
extends: 'recommended', // octane???
|
||||
|
||||
rules: {
|
||||
'attribute-indentation': false,
|
||||
'block-indentation': false,
|
||||
'deprecated-render-helper': false,
|
||||
'img-alt-attributes': false,
|
||||
'require-valid-alt-text': false,
|
||||
'linebreak-style': false,
|
||||
'link-rel-noopener': false,
|
||||
'link-href-attributes': false,
|
||||
'no-attrs-in-components': false,
|
||||
'no-bare-strings': false,
|
||||
'no-debugger': false,
|
||||
|
|
@ -19,6 +20,8 @@ module.exports = {
|
|||
'no-input-block': false,
|
||||
'no-input-tagname': false,
|
||||
'no-invalid-interactive': false,
|
||||
'no-invalid-role': false,
|
||||
'no-positive-tabindex': false,
|
||||
'no-log': false,
|
||||
'no-nested-interactive': false,
|
||||
'no-outlet-outside-routes': false,
|
||||
|
|
|
|||
21
app/app.js
21
app/app.js
|
|
@ -1,13 +1,16 @@
|
|||
import Application from '@ember/application';
|
||||
import Resolver from './resolver';
|
||||
import Resolver from 'ember-resolver';
|
||||
import loadInitializers from 'ember-load-initializers';
|
||||
import config from './config/environment';
|
||||
|
||||
const App = Application.extend({
|
||||
modulePrefix: config.modulePrefix,
|
||||
podModulePrefix: config.podModulePrefix,
|
||||
Resolver,
|
||||
engines: {
|
||||
export default class App extends Application {
|
||||
modulePrefix = config.modulePrefix;
|
||||
|
||||
podModulePrefix = config.podModulePrefix;
|
||||
|
||||
Resolver = Resolver;
|
||||
|
||||
engines = {
|
||||
login: {
|
||||
dependencies: {
|
||||
services: [
|
||||
|
|
@ -232,9 +235,7 @@ const App = Application.extend({
|
|||
externalRoutes: { 'authenticated.cluster.istio.cluster-setting': 'authenticated.cluster.istio.cluster-setting', }
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
loadInitializers(App, config.modulePrefix);
|
||||
|
||||
export default App;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export default Controller.extend({
|
|||
|
||||
tags: alias('projectController.tags'),
|
||||
templatesObsvr: observer('model.apps.[]', function() {
|
||||
once(() => this.get('catalog').fetchAppTemplates(get(this, 'model.apps')));
|
||||
once(this, 'fetchCatalogResources');
|
||||
}),
|
||||
|
||||
filteredApps: computed('model.apps.@each.{type,isFromCatalog,tags,state}', 'tags', 'searchText', function() {
|
||||
|
|
@ -47,4 +47,9 @@ export default Controller.extend({
|
|||
|
||||
return group;
|
||||
}),
|
||||
|
||||
fetchCatalogResources() {
|
||||
this.catalog.fetchAppTemplates(get(this, 'model.apps'));
|
||||
},
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<section class="header clearfix">
|
||||
<div class="right-buttons">
|
||||
<button class="btn btn-sm bg-primary" {{action "newApikey" "account"}}>{{t 'apiPage.actionButton'}}</button>
|
||||
<button class="btn btn-sm bg-primary" type="button" {{action "newApikey" "account"}}>{{t 'apiPage.actionButton'}}</button>
|
||||
</div>
|
||||
|
||||
<h1>{{t 'apiPage.header'}}</h1>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
{{error-sub-row fullColspan=sortable.fullColspan model=backup}}
|
||||
{{/if}}
|
||||
{{else if (eq kind "right-actions")}}
|
||||
<button style="margin-left: -5px;" class="btn btn-sm bg-primary pl-40 pr-40" {{action "snapshotNow"}}>
|
||||
<button style="margin-left: -5px;" class="btn btn-sm bg-primary pl-40 pr-40" type="button" {{action "snapshotNow"}}>
|
||||
{{t 'action.backupEtcd'}}
|
||||
</button>
|
||||
{{else if (eq kind "norows")}}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ export default Controller.extend({
|
|||
}
|
||||
};
|
||||
}),
|
||||
clusterScans: computed('model.clusterScans.@each', function() {
|
||||
clusterScans: computed('model.clusterScans.[]', 'scope.currentCluster.id', function() {
|
||||
return get(this, 'model.clusterScans').filterBy('clusterId', get(this, 'scope.currentCluster.id'));
|
||||
}),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export default Controller.extend({
|
|||
}
|
||||
},
|
||||
|
||||
tests: computed('model.scan.report', 'securityScanConfig.skipList', function() {
|
||||
tests: computed('model.nodes', 'model.scan.report.results', 'securityScanConfig.skipList', function() {
|
||||
const results = get(this, 'model.scan.report.results');
|
||||
|
||||
if (!results) {
|
||||
|
|
@ -100,7 +100,7 @@ export default Controller.extend({
|
|||
|
||||
|
||||
|
||||
clusterScans: computed('model.clusterScans.@each', function() {
|
||||
clusterScans: computed('model.clusterScans.[]', 'scope.currentCluster.id', function() {
|
||||
return get(this, 'model.clusterScans').filterBy('clusterId', get(this, 'scope.currentCluster.id'));
|
||||
}),
|
||||
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@
|
|||
/>
|
||||
{{#if searchText}}
|
||||
<span class="input-group-btn">
|
||||
<button class="btn bg-transparent text-info pl-10 pr-10" {{action "clearSearchText"}}><i class="icon icon-close"></i></button>
|
||||
<button class="btn bg-transparent text-info pl-10 pr-10" type="button" {{action "clearSearchText"}}><i class="icon icon-close"></i></button>
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-sm bg-primary pl-40 pr-40 ml-20" {{action "runScan"}} disabled={{scope.currentCluster.isClusterScanDisabled}}>
|
||||
<button class="btn btn-sm bg-primary pl-40 pr-40 ml-20" disabled={{scope.currentCluster.isClusterScanDisabled}} type="button" {{action "runScan"}}>
|
||||
{{t 'cis.scan.actions.runScan'}}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@
|
|||
<td colspan="{{sortable.fullColspan}}" class="text-center text-muted pt-20 pb-20">{{t 'cis.scan.table.empty'}}</td>
|
||||
</tr>
|
||||
{{else if (eq kind "right-actions")}}
|
||||
<button style="margin-left: -5px;" class="btn btn-sm bg-secondary pl-40 pr-40 mr-5" {{action "setSchedule"}} disabled={{scope.currentCluster.isAddClusterScanScheduleDisabled}}>
|
||||
<button style="margin-left: -5px;" class="btn btn-sm bg-secondary pl-40 pr-40 mr-5" disabled={{scope.currentCluster.isAddClusterScanScheduleDisabled}} type="button" {{action "setSchedule"}}>
|
||||
{{t 'cis.scan.actions.addSchedule'}}
|
||||
</button>
|
||||
<button style="margin-left: -5px;" class="btn btn-sm bg-secondary pl-40 pr-40 mr-5" {{action "setAlert"}} disabled={{scope.currentCluster.isClusterScanDown}}>
|
||||
<button style="margin-left: -5px;" class="btn btn-sm bg-secondary pl-40 pr-40 mr-5" disabled={{scope.currentCluster.isClusterScanDown}} type="button" {{action "setAlert"}}>
|
||||
{{t 'cis.scan.actions.addAlert'}}
|
||||
</button>
|
||||
<button style="margin-left: -5px;" class="btn btn-sm bg-primary pl-40 pr-40" {{action "runScan"}} disabled={{scope.currentCluster.isClusterScanDisabled}}>
|
||||
<button style="margin-left: -5px;" class="btn btn-sm bg-primary pl-40 pr-40" disabled={{scope.currentCluster.isClusterScanDisabled}} type="button" {{action "runScan"}}>
|
||||
{{t 'cis.scan.actions.runScan'}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export default Controller.extend({
|
|||
},
|
||||
},
|
||||
|
||||
clusterCatalogs: computed('model.clusterCatalogs.@each.{clusterId,state,id}', function() {
|
||||
clusterCatalogs: computed('model.clusterCatalogs.@each.{clusterId,id,state}', 'scope.currentCluster.id', function() {
|
||||
return get(this, 'model.clusterCatalogs').filterBy('clusterId', get(this, 'scope.currentCluster.id'));
|
||||
}),
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<section class="header clearfix">
|
||||
<div class="right-buttons">
|
||||
<button class="btn bg-primary btn-sm" {{action "add"}}>
|
||||
<button class="btn bg-primary btn-sm" type="button" {{action "add"}}>
|
||||
{{t 'catalogSettings.more.addActionLabel'}}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -148,9 +148,7 @@ export default Route.extend({
|
|||
activate() {
|
||||
this._super(...arguments);
|
||||
|
||||
scheduleOnce('afterRender', this, function() {
|
||||
set(this, 'controller.model.activated', true);
|
||||
});
|
||||
scheduleOnce('afterRender', this, 'activateModel');
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
|
@ -163,4 +161,8 @@ export default Route.extend({
|
|||
provider: { refreshModel: true },
|
||||
clusterTemplateRevision: { refreshModel: true }
|
||||
},
|
||||
|
||||
activateModel() {
|
||||
set(this, 'controller.model.activated', true);
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ export default Controller.extend({
|
|||
return null;
|
||||
}),
|
||||
|
||||
rows: computed('model.nodes.@each.clusterId', function() {
|
||||
rows: computed('model.cluster.id', 'model.nodes.@each.clusterId', function() {
|
||||
return get(this, 'model.nodes').filterBy('clusterId', get(this, 'model.cluster.id'));
|
||||
}),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<section class="header clearfix">
|
||||
<h1 class="pull-left">{{t "nodesPage.header"}}</h1>
|
||||
<div class="right-buttons">
|
||||
<button class="btn bg-primary btn-sm ml-10" {{action "editCluster"}}>
|
||||
<button class="btn bg-primary btn-sm ml-10" type="button" {{action "editCluster"}}>
|
||||
<span>{{t "nodesPage.editCluster"}}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -47,13 +47,11 @@
|
|||
{{#if capabilities.nodePoolsCanScale}}
|
||||
<p class="m-0">
|
||||
<button
|
||||
class="btn btn-xs bg-primary"
|
||||
{{action "scaleDownPool" node.ref.id}}
|
||||
disabled={{lte node.ref.quantity 1}}
|
||||
class="btn btn-xs bg-primary" disabled={{lte node.ref.quantity 1}} type="button" {{action "scaleDownPool" node.ref.id}}
|
||||
>
|
||||
<i class="icon icon-minus icon-fw"/>
|
||||
</button>
|
||||
<button style="margin-left: -5px;" class="btn btn-xs bg-primary" {{action "scaleUpPool" node.ref.id}}>
|
||||
<button style="margin-left: -5px;" class="btn btn-xs bg-primary" type="button" {{action "scaleUpPool" node.ref.id}}>
|
||||
<i class="icon icon-plus icon-fw"/>
|
||||
</button>
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<section class="header clearfix">
|
||||
<div class="pull-left pt-10"><h1>{{t 'notifierPage.notifiers'}}</h1></div>
|
||||
<div class="right-buttons">
|
||||
<button class="btn btn-sm bg-primary" {{action "showNewEditModal"}}>{{t 'notifierPage.index.addActionLabel'}}</button>
|
||||
<button class="btn btn-sm bg-primary" type="button" {{action "showNewEditModal"}}>{{t 'notifierPage.index.addActionLabel'}}</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
|
|
|||
|
|
@ -71,28 +71,28 @@ export default Controller.extend(NewOrEdit, {
|
|||
return get(this, 'model.allProjects').filterBy('clusterId', get(this, 'scope.currentCluster.id'))
|
||||
}),
|
||||
|
||||
projectLimit: computed('primaryResource.resourceQuota.{limit}', 'primaryResource.projectId', function() {
|
||||
projectLimit: computed('allProjects', 'primaryResource.projectId', 'primaryResource.resourceQuota.limit', function() {
|
||||
const projectId = get(this, 'primaryResource.projectId');
|
||||
const project = get(this, 'allProjects').findBy('id', projectId);
|
||||
|
||||
return get(project, 'resourceQuota.limit');
|
||||
}),
|
||||
|
||||
projectUsedLimit: computed('primaryResource.resourceQuota.{limit}', 'primaryResource.projectId', function() {
|
||||
projectUsedLimit: computed('allProjects', 'primaryResource.projectId', 'primaryResource.resourceQuota.limit', function() {
|
||||
const projectId = get(this, 'primaryResource.projectId');
|
||||
const project = get(this, 'allProjects').findBy('id', projectId);
|
||||
|
||||
return get(project, 'resourceQuota.usedLimit');
|
||||
}),
|
||||
|
||||
nsDefaultQuota: computed('primaryResource.resourceQuota.{limit}', 'primaryResource.projectId', function() {
|
||||
nsDefaultQuota: computed('allProjects', 'primaryResource.projectId', 'primaryResource.resourceQuota.limit', function() {
|
||||
const projectId = get(this, 'primaryResource.projectId');
|
||||
const project = get(this, 'allProjects').findBy('id', projectId);
|
||||
|
||||
return get(project, 'namespaceDefaultResourceQuota.limit');
|
||||
}),
|
||||
|
||||
nameExists: computed('primaryResource.name', 'model.namespaces.@each.name', function() {
|
||||
nameExists: computed('model.namespaces.@each.name', 'primaryResource.{id,name}', function() {
|
||||
const name = get(this, 'primaryResource.name');
|
||||
|
||||
if ( name ) {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
<section class="header clearfix">
|
||||
<div class="right-buttons">
|
||||
<button
|
||||
{{action "importYaml"}}
|
||||
class="btn btn-sm bg-default mr-10"
|
||||
disabled={{rbac-prevents resource="storageclass" scope="cluster" permission="create"}}
|
||||
disabled={{rbac-prevents resource="storageclass" scope="cluster" permission="create"}} type="button" {{action "importYaml"}}
|
||||
>
|
||||
{{t "nav.containers.importCompose"}}
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
<section class="header clearfix">
|
||||
<div class="right-buttons">
|
||||
<button
|
||||
{{action "importYaml"}}
|
||||
class="btn btn-sm bg-default mr-10"
|
||||
disabled={{rbac-prevents resource="persistentvolume" scope="cluster" permission="create"}}
|
||||
disabled={{rbac-prevents resource="persistentvolume" scope="cluster" permission="create"}} type="button" {{action "importYaml"}}
|
||||
>
|
||||
{{t "nav.containers.importCompose"}}
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ export default Controller.extend({
|
|||
isPopup: alias('application.isPopup'),
|
||||
pageScope: alias('scope.currentPageScope'),
|
||||
|
||||
hasHosts: computed.gt('model.hosts.length', 0),
|
||||
|
||||
bootstrap: on('init', function() {
|
||||
schedule('afterRender', this, () => {
|
||||
this.get('application').setProperties({
|
||||
|
|
@ -32,8 +34,4 @@ export default Controller.extend({
|
|||
});
|
||||
}),
|
||||
|
||||
hasHosts: computed('model.hosts.length', function() {
|
||||
return (this.get('model.hosts.length') > 0);
|
||||
}),
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
</div>
|
||||
<div class="row mt-20">
|
||||
<div class="col span-12 text-center">
|
||||
<button class="btn bg-primary" {{action "editPassword"}}>
|
||||
<button class="btn bg-primary" type="button" {{action "editPassword"}}>
|
||||
{{t "userPreferencesPage.generalInfo.password.text"}}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export default Controller.extend({
|
|||
group: alias('projectController.group'),
|
||||
groupTableBy: alias('projectController.groupTableBy'),
|
||||
|
||||
rows: computed('model.configMaps.[].type', function() {
|
||||
rows: computed('model.configMaps.@each.type', function() {
|
||||
return get(this, 'model.configMaps').filterBy('type', 'configMap');
|
||||
}),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
{{/tooltip-element}}
|
||||
</div>
|
||||
|
||||
<button {{action 'importYaml'}} class="btn btn-sm bg-default mr-10" disabled={{rbac-prevents resource="configmap" scope="project" permission="create"}}>{{t 'nav.containers.importCompose'}}</button>
|
||||
<button class="btn btn-sm bg-default mr-10" disabled={{rbac-prevents resource="configmap" scope="project" permission="create"}} type="button" {{action 'importYaml'}}>{{t 'nav.containers.importCompose'}}</button>
|
||||
|
||||
{{#link-to "authenticated.project.config-maps.new" classNames="btn btn-sm bg-primary" disabled=(rbac-prevents resource=resource scope="project" permission="create")}}{{t 'configMapsPage.index.linkTo'}}{{/link-to}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ export default Route.extend({
|
|||
set(controller, 'containerName', model.containerName);
|
||||
|
||||
if (controller.get('kubernetes')) {
|
||||
defineProperty(controller, 'command', computed('model.pod.labels', function() {
|
||||
defineProperty(controller, 'command', computed('cookies', 'model.pod.labels', function() {
|
||||
var labels = get(this, 'model.pod.labels') || {};
|
||||
|
||||
if ( `${ labels[C.LABEL.K8S_TOKEN] }` === 'true' ) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{{#containers-header showGroup=false}}
|
||||
<button {{action 'importYaml'}} class="btn btn-sm bg-default mr-10" disabled={{rbac-prevents resource="service" scope="project" permission="create"}}>{{t 'nav.containers.importCompose'}}</button>
|
||||
<button class="btn btn-sm bg-default mr-10" disabled={{rbac-prevents resource="service" scope="project" permission="create"}} type="button" {{action 'importYaml'}}>{{t 'nav.containers.importCompose'}}</button>
|
||||
{{#link-to "authenticated.project.dns.new" scope.currentProject.id class="btn btn-sm bg-primary" disabled=(rbac-prevents resource="service" scope="project" permission="create")}}{{t 'nav.containers.addDns'}}{{/link-to}}
|
||||
{{/containers-header}}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,17 +24,25 @@ export default Controller.extend({
|
|||
}
|
||||
}),
|
||||
|
||||
latestAnnouncement: computed('model.announcements', function() {
|
||||
latestAnnouncement: computed('forumsLink', 'model.announcements.topics', function() {
|
||||
let out = {
|
||||
title: '',
|
||||
link: '',
|
||||
created: '',
|
||||
};
|
||||
|
||||
if (this.get('model.announcements.topics')) {
|
||||
let sorted = this.get('model.announcements.topics').sortBy('id');
|
||||
var announcement = sorted[sorted.length - 1];
|
||||
|
||||
return {
|
||||
out = {
|
||||
title: announcement.title,
|
||||
link: `${ this.get('forumsLink') }/t/${ announcement.slug }`,
|
||||
created: announcement.created_at
|
||||
};
|
||||
}
|
||||
|
||||
return out;
|
||||
}),
|
||||
|
||||
forumsLink: C.EXT_REFERENCES.FORUM,
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<h3>{{t 'helpPage.host.header'}}</h3>
|
||||
<hr/>
|
||||
<p>{{t 'helpPage.host.content' appName=settings.appName minVersion=settings.minDockerVersion}} <a href="{{docsLink}}/hosts/" target="_blank">{{t 'helpPage.host.contentLink'}}</a></p>
|
||||
{{#link-to "authenticated.host-templates" class="btn bg-primary"}}{{t 'helpPage.host.addHostLink'}}{{/link-to}}
|
||||
{{!-- {{#link-to "authenticated.host-templates" class="btn bg-primary"}}{{t 'helpPage.host.addHostLink'}}{{/link-to}} --}}
|
||||
</div>
|
||||
|
||||
<div class="col span-4">
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
<section class="header clearfix">
|
||||
<div class="right-buttons">
|
||||
<button
|
||||
{{action "importYaml"}}
|
||||
class="btn btn-sm bg-default mr-10"
|
||||
disabled={{rbac-prevents resource="horizontalpodautoscaler" scope="project" permission="create"}}
|
||||
disabled={{rbac-prevents resource="horizontalpodautoscaler" scope="project" permission="create"}} type="button" {{action "importYaml"}}
|
||||
>
|
||||
{{t "nav.containers.importCompose"}}
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -51,14 +51,14 @@ export default Controller.extend({
|
|||
},
|
||||
},
|
||||
|
||||
allNamespace: computed('model.namespaces.[]', function() {
|
||||
allNamespace: computed('model.namespaces.[]', 'scope.currentProject.id', function() {
|
||||
let ns = get(this, 'model.namespaces');
|
||||
let pId = get(this, 'scope.currentProject.id');
|
||||
|
||||
return ns.filter( (n) => get(n, 'projectId') === pId || isEmpty(get(n, 'projectId')));
|
||||
}),
|
||||
|
||||
projectNamespaces: computed('model.namespaces', function() {
|
||||
projectNamespaces: computed('model.namespaces', 'scope.currentProject.id', function() {
|
||||
return get(this, 'model.namespaces').filter( (ns) => get(ns, 'projectId') === get(this, 'scope.currentProject.id'));
|
||||
}),
|
||||
|
||||
|
|
|
|||
|
|
@ -36,11 +36,11 @@ export default Controller.extend({
|
|||
}
|
||||
},
|
||||
|
||||
clusterCatalogs: computed('model.clusterCatalogs.@each.{clusterId,state,id}', function() {
|
||||
clusterCatalogs: computed('model.clusterCatalogs.@each.{clusterId,id,state}', 'scope.currentCluster.id', function() {
|
||||
return get(this, 'model.clusterCatalogs').filterBy('clusterId', get(this, 'scope.currentCluster.id'));
|
||||
}),
|
||||
|
||||
projectCatalogs: computed('model.projectCatalogs.@each.{clusterId,state,id}', function() {
|
||||
projectCatalogs: computed('model.projectCatalogs.@each.{clusterId,id,state}', 'scope.currentProject.id', function() {
|
||||
return get(this, 'model.projectCatalogs').filterBy('projectId', get(this, 'scope.currentProject.id'));
|
||||
}),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<section class="header clearfix">
|
||||
<div class="right-buttons">
|
||||
<button class="btn bg-primary btn-sm" {{action "add"}}>
|
||||
<button class="btn bg-primary btn-sm" type="button" {{action "add"}}>
|
||||
{{t 'catalogSettings.more.addActionLabel'}}
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -27,5 +27,5 @@
|
|||
|
||||
|
||||
<div class="footer-actions mt-20">
|
||||
<button {{action "goBack"}} class="btn bg-transparent">{{t 'generic.back'}}</button>
|
||||
<button class="btn bg-transparent" type="button" {{action "goBack"}}>{{t 'generic.back'}}</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export default Controller.extend({
|
|||
group: alias('projectController.group'),
|
||||
groupTableBy: alias('projectController.groupTableBy'),
|
||||
|
||||
rows: computed('model.projectSecrets.[].type', 'model.namespacedSecrets.[].type', function() {
|
||||
rows: computed('model.projectSecrets.@each.type', 'model.namespacedSecrets.@each.type', function() {
|
||||
const proj = get(this, 'model.projectSecrets').filterBy('type', 'secret');
|
||||
const ns = get(this, 'model.namespacedSecrets').filterBy('type', 'namespacedSecret');
|
||||
const out = proj.concat(ns);
|
||||
|
|
|
|||
|
|
@ -157,21 +157,16 @@ export default Route.extend(Preload, {
|
|||
const version = get(this, 'settings.rancherVersion');
|
||||
const isDev = isDevBuild(version);
|
||||
|
||||
|
||||
if ( get(this, 'access.admin') && (!telemetry || telemetry === 'prompt') ) {
|
||||
// Show the telemetry opt-in if not set
|
||||
scheduleOnce('afterRender', this, function() {
|
||||
get(this, 'modalService').toggleModal('modal-telemetry');
|
||||
});
|
||||
scheduleOnce('afterRender', this.modalService, 'toggleModal', 'modal-telemetry');
|
||||
} else if ( form && !get(this, `prefs.${ C.PREFS.FEEDBACK }`) ) {
|
||||
// Try.rancher feedback
|
||||
scheduleOnce('afterRender', this, function() {
|
||||
get(this, 'modalService').toggleModal('modal-feedback');
|
||||
});
|
||||
scheduleOnce('afterRender', this.modalService, 'toggleModal', 'modal-feedback');
|
||||
} else if ( !isDev && (!seenWhatsNew || compare(seenWhatsNew, C.WHATS_NEW_VERSION) < 0) ) {
|
||||
// What's new
|
||||
scheduleOnce('afterRender', this, function() {
|
||||
get(this, 'modalService').toggleModal('modal-whats-new');
|
||||
});
|
||||
scheduleOnce('afterRender', this.modalService, 'toggleModal', 'modal-whats-new');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
import ContentElement from 'ember-basic-dropdown/components/basic-dropdown/content-element';
|
||||
import { get } from '@ember/object';
|
||||
import { next } from '@ember/runloop';
|
||||
|
||||
const CE = ContentElement.extend({
|
||||
click() {
|
||||
this.closeDD();
|
||||
|
||||
return true;
|
||||
},
|
||||
closeDD() {
|
||||
let dd = get(this, 'parentView.dropdown');
|
||||
|
||||
if (get(dd, 'actions')) {
|
||||
next(() => {
|
||||
dd.actions.close();
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
export default CE;
|
||||
|
|
@ -15,7 +15,7 @@ export default Component.extend({
|
|||
get(this, 'model.toggleSkip')()
|
||||
},
|
||||
},
|
||||
isInSkipList: computed('model.skipList.@each', function() {
|
||||
isInSkipList: computed('model.id', 'model.skipList.[]', function() {
|
||||
return get(this, 'model.skipList').indexOf(get(this, 'model.id')) !== -1;
|
||||
}),
|
||||
showSkipButton: computed('model.state', 'isInSkipList', function() {
|
||||
|
|
|
|||
|
|
@ -5,10 +5,8 @@ import { computed } from '@ember/object'
|
|||
export default Component.extend({
|
||||
layout,
|
||||
tagName: '',
|
||||
error: computed('model.status.conditions.@each', function() {
|
||||
errorMessage: computed.reads('error.message'),
|
||||
error: computed('model.status.conditions.[]', function() {
|
||||
return this.model.status.conditions.find((condition) => condition.type === 'Failed')
|
||||
}),
|
||||
errorMessage: computed('error.message', function() {
|
||||
return this.error.message;
|
||||
})
|
||||
});
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@
|
|||
{{t 'containerLogs.previous'}}
|
||||
</label>
|
||||
</div>
|
||||
<button {{action "scrollToTop"}} class="btn bg-default">{{t 'containerLogs.scrollTop'}}</button>
|
||||
<button {{action "followLog"}} class="btn bg-default scroll-bottom">{{t 'containerLogs.scrollBottom'}}</button>
|
||||
<button {{action "download"}} class="btn bg-default">{{t 'containerLogs.download'}}</button>
|
||||
<button {{action "clear"}} class="btn bg-default">{{t 'containerLogs.clear'}}</button>
|
||||
<button {{action "cancel"}} class="btn bg-primary">{{t 'generic.closeModal'}}</button>
|
||||
<button class="btn bg-default" type="button" {{action "scrollToTop"}}>{{t 'containerLogs.scrollTop'}}</button>
|
||||
<button class="btn bg-default scroll-bottom" type="button" {{action "followLog"}}>{{t 'containerLogs.scrollBottom'}}</button>
|
||||
<button class="btn bg-default" type="button" {{action "download"}}>{{t 'containerLogs.download'}}</button>
|
||||
<button class="btn bg-default" type="button" {{action "clear"}}>{{t 'containerLogs.clear'}}</button>
|
||||
<button class="btn bg-primary" type="button" {{action "cancel"}}>{{t 'generic.closeModal'}}</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export default Component.extend({
|
|||
|
||||
extraSearchFields: ['displayIp', 'primaryHost.displayName'],
|
||||
|
||||
headers: computed(function() {
|
||||
headers: computed('showNode', 'showStats', function() {
|
||||
if ( this.get('showStats') ) {
|
||||
return headersWithStats;
|
||||
} else if ( this.get('showNode') ) {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
<td>
|
||||
{{#if editing}}
|
||||
<button class="btn bg-primary btn-sm" {{action "remove" metric}}>
|
||||
<button class="btn bg-primary btn-sm" type="button" {{action "remove" metric}}>
|
||||
<i class="icon icon-minus"/><span class="sr-only">{{t 'generic.remove'}}</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
|
||||
<div>
|
||||
{{#if editing}}
|
||||
<button class="btn bg-link icon-btn p-0" {{action "add"}}>
|
||||
<button class="btn bg-link icon-btn p-0" type="button" {{action "add"}}>
|
||||
<span class="darken"><i class="icon icon-plus text-small"/></span>
|
||||
<span>{{t 'formCustomMetrics.addActionLabel'}}</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -35,10 +35,7 @@ export default Component.extend({
|
|||
initial = lastContainer;
|
||||
}
|
||||
|
||||
scheduleOnce('afterRender', () => {
|
||||
this.send('setInput', initial);
|
||||
this.userInputDidChange();
|
||||
});
|
||||
scheduleOnce('afterRender', this, 'setupComponent', initial);
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
|
@ -92,4 +89,9 @@ export default Component.extend({
|
|||
set(this, 'errors', errors);
|
||||
},
|
||||
|
||||
setupComponent(initial) {
|
||||
this.send('setInput', initial);
|
||||
this.userInputDidChange();
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export default Component.extend({
|
|||
});
|
||||
}
|
||||
},
|
||||
jobConfig: computed('scaleMode', function() {
|
||||
jobConfig: computed('scaleMode', 'workload.cronJobConfig.jobConfig', 'workload.jobConfig', function() {
|
||||
const scaleMode = get(this, 'scaleMode');
|
||||
let config;
|
||||
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@
|
|||
|
||||
<div>
|
||||
{{#if editing}}
|
||||
<button class="btn bg-link icon-btn p-0" {{action "addPort"}}>
|
||||
<button class="btn bg-link icon-btn p-0" type="button" {{action "addPort"}}>
|
||||
<span class="darken">
|
||||
<i class="icon icon-plus text-small"/>
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -76,11 +76,11 @@ export default Component.extend({
|
|||
}
|
||||
}),
|
||||
|
||||
selectedChoice: computed('_allNodes.@each.{id,clusterId,name,state}', function() {
|
||||
selectedChoice: computed('_allNodes.@each.{clusterId,id,name,state}', 'hostChoices', 'initialHostId', function() {
|
||||
return get(this, 'hostChoices').findBy('id', get(this, 'initialHostId'));
|
||||
}),
|
||||
|
||||
hostChoices: computed('_allNodes.@each.{id,clusterId,name,state}', function() {
|
||||
hostChoices: computed('_allNodes.@each.{clusterId,id,name,state}', 'scope.currentCluster.id', function() {
|
||||
const list = get(this, '_allNodes').filter((node) => !get(node, 'isUnschedulable'))
|
||||
.filterBy('clusterId', get(this, 'scope.currentCluster.id'))
|
||||
.map((host) => {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
</div>
|
||||
{{#if editing}}
|
||||
<div class="col span-2 text-right mt-0">
|
||||
<button class="btn bg-link icon-btn" {{action "remove"}}>
|
||||
<button class="btn bg-link icon-btn" type="button" {{action "remove"}}>
|
||||
<span class="darken"><i class="icon icon-minus text-small"/></span>
|
||||
<span>{{t "formVolumeRow.remove"}}</span>
|
||||
</button>
|
||||
|
|
@ -55,17 +55,17 @@
|
|||
{{t (concat "formVolumeRow.mode." model.mode)}}
|
||||
{{#if editing}}
|
||||
{{#if (eq model.mode "newPvc")}}
|
||||
<button class="btn bg-transparent" {{action "defineNewPvc"}}>
|
||||
<button class="btn bg-transparent" type="button" {{action "defineNewPvc"}}>
|
||||
<i class="icon icon-edit"/>
|
||||
{{t "generic.edit"}}
|
||||
</button>
|
||||
{{else if (eq model.mode "newVolumeClaimTemplate")}}
|
||||
<button class="btn bg-transparent" {{action "defineNewVct"}}>
|
||||
<button class="btn bg-transparent" type="button" {{action "defineNewVct"}}>
|
||||
<i class="icon icon-edit"/>
|
||||
{{t "generic.edit"}}
|
||||
</button>
|
||||
{{else if (or (eq model.mode "existingVolume") (eq model.mode "newVolume"))}}
|
||||
<button class="btn bg-transparent" {{action "defineNewVolume"}}>
|
||||
<button class="btn bg-transparent" type="button" {{action "defineNewVolume"}}>
|
||||
<i class="icon icon-edit"/>
|
||||
{{t "generic.edit"}}
|
||||
</button>
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
</div>
|
||||
{{#if editing}}
|
||||
<div class="col span-2 text-right mt-0">
|
||||
<button class="btn bg-link icon-btn" {{action "remove"}}>
|
||||
<button class="btn bg-link icon-btn" type="button" {{action "remove"}}>
|
||||
<span class="darken"><i class="icon icon-minus text-small"/></span>
|
||||
<span>{{t "formVolumeRow.remove"}}</span>
|
||||
</button>
|
||||
|
|
@ -185,7 +185,7 @@
|
|||
</td>
|
||||
<td>
|
||||
{{#if editing}}
|
||||
<button class="btn bg-primary btn-sm" {{action "removeMount" mnt}}>
|
||||
<button class="btn bg-primary btn-sm" type="button" {{action "removeMount" mnt}}>
|
||||
<i class="icon icon-minus"/>
|
||||
<span class="sr-only">{{t "generic.remove"}}</span>
|
||||
</button>
|
||||
|
|
@ -200,7 +200,7 @@
|
|||
{{/if}}
|
||||
{{#if editing}}
|
||||
<div class="mt-20">
|
||||
<button class="btn bg-link icon-btn" {{action "addMount"}}>
|
||||
<button class="btn bg-link icon-btn" type="button" {{action "addMount"}}>
|
||||
<span class="darken"><i class="icon icon-plus text-small"/></span>
|
||||
<span>{{t "formVolumeRow.addMount"}}</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -26,39 +26,33 @@
|
|||
{{t "generic.na"}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if editing}}
|
||||
{{#basic-dropdown
|
||||
horizontalPosition="left"
|
||||
as |dd|}}
|
||||
{{#dd.trigger
|
||||
class="btn bg-link p-0 icon-btn pl-10"
|
||||
}}
|
||||
<BasicDropdown @horizontalPosition="left" as |dd|>
|
||||
<dd.Trigger class="btn bg-link p-0 icon-btn pl-10">
|
||||
<span>
|
||||
{{t "formVolumes.add.label"}}
|
||||
</span>
|
||||
<span class="darken">
|
||||
<i class="icon icon-chevron-down"></i>
|
||||
</span>
|
||||
{{/dd.trigger}}
|
||||
|
||||
{{#dd.content}}
|
||||
<li>
|
||||
</dd.Trigger>
|
||||
<dd.Content>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a {{action "addVolume"}}>
|
||||
{{t "formVolumes.add.newVolume"}}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a {{action "addNewPvc"}}>
|
||||
{{t "formVolumes.add.newPvc"}}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a {{action "addPvc"}}>
|
||||
{{t "formVolumes.add.existingPvc"}}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a {{action "addBindMount"}}>
|
||||
{{t "formVolumes.add.bindMount"}}
|
||||
</a>
|
||||
|
|
@ -68,37 +62,36 @@
|
|||
{{t "formVolumes.add.tmpfs"}}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a {{action "addSecret"}}>
|
||||
{{t "formVolumes.add.secret"}}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a {{action "addConfigMap"}}>
|
||||
{{t "formVolumes.add.configMap"}}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a {{action "addCertificate"}}>
|
||||
{{t "formVolumes.add.certificate"}}
|
||||
</a>
|
||||
</li>
|
||||
{{#if (and loggingEnabled (not isWindows))}}
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a {{action "addCustomLogPath"}}>
|
||||
{{t "formVolumes.add.customLogPath"}}
|
||||
</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{#if isStatefulSet}}
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a {{action "addVolumeClaimTemplate"}}>
|
||||
{{t "formVolumes.add.vct"}}
|
||||
</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/dd.content}}
|
||||
{{/basic-dropdown}}
|
||||
</dd.Content>
|
||||
</BasicDropdown>
|
||||
{{/if}}
|
||||
|
||||
{{/accordion-list-item}}
|
||||
|
|
@ -74,21 +74,18 @@
|
|||
<div class="row">
|
||||
<div class="btn-group no-inline-space mt-5">
|
||||
<button
|
||||
class="btn btn-link btn-sm bg-{{if (eq targetOs "all") "primary" "default" }}"
|
||||
{{action "setTargetOs" "all"}}
|
||||
class="btn btn-link btn-sm bg-{{if (eq targetOs "all") "primary" "default" }}" type="button" {{action "setTargetOs" "all"}}
|
||||
>
|
||||
{{t "newContainer.all"}}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-link btn-sm bg-{{if (eq targetOs "linux") "primary" "default" }}"
|
||||
{{action "setTargetOs" "linux"}}
|
||||
class="btn btn-link btn-sm bg-{{if (eq targetOs "linux") "primary" "default" }}" type="button" {{action "setTargetOs" "linux"}}
|
||||
>
|
||||
<i class="icon icon-fw icon-linux"></i>
|
||||
{{t "newContainer.linux"}}
|
||||
</button>
|
||||
<button
|
||||
class="btn btn-link btn-sm bg-{{if (eq targetOs "windows") "primary" "default" }}"
|
||||
{{action "setTargetOs" "windows"}}
|
||||
class="btn btn-link btn-sm bg-{{if (eq targetOs "windows") "primary" "default" }}" type="button" {{action "setTargetOs" "windows"}}
|
||||
>
|
||||
<i class="icon icon-fw icon-windows"></i>
|
||||
{{t "newContainer.windows"}}
|
||||
|
|
@ -198,11 +195,11 @@
|
|||
{{t "formHealthCheck.liveness"}}
|
||||
</label>
|
||||
<div class="pull-right text-small">
|
||||
<button class="btn bg-transparent p-0" {{action "toggleSeparateLivenessCheck"}}>{{t "formHealthCheck.combinedLivenessCheck"}}</button>
|
||||
<button class="btn bg-transparent p-0" type="button" {{action "toggleSeparateLivenessCheck"}}>{{t "formHealthCheck.combinedLivenessCheck"}}</button>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="pull-right text-small">
|
||||
<button class="btn bg-transparent p-0" {{action "toggleSeparateLivenessCheck"}}>{{t "formHealthCheck.separateLivenessCheck"}}</button>
|
||||
<button class="btn bg-transparent p-0" type="button" {{action "toggleSeparateLivenessCheck"}}>{{t "formHealthCheck.separateLivenessCheck"}}</button>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ export default Component.extend(ViewNewEdit, ChildHook, {
|
|||
}
|
||||
}),
|
||||
|
||||
showSessionAffinity: computed('isHeadless', 'showMoreOptions', function() {
|
||||
showSessionAffinity: computed('isHeadless', 'kind', 'showMoreOptions', function() {
|
||||
return get(this, 'showMoreOptions') && get(this, 'kind') !== HEADLESS;
|
||||
}),
|
||||
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@
|
|||
|
||||
{{#if editing}}
|
||||
<div class="row">
|
||||
<button class="btn bg-link icon-btn pull-right" {{action "addMetric"}}>
|
||||
<button class="btn bg-link icon-btn pull-right" type="button" {{action "addMetric"}}>
|
||||
<span class="darken">
|
||||
<i class="icon icon-plus text-small"></i>
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -109,6 +109,8 @@ export default Component.extend(ViewNewEdit, {
|
|||
if (entry) {
|
||||
return `volume-source/source-${ name }`;
|
||||
}
|
||||
|
||||
return null;
|
||||
}),
|
||||
|
||||
willSave() {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export default Component.extend(ViewNewEdit, {
|
|||
},
|
||||
},
|
||||
|
||||
headerToken: computed('scope', function() {
|
||||
headerToken: computed('mode', 'scope', function() {
|
||||
let k = 'cruPersistentVolumeClaim.define.';
|
||||
|
||||
k += get(this, 'mode');
|
||||
|
|
@ -88,6 +88,8 @@ export default Component.extend(ViewNewEdit, {
|
|||
field: entry.value,
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}),
|
||||
|
||||
willSave() {
|
||||
|
|
|
|||
|
|
@ -54,14 +54,14 @@ export default Component.extend({
|
|||
return value;
|
||||
}
|
||||
}),
|
||||
canAddMore: computed('filteredKeyContent', function() {
|
||||
canAddMore: computed('filteredKeyContent.length', 'keyValuePairs.length', function() {
|
||||
return get(this, 'filteredKeyContent.length') > 1
|
||||
|| get(this, 'filteredKeyContent.length') > 0 && get(this, 'keyValuePairs.length') === 0;
|
||||
}),
|
||||
lastIndex: computed('keyValuePairs.[]', function() {
|
||||
return get(this, 'keyValuePairs.length') - 1;
|
||||
}),
|
||||
filteredKeyContent: computed('asyncKeyContent.value', 'keyValuePairs.@each', 'keyValuePairs.[]', 'keyValuePairs', function() {
|
||||
filteredKeyContent: computed('asyncKeyContent.value', 'keyContentFilter', 'keyValuePairs.[]', function() {
|
||||
if (!get(this, 'keyContentFilter')) {
|
||||
return get(this, 'asyncKeyContent.value') || [];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,7 @@
|
|||
<td> </td>
|
||||
<td class="valign-top text-right">
|
||||
<button
|
||||
class="btn bg-primary btn-sm"
|
||||
{{action "onRemove" index}}>
|
||||
class="btn bg-primary btn-sm" type="button" {{action "onRemove" index}}>
|
||||
<i class="icon icon-minus"/>
|
||||
<span class="sr-only">
|
||||
{{t "generic.remove"}}
|
||||
|
|
@ -49,8 +48,7 @@
|
|||
<td> </td>
|
||||
<td class="valign-top text-right">
|
||||
<button
|
||||
class="btn bg-primary btn-sm"
|
||||
{{action "onRemove" lastIndex}}>
|
||||
class="btn bg-primary btn-sm" type="button" {{action "onRemove" lastIndex}}>
|
||||
<i class="icon icon-minus"/>
|
||||
<span class="sr-only">
|
||||
{{t "generic.remove"}}
|
||||
|
|
@ -63,9 +61,7 @@
|
|||
</table>
|
||||
{{/if}}
|
||||
<button
|
||||
class={{addButtonClass}}
|
||||
{{action "onAdd"}}
|
||||
disabled={{not canAddMore}}
|
||||
class={{addButtonClass}} disabled={{not canAddMore}} type="button" {{action "onAdd"}}
|
||||
>
|
||||
<span class="darken">
|
||||
<i class="icon icon-plus text-small"/>
|
||||
|
|
|
|||
|
|
@ -99,9 +99,7 @@ export default Component.extend({
|
|||
set(this, 'checkType', type);
|
||||
this.validate();
|
||||
|
||||
scheduleOnce('afterRender', () => {
|
||||
this.checkChanged()
|
||||
});
|
||||
scheduleOnce('afterRender', this, 'checkChanged');
|
||||
},
|
||||
|
||||
checkChanged: observer('path', 'host', 'headers', 'checkType', 'command', function() {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
<td> </td>
|
||||
<td class="valign-top text-right">
|
||||
{{#if editing}}
|
||||
<button class="btn bg-primary btn-sm" {{action "remove" row}}><i class="icon icon-minus"/><span class="sr-only">{{t "generic.remove"}}</span></button>
|
||||
<button class="btn bg-primary btn-sm" type="button" {{action "remove" row}}><i class="icon icon-minus"/><span class="sr-only">{{t "generic.remove"}}</span></button>
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
|
||||
{{#if editing}}
|
||||
<div>
|
||||
<button class="btn bg-link icon-btn p-0" {{action "add"}}>
|
||||
<button class="btn bg-link icon-btn p-0" type="button" {{action "add"}}>
|
||||
<span class="darken"><i class="icon icon-plus text-small"/></span>
|
||||
<span>{{t "formKeyToPath.addAction"}}</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
{{#if editing}}
|
||||
<div class="row">
|
||||
<button class="btn bg-link icon-btn pull-left" {{action "addRule"}}>
|
||||
<button class="btn bg-link icon-btn pull-left" type="button" {{action "addRule"}}>
|
||||
<span class="darken"><i class="icon icon-plus text-small"></i></span>
|
||||
<span>{{t "formNodeAffinity.addRuleLabel"}}</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<div class="clearfix">
|
||||
<label class="acc-label">{{t 'formNodeRequirement.label'}}</label>
|
||||
{{#if editing}}
|
||||
<button class="btn bg-link icon-btn" {{action "addRule"}}>
|
||||
<button class="btn bg-link icon-btn" type="button" {{action "addRule"}}>
|
||||
<span class="darken"><i class="icon icon-plus text-small"></i></span>
|
||||
<span>{{t 'formNodeRequirement.addRuleLabel'}}</span>
|
||||
</button>
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
|
||||
{{#if editing}}
|
||||
<td class="text-right">
|
||||
<button class="btn bg-primary btn-sm" {{action "removeRule" rule}}><i class="icon icon-minus"/><span class="sr-only">{{t 'generic.remove'}}</span></button>
|
||||
<button class="btn bg-primary btn-sm" type="button" {{action "removeRule" rule}}><i class="icon icon-minus"/><span class="sr-only">{{t 'generic.remove'}}</span></button>
|
||||
</td>
|
||||
{{/if}}
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<div class="row">
|
||||
{{#if editing}}
|
||||
<div class="pull-right">
|
||||
<button class="btn bg-transparent text-small vertical-middle" {{action "removeRule" rule}}>
|
||||
<button class="btn bg-transparent text-small vertical-middle" type="button" {{action "removeRule" rule}}>
|
||||
{{t 'formNodeAffinity.removeRuleLabel'}}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ export default Component.extend(NewOrEdit, {
|
|||
|
||||
},
|
||||
|
||||
showAdmin: computed('model.roles.@each.id', 'mode', function() {
|
||||
showAdmin: computed('mode', 'model.roles.@each.id', 'type', function() {
|
||||
const id = `${ get(this, 'type') }-owner`;
|
||||
const role = get(this, 'model.roles').findBy('id', id);
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ export default Component.extend(NewOrEdit, {
|
|||
return false;
|
||||
}),
|
||||
|
||||
showStdUser: computed('model.roles.@each.id', 'mode', function() {
|
||||
showStdUser: computed('mode', 'model.roles.@each.id', 'type', function() {
|
||||
const id = `${ get(this, 'type') }-member`;
|
||||
const role = get(this, 'model.roles').findBy('id', id);
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ export default Component.extend(NewOrEdit, {
|
|||
}),
|
||||
|
||||
|
||||
baseRoles: computed(function() {
|
||||
baseRoles: computed('type', function() {
|
||||
return [
|
||||
`${ get(this, 'type') }-admin`,
|
||||
`${ get(this, 'type') }-owner`,
|
||||
|
|
@ -186,7 +186,7 @@ export default Component.extend(NewOrEdit, {
|
|||
];
|
||||
}),
|
||||
|
||||
userRoles: computed('model.roles.[]', function() {
|
||||
userRoles: computed('model.roles.[]', 'type', function() {
|
||||
let roles = get(this, 'model.roles');
|
||||
let userDef = roles.filter((role) => !get(role, 'builtin')
|
||||
&& !get(role, 'external')
|
||||
|
|
@ -201,7 +201,7 @@ export default Component.extend(NewOrEdit, {
|
|||
});
|
||||
}),
|
||||
|
||||
custom: computed('model.roles.[]', function() {
|
||||
custom: computed('baseRoles', 'model.roles.[]', 'type', function() {
|
||||
// built in
|
||||
let roles = get(this, 'model.roles').filterBy('hidden', false);
|
||||
let excludes = get(this, 'baseRoles');
|
||||
|
|
@ -217,7 +217,7 @@ export default Component.extend(NewOrEdit, {
|
|||
});
|
||||
}),
|
||||
|
||||
mode: computed('editing', {
|
||||
mode: computed('editing', 'model.roles', 'type', 'userRoles.{firstObject,length}', {
|
||||
get() {
|
||||
let mode = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
|
||||
<td>
|
||||
{{#if editing}}
|
||||
<button class="btn bg-primary btn-sm" {{action "removePort" port}}>
|
||||
<button class="btn bg-primary btn-sm" type="button" {{action "removePort" port}}>
|
||||
<i class="icon icon-minus"/><span class="sr-only">{{t 'generic.remove'}}</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
|
|
@ -95,7 +95,7 @@
|
|||
|
||||
<div>
|
||||
{{#if editing}}
|
||||
<button class="btn bg-link icon-btn p-0" {{action "addPort"}}>
|
||||
<button class="btn bg-link icon-btn p-0" type="button" {{action "addPort"}}>
|
||||
<span class="darken"><i class="icon icon-plus text-small"/></span>
|
||||
<span>{{t 'formServicePorts.addAction'}}</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export default Component.extend({
|
|||
selectedSecret: null,
|
||||
sources: SOURCES,
|
||||
|
||||
prefixOrTarget: computed('source.sourceKey', {
|
||||
prefixOrTarget: computed('source.{prefix,source,sourceKey,targetKey}', {
|
||||
get() {
|
||||
if ( get(this, 'source.source') !== 'field' && (get(this, 'source.sourceKey') === null || get(this, 'source.sourceKey') === undefined) ) {
|
||||
return get(this, 'source.prefix');
|
||||
|
|
@ -49,7 +49,7 @@ export default Component.extend({
|
|||
}
|
||||
}),
|
||||
|
||||
prefixOrKeys: computed('source.sourceName', 'selectedSecret', 'selectedConfigMap', function() {
|
||||
prefixOrKeys: computed('selectedConfigMap', 'selectedSecret', 'source.{source,sourceName}', 'specificKeyOnly', function() {
|
||||
let prefix = {
|
||||
id: null,
|
||||
label: 'All'
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@
|
|||
</td>
|
||||
<td>
|
||||
{{#if editing}}
|
||||
<button class="btn bg-primary btn-sm" {{action remove source}}>
|
||||
<button class="btn bg-primary btn-sm" type="button" {{action remove source}}>
|
||||
<i class="icon icon-minus"/><span class="sr-only">{{t "generic.remove"}}</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -200,6 +200,8 @@ export default Component.extend({
|
|||
return [TARGET_TYPES.VALUE, TARGET_TYPES.AVERAGE_VALUE];
|
||||
case OBJECT:
|
||||
return [TARGET_TYPES.VALUE, TARGET_TYPES.AVERAGE_VALUE];
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
}),
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@
|
|||
<div class="row">
|
||||
<div class="pull-right">
|
||||
{{#if (lte metrics.length 1 )}}
|
||||
<button class="btn btn-disabled-transparent text-small vertical-middle" disabled="true">
|
||||
<button class="btn btn-disabled-transparent text-small vertical-middle" disabled="true" type="button">
|
||||
{{t "cruHpa.metrics.removeMetricLabel"}}
|
||||
</button>
|
||||
{{else}}
|
||||
<button class="btn bg-transparent text-small vertical-middle" {{action "removeMetric" metric}}>
|
||||
<button class="btn bg-transparent text-small vertical-middle" type="button" {{action "removeMetric" metric}}>
|
||||
{{t "cruHpa.metrics.removeMetricLabel"}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@
|
|||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<button class="btn bg-link icon-btn pull-right" style="margin-top: 8px;" {{action "upload"}}>
|
||||
<button class="btn bg-link icon-btn pull-right" style="margin-top: 8px;" type="button" {{action "upload"}}>
|
||||
<span class="darken"><i class="icon icon-upload text-small"/></span>
|
||||
<span>{{t uploadActionLabel}}</span>
|
||||
</button>
|
||||
<button class="btn bg-link icon-btn pull-right mr-10" style="margin-top: 8px;" {{action "add"}}>
|
||||
<button class="btn bg-link icon-btn pull-right mr-10" style="margin-top: 8px;" type="button" {{action "add"}}>
|
||||
<span class="darken"><i class="icon icon-plus text-small"/></span>
|
||||
<span>{{t addActionLabel}}</span>
|
||||
</button>
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
value=file.value
|
||||
placeholder=valuePlaceholder
|
||||
}}
|
||||
<button class="btn bg-primary" {{action "remove" file}}><i class="icon icon-minus"></i></button>
|
||||
<button class="btn bg-primary" type="button" {{action "remove" file}}><i class="icon icon-minus"></i></button>
|
||||
{{/input-text-file}}
|
||||
{{/each}}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
{{t "modalAboutComponent.linuxImageList"}}
|
||||
</td>
|
||||
<td data-title="download-linux-imgae-list">
|
||||
<button class="btn bg-transparent p-0" {{action "downloadLinuxImages"}}>
|
||||
<button class="btn bg-transparent p-0" type="button" {{action "downloadLinuxImages"}}>
|
||||
{{t "generic.download"}}
|
||||
</button>
|
||||
</td>
|
||||
|
|
@ -89,7 +89,7 @@
|
|||
{{t "modalAboutComponent.windowsImageList"}}
|
||||
</td>
|
||||
<td data-title="download-windows-imgae-list">
|
||||
<button class="btn bg-transparent p-0" {{action "downloadWindowsImages"}}>
|
||||
<button class="btn bg-transparent p-0" type="button" {{action "downloadWindowsImages"}}>
|
||||
{{t "generic.download"}}
|
||||
</button>
|
||||
</td>
|
||||
|
|
@ -97,7 +97,7 @@
|
|||
</table>
|
||||
|
||||
<div class="footer-actions">
|
||||
<button {{action "cancel"}} class="btn bg-primary">
|
||||
<button class="btn bg-primary" type="button" {{action "cancel"}}>
|
||||
{{t "generic.closeModal"}}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ export default Component.extend(ModalBase, NewOrEdit, {
|
|||
return ttlUnits.slice(0, indexOfUnit + 1);
|
||||
}),
|
||||
|
||||
allClusters: computed('scope.allClusters.@each.{id}', function() {
|
||||
allClusters: computed('scope.allClusters.@each.id', function() {
|
||||
const allClusters = get(this, 'scope.allClusters');
|
||||
|
||||
return allClusters.map((c) => {
|
||||
|
|
|
|||
|
|
@ -63,8 +63,7 @@
|
|||
|
||||
<div class="footer-actions">
|
||||
<button
|
||||
{{action "cancel"}}
|
||||
class="bg-primary"
|
||||
class="bg-primary" type="button" {{action "cancel"}}
|
||||
>
|
||||
{{t "generic.closeModal"}}
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -103,25 +103,25 @@ export default Component.extend(ModalBase, NewOrEdit, {
|
|||
set(this, 'primaryResource.tags', get(this, 'tags').split(',') || []);
|
||||
}),
|
||||
|
||||
canMoveNamespace: computed('primaryResource.actionLinks.{move}', function() {
|
||||
canMoveNamespace: computed('primaryResource.actionLinks.move', function() {
|
||||
return !!get(this, 'primaryResource.actionLinks.move');
|
||||
}),
|
||||
|
||||
projectLimit: computed('primaryResource.resourceQuota.{limit}', 'primaryResource.projectId', function() {
|
||||
projectLimit: computed('allProjects', 'primaryResource.projectId', 'primaryResource.resourceQuota.limit', function() {
|
||||
const projectId = get(this, 'primaryResource.projectId');
|
||||
const project = get(this, 'allProjects').findBy('id', projectId);
|
||||
|
||||
return get(project, 'resourceQuota.limit');
|
||||
}),
|
||||
|
||||
projectUsedLimit: computed('primaryResource.resourceQuota.{limit}', 'primaryResource.projectId', function() {
|
||||
projectUsedLimit: computed('allProjects', 'primaryResource.projectId', 'primaryResource.resourceQuota.limit', function() {
|
||||
const projectId = get(this, 'primaryResource.projectId');
|
||||
const project = get(this, 'allProjects').findBy('id', projectId);
|
||||
|
||||
return get(project, 'resourceQuota.usedLimit');
|
||||
}),
|
||||
|
||||
nsDefaultQuota: computed('primaryResource.resourceQuota.{limit}', 'primaryResource.projectId', function() {
|
||||
nsDefaultQuota: computed('allProjects', 'primaryResource.projectId', 'primaryResource.resourceQuota.limit', function() {
|
||||
const projectId = get(this, 'primaryResource.projectId');
|
||||
const project = get(this, 'allProjects').findBy('id', projectId);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,33 +17,8 @@ export default Component.extend(ModalBase, {
|
|||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
let self = this;
|
||||
|
||||
let opt = JSON.parse(this.get(`settings.${ C.SETTING.FEEDBACK_FORM }`) || '{}');
|
||||
|
||||
scheduleOnce('afterRender', this, () => {
|
||||
loadScript('//js.hsforms.net/forms/v2.js').then(() => {
|
||||
window['hbspt'].forms.create({
|
||||
css: '',
|
||||
portalId: opt.portalId, // '468859',
|
||||
formId: opt.formId, // 'bfca2d1d-ed50-4ed7-a582-3f0440f236ca',
|
||||
target: '#feedback-form',
|
||||
errorClass: 'form-control',
|
||||
onFormReady() {
|
||||
self.styleForm();
|
||||
$('INPUT[name=rancher_account_id]')[0].value = self.get('access.principal.id');// eslint-disable-line
|
||||
$('INPUT[name=github_username]')[0].value = self.get('access.identity.login');// eslint-disable-line
|
||||
self.set('loading', false);
|
||||
},
|
||||
onFormSubmit() {
|
||||
self.styleForm();
|
||||
later(() => {
|
||||
self.send('sent');
|
||||
}, 1000);
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
scheduleOnce('afterRender', this, 'setupForm', JSON.parse(this.get(`settings.${ C.SETTING.FEEDBACK_FORM }`) || '{}'));
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
|
@ -81,4 +56,30 @@ export default Component.extend(ModalBase, {
|
|||
});
|
||||
},
|
||||
|
||||
setupForm(opt) {
|
||||
const self = this;
|
||||
|
||||
loadScript('//js.hsforms.net/forms/v2.js').then(() => {
|
||||
window['hbspt'].forms.create({
|
||||
css: '',
|
||||
portalId: opt.portalId, // '468859',
|
||||
formId: opt.formId, // 'bfca2d1d-ed50-4ed7-a582-3f0440f236ca',
|
||||
target: '#feedback-form',
|
||||
errorClass: 'form-control',
|
||||
onFormReady() {
|
||||
self.styleForm();
|
||||
$('INPUT[name=rancher_account_id]')[0].value = self.get('access.principal.id');// eslint-disable-line
|
||||
$('INPUT[name=github_username]')[0].value = self.get('access.identity.login');// eslint-disable-line
|
||||
self.set('loading', false);
|
||||
},
|
||||
onFormSubmit() {
|
||||
self.styleForm();
|
||||
later(() => {
|
||||
self.send('sent');
|
||||
}, 1000);
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@
|
|||
</div>
|
||||
|
||||
<div class="footer-actions pt-20">
|
||||
<button {{action "submit"}} class="btn bg-primary" disabled={{loading}}>{{t 'modalFeedback.send'}}</button>
|
||||
<button class="btn bg-primary" disabled={{loading}} type="button" {{action "submit"}}>{{t 'modalFeedback.send'}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@
|
|||
{{/if}}
|
||||
</section>
|
||||
<div class="footer-actions">
|
||||
<button {{action "cancel"}} class="btn bg-primary close-kubeconfig">{{t 'generic.closeModal'}}</button>
|
||||
<button class="btn bg-primary close-kubeconfig" type="button" {{action "cancel"}}>{{t 'generic.closeModal'}}</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@
|
|||
}}
|
||||
|
||||
<div class="footer-actions">
|
||||
<button {{action "cancel"}} class="btn bg-primary">{{t 'generic.closeModal'}}</button>
|
||||
<button class="btn bg-primary" type="button" {{action "cancel"}}>{{t 'generic.closeModal'}}</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
</select>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{#if (not loadingBackups)}}
|
||||
{{#unless loadingBackups}}
|
||||
<div class="col span-5">
|
||||
<label
|
||||
class="acc-label"
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ export default Component.extend(ModalBase, {
|
|||
});
|
||||
}),
|
||||
|
||||
current: computed('choices.[]', function() {
|
||||
current: computed('choices.[]', 'choices.firstObject.data', function() {
|
||||
return get(this, 'choices.firstObject.data');
|
||||
}),
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ export default Component.extend(ModalBase, {
|
|||
return get(this, 'revisions').findBy('name', get(this, 'revisionId'));
|
||||
}),
|
||||
|
||||
diff: computed('current', 'selected', function() {
|
||||
diff: computed('current.status', 'selected.status', function() {
|
||||
if (get(this, 'current') && get(this, 'selected')) {
|
||||
let left = get(this, 'current.status');
|
||||
let right = get(this, 'selected.status');
|
||||
|
|
@ -97,5 +97,7 @@ export default Component.extend(ModalBase, {
|
|||
|
||||
return jsondiffpatch.formatters.html.format(delta, left).htmlSafe();
|
||||
}
|
||||
|
||||
return null;
|
||||
}),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ export default Component.extend(ModalBase, {
|
|||
}),
|
||||
|
||||
|
||||
currentMultiClusterAppRevision: computed('choices.[]', 'revisionId', 'selectedMultiClusterAppRevision', function() {
|
||||
currentMultiClusterAppRevision: computed('choices.[]', 'choices.firstObject.data', 'revisionId', 'selectedMultiClusterAppRevision', function() {
|
||||
return get(this, 'choices.firstObject.data');
|
||||
}),
|
||||
|
||||
|
|
@ -82,6 +82,8 @@ export default Component.extend(ModalBase, {
|
|||
|
||||
return this.generateAnswersJsonDiff(currentMultiClusterAppRevision, selectedMultiClusterAppRevision);
|
||||
}
|
||||
|
||||
return null;
|
||||
}),
|
||||
|
||||
initModelWithClone() {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ export default Component.extend(ModalBase, {
|
|||
},
|
||||
},
|
||||
|
||||
choices: computed('revisions.[]', function() {
|
||||
choices: computed('model.workloadAnnotations', 'revisions.[]', function() {
|
||||
return (get(this, 'revisions') || [])
|
||||
.sortBy('createdTS')
|
||||
.reverse()
|
||||
|
|
@ -102,7 +102,7 @@ export default Component.extend(ModalBase, {
|
|||
});
|
||||
}),
|
||||
|
||||
current: computed('revisions.@each.workloadAnnotations', function() {
|
||||
current: computed('model.workloadAnnotations', 'revisions.@each.workloadAnnotations', function() {
|
||||
const currentRevision = get(this, 'model.workloadAnnotations')[C.LABEL.DEPLOYMENT_REVISION];
|
||||
|
||||
return (get(this, 'revisions') || []).find((r) => get(r, 'workloadAnnotations')[C.LABEL.DEPLOYMENT_REVISION] === currentRevision);
|
||||
|
|
@ -112,7 +112,7 @@ export default Component.extend(ModalBase, {
|
|||
return (get(this, 'revisions') || []).findBy('id', get(this, 'revisionId'));
|
||||
}),
|
||||
|
||||
diff: computed('current', 'selected', function() {
|
||||
diff: computed('current', 'keys', 'selected', function() {
|
||||
if (get(this, 'current') && get(this, 'selected')) {
|
||||
let left = sanitize(get(this, 'current'), get(this, 'keys'));
|
||||
let right = sanitize(get(this, 'selected'), get(this, 'keys'));
|
||||
|
|
@ -122,5 +122,7 @@ export default Component.extend(ModalBase, {
|
|||
|
||||
return jsondiffpatch.formatters.html.format(delta, left).htmlSafe();
|
||||
}
|
||||
|
||||
return null;
|
||||
}),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -68,5 +68,5 @@
|
|||
</div>
|
||||
|
||||
<div class="footer-actions pb-20">
|
||||
<button {{action "cancel"}} class="btn bg-primary">{{t "generic.closeModal"}}</button>
|
||||
<button class="btn bg-primary" type="button" {{action "cancel"}}>{{t "generic.closeModal"}}</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@
|
|||
</div>
|
||||
|
||||
<div class="footer-actions">
|
||||
<button {{action "cancel"}} class="btn bg-primary">{{t 'modalWelcome.closeModal'}}</button>
|
||||
<button class="btn bg-primary" type="button" {{action "cancel"}}>{{t 'modalWelcome.closeModal'}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@
|
|||
</div>
|
||||
|
||||
<div class="footer-actions">
|
||||
<button {{action "cancel"}} class="btn btn-primary">{{t 'generic.closeModal'}}</button>
|
||||
<button class="btn btn-primary" type="button" {{action "cancel"}}>{{t 'generic.closeModal'}}</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,6 @@
|
|||
</ul>
|
||||
|
||||
<div class="footer-actions">
|
||||
<button {{action "cancel"}} class="btn bg-primary">{{t 'generic.closeModal'}}</button>
|
||||
<button class="btn bg-primary" type="button" {{action "cancel"}}>{{t 'generic.closeModal'}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -77,30 +77,7 @@ export default Component.extend(NewOrEdit, CatalogApp, ChildHook, {
|
|||
this._super(...arguments);
|
||||
set(this, 'selectedTemplateModel', null);
|
||||
|
||||
scheduleOnce('afterRender', () => {
|
||||
if ( get(this, 'selectedTemplateUrl') ) {
|
||||
if (this.catalogTemplate) {
|
||||
this.initTemplateModel(this.catalogTemplate);
|
||||
} else {
|
||||
this.templateChanged();
|
||||
}
|
||||
} else {
|
||||
var def = get(this, 'templateResource.defaultVersion');
|
||||
var links = get(this, 'versionLinks');
|
||||
var app = get(this, 'catalogApp');
|
||||
|
||||
if (get(app, 'id') && !get(this, 'upgrade')) {
|
||||
def = get(app, 'externalIdInfo.version');
|
||||
}
|
||||
|
||||
if (links[def]) {
|
||||
set(this, 'selectedTemplateUrl', links[def]);
|
||||
} else {
|
||||
set(this, 'selectedTemplateUrl', null);
|
||||
}
|
||||
}
|
||||
set(this, 'editable.selectedTemplateUrl', get(this, 'selectedTemplateUrl'));
|
||||
});
|
||||
scheduleOnce('afterRender', this, 'setupComponent');
|
||||
},
|
||||
|
||||
didRender() {
|
||||
|
|
@ -320,7 +297,7 @@ export default Component.extend(NewOrEdit, CatalogApp, ChildHook, {
|
|||
}
|
||||
});
|
||||
|
||||
template.customAnswers = customAnswers;
|
||||
set(template, 'customAnswers', customAnswers);
|
||||
},
|
||||
|
||||
validate() {
|
||||
|
|
@ -445,4 +422,29 @@ export default Component.extend(NewOrEdit, CatalogApp, ChildHook, {
|
|||
|
||||
return !!questions.some((question) => get(question, 'type') === 'password' && !!isNumeric(get(question, 'answer')) && get(question, 'answer') !== '');
|
||||
},
|
||||
|
||||
setupComponent() {
|
||||
if ( get(this, 'selectedTemplateUrl') ) {
|
||||
if (this.catalogTemplate) {
|
||||
this.initTemplateModel(this.catalogTemplate);
|
||||
} else {
|
||||
this.templateChanged();
|
||||
}
|
||||
} else {
|
||||
var def = get(this, 'templateResource.defaultVersion');
|
||||
var links = get(this, 'versionLinks');
|
||||
var app = get(this, 'catalogApp');
|
||||
|
||||
if (get(app, 'id') && !get(this, 'upgrade')) {
|
||||
def = get(app, 'externalIdInfo.version');
|
||||
}
|
||||
|
||||
if (links[def]) {
|
||||
set(this, 'selectedTemplateUrl', links[def]);
|
||||
} else {
|
||||
set(this, 'selectedTemplateUrl', null);
|
||||
}
|
||||
}
|
||||
set(this, 'editable.selectedTemplateUrl', get(this, 'selectedTemplateUrl'));
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
</h1>
|
||||
<p>{{templateResource.description}}</p>
|
||||
<div class="row">
|
||||
<button class="btn btn-sm bg-transparent pl-0" {{action "toogleDetailedDescriptions"}}>
|
||||
<button class="btn btn-sm bg-transparent pl-0" type="button" {{action "toogleDetailedDescriptions"}}>
|
||||
{{t "newCatalog.seeMore"}}
|
||||
</button>
|
||||
</div>
|
||||
|
|
@ -303,7 +303,7 @@
|
|||
</div>
|
||||
{{else}}
|
||||
<div class="footer-actions">
|
||||
<button {{action "cancel"}} class="btn bg-transparent">
|
||||
<button class="btn bg-transparent" type="button" {{action "cancel"}}>
|
||||
{{t "saveCancel.cancel"}}
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ export default Component.extend(NewOrEdit, ChildHook, {
|
|||
pspDidChange: observer('podSecurityPolicyTemplateId', function() {
|
||||
set(this, 'model.project.podSecurityPolicyTemplateId', get(this, 'podSecurityPolicyTemplateId'));
|
||||
}),
|
||||
creator: computed('primaryResource.creatorId', function() {
|
||||
creator: computed('editing', 'model.{me,users}', 'primaryResource.creatorId', function() {
|
||||
let cid = get(this, 'primaryResource.creatorId');
|
||||
let creator = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,6 @@
|
|||
<td> </td>
|
||||
{{#if editing}}
|
||||
<div class="input-group-btn">
|
||||
<button class="btn bg-primary btn-sm" {{action "removeRule" rule}}><i class="icon icon-minus"/></button>
|
||||
<button class="btn bg-primary btn-sm" type="button" {{action "removeRule" rule}}><i class="icon icon-minus"/></button>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if editing}}
|
||||
<button class="btn bg-link icon-btn" {{action "addRule"}}>
|
||||
<button class="btn bg-link icon-btn" type="button" {{action "addRule"}}>
|
||||
<span class="darken"><i class="icon icon-plus text-small"/></span>
|
||||
<span>{{t "formScheduling.addRule"}}</span>
|
||||
</button>
|
||||
<button class="btn bg-transparent btn-sm" {{action "addRule" true}}>
|
||||
<button class="btn bg-transparent btn-sm" type="button" {{action "addRule" true}}>
|
||||
{{t "formScheduling.addCustom"}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ export default Component.extend(ModalBase, NewOrEdit, {
|
|||
return 'generic.save';
|
||||
} else if (mode === 'clone') {
|
||||
return 'notifierPage.clone';
|
||||
} else if (mode === 'add') {
|
||||
} else {
|
||||
return 'generic.add';
|
||||
}
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -579,25 +579,22 @@
|
|||
{{#if testing}}
|
||||
<button
|
||||
style="color: white;"
|
||||
class="btn bg-info btn-disabled"
|
||||
{{action "test"}}
|
||||
class="btn bg-info btn-disabled" type="button" {{action "test"}}
|
||||
>
|
||||
<i class="icon icon-spinner icon-spin"></i>{{t "notifierPage.testAction.testing"}}
|
||||
</button>
|
||||
{{else}}
|
||||
{{#if tested}}
|
||||
<button
|
||||
{{action "test"}}
|
||||
class="btn btn-disabled {{if testOk "bg-success" "bg-error"}}"
|
||||
style="color: white;"
|
||||
style="color: white;" type="button" {{action "test"}}
|
||||
>
|
||||
{{if testOk (t "notifierPage.testAction.testOk") (t "notifierPage.testAction.testFailed")}}
|
||||
</button>
|
||||
{{else}}
|
||||
<button
|
||||
{{action "test"}}
|
||||
class="btn bg-info"
|
||||
style="color: white;"
|
||||
style="color: white;" type="button" {{action "test"}}
|
||||
>
|
||||
{{t "notifierPage.testAction.test"}}
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export default Component.extend({
|
|||
headers,
|
||||
|
||||
clusterId: reads('scope.currentCluster.id'),
|
||||
filteredNotifiers: computed('model.@each.{clusterId}', 'clusterId', function() {
|
||||
filteredNotifiers: computed('model.@each.clusterId', 'clusterId', function() {
|
||||
const data = this.get('model') || [];
|
||||
const clusterId = get(this, 'clusterId')
|
||||
|
||||
|
|
|
|||
|
|
@ -1,72 +1,107 @@
|
|||
<a href="#" class="btn btn-sm bg-transparent" {{action "showAbout"}} aria-label="About Rancher">
|
||||
{{ displayVersion }}
|
||||
<a
|
||||
href="#"
|
||||
class="btn btn-sm bg-transparent"
|
||||
aria-label="About Rancher"
|
||||
{{action "showAbout"}}
|
||||
>
|
||||
{{displayVersion}}
|
||||
</a>
|
||||
|
||||
{{#if settings.isRancher}}
|
||||
{{#if projectId}}
|
||||
<a href="{{href-to "authenticated.project.help" projectId}}" role="button" class="btn btn-sm bg-transparent">
|
||||
<a
|
||||
href="{{href-to "authenticated.project.help" projectId}}"
|
||||
role="button"
|
||||
class="btn btn-sm bg-transparent"
|
||||
>
|
||||
{{t "pageFooter.help"}}
|
||||
</a>
|
||||
{{/if}}
|
||||
<a role="button" class="btn btn-sm bg-transparent" target="blank" rel="noreferrer noopener" href="{{settings.docsBase}}">
|
||||
<a
|
||||
role="button"
|
||||
class="btn btn-sm bg-transparent"
|
||||
target="blank"
|
||||
rel="noreferrer noopener"
|
||||
href="{{settings.docsBase}}"
|
||||
>
|
||||
{{t "pageFooter.help"}}
|
||||
</a>
|
||||
<a role="button" class="btn btn-sm bg-transparent" target="blank" rel="noreferrer noopener" href="{{forumBase}}">
|
||||
<a
|
||||
role="button"
|
||||
class="btn btn-sm bg-transparent"
|
||||
target="blank"
|
||||
rel="noreferrer noopener"
|
||||
href="{{forumBase}}"
|
||||
>
|
||||
{{t "pageFooter.forums"}}
|
||||
</a>
|
||||
<a role="button" class="btn btn-sm bg-transparent" target="blank" rel="noreferrer noopener" href="{{slackBase}}">
|
||||
<a
|
||||
role="button"
|
||||
class="btn btn-sm bg-transparent"
|
||||
target="blank"
|
||||
rel="noreferrer noopener"
|
||||
href="{{slackBase}}"
|
||||
>
|
||||
{{t "pageFooter.slack"}}
|
||||
</a>
|
||||
{{#if showWechat}}
|
||||
<a role="button" class="btn btn-sm bg-transparent" target="blank" rel="noreferrer noopener" href="{{cnforumBase}}">
|
||||
<a
|
||||
role="button"
|
||||
class="btn btn-sm bg-transparent"
|
||||
target="blank"
|
||||
rel="noreferrer noopener"
|
||||
href="{{cnforumBase}}"
|
||||
>
|
||||
{{t "pageFooter.cnforums"}}
|
||||
</a>
|
||||
<a class="btn btn-sm bg-transparent" {{action "showWechat"}}>
|
||||
{{t "modalWechat.wechat"}}
|
||||
</a>
|
||||
{{/if}}
|
||||
<a role="button" class="btn btn-sm bg-transparent" target="blank" rel="noreferrer noopener" href="{{settings.issueUrl}}">
|
||||
<a
|
||||
role="button"
|
||||
class="btn btn-sm bg-transparent"
|
||||
target="blank"
|
||||
rel="noreferrer noopener"
|
||||
href="{{settings.issueUrl}}"
|
||||
>
|
||||
{{t "pageFooter.issues"}}
|
||||
</a>
|
||||
{{/if}}
|
||||
|
||||
<div class="pull-right">
|
||||
<div class="compose-download inline-block dropup">
|
||||
{{#hover-dropdown
|
||||
verticalPosition="above"
|
||||
horizontalPosition="right"
|
||||
renderInPlace=true
|
||||
as |dd|
|
||||
renderInPlace=true as |dd|
|
||||
}}
|
||||
{{#dd.trigger
|
||||
class="hand btn btn-sm bg-transparent"
|
||||
}}
|
||||
<i class="icon icon-download"></i> {{t "pageFooter.download.link"}} <i class="icon icon-chevron-down"></i>
|
||||
{{/dd.trigger}}
|
||||
|
||||
{{#dd.content class="text-right"}}
|
||||
<li>
|
||||
<dd.Trigger class="hand btn btn-sm bg-transparent">
|
||||
<i class="icon icon-download"></i>
|
||||
{{t "pageFooter.download.link"}}
|
||||
<i class="icon icon-chevron-down"></i>
|
||||
</dd.Trigger>
|
||||
<dd.Content class="text-right">
|
||||
<li {{action dd.actions.close}}>
|
||||
<a href="{{cli.darwin}}">
|
||||
{{t "pageFooter.download.mac"}} <i class="icon icon-fw icon-apple"></i>
|
||||
{{t "pageFooter.download.mac"}}
|
||||
<i class="icon icon-fw icon-apple"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a href="{{cli.windows}}">
|
||||
{{t "pageFooter.download.windows"}} <i class="icon icon-fw icon-windows"></i>
|
||||
{{t "pageFooter.download.windows"}}
|
||||
<i class="icon icon-fw icon-windows"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a href="{{cli.linux}}">
|
||||
{{t "pageFooter.download.linux"}} <i class="icon icon-fw icon-linux"></i>
|
||||
{{t "pageFooter.download.linux"}}
|
||||
<i class="icon icon-fw icon-linux"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{/dd.content}}
|
||||
</dd.Content>
|
||||
{{/hover-dropdown}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
{{language-dropdown
|
||||
dropdownVertPosition="above"
|
||||
classNames="dropup"
|
||||
}}
|
||||
{{language-dropdown dropdownVertPosition="above" classNames="dropup"}}
|
||||
</div>
|
||||
|
|
@ -250,7 +250,7 @@ export default Component.extend(ThrottledResize, {
|
|||
return out;
|
||||
}),
|
||||
|
||||
projectSearchResults: computed('searchInput', 'byCluster.[]', function() {
|
||||
projectSearchResults: computed('byCluster.[]', 'projectChoices', 'searchInput', function() {
|
||||
const needle = get(this, 'searchInput');
|
||||
const out = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -3,49 +3,62 @@
|
|||
verticalPosition="below"
|
||||
renderInPlace=true
|
||||
onOpen=(action "onOpen")
|
||||
onClose=(action "onClose")
|
||||
as |dd|
|
||||
onClose=(action "onClose") as |dd|
|
||||
}}
|
||||
|
||||
{{#dd.trigger
|
||||
ariaLabel=(t "nav.projectDropdown.label")
|
||||
}}
|
||||
<a role="button" aria-haspopup="true" class="{{if twoLine "two-line "}}text-white nav-link">
|
||||
<dd.Trigger aria-label={{t "nav.projectDropdown.label"}}>
|
||||
<a
|
||||
role="button"
|
||||
aria-haspopup="true"
|
||||
class="{{if twoLine "two-line "}}text-white nav-link"
|
||||
>
|
||||
{{#if (eq pageScope "project")}}
|
||||
<div class="clip">
|
||||
<span>{{project.cluster.displayName}}</span>
|
||||
<span>
|
||||
{{project.cluster.displayName}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="pl-15 clip text-muted">
|
||||
<span>{{project.displayName}}</span>
|
||||
<span>
|
||||
{{project.displayName}}
|
||||
</span>
|
||||
</div>
|
||||
{{else if (eq pageScope "cluster")}}
|
||||
<div class="clip">
|
||||
<span>{{cluster.displayName}}</span>
|
||||
<span>
|
||||
{{cluster.displayName}}
|
||||
</span>
|
||||
</div>
|
||||
{{else if (eq pageScope "global")}}
|
||||
<div class="clip">
|
||||
<span>{{t "nav.admin.tab"}}</span>
|
||||
<span>
|
||||
{{t "nav.admin.tab"}}
|
||||
</span>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="clip">
|
||||
<span>{{pageScope}}</span>
|
||||
<span>
|
||||
{{pageScope}}
|
||||
</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<span class="sr-only">{{t "nav.srToggleDropdown"}}</span>
|
||||
<span class="sr-only">
|
||||
{{t "nav.srToggleDropdown"}}
|
||||
</span>
|
||||
<i class="icon icon-chevron-down chevron"></i>
|
||||
</a>
|
||||
|
||||
{{/dd.trigger}}
|
||||
|
||||
{{#dd.content
|
||||
class="project-menu"
|
||||
style=menuStyle
|
||||
}}
|
||||
</dd.Trigger>
|
||||
<dd.Content class="project-menu" style={{menuStyle}}>
|
||||
<div class="global">
|
||||
<ul class="list-unstyled">
|
||||
<li class="item clip {{if (eq pageScope "global") "active selected" "inactive"}}">
|
||||
<a href="{{href-to "global-admin"}}" class="{{if (eq pageScope "global") "active selected" "inactive"}}">
|
||||
<li
|
||||
class="item clip
|
||||
{{if (eq pageScope "global") "active selected" "inactive"}}"
|
||||
{{action dd.actions.close}}
|
||||
>
|
||||
<a
|
||||
href="{{href-to "global-admin"}}"
|
||||
class="{{if (eq pageScope "global") "active selected" "inactive"}}"
|
||||
>
|
||||
{{t "nav.admin.tab"}}
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -58,44 +71,50 @@
|
|||
value=searchInput
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div class="clusters">
|
||||
<label class="acc-label">
|
||||
{{t "nav.projectDropdown.clusters"}}
|
||||
</label>
|
||||
|
||||
<ul class="list-unstyled {{if (eq hoverEntry null) "no-hover-entry"}}" style="{{columnStyle}}">
|
||||
<ul
|
||||
class="list-unstyled {{if (eq hoverEntry null) "no-hover-entry"}}"
|
||||
style="{{columnStyle}}"
|
||||
>
|
||||
{{#if searchInput}}
|
||||
{{#each clusterSearchResults as |entry|}}
|
||||
<li data-cluster-id="{{entry.cluster.id}}" class="item clip cluster">
|
||||
{{#link-to
|
||||
"authenticated.cluster"
|
||||
entry.cluster.id
|
||||
class="top"
|
||||
}}
|
||||
<li
|
||||
data-cluster-id="{{entry.cluster.id}}"
|
||||
class="item clip cluster"
|
||||
{{action dd.actions.close}}
|
||||
>
|
||||
{{#link-to "authenticated.cluster" entry.cluster.id class="top"}}
|
||||
{{entry.searchMatch}}
|
||||
{{/link-to}}
|
||||
<p class="state">{{entry.cluster.displayState}}</p>
|
||||
<p class="state">
|
||||
{{entry.cluster.displayState}}
|
||||
</p>
|
||||
</li>
|
||||
{{else}}
|
||||
<li class="text-muted p-10">
|
||||
{{t "nav.projectDropdown.clustersNoMatch" searchInput=searchInput}}
|
||||
{{t "nav.projectDropdown.clustersNoMatch" searchInput=searchInput
|
||||
}}
|
||||
</li>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
{{#each byCluster as |entry|}}
|
||||
<li
|
||||
data-cluster-id={{entry.cluster.id}}
|
||||
class="item clip cluster {{if entry.active "active" "inactive"}} {{if (eq hoverEntry entry) "hover"}}"
|
||||
class="item clip cluster
|
||||
{{if entry.active "active" "inactive"}}
|
||||
|
||||
{{if (eq hoverEntry entry) "hover"}}"
|
||||
{{action dd.actions.close}}
|
||||
>
|
||||
{{#link-to
|
||||
"authenticated.cluster"
|
||||
entry.cluster.id
|
||||
class="top"
|
||||
}}
|
||||
{{#link-to "authenticated.cluster" entry.cluster.id class="top"}}
|
||||
{{entry.cluster.displayName}}
|
||||
{{/link-to}}
|
||||
<p class="state">{{entry.cluster.displayState}}</p>
|
||||
<p class="state">
|
||||
{{entry.cluster.displayState}}
|
||||
</p>
|
||||
</li>
|
||||
{{else}}
|
||||
<li class="text-muted p-10">
|
||||
|
|
@ -105,52 +124,57 @@
|
|||
{{/if}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="projects">
|
||||
{{#if (or searchInput (not clusterEntry)) }}
|
||||
{{#if (or searchInput (not clusterEntry))}}
|
||||
<label class="acc-label">
|
||||
{{t "nav.projectDropdown.projects"}}
|
||||
</label>
|
||||
{{else}}
|
||||
<label class="acc-label">
|
||||
{{t "nav.projectDropdown.projectsIn" cluster=clusterEntry.cluster.displayName}}
|
||||
{{t
|
||||
"nav.projectDropdown.projectsIn"
|
||||
cluster=clusterEntry.cluster.displayName
|
||||
}}
|
||||
</label>
|
||||
{{/if}}
|
||||
|
||||
<ul class="list-unstyled" style="{{columnStyle}}">
|
||||
{{#if searchInput}}
|
||||
{{#each projectSearchResults as |entry|}}
|
||||
<li class="item clip project {{unless entry.project.isReady "not-ready"}}">
|
||||
{{#link-to
|
||||
"authenticated.project"
|
||||
entry.project.id
|
||||
class="top"
|
||||
}}
|
||||
<li
|
||||
class="item clip project
|
||||
{{unless entry.project.isReady "not-ready"}}"
|
||||
{{action dd.actions.close}}
|
||||
>
|
||||
{{#link-to "authenticated.project" entry.project.id class="top"}}
|
||||
{{entry.searchMatch}}
|
||||
{{/link-to}}
|
||||
<p class="state">
|
||||
{{t "nav.projectDropdown.projectInCluster" cluster=entry.cluster.displayName}}
|
||||
{{~#unless entry.project.isReady~}}
|
||||
, {{t "nav.projectDropdown.projectNotReady"}}
|
||||
{{t
|
||||
"nav.projectDropdown.projectInCluster"
|
||||
cluster=entry.cluster.displayName
|
||||
}}
|
||||
{{#unless entry.project.isReady}}
|
||||
,{{t "nav.projectDropdown.projectNotReady"}}
|
||||
{{/unless}}
|
||||
</p>
|
||||
</li>
|
||||
{{else}}
|
||||
<li class="text-muted p-10">
|
||||
{{t "nav.projectDropdown.projectsNoMatch" searchInput=searchInput}}
|
||||
{{t "nav.projectDropdown.projectsNoMatch" searchInput=searchInput
|
||||
}}
|
||||
</li>
|
||||
{{/each}}
|
||||
{{else if clusterEntry}}
|
||||
{{#each clusterEntry.projects as |project|}}
|
||||
<li
|
||||
data-project-id={{project.id}}
|
||||
class="item clip project {{unless project.isReady "not-ready"}} {{if project.active "active" "inactive"}}"
|
||||
class="item clip project
|
||||
{{unless project.isReady "not-ready"}}
|
||||
|
||||
{{if project.active "active" "inactive"}}"
|
||||
{{action dd.actions.close}}
|
||||
>
|
||||
{{#link-to
|
||||
"authenticated.project"
|
||||
project.id
|
||||
class="top"
|
||||
}}
|
||||
{{#link-to "authenticated.project" project.id class="top"}}
|
||||
{{project.displayName}}
|
||||
{{/link-to}}
|
||||
<p class="state">
|
||||
|
|
@ -173,5 +197,5 @@
|
|||
{{/if}}
|
||||
</ul>
|
||||
</div>
|
||||
{{/dd.content}}
|
||||
</dd.Content>
|
||||
{{/hover-dropdown}}
|
||||
|
|
@ -59,47 +59,11 @@ export default Component.extend({
|
|||
|
||||
run.once(this, 'updateNavTree');
|
||||
|
||||
run.scheduleOnce('render', () => {
|
||||
// responsive nav 63-87
|
||||
var responsiveNav = document.getElementById('js-responsive-nav');
|
||||
|
||||
var toggleBtn = document.createElement('a');
|
||||
|
||||
toggleBtn.setAttribute('class', 'nav-toggle');
|
||||
responsiveNav.insertBefore(toggleBtn, responsiveNav.firstChild);
|
||||
|
||||
function hasClass(e, t){
|
||||
return (new RegExp(` ${ t } `)).test(` ${ e.className } `)
|
||||
}
|
||||
|
||||
function toggleClass(e, t){
|
||||
var n = ` ${ e.className.replace(/[\t\r\n]/g, ' ') } `;
|
||||
|
||||
if (hasClass(e, t)){
|
||||
while (n.indexOf(` ${ t } `) >= 0){
|
||||
n = n.replace(` ${ t } `, ' ')
|
||||
}e.className = n.replace(/^\s+|\s+$/g, '')
|
||||
} else {
|
||||
e.className += ` ${ t }`
|
||||
}
|
||||
}
|
||||
|
||||
toggleBtn.onclick = function() {
|
||||
toggleClass(this.parentNode, 'nav-open');
|
||||
}
|
||||
|
||||
var root = document.documentElement;
|
||||
|
||||
root.className = `${ root.className } js`;
|
||||
});
|
||||
run.scheduleOnce('render', this, this.setupResponsiveNav);
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
run.scheduleOnce('afterRender', this, function() {
|
||||
this.get('router').on('routeWillChange', () => {
|
||||
$('header > nav').removeClass('nav-open');// eslint-disable-line
|
||||
});
|
||||
});
|
||||
run.scheduleOnce('afterRender', this, this.setupTearDown);
|
||||
},
|
||||
|
||||
shouldUpdateNavTree: observer(
|
||||
|
|
@ -130,7 +94,7 @@ export default Component.extend({
|
|||
return get(this, 'scope.dashboardBase').replace(/\/+$/, '');
|
||||
}),
|
||||
|
||||
dashboardLink: computed('pageScope', 'clusterId', 'cluster.isReady', function() {
|
||||
dashboardLink: computed('cluster.isReady', 'clusterId', 'pageScope', 'scope.dashboardLink', function() {
|
||||
if ( get(this, 'pageScope') === 'global' || !this.clusterId ) {
|
||||
// Only inside a cluster
|
||||
return;
|
||||
|
|
@ -244,4 +208,44 @@ export default Component.extend({
|
|||
}
|
||||
},
|
||||
|
||||
setupResponsiveNav() {
|
||||
// responsive nav 63-87
|
||||
var responsiveNav = document.getElementById('js-responsive-nav');
|
||||
|
||||
var toggleBtn = document.createElement('a');
|
||||
|
||||
toggleBtn.setAttribute('class', 'nav-toggle');
|
||||
responsiveNav.insertBefore(toggleBtn, responsiveNav.firstChild);
|
||||
|
||||
function hasClass(e, t){
|
||||
return (new RegExp(` ${ t } `)).test(` ${ e.className } `)
|
||||
}
|
||||
|
||||
function toggleClass(e, t){
|
||||
var n = ` ${ e.className.replace(/[\t\r\n]/g, ' ') } `;
|
||||
|
||||
if (hasClass(e, t)){
|
||||
while (n.indexOf(` ${ t } `) >= 0){
|
||||
n = n.replace(` ${ t } `, ' ')
|
||||
}e.className = n.replace(/^\s+|\s+$/g, '')
|
||||
} else {
|
||||
e.className += ` ${ t }`
|
||||
}
|
||||
}
|
||||
|
||||
toggleBtn.onclick = function() {
|
||||
toggleClass(this.parentNode, 'nav-open');
|
||||
}
|
||||
|
||||
var root = document.documentElement;
|
||||
|
||||
root.className = `${ root.className } js`;
|
||||
},
|
||||
|
||||
setupTearDown() {
|
||||
this.get('router').on('routeWillChange', () => {
|
||||
$('header > nav').removeClass('nav-open');// eslint-disable-line
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,23 +1,22 @@
|
|||
<nav class="clearfix responsive-nav" role="navigation" id="js-responsive-nav">
|
||||
<a class="nav-logo logo-oss btn bg-transparent">
|
||||
<span class="sr-only">{{settings.appName}}</span>
|
||||
<span class="sr-only">
|
||||
{{settings.appName}}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<ul class="nav-main nav-list no-inline-space">
|
||||
{{page-header-project
|
||||
pageScope=pageScope
|
||||
}}
|
||||
|
||||
{{page-header-project pageScope=pageScope}}
|
||||
{{#each navTree as |item|}}
|
||||
{{#if item.submenu.length}}
|
||||
{{! Has a submenu }}
|
||||
{{#hover-dropdown
|
||||
tagName="li"
|
||||
class="nav-item"
|
||||
as |dd|
|
||||
{{#hover-dropdown tagName="li" class="nav-item" as |dd|}}
|
||||
<dd.Trigger>
|
||||
{{#if
|
||||
(or
|
||||
(not item.resource)
|
||||
(rbac-allows resource=item.resource scope=item.resourceScope)
|
||||
)
|
||||
}}
|
||||
{{#dd.trigger}}
|
||||
{{#if (or (not item.resource) (rbac-allows resource=item.resource scope=item.resourceScope))}}
|
||||
{{#if item.route}}
|
||||
{{#link-to-as-attrs
|
||||
ourRoute=item.route
|
||||
|
|
@ -30,22 +29,33 @@
|
|||
aria-expanded="false"
|
||||
}}
|
||||
{{t item.localizedLabel default=item.label}}
|
||||
<span class="icon icon-chevron-down"/>
|
||||
<span class="icon icon-chevron-down"></span>
|
||||
{{/link-to-as-attrs}}
|
||||
{{else}}
|
||||
<a class="nav-link" role="button" aria-haspopup="true" aria-label={{t item.localizedLabel default=item.label}}>
|
||||
<a
|
||||
class="nav-link"
|
||||
role="button"
|
||||
aria-haspopup="true"
|
||||
aria-label={{t item.localizedLabel default=item.label}}
|
||||
>
|
||||
{{t item.localizedLabel default=item.label}}
|
||||
<span class="icon icon-chevron-down"/>
|
||||
<span class="icon icon-chevron-down"></span>
|
||||
</a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/dd.trigger}}
|
||||
|
||||
{{#dd.content}}
|
||||
</dd.Trigger>
|
||||
<dd.Content>
|
||||
{{#each item.submenu as |subitem|}}
|
||||
{{#if subitem.route}}
|
||||
{{#if (or (not subitem.resource) (rbac-allows resource=subitem.resource scope=subitem.resourceScope))}}
|
||||
<li>
|
||||
{{#if
|
||||
(or
|
||||
(not subitem.resource)
|
||||
(rbac-allows
|
||||
resource=subitem.resource scope=subitem.resourceScope
|
||||
)
|
||||
)
|
||||
}}
|
||||
<li {{action dd.actions.close}}>
|
||||
{{#link-to-as-attrs
|
||||
ourRoute=subitem.route
|
||||
ctx=subitem.ctx
|
||||
|
|
@ -56,7 +66,7 @@
|
|||
<span>
|
||||
{{t subitem.localizedLabel default=subitem.label}}
|
||||
</span>
|
||||
<i class="{{subitem.icon}}"/>
|
||||
<i class="{{subitem.icon}}"></i>
|
||||
{{/link-to-as-attrs}}
|
||||
</li>
|
||||
{{/if}}
|
||||
|
|
@ -64,44 +74,52 @@
|
|||
<li class="divider"></li>
|
||||
{{else if subitem.dashboardBaseLink}}
|
||||
{{#if dashboardBaseLink}}
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a
|
||||
href={{ concat dashboardBaseLink subitem.dashboardBaseLink }}
|
||||
href={{concat dashboardBaseLink subitem.dashboardBaseLink
|
||||
}}
|
||||
>
|
||||
{{t subitem.localizedLabel default=subitem.label}}
|
||||
<i class="icon icon-external-link" />
|
||||
<i class="icon icon-external-link"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{else if subitem.dashboardLink}}
|
||||
{{#if dashboardLink}}
|
||||
<li>
|
||||
<a
|
||||
href={{ concat dashboardLink subitem.dashboardLink }}
|
||||
>
|
||||
<li {{action dd.actions.close}}>
|
||||
<a href={{concat dashboardLink subitem.dashboardLink}}>
|
||||
{{t subitem.localizedLabel default=subitem.label}}
|
||||
<i class="icon icon-external-link" />
|
||||
<i class="icon icon-external-link"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{! Just a label }}
|
||||
<li class="dropdown-header">
|
||||
<li class="dropdown-header" {{action dd.actions.close}}>
|
||||
<span>
|
||||
{{t subitem.localizedLabel default=subitem.label}}
|
||||
</span>
|
||||
<i class="{{subitem.icon}}"/>
|
||||
<i class="{{subitem.icon}}"></i>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
{{/dd.content}}
|
||||
</dd.Content>
|
||||
{{/hover-dropdown}}
|
||||
|
||||
{{else if item.route}}
|
||||
|
||||
{{#if (or (not item.resource) (rbac-allows resource=item.resource scope=item.resourceScope))}}
|
||||
{{#if
|
||||
(or
|
||||
(not item.resource)
|
||||
(rbac-allows resource=item.resource scope=item.resourceScope)
|
||||
)
|
||||
}}
|
||||
{{! No submenu }}
|
||||
<li class="nav-item {{if (and item.disableIfClusterNotReady (not cluster.isReady)) "pointer-events-none"}}">
|
||||
<li
|
||||
class="nav-item
|
||||
{{if
|
||||
(and item.disableIfClusterNotReady (not cluster.isReady))
|
||||
"pointer-events-none"
|
||||
}}"
|
||||
>
|
||||
{{#link-to-as-attrs
|
||||
ourRoute=item.route
|
||||
ctx=item.ctx
|
||||
|
|
@ -114,26 +132,21 @@
|
|||
{{/link-to-as-attrs}}
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
{{else if item.dashboardBaseLink}}
|
||||
{{#if dashboardBaseLink}}
|
||||
<li>
|
||||
<a
|
||||
href={{ concat dashboardBaseLink item.dashboardBaseLink }}
|
||||
>
|
||||
<a href={{concat dashboardBaseLink item.dashboardBaseLink}}>
|
||||
{{t item.localizedLabel default=item.label}}
|
||||
<i class="icon icon-external-link" />
|
||||
<i class="icon icon-external-link"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{else if item.dashboardLink}}
|
||||
{{#if dashboardLink}}
|
||||
<li>
|
||||
<a
|
||||
href={{ concat dashboardLink item.dashboardLink }}
|
||||
>
|
||||
<a href={{concat dashboardLink item.dashboardLink}}>
|
||||
{{t item.localizedLabel default=item.label}}
|
||||
<i class="icon icon-external-link" />
|
||||
<i class="icon icon-external-link"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
|
@ -142,35 +155,30 @@
|
|||
<li class="dropdown-header">
|
||||
{{t item.localizedLabel default=item.label}}
|
||||
</li>
|
||||
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
{{#if dashboardLink}}
|
||||
<div class="try-dashboard bg-secondary">
|
||||
<a href="{{dashboardLink}}" class="btn bg-warning">{{t "nav.dashboard.try"}}</a>
|
||||
<a href="{{dashboardLink}}" class="btn bg-warning">
|
||||
{{t "nav.dashboard.try"}}
|
||||
</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#hover-dropdown
|
||||
tagName="ul"
|
||||
class="nav-user list-unstyled"
|
||||
horizontalPosition="right"
|
||||
delay=250
|
||||
as |dd|
|
||||
delay=250 as |dd|
|
||||
}}
|
||||
<li class="nav-item">
|
||||
{{#dd.trigger
|
||||
<dd.Trigger
|
||||
class="btn"
|
||||
ariaLabel=(t "nav.user.label" username=session.user)
|
||||
}}
|
||||
ariaLabel={{t "nav.user.label" username=session.user}}
|
||||
>
|
||||
<a role="button" aria-haspopup="true" class="nav-link">
|
||||
{{#if accessEnabled}}
|
||||
{{identity-avatar
|
||||
link=false
|
||||
identity=access.principal
|
||||
}}
|
||||
{{identity-avatar link=false identity=access.principal}}
|
||||
{{else}}
|
||||
<div class="gh-avatar">
|
||||
<div class="gh-placeholder">
|
||||
|
|
@ -183,43 +191,51 @@
|
|||
</span>
|
||||
<i class="icon icon-chevron-down text-muted"></i>
|
||||
</a>
|
||||
{{/dd.trigger}}
|
||||
</dd.Trigger>
|
||||
</li>
|
||||
|
||||
{{#dd.content class="text-right"}}
|
||||
<dd.Content class="text-right">
|
||||
{{#if accessEnabled}}
|
||||
<li role="presentation" class="user-auth">
|
||||
<li role="presentation" class="user-auth" {{action dd.actions.close}}>
|
||||
{{identity-block principal=access.principal}}
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
<li role="separator" class="divider"></li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
{{#link-to "authenticated.apikeys"}}
|
||||
<span>{{t "nav.api.link"}}</span>
|
||||
<span>
|
||||
{{t "nav.api.link"}}
|
||||
</span>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
{{#link-to "global-admin.security.cloud-credentials"}}
|
||||
<span>{{t "nav.admin.security.cloudCredentials"}}</span>
|
||||
<span>
|
||||
{{t "nav.admin.security.cloudCredentials"}}
|
||||
</span>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
{{#link-to "nodes.node-templates"}}
|
||||
<span>{{t "nav.nodeTemplates.link"}}</span>
|
||||
<span>
|
||||
{{t "nav.nodeTemplates.link"}}
|
||||
</span>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
{{#link-to "authenticated.prefs"}}
|
||||
<span>{{t "nav.userPreferences.link"}}</span>
|
||||
<span>
|
||||
{{t "nav.userPreferences.link"}}
|
||||
</span>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li>
|
||||
<li {{action dd.actions.close}}>
|
||||
{{#link-to "logout" class="user-logout"}}
|
||||
<span>{{t "nav.user.logout"}}</span>
|
||||
<span>
|
||||
{{t "nav.user.logout"}}
|
||||
</span>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/dd.content}}
|
||||
</dd.Content>
|
||||
{{/hover-dropdown}}
|
||||
</nav>
|
||||
|
|
@ -35,7 +35,7 @@ export default Component.extend({
|
|||
}),
|
||||
// Ignore the setting because these are tiny dots.
|
||||
|
||||
filtered: computed('pods.[]', 'pod', 'searchText', function() {
|
||||
filtered: computed('pod', 'pods.[]', 'searchFields', 'searchText', function() {
|
||||
let out = [];
|
||||
const pod = this.get('pod');
|
||||
const pods = this.get('pods');
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export default Component.extend({
|
|||
},
|
||||
},
|
||||
|
||||
canExpand: computed('expandPlaceholder', 'model.containers', function() {
|
||||
canExpand: computed('expandPlaceholder', 'model.containers.length', function() {
|
||||
return get(this, 'expandPlaceholder') && get(this, 'model.containers.length') > 1;
|
||||
}),
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export default Component.extend({
|
|||
|
||||
let valueDep = `values.@each.{${ colorKey },${ labelKey },${ valueKey }}`;
|
||||
|
||||
defineProperty(this, 'pieces', computed('min', 'max', valueDep, () => {
|
||||
defineProperty(this, 'pieces', computed(valueDep, 'max', 'min', 'minPercent', 'values', () => {
|
||||
let min = get(this, 'min');
|
||||
let max = get(this, 'max');
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ export default Component.extend({
|
|||
}));
|
||||
|
||||
valueDep = `tooltipValues.@each.{${ labelKey },${ valueKey }}`;
|
||||
defineProperty(this, 'tooltipContent', computed(valueDep, () => {
|
||||
defineProperty(this, 'tooltipContent', computed(valueDep, 'labelKey', 'tooltipArrayOrString', 'tooltipValues', 'valueKey', () => {
|
||||
let labelKey = get(this, 'labelKey');
|
||||
let valueKey = get(this, 'valueKey');
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<td> </td>
|
||||
<div class="input-group-btn">
|
||||
{{#if editing}}
|
||||
<button class="btn bg-primary btn-sm" {{action remove quota}}>
|
||||
<button class="btn bg-primary btn-sm" type="button" {{action remove quota}}>
|
||||
<i class="icon icon-minus" />
|
||||
</button>
|
||||
{{/if}}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
{{#if editing}}
|
||||
<div class="row mt-10">
|
||||
<button class="btn bg-link icon-btn" {{action "addQuota"}}>
|
||||
<button class="btn bg-link icon-btn" type="button" {{action "addQuota"}}>
|
||||
<span class="darken"><i class="icon icon-plus text-small"></i></span>
|
||||
<span>{{t "formResourceQuota.addQuotaLabel"}}</span>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@
|
|||
<div class="text-center text-muted border-dash p-20 mb-20">{{t 'billingInfo.noSub'}}</div>
|
||||
{{/if}}
|
||||
<div class="text-center">
|
||||
<button class="btn bg-primary" onclick={{action 'addNew'}} disabled={{if (gte cards.length 1) 'true' ''}}>{{t 'billingInfo.addNew'}}</button>
|
||||
<button class="btn bg-primary" onclick={{action 'addNew'}} disabled={{if (gte cards.length 1) 'true' ''}} type="button">{{t 'billingInfo.addNew'}}</button>
|
||||
</div>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue