mirror of https://github.com/rancher/ui.git
303 lines
13 KiB
Handlebars
303 lines
13 KiB
Handlebars
{{#accordion-list-item
|
|
title=(t 'formSecurity.title')
|
|
detail=(t 'formSecurity.detail' appName=settings.appName)
|
|
status=status
|
|
statusClass=statusClass
|
|
expandAll=expandAll
|
|
expand=(action expandFn)
|
|
}}
|
|
<div class="row box">
|
|
<div class="col span-4">
|
|
<label class="acc-label">{{t 'formSecurity.pullImage.label'}}</label>
|
|
{{#if editing}}
|
|
<div class="radio">
|
|
<label>{{radio-button selection=pullImage value=false}} {{t 'formSecurity.pullImage.disable'}}</label>
|
|
</div>
|
|
{{#if isService}}
|
|
<div class="radio">
|
|
<label>{{radio-button selection=pullImage value=true}} {{t 'formSecurity.pullImage.enableService'}}</label>
|
|
</div>
|
|
{{else}}
|
|
<div class="radio">
|
|
<label>{{radio-button selection=pullImage value=true}} {{t 'formSecurity.pullImage.enableContainer'}}</label>
|
|
</div>
|
|
{{/if}}
|
|
{{else}}
|
|
{{/if}}
|
|
</div>
|
|
{{#unless scope.current.isWindows}}
|
|
<div class="col span-4">
|
|
<label class="acc-label">{{t 'formSecurity.privileged.label'}}</label>
|
|
{{#input-or-display editable=editing value=instance.privileged}}
|
|
<div class="radio">
|
|
<label>{{radio-button selection=instance.privileged value=false}} {{t 'formSecurity.privileged.disable'}}</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label>{{radio-button selection=instance.privileged value=true}} {{t 'formSecurity.privileged.enable'}}</label>
|
|
</div>
|
|
{{/input-or-display}}
|
|
</div>
|
|
<div class="col span-4">
|
|
<label class="acc-label">{{t 'formSecurity.pidMode.label'}}</label>
|
|
{{#input-or-display editable=editing value=pidHost}}
|
|
<div class="radio">
|
|
<label>{{radio-button selection=pidHost value=false}} {{t 'formSecurity.pidMode.disable'}}</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label>{{radio-button selection=pidHost value=true}} {{t 'formSecurity.pidMode.enable'}}</label>
|
|
</div>
|
|
{{/input-or-display}}
|
|
</div>
|
|
{{/unless}}
|
|
</div>
|
|
|
|
{{#if scope.current.isWindows}}
|
|
<div class="row box mt-20">
|
|
<label class="acc-label">{{t 'formSecurity.isolation.label'}}</label>
|
|
{{#input-or-display editable=editing value=instance.isolation}}
|
|
{{new-select
|
|
content=isolationChoices
|
|
localizedLabel=true
|
|
value=instance.isolation
|
|
}}
|
|
{{/input-or-display}}
|
|
</div>
|
|
{{else}}
|
|
<div class="row box mt-20">
|
|
<div class="col span-4">
|
|
<label class="acc-label">{{t 'formSecurity.memoryLimit.label'}}</label>
|
|
{{#input-or-display editable=editing value=memoryMode classesForDisplay="text-muted form-control-static"}}
|
|
<div class="radio">
|
|
<label>{{radio-button selection=memoryMode value="unlimited"}} {{t 'formSecurity.memoryLimit.unlimited'}}</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label>
|
|
{{radio-button selection=memoryMode value="set"}} {{t 'formSecurity.memoryLimit.set'}}
|
|
<span class="with-input" style="width: 175px;">
|
|
<div class="input-group input-sm">
|
|
{{input-integer min="4" step="1" value=memoryMb disabled=(not-eq memoryMode 'set')}}
|
|
<div class="input-group-addon bg-default">{{t 'generic.mibibyte'}}</div>
|
|
</div>
|
|
</span>
|
|
</label>
|
|
</div>
|
|
{{/input-or-display}}
|
|
</div>
|
|
|
|
<div class="col span-4">
|
|
<label class="acc-label">{{t 'formSecurity.swapLimit.label'}}</label>
|
|
{{#input-or-display editable=editing value=swapMode classesForDisplay="text-muted form-control-static"}}
|
|
<div class="radio">
|
|
<label>{{radio-button selection=swapMode value="default" disabled=(eq memoryMode "unlimited")}} {{t 'formSecurity.swapLimit.default'}}</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label>{{radio-button selection=swapMode value="unlimited"}} {{t 'formSecurity.swapLimit.unlimited'}}</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label>{{radio-button selection=swapMode value="none"}} {{t 'formSecurity.swapLimit.none'}}</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label>
|
|
{{radio-button selection=swapMode value="set"}} {{t 'formSecurity.swapLimit.set'}}
|
|
<span class="with-input" style="width: 175px;">
|
|
<div class="input-group input-sm">
|
|
{{input-integer min="4" step="1" value=swapMb disabled=(not-eq memoryMode 'set')}}
|
|
<div class="input-group-addon bg-default">{{t 'generic.mibibyte'}}</div>
|
|
</div>
|
|
</span>
|
|
</label>
|
|
</div>
|
|
{{/input-or-display}}
|
|
</div>
|
|
|
|
<div class="col span-4">
|
|
<label class="acc-label">{{t 'formSecurity.swappiness.label'}}</label>
|
|
{{#input-or-display editable=editing value=swappinessMode classesForDisplay="text-muted form-control-static"}}
|
|
<div class="radio">
|
|
<label>{{radio-button selection=swappinessMode value="default" disabled=(eq swapMode "none")}} {{t 'formSecurity.swappiness.default'}}</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label>{{radio-button selection=swappinessMode value="none" disabled=(eq swapMode "none")}} {{t 'formSecurity.swappiness.none'}}</label>
|
|
</div>
|
|
<div class="radio">
|
|
<label>
|
|
{{radio-button selection=swappinessMode value="set" disabled=(eq swapMode "none")}} {{t 'formSecurity.swappiness.set'}}
|
|
<span class="with-input" style="width: 60px;">
|
|
{{input-integer classNames="input-xs" min="1" max="100" step="1" value=swappiness disabled=(not-eq swappinessMode 'set')}}
|
|
</span>
|
|
</label>
|
|
</div>
|
|
{{/input-or-display}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-20">
|
|
<div class="col box span-6">
|
|
<label class="acc-label">{{t 'formSecurity.memoryReservation.label'}}</label>
|
|
{{#input-or-display editable=editing value=memoryReservationMb classesForDisplay="text-muted form-control-static"}}
|
|
<div class="input-group">
|
|
{{input-integer min="4" step="1" value=memoryReservationMb classNames="form-control" placeholder=(t 'formSecurity.memoryReservation.placeholder')}}
|
|
<div class="input-group-addon bg-default">{{t 'generic.mibibyte'}}</div>
|
|
</div>
|
|
{{/input-or-display}}
|
|
</div>
|
|
<div class="col box span-6">
|
|
<label class="acc-label">{{t 'formSecurity.milliCpuReservation.label'}}</label>
|
|
{{#input-or-display editable=editing value=instance.milliCpuReservation classesForDisplay="text-muted form-control-static"}}
|
|
<span class="with-input">
|
|
<div class="input-group">
|
|
{{input-integer min="1" step="1" value=instance.milliCpuReservation classNames="form-control"}}
|
|
<div class="input-group-addon bg-default">{{t 'formSecurity.milliCpuReservation.unit'}}</div>
|
|
</div>
|
|
</span>
|
|
{{/input-or-display}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-20">
|
|
<div class="col box span-6">
|
|
<label class="acc-label">{{t 'formSecurity.cpuPinning.label'}}</label>
|
|
{{#input-or-display editable=editing value=instance.cpuSet}}
|
|
{{input type="text" value=instance.cpuSet classNames="form-control" placeholder=(t 'formSecurity.cpuPinning.placeholder')}}
|
|
{{/input-or-display}}
|
|
</div>
|
|
<div class="col box span-6">
|
|
<label class="acc-label">{{t 'formSecurity.shares.label'}}</label>
|
|
{{#input-or-display editable=editing value=instance.cpuShares}}
|
|
{{input-integer value=instance.cpuShares step=128 min=0 classNames="form-control" placeholder=(t 'formSecurity.shares.placeholder')}}
|
|
{{/input-or-display}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-20">
|
|
<div class="col box span-6">
|
|
<label class="acc-label">{{t 'formSecurity.capabilities.add'}}</label>
|
|
{{#if editing}}
|
|
<select class="form-control select-cap-add" multiple="true" onchange={{action 'modifyCapabilities' 'capAdd' }}>
|
|
{{#each capabilityChoices as |choice|}}
|
|
<option value={{choice}} selected={{array-includes instance.capAdd choice}}>{{choice}}</option>
|
|
{{/each}}
|
|
</select>
|
|
{{else}}
|
|
{{#if instance.capAdd}}
|
|
{{#each instance.capAdd as |choice index|}}
|
|
{{if index ", "}} {{choice}}
|
|
{{/each}}
|
|
{{else}}
|
|
<div>{{t 'generic.none'}}</div>
|
|
{{/if}}
|
|
{{/if}}
|
|
</div>
|
|
|
|
<div class="col box span-6">
|
|
<label class="acc-label">{{t 'formSecurity.capabilities.drop'}}</label>
|
|
{{#if editing}}
|
|
<select class="form-control select-cap-drop" multiple="true" onchange={{action 'modifyCapabilities' 'capDrop'}}>
|
|
{{#each capabilityChoices as |choice|}}
|
|
<option value={{choice}} selected={{array-includes instance.capDrop choice}}>{{choice}}</option>
|
|
{{/each}}
|
|
</select>
|
|
{{else}}
|
|
{{#if instance.capDrop}}
|
|
{{#each instance.capDrop as |choice index|}}
|
|
{{if index ", "}} {{choice}}
|
|
{{/each}}
|
|
{{else}}
|
|
<div>{{t 'generic.none'}}</div>
|
|
{{/if}}
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
|
|
{{#if editing}}
|
|
<div class="row">
|
|
<div class="col span-12 text-center text-info m-0">
|
|
{{t 'formSecurity.capabilities.helpBlock.text'}}
|
|
<a href="http://man7.org/linux/man-pages/man7/capabilities.7.html" target="_blank">{{t 'formSecurity.capabilities.helpBlock.link'}}</a>
|
|
</div>
|
|
</div>
|
|
{{/if}}
|
|
|
|
<div class="row box mt-20">
|
|
<label class="acc-label">{{t 'formSecurity.deviceBinding.label'}}</label>
|
|
{{#if editing}}
|
|
<div>
|
|
<button class="btn bg-link icon-btn" {{action "addDevice"}}>
|
|
<span class="darken"><i class="icon icon-plus text-small"/></span>
|
|
<span>{{t 'formSecurity.deviceBinding.addActionLabel'}}</span>
|
|
</button>
|
|
</div>
|
|
|
|
{{#if devicesArray.length}}
|
|
<div class="pt-20"></div>
|
|
<table class="table fixed no-lines no-top-padding pt-10">
|
|
<tr>
|
|
<th>{{t 'formSecurity.deviceBinding.pathHost.label'}}</th>
|
|
<th width="30"> </th>
|
|
<th>{{t 'formSecurity.deviceBinding.pathContainer.label'}}</th>
|
|
<th width="30"> </th>
|
|
<th width="200">{{t 'formSecurity.deviceBinding.permissions.label'}}</th>
|
|
<th width="30"> </th>
|
|
</tr>
|
|
{{#each devicesArray as |device|}}
|
|
<tr>
|
|
<td>
|
|
{{input class="form-control input-sm device-host" type="text" value=device.host placeholder=(t 'formSecurity.deviceBinding.pathHost.placeholder')}}
|
|
</td>
|
|
<td style="text-align: center">
|
|
<p class="input-sm"><i class="icon icon-chevron-right"></i></p>
|
|
</td>
|
|
<td>
|
|
{{input class="form-control input-sm" type="text" value=device.container placeholder=(t 'formSecurity.deviceBinding.pathContainer.placeholder')}}
|
|
</td>
|
|
<td> </td>
|
|
<td>
|
|
{{device-permissions buttonClass="btn-sm" initialSelection=device.permissions changed=(action (mut device.permissions))}}
|
|
</td>
|
|
<td class="text-right">
|
|
<button class="btn bg-primary btn-sm" {{action "removeDevice" device}}><i class="icon icon-minus"/></button>
|
|
</td>
|
|
</tr>
|
|
{{/each}}
|
|
</table>
|
|
{{/if}}
|
|
{{else}}
|
|
{{#if devicesArray.length}}
|
|
<table class="table fixed no-lines no-top-padding">
|
|
<tr>
|
|
<th>{{t 'formSecurity.deviceBinding.pathHost.label'}}</th>
|
|
<th width="30"> </th>
|
|
<th>{{t 'formSecurity.deviceBinding.pathContainer.label'}}</th>
|
|
<th width="30"> </th>
|
|
<th width="100">{{t 'formSecurity.deviceBinding.permissions.label'}}</th>
|
|
<th width="30"> </th>
|
|
</tr>
|
|
{{#each devicesArray as |device|}}
|
|
<tr>
|
|
<td>
|
|
{{device.host}}
|
|
</td>
|
|
<td style="text-align: center">
|
|
<p class="input-sm pt-10"><i class="icon icon-chevron-right"></i></p>
|
|
</td>
|
|
<td>
|
|
{{device.container}}
|
|
</td>
|
|
<td> </td>
|
|
<td>
|
|
{{device-permissions buttonClass="btn-sm" initialSelection=device.permissions changed=(action (mut device.permissions)) editing=editing}}
|
|
</td>
|
|
<td class="text-right">
|
|
|
|
</td>
|
|
</tr>
|
|
{{/each}}
|
|
</table>
|
|
{{else}}
|
|
<div>{{t 'generic.none'}}</div>
|
|
{{/if}}
|
|
{{/if}}
|
|
</div>
|
|
{{/if}}
|
|
{{/accordion-list-item}}
|