volumes: update UI

This commit is contained in:
Girish Ramakrishnan
2021-05-13 09:14:34 -07:00
parent fd3fb23955
commit 95e2b726c1
9 changed files with 666 additions and 130 deletions
+35 -31
View File
@@ -1,65 +1,68 @@
<!-- modal volume add -->
<div class="modal fade" id="volumeAddModal" tabindex="-1" role="dialog">
<div class="modal fade" id="volumeConfigureModal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{ 'volumes.addVolumeDialog.title' | tr }}</h4>
<h4 class="modal-title" ng-show="volumeConfigure.adding">{{ 'volumes.addVolumeDialog.title' | tr }}</h4>
<h4 class="modal-title" ng-hide="volumeConfigure.adding">{{ 'volumes.updateVolumeDialog.title' | tr:{ volume: volumeConfigure.volume.name } }}</h4>
</div>
<div class="modal-body">
<form name="volumeAddForm" role="form" novalidate ng-submit="volumeAdd.submit()" autocomplete="off">
<form name="volumeConfigureForm" role="form" novalidate ng-submit="volumeConfigure.submit()" autocomplete="off">
<fieldset>
<p class="has-error text-center" ng-show="volumeAdd.error">{{ volumeAdd.error }}</p>
<p class="has-error text-center" ng-show="volumeConfigure.error">{{ volumeConfigure.error }}</p>
<div class="form-group">
<div class="form-group" ng-show="volumeConfigure.adding">
<label class="control-label">{{ 'volumes.name' | tr }}</label>
<p class="small text-info" ng-bind-html="'volumes.addVolumeDialog.nameWarning' | tr"></p>
<input type="text" class="form-control" ng-model="volumeAdd.name" name="name" ng-disabled="volumeAdd.busy" autofocus>
<input type="text" class="form-control" ng-model="volumeConfigure.name" name="name" ng-disabled="volumeConfigure.busy" autofocus>
</div>
<div class="form-group">
<div class="form-group" ng-show="volumeConfigure.adding">
<label class="control-label">{{ 'volumes.hostPath' | tr }}</label>
<input type="text" class="form-control" ng-model="volumeAdd.hostPath" name="hostPath" ng-disabled="volumeAdd.busy" autofocus>
<input type="text" class="form-control" ng-model="volumeConfigure.hostPath" name="hostPath" ng-disabled="volumeConfigure.busy" autofocus>
</div>
<div class="form-group">
<label class="control-label" for="mountType">{{ 'volumes.mountType' | tr }}</label>
<select class="form-control" id="mountType" ng-model="volumeAdd.mountType" ng-options="a.value as a.name for a in mountTypes"></select>
<select class="form-control" id="mountType" ng-model="volumeConfigure.mountType" ng-options="a.value as a.name for a in mountTypes"></select>
<p class="small text-info" ng-show="volumeConfigure.mountType === 'noop'" ng-bind-html="'volumes.addVolumeDialog.noopWarning' | tr"></p>
<p class="small text-info" ng-hide="volumeConfigure.mountType === 'noop'" ng-bind-html="'volumes.addVolumeDialog.mountTypeInfo' | tr"></p>
</div>
<div uib-collapse="volumeAdd.mountType === 'noop'">
<div class="form-group" ng-show="volumeAdd.mountType === 'ext4'">
<label class="control-label" for="volumeAddHost">{{ 'volumes.diskPath' | tr }}</label>
<input type="text" class="form-control" ng-model="volumeAdd.diskPath" id="volumeAddDiskPath" name="diskPath" ng-disabled="volumeAdd.busy" placeholder="/dev/disk/by-uuid/uuid">
<div uib-collapse="volumeConfigure.mountType === 'noop'">
<div class="form-group" ng-show="volumeConfigure.mountType === 'ext4'">
<label class="control-label" for="volumeConfigureHost">{{ 'volumes.addVolumeDialog.diskPath' | tr }}</label>
<input type="text" class="form-control" ng-model="volumeConfigure.diskPath" id="volumeConfigureDiskPath" name="diskPath" ng-disabled="volumeConfigure.busy" placeholder="/dev/disk/by-uuid/uuid">
</div>
<div class="form-group" ng-show="volumeAdd.mountType === 'cifs' || volumeAdd.mountType === 'nfs'">
<label class="control-label" for="volumeAddHost">{{ 'volumes.host' | tr }}</label>
<input type="text" class="form-control" ng-model="volumeAdd.host" id="volumeAddHost" name="host" ng-disabled="volumeAdd.busy" placeholder="Server IP or hostname">
<div class="form-group" ng-show="volumeConfigure.mountType === 'cifs' || volumeConfigure.mountType === 'nfs'">
<label class="control-label" for="volumeConfigureHost">{{ 'volumes.addVolumeDialog.server' | tr }}</label>
<input type="text" class="form-control" ng-model="volumeConfigure.host" id="volumeConfigureHost" name="host" ng-disabled="volumeConfigure.busy" placeholder="Server IP or hostname">
</div>
<div class="form-group" ng-show="volumeAdd.mountType === 'cifs' || volumeAdd.mountType === 'nfs'">
<label class="control-label" for="volumeAddRemoteDir">{{ 'volumes.remoteDirectory' | tr }}</label>
<input type="text" class="form-control" ng-model="volumeAdd.remoteDir" id="volumeAddRemoteDir" name="remoteDir" ng-disabled="volumeAdd.busy" placeholder="/share">
<div class="form-group" ng-show="volumeConfigure.mountType === 'cifs' || volumeConfigure.mountType === 'nfs'">
<label class="control-label" for="volumeConfigureRemoteDir">{{ 'volumes.addVolumeDialog.remoteDirectory' | tr }}</label>
<input type="text" class="form-control" ng-model="volumeConfigure.remoteDir" id="volumeConfigureRemoteDir" name="remoteDir" ng-disabled="volumeConfigure.busy" placeholder="/share">
</div>
<div class="form-group" ng-show="volumeAdd.mountType === 'cifs'">
<label class="control-label" for="volumeAddUsername">{{ 'volumes.username' | tr }}</label>
<input type="text" class="form-control" ng-model="volumeAdd.username" id="volumeAddUsername" name="username" ng-disabled="volumeAdd.busy">
<div class="form-group" ng-show="volumeConfigure.mountType === 'cifs'">
<label class="control-label" for="volumeConfigureUsername">{{ 'volumes.addVolumeDialog.username' | tr }}</label>
<input type="text" class="form-control" ng-model="volumeConfigure.username" id="volumeConfigureUsername" name="username" ng-disabled="volumeConfigure.busy">
</div>
<div class="form-group" ng-show="volumeAdd.mountType === 'cifs'">
<label class="control-label" for="volumeAddPassword">{{ 'volumes.password' | tr }}</label>
<input type="password" class="form-control" ng-model="volumeAdd.password" id="volumeAddPassword" name="password" ng-disabled="volumeAdd.busy">
<div class="form-group" ng-show="volumeConfigure.mountType === 'cifs'">
<label class="control-label" for="volumeConfigurePassword">{{ 'volumes.addVolumeDialog.password' | tr }}</label>
<input type="password" class="form-control" ng-model="volumeConfigure.password" id="volumeConfigurePassword" name="password" ng-disabled="volumeConfigure.busy">
</div>
</div>
<input class="ng-hide" type="submit" ng-disabled="volumeAddForm.$invalid || volumeAdd.busy"/>
<input class="ng-hide" type="submit" ng-disabled="volumeConfigureForm.$invalid || volumeConfigure.busy"/>
</fieldset>
</form>
</div>
<div class="modal-footer ">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'main.dialog.cancel' | tr }}</button>
<button type="submit" class="btn btn-outline btn-success pull-right" ng-click="volumeAdd.submit()" ng-disabled="volumeAddForm.$invalid || volumeAdd.busy"><i class="fa fa-circle-notch fa-spin" ng-show="volumeAdd.busy"></i> {{ 'volumes.addVolumeDialog.addAction' | tr }}</button>
<button type="submit" class="btn btn-outline btn-success pull-right" ng-click="volumeConfigure.submit()" ng-disabled="volumeConfigureForm.$invalid || volumeConfigure.busy"><i class="fa fa-circle-notch fa-spin" ng-show="volumeConfigure.busy"></i> {{ 'main.dialog.save' | tr }}</button>
</div>
</div>
</div>
@@ -86,7 +89,7 @@
<div class="content">
<div class="text-left">
<h1>{{ 'volumes.title' | tr }} <button class="btn btn-primary btn-outline pull-right" ng-click="volumeAdd.show()"><i class="fa fa-plus"></i> {{ 'volumes.addVolumeAction' | tr }}</button></h1>
<h1>{{ 'volumes.title' | tr }} <button class="btn btn-primary btn-outline pull-right" ng-click="volumeConfigure.show()"><i class="fa fa-plus"></i> {{ 'volumes.addVolumeAction' | tr }}</button></h1>
</div>
<div class="card card-large">
@@ -110,13 +113,14 @@
</thead>
<tbody>
<tr ng-repeat="volume in volumes">
<td class="elide-table-cell hand">
<td class="elide-table-cell hand" ng-click="volumeConfigure.show(volume)">
{{ volume.name }}
</td>
<td class="text-left elide-table-cell hidden-xs hidden-sm hand">
{{ volume.hostPath }}
<td class="text-left elide-table-cell hidden-xs hidden-sm hand" ng-click="volumeConfigure.show(volume)">
{{ volume.hostPath }} ({{ volume.mountType }})
</td>
<td class="text-right no-wrap" style="vertical-align: bottom">
<button class="btn btn-xs btn-default" ng-click="volumeConfigure.show(volume)" title="{{ 'volumes.tooltipEdit' | tr }}"><i class="fa fa-pencil-alt"></i></button>
<a class="btn btn-xs btn-default" ng-href="{{ '/filemanager.html?volumeId=' + volume.id }}" target="_blank" uib-tooltip="{{ 'volumes.openFileManagerActionTooltip' | tr }}"><i class="fas fa-folder"></i></a>
<button class="btn btn-xs btn-danger" ng-click="volumeRemove.show(volume)" uib-tooltip="{{ 'volumes.removeVolumeActionTooltip' | tr }}"><i class="far fa-trash-alt"></i></button>
</td>