mirror of https://github.com/portainer/portainer
feat(volumes): add a switch to use CIFS volumes (#3823)
* feat(volumes): add a switch to use CIFS volumes * feat(volumes): switch between nfs and cifs * feat(volumes): autofix sharepoint, hide driveroptions and allow to create unnammed volume * feat(volumes): change cifs version select options * feat(volumes): change few thingspull/3835/head
parent
8eac1d2221
commit
ebac85b462
@ -0,0 +1,84 @@
|
|||||||
|
<!-- CIFS-settings -->
|
||||||
|
<div ng-show="$ctrl.data.useCIFS">
|
||||||
|
<ng-form class="form-horizontal" name="cifsInformationForm">
|
||||||
|
<div class="col-sm-12 form-section-title">
|
||||||
|
CIFS Settings
|
||||||
|
</div>
|
||||||
|
<!-- address-input -->
|
||||||
|
<div class="form-group col-md-12">
|
||||||
|
<label for="cifs_address" class="col-sm-2 col-md-1 control-label text-left">Address</label>
|
||||||
|
<div class="col-sm-10 col-md-11">
|
||||||
|
<input type="text" class="form-control" ng-model="$ctrl.data.serverAddress" name="cifs_address" placeholder="e.g. my.cifs-server.com OR xxx.xxx.xxx.xxx" required />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-12" ng-show="cifsInformationForm.cifs_address.$invalid">
|
||||||
|
<div class="small text-warning">
|
||||||
|
<div ng-messages="cifsInformationForm.cifs_address.$error">
|
||||||
|
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- !address-input -->
|
||||||
|
<!-- mount-point-input -->
|
||||||
|
<div class="form-group col-md-12">
|
||||||
|
<label for="cifs_share" class="col-sm-2 col-md-1 control-label text-left">Share</label>
|
||||||
|
<div class="col-sm-10 col-md-11">
|
||||||
|
<input type="text" class="form-control" ng-model="$ctrl.data.share" name="cifs_share" placeholder="e.g. /myshare" required />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-12" ng-show="cifsInformationForm.cifs_share.$invalid">
|
||||||
|
<div class="small text-warning">
|
||||||
|
<div ng-messages="cifsInformationForm.cifs_share.$error">
|
||||||
|
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- !mount-point-input -->
|
||||||
|
<!-- version-input -->
|
||||||
|
<div class="form-group col-md-12">
|
||||||
|
<label for="cifs_version" class="col-sm-2 col-md-1 control-label text-left">CIFS Version</label>
|
||||||
|
<div class="col-sm-10 col-md-11">
|
||||||
|
<select class="form-control" ng-model="$ctrl.data.version" name="cifs_version" ng-options="version for version in $ctrl.data.versions" required></select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-12" ng-show="cifsInformationForm.cifs_version.$invalid">
|
||||||
|
<div class="small text-warning">
|
||||||
|
<div ng-messages="cifsInformationForm.cifs_version.$error">
|
||||||
|
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- !version-input -->
|
||||||
|
<!-- username -->
|
||||||
|
<div class="form-group col-md-12">
|
||||||
|
<label for="cifs_username" class="col-sm-2 col-md-1 control-label text-left">Username</label>
|
||||||
|
<div class="col-sm-10 col-md-11">
|
||||||
|
<input type="text" class="form-control" ng-model="$ctrl.data.username" name="cifs_username" required />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-12" ng-show="cifsInformationForm.cifs_username.$invalid">
|
||||||
|
<div class="small text-warning">
|
||||||
|
<div ng-messages="cifsInformationForm.cifs_username.$error">
|
||||||
|
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- !username -->
|
||||||
|
<!-- password -->
|
||||||
|
<div class="form-group col-md-12">
|
||||||
|
<label for="cifs_password" class="col-sm-2 col-md-1 control-label text-left">Password</label>
|
||||||
|
<div class="col-sm-10 col-md-11">
|
||||||
|
<input type="text" class="form-control" ng-model="$ctrl.data.password" name="cifs_password" required />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-12" ng-show="cifsInformationForm.password.$invalid">
|
||||||
|
<div class="small text-warning">
|
||||||
|
<div ng-messages="cifsInformationForm.cifs_password.$error">
|
||||||
|
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- !password -->
|
||||||
|
</ng-form>
|
||||||
|
</div>
|
||||||
|
<!-- !CIFS-settings -->
|
@ -0,0 +1,6 @@
|
|||||||
|
angular.module('portainer.docker').component('volumesCifsForm', {
|
||||||
|
templateUrl: './volumesCifsForm.html',
|
||||||
|
bindings: {
|
||||||
|
data: '=',
|
||||||
|
},
|
||||||
|
});
|
@ -0,0 +1,15 @@
|
|||||||
|
export function VolumesCIFSFormData() {
|
||||||
|
this.useCIFS = false;
|
||||||
|
this.serverAddress = '';
|
||||||
|
this.share = '';
|
||||||
|
this.version = 'CIFS v2.0 (Used by Windows Vista / Server 2008)';
|
||||||
|
this.versions = [
|
||||||
|
'CIFS v1.0 (Used by Windows XP / Server 2003 and earlier)',
|
||||||
|
'CIFS v2.0 (Used by Windows Vista / Server 2008)',
|
||||||
|
'CIFS v2.1 (Used by Windows 7 / Server 2008 R2)',
|
||||||
|
'CIFS 3.0 (Used by Windows 8 / Server 2012 and newer)',
|
||||||
|
];
|
||||||
|
this.versionsNumber = ['1.0', '2.0', '2.1', '3.0'];
|
||||||
|
this.username = '';
|
||||||
|
this.password = '';
|
||||||
|
}
|
@ -1,86 +1,72 @@
|
|||||||
<div>
|
<!-- NFS-settings -->
|
||||||
<div class="form-group col-md-12">
|
<div ng-show="$ctrl.data.useNFS">
|
||||||
<label for="useNFS" class="control-label text-left">
|
<ng-form class="form-horizontal" name="nfsInformationForm">
|
||||||
Use NFS volume
|
<div class="col-sm-12 form-section-title">
|
||||||
</label>
|
NFS Settings
|
||||||
<label class="switch" style="margin-left: 20px;">
|
|
||||||
<input type="checkbox" name="useNFS" ng-model="$ctrl.data.useNFS" />
|
|
||||||
<i></i>
|
|
||||||
</label>
|
|
||||||
<div ng-if="$ctrl.data.useNFS" class="small text-muted" style="margin-top: 10px;">
|
|
||||||
Ensure <code>nfs-utils</code> are installed on your hosts.
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<!-- address-input -->
|
||||||
<!-- NFS-settings -->
|
<div class="form-group col-md-12">
|
||||||
<div ng-show="$ctrl.data.useNFS">
|
<label for="nfs_address" class="col-sm-2 col-md-1 control-label text-left">Address</label>
|
||||||
<ng-form class="form-horizontal" name="nfsInformationForm">
|
<div class="col-sm-10 col-md-11">
|
||||||
<div class="col-sm-12 form-section-title">
|
<input type="text" class="form-control" ng-model="$ctrl.data.serverAddress" name="nfs_address" placeholder="e.g. my.nfs-server.com OR xxx.xxx.xxx.xxx" required />
|
||||||
NFS Settings
|
|
||||||
</div>
|
</div>
|
||||||
<!-- address-input -->
|
</div>
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12" ng-show="nfsInformationForm.nfs_address.$invalid">
|
||||||
<label for="nfs_address" class="col-sm-2 col-md-1 control-label text-left">Address</label>
|
<div class="small text-warning">
|
||||||
<div class="col-sm-10 col-md-11">
|
<div ng-messages="nfsInformationForm.nfs_address.$error">
|
||||||
<input type="text" class="form-control" ng-model="$ctrl.data.serverAddress" name="nfs_address" placeholder="e.g. my.nfs-server.com OR xxx.xxx.xxx.xxx" required />
|
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-12" ng-show="nfsInformationForm.nfs_address.$invalid">
|
|
||||||
<div class="small text-warning">
|
|
||||||
<div ng-messages="nfsInformationForm.nfs_address.$error">
|
|
||||||
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- !address-input -->
|
</div>
|
||||||
<!-- version-input -->
|
<!-- !address-input -->
|
||||||
<div class="form-group col-md-12">
|
<!-- version-input -->
|
||||||
<label for="nfs_version" class="col-sm-2 col-md-1 control-label text-left">NFS Version</label>
|
<div class="form-group col-md-12">
|
||||||
<div class="col-sm-10 col-md-11">
|
<label for="nfs_version" class="col-sm-2 col-md-1 control-label text-left">NFS Version</label>
|
||||||
<select class="form-control" ng-model="$ctrl.data.version" name="nfs_version" ng-options="version for version in $ctrl.data.versions" required></select>
|
<div class="col-sm-10 col-md-11">
|
||||||
</div>
|
<select class="form-control" ng-model="$ctrl.data.version" name="nfs_version" ng-options="version for version in $ctrl.data.versions" required></select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-12" ng-show="nfsInformationForm.nfs_version.$invalid">
|
</div>
|
||||||
<div class="small text-warning">
|
<div class="form-group col-md-12" ng-show="nfsInformationForm.nfs_version.$invalid">
|
||||||
<div ng-messages="nfsInformationForm.nfs_version.$error">
|
<div class="small text-warning">
|
||||||
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
<div ng-messages="nfsInformationForm.nfs_version.$error">
|
||||||
</div>
|
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- !version-input -->
|
</div>
|
||||||
<!-- mount-point-input -->
|
<!-- !version-input -->
|
||||||
<div class="form-group col-md-12">
|
<!-- mount-point-input -->
|
||||||
<label for="nfs_mountpoint" class="col-sm-2 col-md-1 control-label text-left">Mount point</label>
|
<div class="form-group col-md-12">
|
||||||
<div class="col-sm-10 col-md-11">
|
<label for="nfs_mountpoint" class="col-sm-2 col-md-1 control-label text-left">Mount point</label>
|
||||||
<input type="text" class="form-control" ng-model="$ctrl.data.mountPoint" name="nfs_mountpoint" placeholder="e.g. /export/share, :/export/share, /share or :/share" required />
|
<div class="col-sm-10 col-md-11">
|
||||||
</div>
|
<input type="text" class="form-control" ng-model="$ctrl.data.mountPoint" name="nfs_mountpoint" placeholder="e.g. /export/share, :/export/share, /share or :/share" required />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-12" ng-show="nfsInformationForm.nfs_mountpoint.$invalid">
|
</div>
|
||||||
<div class="small text-warning">
|
<div class="form-group col-md-12" ng-show="nfsInformationForm.nfs_mountpoint.$invalid">
|
||||||
<div ng-messages="nfsInformationForm.nfs_mountpoint.$error">
|
<div class="small text-warning">
|
||||||
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
<div ng-messages="nfsInformationForm.nfs_mountpoint.$error">
|
||||||
</div>
|
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- !mount-point-input -->
|
</div>
|
||||||
<!-- options-input -->
|
<!-- !mount-point-input -->
|
||||||
<div class="form-group col-md-12">
|
<!-- options-input -->
|
||||||
<label for="nfs_options" class="col-sm-2 col-md-1 control-label text-left"
|
<div class="form-group col-md-12">
|
||||||
>Options
|
<label for="nfs_options" class="col-sm-2 col-md-1 control-label text-left"
|
||||||
<portainer-tooltip position="bottom" message="Comma separated list of options"></portainer-tooltip>
|
>Options
|
||||||
</label>
|
<portainer-tooltip position="bottom" message="Comma separated list of options"></portainer-tooltip>
|
||||||
<div class="col-sm-10 col-md-11">
|
</label>
|
||||||
<input type="text" class="form-control" ng-model="$ctrl.data.options" name="nfs_options" placeholder="e.g. rw,noatime,tcp ..." required />
|
<div class="col-sm-10 col-md-11">
|
||||||
</div>
|
<input type="text" class="form-control" ng-model="$ctrl.data.options" name="nfs_options" placeholder="e.g. rw,noatime,tcp ..." required />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-12" ng-show="nfsInformationForm.nfs_options.$invalid">
|
</div>
|
||||||
<div class="small text-warning">
|
<div class="form-group col-md-12" ng-show="nfsInformationForm.nfs_options.$invalid">
|
||||||
<div ng-messages="nfsInformationForm.nfs_options.$error">
|
<div class="small text-warning">
|
||||||
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
<div ng-messages="nfsInformationForm.nfs_options.$error">
|
||||||
</div>
|
<p ng-message="required"> <i class="fa fa-exclamation-triangle" aria-hidden="true"></i> This field is required.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- !options-input -->
|
</div>
|
||||||
</ng-form>
|
<!-- !options-input -->
|
||||||
</div>
|
</ng-form>
|
||||||
<!-- !NFS-settings -->
|
|
||||||
</div>
|
</div>
|
||||||
|
<!-- !NFS-settings -->
|
||||||
|
Loading…
Reference in new issue