2019-10-07 16:19:01 +00:00
|
|
|
{{template "base" .}}
|
|
|
|
|
|
|
|
{{define "title"}}{{.Title}}{{end}}
|
|
|
|
|
2019-11-13 10:36:21 +00:00
|
|
|
{{define "extra_css"}}
|
|
|
|
<link href="/static/vendor/tempusdominus/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet">
|
|
|
|
{{end}}
|
|
|
|
|
2019-10-07 16:19:01 +00:00
|
|
|
{{define "page_body"}}
|
|
|
|
|
|
|
|
<!-- Page Heading -->
|
|
|
|
<h1 class="h5 mb-4 text-gray-800">{{if .IsAdd}}Add a new user{{else}}Edit user{{end}}</h1>
|
|
|
|
{{if .Error}}
|
|
|
|
<div class="card mb-4 border-left-warning">
|
|
|
|
<div class="card-body text-form-error">{{.Error}}</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2020-01-31 18:04:00 +00:00
|
|
|
<form id="user_form" enctype="multipart/form-data" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
2019-10-07 16:19:01 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idUsername" class="col-sm-2 col-form-label">Username</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<input type="text" class="form-control" id="idUsername" name="username" placeholder=""
|
|
|
|
value="{{.User.Username}}" maxlength="255" autocomplete="nope" required
|
|
|
|
{{if not .IsAdd}}readonly{{end}}>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-11-13 10:36:21 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idStatus" class="col-sm-2 col-form-label">Status</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<select class="form-control" id="idStatus" name="status">
|
|
|
|
<option value="1" {{if eq .User.Status 1 }}selected{{end}}>Active</option>
|
|
|
|
<option value="0" {{if eq .User.Status 0 }}selected{{end}}>Inactive</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idExpirationDate" class="col-sm-2 col-form-label">Expiration Date</label>
|
|
|
|
<div class="col-sm-10 input-group date" id="expirationDatePicker" data-target-input="nearest">
|
|
|
|
<input type="text" class="form-control datetimepicker-input" id="idExpirationDate"
|
|
|
|
data-target="#expirationDatePicker">
|
|
|
|
<div class="input-group-append" data-target="#expirationDatePicker" data-toggle="datetimepicker">
|
|
|
|
<div class="input-group-text"><i class="fas fa-calendar"></i></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-10-07 16:19:01 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idPassword" class="col-sm-2 col-form-label">Password</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<input type="password" class="form-control" id="idPassword" name="password" placeholder="" maxlength="255"
|
|
|
|
autocomplete="new-password" {{if not .IsAdd}}aria-describedby="pwdHelpBlock" {{end}}>
|
|
|
|
{{if not .IsAdd}}
|
|
|
|
<small id="pwdHelpBlock" class="form-text text-muted">
|
|
|
|
If empty the current password will not be changed
|
|
|
|
</small>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idPublicKeys" class="col-sm-2 col-form-label">Public keys</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<textarea class="form-control" id="idPublicKeys" name="public_keys" rows="3"
|
|
|
|
aria-describedby="pkHelpBlock">{{range .User.PublicKeys}}{{.}} {{end}}</textarea>
|
|
|
|
<small id="pkHelpBlock" class="form-text text-muted">
|
|
|
|
One public key per line
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-02-19 21:39:30 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idLoginMethods" class="col-sm-2 col-form-label">Denied login methods</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<select class="form-control" id="idLoginMethods" name="ssh_login_methods" multiple>
|
|
|
|
{{range $method := .ValidSSHLoginMethods}}
|
|
|
|
<option value="{{$method}}"
|
|
|
|
{{range $m := $.User.Filters.DeniedLoginMethods }}{{if eq $m $method}}selected{{end}}{{end}}>{{$method}}
|
|
|
|
</option>
|
|
|
|
{{end}}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-10-07 16:19:01 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idPermissions" class="col-sm-2 col-form-label">Permissions</label>
|
|
|
|
<div class="col-sm-10">
|
2019-10-09 09:48:54 +00:00
|
|
|
<select class="form-control" id="idPermissions" name="permissions" required multiple>
|
2019-10-07 16:19:01 +00:00
|
|
|
{{range $validPerm := .ValidPerms}}
|
|
|
|
<option value="{{$validPerm}}"
|
2019-12-25 17:20:19 +00:00
|
|
|
{{range $perm := $.RootDirPerms }}{{if eq $perm $validPerm}}selected{{end}}{{end}}>{{$validPerm}}
|
2019-10-07 16:19:01 +00:00
|
|
|
</option>
|
|
|
|
{{end}}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-12-25 17:20:19 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idSubDirsPermissions" class="col-sm-2 col-form-label">Sub dirs permissions</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<textarea class="form-control" id="idSubDirsPermissions" name="sub_dirs_permissions" rows="3"
|
|
|
|
aria-describedby="subDirsHelpBlock">{{range $dir, $perms := .User.Permissions -}}
|
|
|
|
{{if ne $dir "/" -}}
|
2020-02-23 10:30:26 +00:00
|
|
|
{{$dir}}::{{range $index, $p := $perms}}{{if $index}},{{end}}{{$p}}{{end}}
|
2019-12-25 17:20:19 +00:00
|
|
|
{{- end}}
|
|
|
|
{{- end}}</textarea>
|
|
|
|
<small id="subDirsHelpBlock" class="form-text text-muted">
|
2020-02-23 10:30:26 +00:00
|
|
|
One directory per line as dir::perms, for example /somedir::list,download
|
2019-12-25 17:20:19 +00:00
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-10-07 16:19:01 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idHomeDir" class="col-sm-2 col-form-label">Home Dir</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<input type="text" class="form-control" id="idHomeDir" name="home_dir" placeholder=""
|
|
|
|
value="{{.User.HomeDir}}" maxlength="255">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-02-23 10:30:26 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idVirtualFolders" class="col-sm-2 col-form-label">Virtual folders</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<textarea class="form-control" id="idVirtualFolders" name="virtual_folders" rows="3"
|
|
|
|
aria-describedby="vfHelpBlock">{{range $index, $mapping := .User.VirtualFolders -}}
|
|
|
|
{{$mapping.VirtualPath}}::{{$mapping.MappedPath}}
|
|
|
|
{{- end}}</textarea>
|
|
|
|
<small id="vfHelpBlock" class="form-text text-muted">
|
|
|
|
One mapping per line as vpath::path, for example /vdir::/home/adir or /vdir::C:\adir, ignored for non local filesystems
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-10-07 16:19:01 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idQuotaFiles" class="col-sm-2 col-form-label">Quota files</label>
|
|
|
|
<div class="col-sm-3">
|
|
|
|
<input type="number" class="form-control" id="idQuotaFiles" name="quota_files" placeholder=""
|
|
|
|
value="{{.User.QuotaFiles}}" min="0" aria-describedby="qfHelpBlock">
|
|
|
|
<small id="qfHelpBlock" class="form-text text-muted">
|
|
|
|
0 means no limit
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-2"></div>
|
|
|
|
<label for="idQuotaSize" class="col-sm-2 col-form-label">Quota size (bytes)</label>
|
|
|
|
<div class="col-sm-3">
|
|
|
|
<input type="number" class="form-control" id="idQuotaSize" name="quota_size" placeholder=""
|
|
|
|
value="{{.User.QuotaSize}}" min="0" aria-describedby="qsHelpBlock">
|
|
|
|
<small id="qsHelpBlock" class="form-text text-muted">
|
|
|
|
0 means no limit
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idUploadBandwidth" class="col-sm-2 col-form-label">Bandwidth UL (KB/s)</label>
|
|
|
|
<div class="col-sm-3">
|
|
|
|
<input type="number" class="form-control" id="idUploadBandwidth" name="upload_bandwidth" placeholder=""
|
|
|
|
value="{{.User.UploadBandwidth}}" min="0" aria-describedby="ulHelpBlock">
|
|
|
|
<small id="ulHelpBlock" class="form-text text-muted">
|
|
|
|
0 means no limit
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-2"></div>
|
|
|
|
<label for="idDownloadBandwidth" class="col-sm-2 col-form-label">Bandwidth DL (KB/s)</label>
|
|
|
|
<div class="col-sm-3">
|
|
|
|
<input type="number" class="form-control" id="idDownloadBandwidth" name="download_bandwidth" placeholder=""
|
|
|
|
value="{{.User.DownloadBandwidth}}" min="0" aria-describedby="dlHelpBlock">
|
|
|
|
<small id="dlHelpBlock" class="form-text text-muted">
|
|
|
|
0 means no limit
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idMaxSessions" class="col-sm-2 col-form-label">Max sessions</label>
|
|
|
|
<div class="col-sm-2">
|
|
|
|
<input type="number" class="form-control" id="idMaxSessions" name="max_sessions" placeholder=""
|
|
|
|
value="{{.User.MaxSessions}}" min="0" aria-describedby="sessionsHelpBlock">
|
|
|
|
<small id="sessionsHelpBlock" class="form-text text-muted">
|
|
|
|
0 means no limit
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-1"></div>
|
|
|
|
<label for="idUID" class="col-sm-1 col-form-label">UID</label>
|
|
|
|
<div class="col-sm-2">
|
|
|
|
<input type="number" class="form-control" id="idUID" name="uid" placeholder="" value="{{.User.UID}}" min="0"
|
|
|
|
max="65535">
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-1"></div>
|
|
|
|
<label for="idGID" class="col-sm-1 col-form-label">GID</label>
|
|
|
|
<div class="col-sm-2">
|
|
|
|
<input type="number" class="form-control" id="idGID" name="gid" placeholder="" value="{{.User.GID}}" min="0"
|
|
|
|
max="65535">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-12-30 17:37:50 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idDeniedIP" class="col-sm-2 col-form-label">Denied IP/Mask</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<input type="text" class="form-control" id="idDeniedIP" name="denied_ip" placeholder=""
|
|
|
|
value="{{.User.GetDeniedIPAsString}}" maxlength="255" aria-describedby="deniedIPHelpBlock">
|
|
|
|
<small id="deniedIPHelpBlock" class="form-text text-muted">
|
|
|
|
Comma separated IP/Mask in CIDR format, for example "192.168.1.0/24,10.8.0.100/32"
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idAllowedIP" class="col-sm-2 col-form-label">Allowed IP/Mask</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<input type="text" class="form-control" id="idAllowedIP" name="allowed_ip" placeholder=""
|
|
|
|
value="{{.User.GetAllowedIPAsString}}" maxlength="255" aria-describedby="allowedIPHelpBlock">
|
|
|
|
<small id="allowedIPHelpBlock" class="form-text text-muted">
|
|
|
|
Comma separated IP/Mask in CIDR format, for example "192.168.1.0/24,10.8.0.100/32"
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-03-01 21:10:29 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idFilesExtensionsDenied" class="col-sm-2 col-form-label">Denied file extensions</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<textarea class="form-control" id="idFilesExtensionsDenied" name="denied_extensions" rows="3"
|
|
|
|
aria-describedby="deniedExtensionsHelpBlock">{{range $index, $filter := .User.Filters.FileExtensions -}}
|
|
|
|
{{if $filter.DeniedExtensions -}}
|
|
|
|
{{$filter.Path}}::{{range $idx, $p := $filter.DeniedExtensions}}{{if $idx}},{{end}}{{$p}}{{end}}
|
|
|
|
{{- end}}
|
|
|
|
{{- end}}</textarea>
|
|
|
|
<small id="deniedExtensionsHelpBlock" class="form-text text-muted">
|
|
|
|
One directory per line as dir::extensions1,extensions2, for example /subdir::.zip,.rar
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idFilesExtensionsAllowed" class="col-sm-2 col-form-label">Allowed file extensions</label>
|
|
|
|
<div class="col-sm-10">
|
|
|
|
<textarea class="form-control" id="idFilesExtensionsAllowed" name="allowed_extensions" rows="3"
|
|
|
|
aria-describedby="allowedExtensionsHelpBlock">{{range $index, $filter := .User.Filters.FileExtensions -}}
|
|
|
|
{{if $filter.AllowedExtensions -}}
|
|
|
|
{{$filter.Path}}::{{range $idx, $p := $filter.AllowedExtensions}}{{if $idx}},{{end}}{{$p}}{{end}}
|
|
|
|
{{- end}}
|
|
|
|
{{- end}}</textarea>
|
|
|
|
<small id="allowedExtensionsHelpBlock" class="form-text text-muted">
|
|
|
|
One directory per line as dir::extensions1,extensions2, for example /somedir::.jpg,.png
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-01-19 06:41:05 +00:00
|
|
|
<div class="form-group row">
|
|
|
|
<label for="idFilesystem" class="col-sm-2 col-form-label">Storage</label>
|
|
|
|
<div class="col-sm-10">
|
2020-01-31 18:04:00 +00:00
|
|
|
<select class="form-control" id="idFilesystem" name="fs_provider" onchange="onFilesystemChanged(this.value)">
|
2020-01-19 06:41:05 +00:00
|
|
|
<option value="0" {{if eq .User.FsConfig.Provider 0 }}selected{{end}}>local</option>
|
2020-01-31 18:04:00 +00:00
|
|
|
<option value="1" {{if eq .User.FsConfig.Provider 1 }}selected{{end}}>Amazon S3 (Compatible)</option>
|
|
|
|
<option value="2" {{if eq .User.FsConfig.Provider 2 }}selected{{end}}>Google Cloud Storage</option>
|
2020-01-19 06:41:05 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-01-31 18:04:00 +00:00
|
|
|
<div class="form-group row s3">
|
2020-02-19 08:41:15 +00:00
|
|
|
<label for="idS3Bucket" class="col-sm-2 col-form-label">Bucket</label>
|
2020-01-19 06:41:05 +00:00
|
|
|
<div class="col-sm-3">
|
|
|
|
<input type="text" class="form-control" id="idS3Bucket" name="s3_bucket" placeholder=""
|
|
|
|
value="{{.User.FsConfig.S3Config.Bucket}}" maxlength="255">
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-2"></div>
|
2020-02-19 08:41:15 +00:00
|
|
|
<label for="idS3Region" class="col-sm-2 col-form-label">Region</label>
|
2020-01-19 06:41:05 +00:00
|
|
|
<div class="col-sm-3">
|
|
|
|
<input type="text" class="form-control" id="idS3Region" name="s3_region" placeholder=""
|
|
|
|
value="{{.User.FsConfig.S3Config.Region}}" maxlength="255">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-01-31 18:04:00 +00:00
|
|
|
<div class="form-group row s3">
|
2020-02-19 08:41:15 +00:00
|
|
|
<label for="idS3AccessKey" class="col-sm-2 col-form-label">Access Key</label>
|
2020-01-19 06:41:05 +00:00
|
|
|
<div class="col-sm-3">
|
|
|
|
<input type="text" class="form-control" id="idS3AccessKey" name="s3_access_key" placeholder=""
|
|
|
|
value="{{.User.FsConfig.S3Config.AccessKey}}" maxlength="255">
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-2"></div>
|
2020-02-19 08:41:15 +00:00
|
|
|
<label for="idS3AccessSecret" class="col-sm-2 col-form-label">Access Secret</label>
|
2020-01-19 06:41:05 +00:00
|
|
|
<div class="col-sm-3">
|
|
|
|
<input type="text" class="form-control" id="idS3AccessSecret" name="s3_access_secret" placeholder=""
|
|
|
|
value="{{.User.FsConfig.S3Config.AccessSecret}}" maxlength="1000">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-01-31 18:04:00 +00:00
|
|
|
<div class="form-group row s3">
|
2020-02-19 08:41:15 +00:00
|
|
|
<label for="idS3StorageClass" class="col-sm-2 col-form-label">Storage Class</label>
|
2020-01-19 06:41:05 +00:00
|
|
|
<div class="col-sm-3">
|
|
|
|
<input type="text" class="form-control" id="idS3StorageClass" name="s3_storage_class" placeholder=""
|
|
|
|
value="{{.User.FsConfig.S3Config.StorageClass}}" maxlength="1000">
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-2"></div>
|
2020-02-19 08:41:15 +00:00
|
|
|
<label for="idS3Endpoint" class="col-sm-2 col-form-label">Endpoint</label>
|
2020-01-19 06:41:05 +00:00
|
|
|
<div class="col-sm-3">
|
|
|
|
<input type="text" class="form-control" id="idS3Endpoint" name="s3_endpoint" placeholder=""
|
|
|
|
value="{{.User.FsConfig.S3Config.Endpoint}}" maxlength="255">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-03-13 07:54:36 +00:00
|
|
|
<div class="form-group row s3">
|
2020-03-13 16:28:55 +00:00
|
|
|
<label for="idS3PartSize" class="col-sm-2 col-form-label">UL Part Size (MB)</label>
|
2020-03-13 07:54:36 +00:00
|
|
|
<div class="col-sm-3">
|
2020-03-13 16:28:55 +00:00
|
|
|
<input type="number" class="form-control" id="idS3PartSize" name="s3_upload_part_size" placeholder=""
|
|
|
|
value="{{.User.FsConfig.S3Config.UploadPartSize}}" aria-describedby="S3PartSizeHelpBlock">
|
|
|
|
<small id="S3PartSizeHelpBlock" class="form-text text-muted">
|
|
|
|
The buffer size for multipart uploads. Zero means the default (5 MB). Minimum is 5
|
|
|
|
</small>
|
2020-03-13 07:54:36 +00:00
|
|
|
</div>
|
|
|
|
<div class="col-sm-2"></div>
|
|
|
|
</div>
|
|
|
|
|
2020-01-31 18:04:00 +00:00
|
|
|
<div class="form-group row s3">
|
2020-02-19 08:41:15 +00:00
|
|
|
<label for="idS3KeyPrefix" class="col-sm-2 col-form-label">Key Prefix</label>
|
2020-01-19 22:23:09 +00:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<input type="text" class="form-control" id="idS3KeyPrefix" name="s3_key_prefix" placeholder=""
|
|
|
|
value="{{.User.FsConfig.S3Config.KeyPrefix}}" maxlength="255" aria-describedby="S3KeyPrefixHelpBlock">
|
|
|
|
<small id="S3KeyPrefixHelpBlock" class="form-text text-muted">
|
|
|
|
Similar to a chroot for local filesystem. Cannot start with "/". Example: "somedir/subdir/".
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-01-31 18:04:00 +00:00
|
|
|
<div class="form-group row gcs">
|
2020-02-19 08:41:15 +00:00
|
|
|
<label for="idGCSBucket" class="col-sm-2 col-form-label">Bucket</label>
|
2020-01-31 18:04:00 +00:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<input type="text" class="form-control" id="idGCSBucket" name="gcs_bucket" placeholder=""
|
|
|
|
value="{{.User.FsConfig.GCSConfig.Bucket}}" maxlength="255">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group row gcs">
|
2020-02-19 08:41:15 +00:00
|
|
|
<label for="idGCSCredentialFile" class="col-sm-2 col-form-label">Credentials file</label>
|
2020-01-31 18:04:00 +00:00
|
|
|
<div class="col-sm-4">
|
|
|
|
<input type="file" class="form-control-file" id="idGCSCredentialFile" name="gcs_credential_file"
|
|
|
|
aria-describedby="GCSCredentialsHelpBlock">
|
|
|
|
<small id="GCSCredentialsHelpBlock" class="form-text text-muted">
|
|
|
|
Add or update credentials from a JSON file
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-1"></div>
|
2020-02-19 08:41:15 +00:00
|
|
|
<label for="idGCSStorageClass" class="col-sm-2 col-form-label">Storage Class</label>
|
2020-01-31 18:04:00 +00:00
|
|
|
<div class="col-sm-3">
|
|
|
|
<input type="text" class="form-control" id="idGCSStorageClass" name="gcs_storage_class" placeholder=""
|
|
|
|
value="{{.User.FsConfig.GCSConfig.StorageClass}}" maxlength="255">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-02-19 08:41:15 +00:00
|
|
|
<div class="form-group gcs">
|
|
|
|
<div class="form-check">
|
|
|
|
<input type="checkbox" class="form-check-input" id="idGCSAutoCredentials" name="gcs_auto_credentials"
|
|
|
|
{{if gt .User.FsConfig.GCSConfig.AutomaticCredentials 0}}checked{{end}}>
|
|
|
|
<label for="idGCSAutoCredentials" class="form-check-label">Automatic credentials</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-01-31 18:04:00 +00:00
|
|
|
<div class="form-group row gcs">
|
2020-02-19 08:41:15 +00:00
|
|
|
<label for="idGCSKeyPrefix" class="col-sm-2 col-form-label">Key Prefix</label>
|
2020-01-31 18:04:00 +00:00
|
|
|
<div class="col-sm-10">
|
|
|
|
<input type="text" class="form-control" id="idGCSKeyPrefix" name="gcs_key_prefix" placeholder=""
|
|
|
|
value="{{.User.FsConfig.GCSConfig.KeyPrefix}}" maxlength="255" aria-describedby="GCSKeyPrefixHelpBlock">
|
|
|
|
<small id="GCSKeyPrefixHelpBlock" class="form-text text-muted">
|
|
|
|
Similar to a chroot for local filesystem. Cannot start with "/". Example: "somedir/subdir/".
|
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2019-11-13 10:36:21 +00:00
|
|
|
<input type="hidden" name="expiration_date" id="hidden_start_datetime" value="">
|
2019-10-07 16:19:01 +00:00
|
|
|
<button type="submit" class="btn btn-primary float-right mt-3 mb-5 px-5 px-3">Submit</button>
|
|
|
|
</form>
|
2019-11-13 10:36:21 +00:00
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "extra_js"}}
|
|
|
|
<script src="/static/vendor/moment/js/moment.min.js"></script>
|
|
|
|
<script src="/static/vendor/tempusdominus/js/tempusdominus-bootstrap-4.min.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
|
|
$('#expirationDatePicker').datetimepicker({
|
|
|
|
format: 'YYYY-MM-DD',
|
|
|
|
buttons: {
|
|
|
|
showClear: false,
|
|
|
|
showClose: true,
|
|
|
|
showToday: false
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2020-01-09 11:14:33 +00:00
|
|
|
{{ if gt .User.ExpirationDate 0 }}
|
2019-11-13 10:36:21 +00:00
|
|
|
var input_dt = moment({{.User.ExpirationDate }}).format('YYYY-MM-DD');
|
2020-01-09 11:14:33 +00:00
|
|
|
$('#idExpirationDate').val(input_dt);
|
|
|
|
$('#expirationDatePicker').datetimepicker('viewDate', input_dt);
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
$("#user_form").submit(function (event) {
|
|
|
|
var dt = $('#idExpirationDate').val();
|
|
|
|
if (dt) {
|
|
|
|
var d = $('#expirationDatePicker').datetimepicker('viewDate');
|
|
|
|
if (d) {
|
|
|
|
var dateString = moment(d).format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
$('#hidden_start_datetime').val(dateString);
|
|
|
|
} else {
|
|
|
|
$('#hidden_start_datetime').val("");
|
|
|
|
}
|
2019-11-13 10:36:21 +00:00
|
|
|
} else {
|
|
|
|
$('#hidden_start_datetime').val("");
|
|
|
|
}
|
2020-01-09 11:14:33 +00:00
|
|
|
return true;
|
|
|
|
});
|
2020-01-31 18:04:00 +00:00
|
|
|
|
|
|
|
onFilesystemChanged('{{.User.FsConfig.Provider}}');
|
|
|
|
|
2019-11-13 10:36:21 +00:00
|
|
|
});
|
2020-01-31 18:04:00 +00:00
|
|
|
|
|
|
|
function onFilesystemChanged(val){
|
|
|
|
if (val == '1'){
|
|
|
|
$('.form-group.row.gcs').hide();
|
2020-02-19 08:41:15 +00:00
|
|
|
$('.form-group.gcs').hide();
|
2020-01-31 18:04:00 +00:00
|
|
|
$('.form-group.row.s3').show();
|
|
|
|
} else if (val == '2'){
|
|
|
|
$('.form-group.row.gcs').show();
|
2020-02-19 08:41:15 +00:00
|
|
|
$('.form-group.gcs').show();
|
2020-01-31 18:04:00 +00:00
|
|
|
$('.form-group.row.s3').hide();
|
|
|
|
} else {
|
|
|
|
$('.form-group.row.gcs').hide();
|
2020-02-19 08:41:15 +00:00
|
|
|
$('.form-group.gcs').hide();
|
2020-01-31 18:04:00 +00:00
|
|
|
$('.form-group.row.s3').hide();
|
|
|
|
}
|
|
|
|
}
|
2019-11-13 10:36:21 +00:00
|
|
|
</script>
|
2020-03-13 07:54:36 +00:00
|
|
|
{{end}}
|