mirror of https://github.com/rancher/ui.git
commit
2ab9f42be3
|
|
@ -80,4 +80,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#accordion-list showExpandAll=false as | al expandFn |}}
|
||||
{{form-related-workloads
|
||||
workloads=model.workloads
|
||||
expandAll=al.expandAll
|
||||
expandFn=expandFn
|
||||
}}
|
||||
{{/accordion-list}}
|
||||
</section>
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box mt-10">
|
||||
<div class="box mt-10 mb-20">
|
||||
{{form-key-value
|
||||
initialMap=primaryResource.data
|
||||
allowEmptyValue=true
|
||||
|
|
@ -58,6 +58,16 @@
|
|||
}}
|
||||
</div>
|
||||
|
||||
{{#accordion-list showExpandAll=false as | al expandFn |}}
|
||||
{{#if isView}}
|
||||
{{form-related-workloads
|
||||
workloads=model.workloads
|
||||
expandAll=al.expandAll
|
||||
expandFn=expandFn
|
||||
}}
|
||||
{{/if}}
|
||||
{{/accordion-list}}
|
||||
|
||||
{{#unless isView}}
|
||||
{{top-errors errors=errors}}
|
||||
{{save-cancel
|
||||
|
|
|
|||
|
|
@ -167,6 +167,13 @@
|
|||
<hr/>
|
||||
|
||||
{{#accordion-list showExpandAll=false as | al expandFn |}}
|
||||
{{#if isView}}
|
||||
{{form-related-workloads
|
||||
workloads=model.workloads
|
||||
expandAll=al.expandAll
|
||||
expandFn=expandFn
|
||||
}}
|
||||
{{/if}}
|
||||
{{#accordion-list-item
|
||||
title=(t "cruPersistentVolume.customize.title")
|
||||
detail=(t "cruPersistentVolume.customize.detail")
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
model=model
|
||||
}}
|
||||
|
||||
<div class="box mt-10">
|
||||
<div class="box mt-10 mb-20">
|
||||
<label class="acc-label">
|
||||
{{t "newSecret.values.label"}}
|
||||
</label>
|
||||
|
|
@ -57,6 +57,16 @@
|
|||
}}
|
||||
</div>
|
||||
|
||||
{{#accordion-list showExpandAll=false as | al expandFn |}}
|
||||
{{#if isView}}
|
||||
{{form-related-workloads
|
||||
workloads=model.workloads
|
||||
expandAll=al.expandAll
|
||||
expandFn=expandFn
|
||||
}}
|
||||
{{/if}}
|
||||
{{/accordion-list}}
|
||||
|
||||
{{#unless isView}}
|
||||
{{top-errors errors=errors}}
|
||||
{{save-cancel
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
import Component from '@ember/component';
|
||||
import layout from './template';
|
||||
import { headers } from 'ui/containers/index/controller'
|
||||
import { set } from '@ember/object';
|
||||
export default Component.extend({
|
||||
layout,
|
||||
classNames: ['accordion-wrapper'],
|
||||
|
||||
headers,
|
||||
expandedInstances: null,
|
||||
expandOnInit: false,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
set(this, 'expandedInstances', []);
|
||||
},
|
||||
|
||||
actions: {
|
||||
toggleExpand(instId) {
|
||||
let list = this.get('expandedInstances');
|
||||
|
||||
if ( list.includes(instId) ) {
|
||||
list.removeObject(instId);
|
||||
} else {
|
||||
list.addObject(instId);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
{{#accordion-list-item
|
||||
title=(t "formRelatedWorkloads.title")
|
||||
detail=(t "formRelatedWorkloads.detail")
|
||||
expandAll=expandAll
|
||||
expand=(action expandFn)
|
||||
expandOnInit=expandOnInit
|
||||
}}
|
||||
{{#sortable-table
|
||||
tableClassNames="double-rows"
|
||||
classNames="grid sortable-table"
|
||||
body=workloads
|
||||
searchText=searchText
|
||||
sortBy=sortBy
|
||||
subRows=true
|
||||
pagingLabel="pagination.workload"
|
||||
headers=headers as |sortable kind inst dt|}}
|
||||
{{#if (eq kind "row")}}
|
||||
{{workload-row
|
||||
model=inst
|
||||
toggle=(action "toggleExpand")
|
||||
expanded=(array-includes expandedInstances inst.id)
|
||||
searchText=searchText
|
||||
subMatches=sortable.subMatches
|
||||
fullColspan=sortable.fullColspan
|
||||
dt=dt
|
||||
}}
|
||||
{{else if (eq kind "nomatch")}}
|
||||
<tr>
|
||||
<td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">
|
||||
{{t "containersPage.table.noMatch"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{else if (eq kind "norows")}}
|
||||
<tr>
|
||||
<td colspan="{{sortable.fullColspan}}" class="text-center text-muted lacsso pt-20 pb-20">
|
||||
{{t "formRelatedWorkloads.nodata"}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
{{/sortable-table}}
|
||||
{{/accordion-list-item}}
|
||||
|
|
@ -4,11 +4,24 @@ import { computed } from '@ember/object'
|
|||
import Resource from '@rancher/ember-api-store/models/resource';
|
||||
|
||||
export default Resource.extend({
|
||||
router: service(),
|
||||
intl: service(),
|
||||
router: service(),
|
||||
intl: service(),
|
||||
allWorkloads: service(),
|
||||
|
||||
state: 'active',
|
||||
|
||||
workloads: computed('allWorkloads.list.@each.volumes', 'allWorkloads.list.@each.containers', function() {
|
||||
return (get(this, 'allWorkloads.list') || []).map((item) => item.obj).filter((workload) => {
|
||||
if ( get(this, 'namespaceId') && get(workload, 'namespaceId') !== get(this, 'namespaceId')) {
|
||||
return false;
|
||||
}
|
||||
const volume = (get(workload, 'volumes') || []).find((volume) => get(volume, 'secret.secretName') === get(this, 'name'));
|
||||
const env = (get(workload, 'containers') || []).find((container) => (get(container, 'environmentFrom') || []).find((env) => get(env, 'source') === 'secret' && get(env, 'sourceName') === get(this, 'name')));
|
||||
|
||||
return volume || env;
|
||||
});
|
||||
}),
|
||||
|
||||
issuedDate: computed('issuedAt', function() {
|
||||
return new Date(get(this, 'issuedAt'));
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -13,7 +13,17 @@ export default Resource.extend({
|
|||
|
||||
namespace: reference('namespaceId', 'namespace', 'clusterStore'),
|
||||
|
||||
firstKey: alias('keys.firstObject'),
|
||||
firstKey: alias('keys.firstObject'),
|
||||
|
||||
workloads: computed('namespace.workloads.@each.volumes', 'namespace.workloads.@each.containers', function() {
|
||||
return (get(this, 'namespace.workloads') || []).filter((workload) => {
|
||||
const volume = (get(workload, 'volumes') || []).find((volume) => get(volume, 'configMap.name') === get(this, 'name'));
|
||||
const env = (get(workload, 'containers') || []).find((container) => (get(container, 'environmentFrom') || []).find((env) => get(env, 'source') === 'configMap' && get(env, 'sourceName') === get(this, 'name')));
|
||||
|
||||
return volume || env;
|
||||
});
|
||||
}),
|
||||
|
||||
keys: computed('data', function() {
|
||||
return Object.keys(get(this, 'data') || {}).sort();
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ var PersistentVolumeClaim = Resource.extend({
|
|||
persistentVolume: reference('volumeId', 'persistentVolume', 'clusterStore'),
|
||||
namespace: reference('namespaceId', 'namespace', 'clusterStore'),
|
||||
|
||||
workloads: computed('namespace.workloads.@each.volumes', function() {
|
||||
return (get(this, 'namespace.workloads') || []).filter((workload) => (get(workload, 'volumes') || []).find((volume) => get(volume, 'persistentVolumeClaim.persistentVolumeClaimId') === get(this, 'id')));
|
||||
}),
|
||||
|
||||
sizeBytes: computed('status.capacity.storage', function() {
|
||||
const str = get(this, 'status.capacity.storage');
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ import { computed, get } from '@ember/object';
|
|||
import Resource from '@rancher/ember-api-store/models/resource';
|
||||
|
||||
export default Resource.extend({
|
||||
router: service(),
|
||||
router: service(),
|
||||
allWorkloads: service(),
|
||||
|
||||
state: 'active',
|
||||
canClone: true,
|
||||
|
|
@ -14,6 +15,18 @@ export default Resource.extend({
|
|||
return Object.keys(get(this, 'data') || {}).sort();
|
||||
}),
|
||||
|
||||
workloads: computed('allWorkloads.list.@each.volumes', 'allWorkloads.list.@each.containers', function() {
|
||||
return (get(this, 'allWorkloads.list') || []).map((item) => item.obj).filter((workload) => {
|
||||
if ( get(this, 'namespaceId') && get(workload, 'namespaceId') !== get(this, 'namespaceId')) {
|
||||
return false;
|
||||
}
|
||||
const volume = (get(workload, 'volumes') || []).find((volume) => get(volume, 'secret.secretName') === get(this, 'name'));
|
||||
const env = (get(workload, 'containers') || []).find((container) => (get(container, 'environmentFrom') || []).find((env) => get(env, 'source') === 'secret' && get(env, 'sourceName') === get(this, 'name')));
|
||||
|
||||
return volume || env;
|
||||
});
|
||||
}),
|
||||
|
||||
actions: {
|
||||
edit() {
|
||||
get(this, 'router').transitionTo('authenticated.project.secrets.detail.edit', get(this, 'id'));
|
||||
|
|
|
|||
|
|
@ -5476,6 +5476,10 @@ formUserData:
|
|||
formLabelsAnnotations:
|
||||
title: Labels & Annotations
|
||||
detail: Key/Value pairs that can be used to label/annotate containers and make scheduling decisions.
|
||||
formRelatedWorkloads:
|
||||
title: Related Workloads
|
||||
detail: Workloads which are using it
|
||||
nodata: No Related Workloads
|
||||
formNodeTaints:
|
||||
title: Taints
|
||||
detail: Taints mark that the node should not accept any pods that do not tolerate the taints.
|
||||
|
|
|
|||
Loading…
Reference in New Issue