mirror of https://github.com/rancher/ui.git
Volume information is missing
This commit is contained in:
parent
e02d48d93a
commit
2d65aadbae
|
|
@ -2,6 +2,7 @@ import { computed } from '@ember/object';
|
||||||
import { oneWay } from '@ember/object/computed';
|
import { oneWay } from '@ember/object/computed';
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
import Controller, { inject as controller } from '@ember/controller';
|
import Controller, { inject as controller } from '@ember/controller';
|
||||||
|
import { get, set } from '@ember/object';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
application: controller(),
|
application: controller(),
|
||||||
|
|
@ -9,12 +10,23 @@ export default Controller.extend({
|
||||||
allWorkloads: service(),
|
allWorkloads: service(),
|
||||||
|
|
||||||
service: oneWay('model.workload'),
|
service: oneWay('model.workload'),
|
||||||
|
namespace: "",
|
||||||
sortBy: 'priority',
|
sortBy: 'priority',
|
||||||
fixedLaunchConfig: null,
|
fixedLaunchConfig: null,
|
||||||
activeLaunchConfig: null,
|
activeLaunchConfig: null,
|
||||||
portSortBy: 'privatePort',
|
portSortBy: 'privatePort',
|
||||||
|
init(){
|
||||||
|
this._super(...arguments);
|
||||||
|
let namespaceId = null;
|
||||||
|
namespaceId = get(this, 'service.namespaceId');
|
||||||
|
|
||||||
|
if (namespaceId) {
|
||||||
|
let namespace = get(this, 'clusterStore').getById('namespace', namespaceId);
|
||||||
|
if (namespace) {
|
||||||
|
set(this, 'namespace', namespace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
headers: [
|
headers: [
|
||||||
{
|
{
|
||||||
name: 'priority',
|
name: 'priority',
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@
|
||||||
|
|
||||||
{{container/form-volumes
|
{{container/form-volumes
|
||||||
launchConfig=activeLaunchConfig
|
launchConfig=activeLaunchConfig
|
||||||
service=service
|
workload=service
|
||||||
editing=false
|
editing=false
|
||||||
expandAll=al.expandAll
|
expandAll=al.expandAll
|
||||||
expandFn=expandFn
|
expandFn=expandFn
|
||||||
|
|
|
||||||
|
|
@ -2,42 +2,54 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col span-6">
|
<div class="col span-6">
|
||||||
<label class="acc-label">{{t 'formVolumeRow.name.label'}}</label>
|
<label class="acc-label">{{t 'formVolumeRow.name.label'}}</label>
|
||||||
{{input type="text" value=model.volume.name placeholder=(t 'formVolumeRow.name.placeholder')}}
|
{{#input-or-display editable=editing value=model.volume.name}}
|
||||||
|
{{input type="text" value=model.volume.name placeholder=(t 'formVolumeRow.name.placeholder')}}
|
||||||
|
{{/input-or-display}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col span-4">
|
<div class="col span-4">
|
||||||
<label class="acc-label">{{t 'formVolumeRow.mode.label'}}</label>
|
<label class="acc-label">{{t 'formVolumeRow.mode.label'}}</label>
|
||||||
<div class="form-control-static">
|
<div class="form-control-static">
|
||||||
{{t (concat 'formVolumeRow.mode.' model.mode)}}
|
{{t (concat 'formVolumeRow.mode.' model.mode)}}
|
||||||
{{#if (eq model.mode "newPvc")}}
|
{{#if editing}}
|
||||||
<button class="btn bg-transparent" action={{action 'defineNewPvc'}}>
|
{{#if (eq model.mode "newPvc")}}
|
||||||
<i class="icon icon-edit"/>
|
<button class="btn bg-transparent" action={{action 'defineNewPvc'}}>
|
||||||
{{t 'generic.edit'}}
|
<i class="icon icon-edit"/>
|
||||||
</button>
|
{{t 'generic.edit'}}
|
||||||
{{else if (or (eq model.mode "existingVolume") (eq model.mode "newVolume"))}}
|
</button>
|
||||||
<button class="btn bg-transparent" action={{action 'defineNewVolume'}}>
|
{{else if (or (eq model.mode "existingVolume") (eq model.mode "newVolume"))}}
|
||||||
<i class="icon icon-edit"/>
|
<button class="btn bg-transparent" action={{action 'defineNewVolume'}}>
|
||||||
{{t 'generic.edit'}}
|
<i class="icon icon-edit"/>
|
||||||
</button>
|
{{t 'generic.edit'}}
|
||||||
|
</button>
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col span-2 text-right mt-0">
|
{{#if editing}}
|
||||||
<button class="btn bg-link icon-btn" {{action "remove"}}>
|
<div class="col span-2 text-right mt-0">
|
||||||
<span class="darken"><i class="icon icon-minus text-small"/></span>
|
<button class="btn bg-link icon-btn" {{action "remove"}}>
|
||||||
<span>Remove Volume</span>
|
<span class="darken"><i class="icon icon-minus text-small"/></span>
|
||||||
</button>
|
<span>{{t "formVolumeRow.remove"}}</span>
|
||||||
</div>
|
</button>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{#if (eq model.mode "existingPvc")}}
|
{{#if (eq model.mode "existingPvc")}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col span-6">
|
<div class="col span-6">
|
||||||
<label class="acc-label">Persistent Volume Claim {{field-required}}</label>
|
<label class="acc-label">{{t "formVolumeRow.mode.existingPvc"}} {{field-required}}</label>
|
||||||
{{new-select
|
{{#if editing}}
|
||||||
value=model.volume.persistentVolumeClaim.persistentVolumeClaimId
|
{{new-select
|
||||||
content=pvcChoices
|
value=model.volume.persistentVolumeClaim.persistentVolumeClaimId
|
||||||
prompt="Select a Persistent Volume Claim..."
|
content=pvcChoices
|
||||||
localizedLabel=false
|
prompt="Select a Persistent Volume Claim..."
|
||||||
}}
|
localizedLabel=false
|
||||||
|
}}
|
||||||
|
{{else}}
|
||||||
|
<div>
|
||||||
|
{{model.volume.persistentVolumeClaim.persistentVolumeClaimId}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{else if (eq model.mode "bindMount")}}
|
{{else if (eq model.mode "bindMount")}}
|
||||||
|
|
@ -58,45 +70,58 @@
|
||||||
{{#if model.mounts.length}}
|
{{#if model.mounts.length}}
|
||||||
<table class="fixed">
|
<table class="fixed">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Mount Point{{field-required}}</th>
|
<th>{{t "formVolumes.table.mountPoint"}}{{field-required}}</th>
|
||||||
<th width="20"> </th>
|
<th width="20"> </th>
|
||||||
<th>Sub Path in Volume</th>
|
<th>{{t "formVolumeRow.subPath"}}</th>
|
||||||
<th width="20"> </th>
|
<th width="20"> </th>
|
||||||
<th width="100" class="text-center">Read-Only</th>
|
<th width="100" class="text-center">{{t "formVolumeRow.readOnly"}}</th>
|
||||||
<th width="40"> </th>
|
{{#if editing}}
|
||||||
|
<th width="40"> </th>
|
||||||
|
{{/if}}
|
||||||
</tr>
|
</tr>
|
||||||
{{#each model.mounts as |mnt|}}
|
{{#each model.mounts as |mnt|}}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{{input value=mnt.mountPath}}
|
{{#input-or-display editable=editing value=mnt.mountPath}}
|
||||||
|
{{input value=mnt.mountPath}}
|
||||||
|
{{/input-or-display}}
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
{{input value=mnt.subPath}}
|
{{#input-or-display editable=editing value=mnt.subPath}}
|
||||||
|
{{input value=mnt.subPath}}
|
||||||
|
{{/input-or-display}}
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
{{input type="checkbox" classNames="form-control" checked=mnt.readOnly}}
|
{{#if editing}}
|
||||||
</td>
|
{{input type="checkbox" classNames="form-control" checked=mnt.readOnly}}
|
||||||
<td>
|
{{else}}
|
||||||
<button class="btn bg-primary btn-sm" {{action "removeMount" mnt}}>
|
{{mnt.readOnly}}
|
||||||
<i class="icon icon-minus"/>
|
{{/if}}
|
||||||
<span class="sr-only">{{t 'generic.remove'}}</span>
|
|
||||||
</button>
|
|
||||||
</td>
|
</td>
|
||||||
|
{{#if editing}}
|
||||||
|
<td>
|
||||||
|
<button class="btn bg-primary btn-sm" {{action "removeMount" mnt}}>
|
||||||
|
<i class="icon icon-minus"/>
|
||||||
|
<span class="sr-only">{{t 'generic.remove'}}</span>
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
{{/if}}
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</table>
|
</table>
|
||||||
{{else}}
|
{{else}}
|
||||||
The volume will not be mounted in the current container. It may be used by other containers in the pod.
|
{{t "formVolumeRow.noVolume"}}
|
||||||
|
{{/if}}
|
||||||
|
{{#if editing}}
|
||||||
|
<div class="mt-20">
|
||||||
|
<button class="btn bg-link icon-btn" {{action "addMount"}}>
|
||||||
|
<span class="darken"><i class="icon icon-plus text-small"/></span>
|
||||||
|
<span>{{t "formVolumeRow.addMount"}}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="mt-20">
|
|
||||||
<button class="btn bg-link icon-btn" {{action "addMount"}}>
|
|
||||||
<span class="darken"><i class="icon icon-plus text-small"/></span>
|
|
||||||
<span>Add Mount</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
expand=(action expandFn)
|
expand=(action expandFn)
|
||||||
everExpanded=true
|
everExpanded=true
|
||||||
}}
|
}}
|
||||||
|
{{log volumesArray}}
|
||||||
{{#if volumesArray.length}}
|
{{#if volumesArray.length}}
|
||||||
{{#each volumesArray as |row|}}
|
{{#each volumesArray as |row|}}
|
||||||
{{container/form-volume-row
|
{{container/form-volume-row
|
||||||
|
|
|
||||||
|
|
@ -3621,7 +3621,11 @@ formVolumeRow:
|
||||||
bindMount: Bind-Mount
|
bindMount: Bind-Mount
|
||||||
tmpfs: Tmpfs
|
tmpfs: Tmpfs
|
||||||
secret: Secret
|
secret: Secret
|
||||||
|
remove: Remove Volume
|
||||||
|
subPath: Sub Path in Volume
|
||||||
|
readOnly: Read-Only
|
||||||
|
noVolume: The volume will not be mounted in the current container. It may be used by other containers in the pod.
|
||||||
|
addMount: Add Mount
|
||||||
formVolumes:
|
formVolumes:
|
||||||
title: Volumes
|
title: Volumes
|
||||||
detail: Persist and share data separate from the lifecycle of an individual container.
|
detail: Persist and share data separate from the lifecycle of an individual container.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue