Update alert

This commit is contained in:
vimniky 2018-04-19 19:04:16 +08:00
parent 59258216c8
commit a09cf1765b
1 changed files with 16 additions and 18 deletions

View File

@ -3,29 +3,27 @@ import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { reads } from '@ember/object/computed';
const SYSTEM_SERVICES = [
{label: 'Etcd', value: 'etcd'},
{label: 'Controller Manager', value: 'controller-manager'},
{label: 'Scheduler', value: 'scheduler'},
];
// **NOTE** backend needs capitalized value
const RESOURCE_KINDS = [
{label: 'Pod', value: 'Pod'},
{label: 'Node', value: 'Node'},
{label: 'Deployment', value: 'Deployment'},
{label: 'Statefulset', value: 'Statefulset'},
{label: 'Daemonset', value: 'Daemonset'},
];
export default Component.extend({
globalStore: service(),
scope: service(),
clusterId: reads('scope.currentCluster.id'),
init(...args) {
this._super(...args);
this.set('systemServices', SYSTEM_SERVICES);
this.set('resourceKinds', RESOURCE_KINDS);
init() {
this._super(...arguments);
const resourceKinds = get(this, 'globalStore')
.getById('schema', 'targetevent')
.optionsFor('resourceKind').sort().map(value => ({
label: value,
value,
}));
const systemServices = get(this, 'globalStore')
.getById('schema', 'targetsystemservice')
.optionsFor('condition').sort().map(value => ({
label: value,
value,
}));
this.set('resourceKinds', resourceKinds);
this.set('systemServices', systemServices);
},
nodes: function() {