add some pre-validation hooks

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2024-08-17 09:11:42 +02:00
commit b9b370fbb8
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF
6 changed files with 90 additions and 65 deletions

View file

@ -34,7 +34,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
</div>
</div>
{{- if or .IsUserPage .IsGroupPage}}
<div class="form-group row mt-10">
<div class="form-group row mt-10 {{if not .CanSetHomeDir}}d-none{{end}}">
<label for="idHomeDir" data-i18n="storage.home_dir" class="col-md-3 col-form-label">Home Dir</label>
<div class="col-md-9">
<input id="idHomeDir" type="text" data-i18n="[placeholder]storage.home_dir_placeholder" class="form-control" name="home_dir" value="{{.DirPath}}" aria-describedby="idHomeDirHelp" />
@ -42,7 +42,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
</div>
</div>
{{- else}}
<div class="form-group row mt-10">
<div class="form-group row mt-10 {{if not .CanSetHomeDir}}d-none{{end}}">
<label for="idMappedPath" data-i18n="storage.home_dir" class="col-md-3 col-form-label">Home Dir</label>
<div class="col-md-9">
<input id="idMappedPath" type="text" data-i18n="[placeholder]storage.home_dir_placeholder" class="form-control" name="mapped_path" value="{{.DirPath}}" aria-describedby="idMappedPathHelp" />