mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
WebClient WIP: add support for localizations
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -17,7 +17,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{.Branding.Name}} - {{template "title" .}}</title>
|
||||
<title></title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
@@ -36,7 +36,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
|
||||
<body data-kt-app-header-fixed="true" data-kt-app-header-fixed-mobile="true" data-kt-app-toolbar-enabled="true" data-kt-app-sidebar-enabled="true" data-kt-app-sidebar-fixed="true" data-kt-app-sidebar-push-header="true" data-kt-app-sidebar-push-toolbar="true" data-kt-app-sidebar-push-footer="true" class="app-default">
|
||||
{{- template "theme-setup" .CSPNonce }}
|
||||
<div class="d-flex flex-column flex-root app-root" id="kt_app_root">
|
||||
<div id="app_loader" class="align-items-center text-center my-10">
|
||||
<span class="spinner-border w-15px h-15px text-muted align-middle me-2"></span>
|
||||
</div>
|
||||
<div class="d-flex flex-column flex-root app-root d-none" id="app_root">
|
||||
<div class="app-page flex-column flex-column-fluid " id="kt_app_page">
|
||||
{{- if .LoggedUser.Username}}
|
||||
<div id="kt_app_header" class="app-header" data-kt-sticky="true" data-kt-sticky-activate="{default: true, lg: true}" data-kt-sticky-name="app-header-minimize" data-kt-sticky-offset="{default: '200px', lg: '300px'}" data-kt-sticky-animation="false">
|
||||
@@ -96,7 +99,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<span class="path10"></span>
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">Light</span>
|
||||
<span data-i18n="theme.light" class="menu-title">Light</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item px-3 my-0">
|
||||
@@ -107,7 +110,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<span class="path2"></span>
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">Dark</span>
|
||||
<span data-i18n="theme.dark" class="menu-title">Dark</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="menu-item px-3 my-0">
|
||||
@@ -120,7 +123,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<span class="path4"></span>
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">System</span>
|
||||
<span data-i18n="theme.system" class="menu-title">System</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -143,7 +146,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</i>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<div class="fw-bold d-flex align-items-center fs-5">
|
||||
<div class="fw-semibold d-flex align-items-center fs-5">
|
||||
<span class="w-175px wrap-word">{{.LoggedUser.Username}}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -152,19 +155,19 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="separator my-2"></div>
|
||||
<div class="menu-item px-3 my-0">
|
||||
<a href="{{.ProfileURL}}" class="menu-link px-3 py-2">
|
||||
<span class="menu-title">Profile</span>
|
||||
<span data-i18n="title.profile" class="menu-title">Profile</span>
|
||||
</a>
|
||||
</div>
|
||||
{{- if .LoggedUser.CanChangePassword}}
|
||||
<div class="menu-item px-3 my-0">
|
||||
<a href="{{.ChangePwdURL}}" class="menu-link px-3 py-2">
|
||||
<span class="menu-title">Change password</span>
|
||||
<span data-i18n="title.change_password" class="menu-title">Change password</span>
|
||||
</a>
|
||||
</div>
|
||||
{{- end}}
|
||||
<div class="menu-item px-3 my-0">
|
||||
<a id="id_logout_link" href="#" class="menu-link px-3 py-2">
|
||||
<span class="menu-title">Sign out</span>
|
||||
<span data-i18n="login.signout" class="menu-title">Sign out</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -201,7 +204,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<span class="path2"></span>
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">{{.FilesTitle}}</span>
|
||||
<span data-i18n="title.files" class="menu-title">Files</span>
|
||||
</a>
|
||||
</div>
|
||||
{{- if .LoggedUser.CanManageShares}}
|
||||
@@ -217,7 +220,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<span class="path6"></span>
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">{{.SharesTitle}}</span>
|
||||
<span data-i18n="title.shares" class="menu-title">Shares</span>
|
||||
</a>
|
||||
</div>
|
||||
{{- end}}
|
||||
@@ -230,7 +233,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<span class="path2"></span>
|
||||
</i>
|
||||
</span>
|
||||
<span class="menu-title">{{.MFATitle}}</span>
|
||||
<span data-i18n="title.two_factor_auth_short" class="menu-title">2FA</span>
|
||||
</a>
|
||||
</div>
|
||||
{{- end}}
|
||||
@@ -294,7 +297,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
{{- block "modals" .}}{{- end}}
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/global/plugins.bundle.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/js/scripts.bundle.js"></script>
|
||||
{{- template "basejs" .CSPNonce }}
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/i18next/i18next.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/i18next/jquery-i18next.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/i18next/i18nextBrowserLanguageDetector.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/i18next/i18nextChainedBackend.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/i18next/i18nextLocalStorageBackend.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/i18next/i18nextHttpBackend.js"></script>
|
||||
{{- template "basejs" . }}
|
||||
<script type="text/javascript" {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}}>
|
||||
var ModalAlert = function () {
|
||||
var modal;
|
||||
@@ -387,10 +396,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
|
||||
function doLogout() {
|
||||
ModalAlert.fire({
|
||||
text: `Are you sure you want to sign out?`,
|
||||
text: $.t("general.confirm_logout"),
|
||||
icon: "question",
|
||||
confirmButtonText: "Sign out",
|
||||
cancelButtonText: 'Cancel',
|
||||
confirmButtonText: $.t("login.signout"),
|
||||
cancelButtonText: $.t("general.cancel"),
|
||||
customClass: {
|
||||
confirmButton: "btn btn-primary",
|
||||
cancelButton: 'btn btn-secondary'
|
||||
|
||||
@@ -17,7 +17,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>{{.Branding.Name}} - {{template "title" .}}</title>
|
||||
<title></title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
@@ -35,7 +35,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
|
||||
<body class="app-blank">
|
||||
{{- template "theme-setup" .CSPNonce}}
|
||||
<div class="d-flex flex-column flex-root">
|
||||
<div id="app_loader" class="align-items-center text-center my-10">
|
||||
<span class="spinner-border w-15px h-15px text-muted align-middle me-2"></span>
|
||||
</div>
|
||||
<div class="d-flex flex-column flex-root d-none" id="app_root">
|
||||
<div class="d-flex flex-column flex-column-fluid bgi-position-y-bottom position-x-center bgi-no-repeat bgi-size-contain bgi-attachment-fixed">
|
||||
<div class="d-flex flex-center flex-column flex-column-fluid p-10 pb-lg-20">
|
||||
<div class="w-lg-500px w-md-450px w-sm-400px bg-body rounded shadow-sm p-10 p-lg-15 mx-auto">
|
||||
@@ -46,7 +49,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/global/plugins.bundle.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/js/scripts.bundle.js"></script>
|
||||
{{- template "basejs" .CSPNonce }}
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/i18next/i18next.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/i18next/jquery-i18next.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/i18next/i18nextBrowserLanguageDetector.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/i18next/i18nextChainedBackend.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/i18next/i18nextLocalStorageBackend.js"></script>
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/vendor/i18next/i18nextHttpBackend.js"></script>
|
||||
{{- template "basejs" . }}
|
||||
<script type="text/javascript" {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}}>
|
||||
KTUtil.onDOMContentLoaded(function () {
|
||||
$('#sign_in_form').submit(function (event) {
|
||||
|
||||
@@ -15,32 +15,45 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{template "base" .}}
|
||||
|
||||
{{- define "title"}}{{.Title}}{{- end}}
|
||||
|
||||
{{- define "page_body"}}
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-light">
|
||||
<h3 class="card-title text-primary">Change password</h3>
|
||||
<h3 data-i18n="title.change_password" class="card-title text-primary">Change password</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="notice d-flex bg-light-primary rounded border-primary border border-dashed p-6 mb-5">
|
||||
<i class="ki-duotone ki-shield-tick fs-2tx text-primary me-4">
|
||||
<span class="path1"></span>
|
||||
<span class="path2"></span>
|
||||
</i>
|
||||
<div class="d-flex flex-stack flex-grow-1 flex-wrap flex-md-nowrap">
|
||||
<div class="mb-3 mb-md-0">
|
||||
<div class="fs-6 text-gray-800 fw-semibold pe-7">
|
||||
<span data-i18n="change_pwd.info">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{- template "errmsg" .Error}}
|
||||
<form id="change_pwd_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label required">Current password</label>
|
||||
<label data-i18n="change_pwd.current" class="col-md-3 col-form-label required">Current password</label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" class="form-control" placeholder="" name="current_password"
|
||||
spellcheck="false" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mt-10">
|
||||
<label class="col-md-3 col-form-label required">New password</label>
|
||||
<label data-i18n="change_pwd.new" class="col-md-3 col-form-label required">New password</label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" class="form-control" placeholder="" name="new_password1"
|
||||
autocomplete="new-password" spellcheck="false" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row mt-10">
|
||||
<label class="col-md-3 col-form-label required">Confirm password</label>
|
||||
<label data-i18n="change_pwd.confirm" class="col-md-3 col-form-label required">Confirm password</label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" class="form-control" placeholder="" name="new_password2"
|
||||
autocomplete="new-password" spellcheck="false" required />
|
||||
@@ -49,11 +62,12 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="d-flex justify-content-end mt-12">
|
||||
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
||||
<button type="submit" id="form_submit" class="btn btn-primary px-10">
|
||||
<span class="indicator-label">
|
||||
<span data-i18n="change_pwd.save" class="indicator-label">
|
||||
Submit
|
||||
</span>
|
||||
<span class="indicator-progress">
|
||||
Please wait... <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -15,8 +15,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{template "base" .}}
|
||||
|
||||
{{define "title"}}{{.Title}}{{end}}
|
||||
|
||||
{{- define "extra_css"}}
|
||||
<style {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}}>
|
||||
.shortcut {font-family: monospace; color: #666;}
|
||||
@@ -44,17 +42,14 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
{{- template "errmsg" ""}}
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header">
|
||||
{{- if .ReadOnly}}
|
||||
<h6 class="card-title">View file "{{.Path}}"</h6>
|
||||
{{- else}}
|
||||
<h6 class="card-title">Edit file "{{.Path}}"</h6>
|
||||
{{- end}}
|
||||
<h6 id="card_title" class="card-title"></h6>
|
||||
<div class="card-toolbar">
|
||||
<a class="btn btn-light-primary px-10 me-5" href='{{.FilesURL}}?path={{.CurrentDir}}' role="button">Back</a>
|
||||
<a data-i18n="general.back" class="btn btn-light-primary px-10 me-5" href='{{.FilesURL}}?path={{.CurrentDir}}' role="button">Back</a>
|
||||
{{- if not .ReadOnly}}
|
||||
<a id="save_button" type="button" class="btn btn-primary px-10" href="#" role="button">
|
||||
<span class="indicator-label">Save</span>
|
||||
<span class="indicator-progress">Please wait...
|
||||
<span data-i18n="general.submit" class="indicator-label">Save</span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</a>
|
||||
@@ -72,27 +67,27 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Editor keybindings</h3>
|
||||
<div class="btn btn-icon btn-sm btn-active-light-primary ms-2" data-bs-dismiss="modal" aria-label="Close">
|
||||
<h3 data-i18n="editor.keybinding" class="modal-title">Editor keybindings</h3>
|
||||
<div data-i18n="[aria-label]general.close" class="btn btn-icon btn-sm btn-active-light-primary ms-2" data-bs-dismiss="modal" aria-label="Close">
|
||||
<i class="ki-duotone ki-cross fs-1"><span class="path1"></span><span class="path2"></span></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
<span class="shortcut">Ctrl-F / Cmd-F</span> => Open search panel
|
||||
<span class="shortcut">Ctrl-F / Cmd-F</span> => <span data-i18n="editor.search" class="fw-semibold">Open search panel</span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="shortcut">Alt-G</span> => Jump to line
|
||||
<span class="shortcut">Alt-G</span> => <span data-i18n="editor.goto" class="fw-semibold">Jump to line</span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="shortcut">Tab</span> => Indent more
|
||||
<span class="shortcut">Tab</span> => <span data-i18n="editor.indent_more" class="fw-semibold">Indent more</span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="shortcut">Shift-Tab</span> => Indent less
|
||||
<span class="shortcut">Shift-Tab</span> => <span data-i18n="editor.indent_less" class="fw-semibold">Indent less</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary" type="button" data-bs-dismiss="modal">OK</button>
|
||||
<button data-i18n="general.ok" class="btn btn-primary" type="button" data-bs-dismiss="modal">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -134,22 +129,36 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}).catch(function (error) {
|
||||
saveButton.removeAttribute('data-kt-indicator');
|
||||
saveButton.disabled = false;
|
||||
let errorMessage = "Error saving file";
|
||||
|
||||
let errorMessage = "";
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
switch (error.response.status) {
|
||||
case 403:
|
||||
errorMessage = "fs.save.err403";
|
||||
break;
|
||||
case 429:
|
||||
errorMessage = "fs.save.err429";
|
||||
break;
|
||||
}
|
||||
}
|
||||
$('#errorTxt').text(errorMessage);
|
||||
if (!errorMessage){
|
||||
errorMessage = "fs.save.err_generic";
|
||||
}
|
||||
setI18NData($('#errorTxt'), errorMessage);
|
||||
$('#errorMsg').removeClass("d-none");
|
||||
});
|
||||
}
|
||||
//{{- end}}
|
||||
|
||||
KTUtil.onDOMContentLoaded(function () {
|
||||
$(document).on("i18nload", function(){
|
||||
//{{- if .ReadOnly}}
|
||||
$('#card_title').text($.t('fs.view_file', { path: '{{.Path}}'}));
|
||||
//{{- else}}
|
||||
$('#card_title').text($.t('fs.edit_file', { path: '{{.Path}}'}));
|
||||
//{{- end}}
|
||||
});
|
||||
|
||||
$(document).on("i18nshow", function(){
|
||||
let filename = "{{.Name}}";
|
||||
let extension = filename.slice((filename.lastIndexOf(".") - 1 >>> 0) + 2).toLowerCase();
|
||||
let options = {
|
||||
|
||||
@@ -15,7 +15,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{template "base" .}}
|
||||
|
||||
{{- define "title"}}{{.Title}}{{- end}}
|
||||
{{- define "page_body"}}
|
||||
{{- template "errmsg" .Error}}
|
||||
<div class="card card-flush shadow-sm">
|
||||
@@ -26,13 +25,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<span class="path1"></span>
|
||||
<span class="path2"></span>
|
||||
</i>
|
||||
<input type="text" data-kt-filemanager-table-filter="search" class="form-control form-control-solid w-250px ps-15" placeholder="Search Files & Folders" />
|
||||
<input data-i18n="[placeholder]general.search" type="text" data-kt-filemanager-table-filter="search" class="form-control form-control-solid w-250px ps-15" placeholder="Search Files & Folders" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-toolbar">
|
||||
<div class="d-flex justify-content-end" data-kt-filemanager-table-toolbar="base">
|
||||
{{- if .CanCreateDirs}}
|
||||
<button id="id_create_dir_button" type="button" class="btn btn-flex btn-light-primary me-3">
|
||||
<button id="id_create_dir_button" data-i18n="fs.new_folder" type="button" class="btn btn-flex btn-light-primary me-3">
|
||||
<i class="ki-duotone ki-add-folder fs-2">
|
||||
<span class="path1"></span>
|
||||
<span class="path2"></span>
|
||||
@@ -41,7 +40,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</button>
|
||||
{{- end}}
|
||||
{{- if .CanAddFiles}}
|
||||
<button type="button" class="btn btn-flex btn-primary" data-bs-toggle="modal" data-bs-target="#modal_upload">
|
||||
<button type="button" data-i18n="fs.upload.text" class="btn btn-flex btn-primary" data-bs-toggle="modal" data-bs-target="#modal_upload">
|
||||
<i class="ki-duotone ki-folder-up fs-2">
|
||||
<span class="path1"></span>
|
||||
<span class="path2"></span>
|
||||
@@ -56,20 +55,20 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
<div class="form-check form-switch form-check-custom form-check-solid me-5" data-kt-filemanager-table-select="select_all_pages_container">
|
||||
<input class="form-check-input" type="checkbox" id="id_select_all_pages" data-kt-filemanager-table-select="select_all_pages" />
|
||||
<label class="form-check-label fw-semibold text-gray-900" for="id_select_all_pages">
|
||||
<label data-i18n="fs.select_across_pages" class="form-check-label fw-semibold text-gray-900" for="id_select_all_pages">
|
||||
Select across pages
|
||||
</label>
|
||||
</div>
|
||||
{{- if or .CanDownload .CanDelete}}
|
||||
<div>
|
||||
<button type="button" class="btn btn-light-primary rotate" data-kt-menu-trigger="click" data-kt-menu-placement="bottom">
|
||||
<button data-i18n="fs.actions" type="button" class="btn btn-light-primary rotate" data-kt-menu-trigger="click" data-kt-menu-placement="bottom">
|
||||
Actions
|
||||
<i class="ki-duotone ki-down fs-3 rotate-180 ms-3 me-0"></i>
|
||||
</button>
|
||||
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-800 menu-state-bg-light-primary fw-semibold w-auto min-w-200 mw-300px py-4" data-kt-menu="true">
|
||||
{{- if .CanDownload}}
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3 fs-6" data-kt-filemanager-table-select="download_selected">
|
||||
<a data-i18n="fs.download" href="#" class="menu-link px-3 fs-6" data-kt-filemanager-table-select="download_selected">
|
||||
Download
|
||||
</a>
|
||||
</div>
|
||||
@@ -77,14 +76,14 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
{{- if not .ShareUploadBaseURL}}
|
||||
{{- if or .CanRename .CanAddFiles}}
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3 fs-6" data-kt-filemanager-table-select="move_or_copy_selected">
|
||||
<a data-i18n="fs.move_copy" href="#" class="menu-link px-3 fs-6" data-kt-filemanager-table-select="move_or_copy_selected">
|
||||
Move or copy
|
||||
</a>
|
||||
</div>
|
||||
{{- end}}
|
||||
{{- if .CanShare}}
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3 fs-6" data-kt-filemanager-table-select="share_selected">
|
||||
<a data-i18n="fs.share" href="#" class="menu-link px-3 fs-6" data-kt-filemanager-table-select="share_selected">
|
||||
Share
|
||||
</a>
|
||||
</div>
|
||||
@@ -92,7 +91,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
{{- end}}
|
||||
{{- if .CanDelete}}
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3 text-danger fs-6" data-kt-filemanager-table-select="delete_selected">
|
||||
<a data-i18n="general.delete" href="#" class="menu-link px-3 text-danger fs-6" data-kt-filemanager-table-select="delete_selected">
|
||||
Delete
|
||||
</a>
|
||||
</div>
|
||||
@@ -108,7 +107,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="badge badge-lg badge-light-primary">
|
||||
<div class="d-flex align-items-center flex-wrap">
|
||||
<i class="ki-duotone ki-home fs-1 text-primary me-3"></i>
|
||||
<a href="{{.FilesURL}}?path=%2F">Home</a>
|
||||
<a data-i18n="fs.home" href="{{.FilesURL}}?path=%2F">Home</a>
|
||||
{{- range .Paths}}
|
||||
<i class="ki-duotone ki-right fs-2x text-primary mx-1"></i>
|
||||
{{- if eq .Href ""}}
|
||||
@@ -127,7 +126,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<span class="path2"></span>
|
||||
</i>
|
||||
</span>
|
||||
<input id="file_manager_new_folder_input" type="text" name="new_folder_name" placeholder="Enter the new folder name" class="form-control mw-250px me-3" />
|
||||
<input data-i18n="[placeholder]fs.create_folder_msg" id="file_manager_new_folder_input" type="text" name="new_folder_name" placeholder="Enter the new folder name" class="form-control mw-250px me-3" />
|
||||
<button class="btn btn-icon btn-light-primary me-3" id="file_manager_add_folder">
|
||||
<span class="indicator-label">
|
||||
<i class="ki-duotone ki-check fs-1"></i>
|
||||
@@ -152,9 +151,9 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
</th>
|
||||
<th></th>
|
||||
<th class="min-w-250px">Name</th>
|
||||
<th class="min-w-10px">Size</th>
|
||||
<th class="min-w-125px">Last Modified</th>
|
||||
<th data-i18n="general.name" class="min-w-250px">Name</th>
|
||||
<th data-i18n="general.size" class="min-w-10px">Size</th>
|
||||
<th data-i18n="general.last_modified" class="min-w-125px">Last Modified</th>
|
||||
<th class="w-125px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -224,18 +223,19 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
dataSrc: "",
|
||||
error: function ($xhr, textStatus, errorThrown) {
|
||||
$(".dataTables_processing").hide();
|
||||
let txt = "Failed to get directory listing";
|
||||
let txt = "";
|
||||
if ($xhr) {
|
||||
let json = $xhr.responseJSON;
|
||||
if (json) {
|
||||
if (json.message) {
|
||||
txt += ": " + json.message;
|
||||
} else {
|
||||
txt += ": " + json.error;
|
||||
txt = json.message;
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#errorModalTxt').text(txt);
|
||||
if (!txt){
|
||||
txt = "fs.dir_list.err_generic";
|
||||
}
|
||||
setI18NData($('#errorModalTxt'), txt);
|
||||
$('#errorModalMsg').removeClass("d-none");
|
||||
}
|
||||
},
|
||||
@@ -277,8 +277,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}
|
||||
],
|
||||
language: {
|
||||
info: $.t('datatable.info'),
|
||||
infoEmpty: $.t('datatable.info_empty'),
|
||||
infoFiltered: $.t('datatable.info_filtered'),
|
||||
loadingRecords: "",
|
||||
emptyTable: "No more subfolders in here"
|
||||
processing: $.t('datatable.processing'),
|
||||
zeroRecords: "",
|
||||
emptyTable: $.t('fs.no_more_subfolders')
|
||||
},
|
||||
order: [1, 'asc']
|
||||
});
|
||||
@@ -289,7 +294,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
let mainNavIcon = document.createElement("i");
|
||||
mainNavIcon.classList.add("ki-duotone", "ki-home", "fs-1", "text-primary", "me-3");
|
||||
let mainNavLink = document.createElement("a");
|
||||
mainNavLink.textContent = "Home";
|
||||
mainNavLink.textContent = $.t('fs.home');
|
||||
mainNavLink.href = "#";
|
||||
mainNavLink.addEventListener("click", function(e){
|
||||
e.preventDefault();
|
||||
@@ -342,12 +347,12 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
let cancelButton = document.querySelector('#dirsbrowser_cancel_folder');
|
||||
errDivEl.addClass("d-none");
|
||||
if (!dirName){
|
||||
errTxtEl.text("Folder name is required");
|
||||
setI18NData(errTxtEl, "fs.folder_name_required");
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
if (dirName.includes("/")){
|
||||
errTxtEl.text('"/" is not allowed in file or directory names');
|
||||
setI18NData(errTxtEl, "fs.invalid_name");
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
@@ -372,16 +377,21 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
cancelButton.disabled = false;
|
||||
$('#dirsbrowser_new_folder').addClass("d-none");
|
||||
}).catch(function (error) {
|
||||
let errorMessage = "Unable to create the new folder";
|
||||
let errorMessage = "";
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
switch (error.response.status) {
|
||||
case 403:
|
||||
errorMessage = "fs.create_dir.err_403";
|
||||
break;
|
||||
case 429:
|
||||
errorMessage = "fs.create_dir.err_429";
|
||||
break;
|
||||
}
|
||||
}
|
||||
errTxtEl.text(errorMessage);
|
||||
if (!errorMessage){
|
||||
errorMessage = "fs.create_dir.err_generic";
|
||||
}
|
||||
setI18NData(errTxtEl, errorMessage);
|
||||
errDivEl.removeClass("d-none");
|
||||
submitButton.removeAttribute('data-kt-indicator');
|
||||
submitButton.disabled = false;
|
||||
@@ -434,18 +444,19 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
dataSrc: "",
|
||||
error: function ($xhr, textStatus, errorThrown) {
|
||||
$(".dataTables_processing").hide();
|
||||
let txt = "Failed to get directory listing";
|
||||
let txt = "";
|
||||
if ($xhr) {
|
||||
let json = $xhr.responseJSON;
|
||||
if (json) {
|
||||
if (json.message){
|
||||
txt += ": " + json.message;
|
||||
} else {
|
||||
txt += ": " + json.error;
|
||||
txt = json.message;
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#errorTxt').text(txt);
|
||||
if (!txt){
|
||||
txt = "fs.dir_list.err_generic";
|
||||
}
|
||||
setI18NData($('#errorTxt'), txt);
|
||||
$('#errorMsg').removeClass("d-none");
|
||||
}
|
||||
},
|
||||
@@ -522,7 +533,23 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{ data: "last_modified" },
|
||||
{
|
||||
data: "last_modified",
|
||||
render: function (data, type, row) {
|
||||
if (type === 'display') {
|
||||
if (data){
|
||||
return $.t('general.datetime', {
|
||||
val: new Date(data),
|
||||
formatParams: {
|
||||
val: { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' },
|
||||
}
|
||||
});
|
||||
}
|
||||
return ""
|
||||
}
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "edit_url",
|
||||
className: 'text-end',
|
||||
@@ -614,22 +641,22 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-700 menu-state-bg-light-primary fw-semibold fs-7 w-150px py-4" data-kt-menu="true">
|
||||
{{- if .CanRename}}
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-filemanager-table-action="rename">Rename</a>
|
||||
<a data-i18n="general.rename" href="#" class="menu-link px-3" data-kt-filemanager-table-action="rename">Rename</a>
|
||||
</div>
|
||||
{{- end}}
|
||||
{{- if or .CanRename .CanAddFiles}}
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-filemanager-table-action="move_or_copy">Move or copy</a>
|
||||
<a data-i18n="fs.move_copy" href="#" class="menu-link px-3" data-kt-filemanager-table-action="move_or_copy">Move or copy</a>
|
||||
</div>
|
||||
{{- end}}
|
||||
{{- if .CanShare}}
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-kt-filemanager-table-action="share">Share</a>
|
||||
<a data-i18n="fs.share" href="#" class="menu-link px-3" data-kt-filemanager-table-action="share">Share</a>
|
||||
</div>
|
||||
{{- end}}
|
||||
{{- if .CanDelete}}
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link text-danger px-3" data-kt-filemanager-table-action="delete">Delete</a>
|
||||
<a data-i18n="general.delete" href="#" class="menu-link text-danger px-3" data-kt-filemanager-table-action="delete">Delete</a>
|
||||
</div>
|
||||
{{- end}}
|
||||
</div>
|
||||
@@ -674,8 +701,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}
|
||||
],
|
||||
language: {
|
||||
info: $.t('datatable.info'),
|
||||
infoEmpty: $.t('datatable.info_empty'),
|
||||
infoFiltered: $.t('datatable.info_filtered'),
|
||||
loadingRecords: "",
|
||||
emptyTable: "No files or folders"
|
||||
processing: $.t('datatable.processing'),
|
||||
zeroRecords: "",
|
||||
emptyTable: $.t('fs.no_files_folders')
|
||||
},
|
||||
orderFixed: [1, 'asc'],
|
||||
order: [2, 'asc']
|
||||
@@ -706,6 +738,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}
|
||||
toggleToolbars();
|
||||
handleRowActions();
|
||||
$('#file_manager_list_body').localize();
|
||||
});
|
||||
|
||||
dt.on('user-select', function(e, dt, type, cell, originalEvent){
|
||||
@@ -754,7 +787,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
selectAllContainer.classList.add('d-none');
|
||||
}
|
||||
if (selectedCount){
|
||||
selectedCount.innerHTML = `${totalSelected} Selected`;
|
||||
selectedCount.innerHTML = $.t('general.selected_items', { count: totalSelected});
|
||||
}
|
||||
if (toolbarBase){
|
||||
toolbarBase.classList.add('d-none');
|
||||
@@ -926,10 +959,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
if (deleteButton) {
|
||||
deleteButton.addEventListener('click', function(e){
|
||||
ModalAlert.fire({
|
||||
text: "Do you want to delete the selected item/s? This action is irreversible",
|
||||
text: $.t('general.delete_multi_confirm'),
|
||||
icon: "warning",
|
||||
confirmButtonText: "Delete",
|
||||
cancelButtonText: 'Cancel',
|
||||
confirmButtonText: $.t('general.delete'),
|
||||
cancelButtonText: $.t('general.cancel'),
|
||||
customClass: {
|
||||
confirmButton: "btn btn-danger",
|
||||
cancelButton: 'btn btn-secondary'
|
||||
@@ -967,8 +1000,11 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
let attrs = getDeleteReqAttrs(meta);
|
||||
let deleteTxt = "";
|
||||
if (selectedRowsIdx.length > 1){
|
||||
let name = getNameFromMeta(meta);
|
||||
deleteTxt = `Delete ${index+1}/${selectedRowsIdx.length}: ${name}`;
|
||||
deleteTxt = $.t('fs.deleting', {
|
||||
idx : index + 1,
|
||||
total: selectedRowsIdx.length,
|
||||
name: getNameFromMeta(meta)
|
||||
});
|
||||
}
|
||||
$('#loading_message').text(deleteTxt);
|
||||
axios.delete(attrs.path,{
|
||||
@@ -986,19 +1022,33 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}).catch(function(error){
|
||||
index++;
|
||||
hasError = true;
|
||||
let errorMessage = "Unable to delete the selected item/s";
|
||||
if (deleted > 0){
|
||||
errorMessage = "Not all the selected items have been deleted, please reload the page";
|
||||
}
|
||||
let errorMessage;
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
switch (error.response.status) {
|
||||
case 403:
|
||||
if (deleted > 0){
|
||||
errorMessage = "fs.delete_multi.err_403_partial";
|
||||
} else {
|
||||
errorMessage = "fs.delete_multi.err_403";
|
||||
}
|
||||
break;
|
||||
case 429:
|
||||
if (deleted > 0){
|
||||
errorMessage = "fs.delete_multi.err_429_partial";
|
||||
} else {
|
||||
errorMessage = "fs.delete_multi.err_429";
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
errTxtEl.text(errorMessage);
|
||||
if (!errorMessage){
|
||||
if (deleted > 0){
|
||||
errorMessage = "fs.delete_multi.err_generic_partial";
|
||||
} else {
|
||||
errorMessage = "fs.delete_multi.err_generic";
|
||||
}
|
||||
}
|
||||
setI18NData(errTxtEl, errorMessage);
|
||||
errDivEl.removeClass("d-none");
|
||||
deleteSelected();
|
||||
});
|
||||
@@ -1122,7 +1172,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
errDivEl.addClass("d-none");
|
||||
items = checkMoveCopyItems(items)
|
||||
if (items.length == 0){
|
||||
errTxtEl.text('"/" is not allowed in file or directory names');
|
||||
setI18NData(errTxtEl, "fs.invalid_name");
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
@@ -1156,9 +1206,12 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}
|
||||
targetPath+=item.targetName;
|
||||
|
||||
if (items.length > 1){
|
||||
let msgTxt = `${sourcePath} => ${targetPath}`;
|
||||
msgTxt = `Copy ${index+1}/${items.length}: ${msgTxt}`;
|
||||
if (items.length > 1) {
|
||||
msgTxt = $.t('fs.copying', {
|
||||
idx: index + 1,
|
||||
total: items.length,
|
||||
name: `${sourcePath} => ${targetPath}`
|
||||
});
|
||||
$('#loading_message').text(msgTxt);
|
||||
}
|
||||
let path = '{{.FileActionsURL}}/copy';
|
||||
@@ -1178,16 +1231,21 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}).catch(function (error) {
|
||||
index++;
|
||||
hasError = true;
|
||||
let errorMessage = "Error copying item";
|
||||
let errorMessage = "";
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
switch (error.response.status) {
|
||||
case 403:
|
||||
errorMessage = "fs.copy.err_403";
|
||||
break;
|
||||
case 429:
|
||||
errorMessage = "fs.copy.err_429";
|
||||
break;
|
||||
}
|
||||
}
|
||||
errTxtEl.text(errorMessage);
|
||||
if (!errorMessage){
|
||||
errorMessage = "fs.copy.err_generic";
|
||||
}
|
||||
setI18NData(errTxtEl, errorMessage);
|
||||
errDivEl.removeClass("d-none");
|
||||
copyItem();
|
||||
});
|
||||
@@ -1206,7 +1264,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
errDivEl.addClass("d-none");
|
||||
items = checkMoveCopyItems(items)
|
||||
if (items.length == 0){
|
||||
errTxtEl.text('"/" is not allowed in file or directory names');
|
||||
setI18NData(errTxtEl, "fs.invalid_name");
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
@@ -1240,9 +1298,12 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}
|
||||
targetPath+=item.targetName;
|
||||
|
||||
if (items.length > 1){
|
||||
let msgTxt = `${sourcePath} => ${targetPath}`;
|
||||
msgTxt = `Move ${index+1}/${items.length}: ${msgTxt}`;
|
||||
if (items.length > 1) {
|
||||
msgTxt = $.t('fs.moving', {
|
||||
idx: index + 1,
|
||||
total: items.length,
|
||||
name: `${sourcePath} => ${targetPath}`
|
||||
});
|
||||
$('#loading_message').text(msgTxt);
|
||||
}
|
||||
let path = '{{.FileActionsURL}}/move';
|
||||
@@ -1262,16 +1323,21 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}).catch(function (error) {
|
||||
index++;
|
||||
hasError = true;
|
||||
let errorMessage = "Error moving item";
|
||||
let errorMessage = "";
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
switch (error.response.status) {
|
||||
case 403:
|
||||
errorMessage = "fs.move.err_403";
|
||||
break;
|
||||
case 429:
|
||||
errorMessage = "fs.move.err_429";
|
||||
break;
|
||||
}
|
||||
}
|
||||
errTxtEl.text(errorMessage);
|
||||
if (!errorMessage){
|
||||
errorMessage = "fs.move.err_generic";
|
||||
}
|
||||
setI18NData(errTxtEl, errorMessage);
|
||||
errDivEl.removeClass("d-none");
|
||||
moveItem();
|
||||
});
|
||||
@@ -1303,10 +1369,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
let itemName = getNameFromMeta(meta);
|
||||
|
||||
ModalAlert.fire({
|
||||
text: `Do you want to delete "${itemName}"? This action is irreversible`,
|
||||
text: $.t('general.delete_confirm', {name: itemName}),
|
||||
icon: "warning",
|
||||
confirmButtonText: "Delete",
|
||||
cancelButtonText: 'Cancel',
|
||||
confirmButtonText: $.t('general.delete'),
|
||||
cancelButtonText: $.t('general.cancel'),
|
||||
customClass: {
|
||||
confirmButton: "btn btn-danger",
|
||||
cancelButton: 'btn btn-secondary'
|
||||
@@ -1329,16 +1395,22 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
location.reload();
|
||||
}).catch(function(error){
|
||||
KTApp.hidePageLoading();
|
||||
let errorMessage = `Unable to delete "${itemName}"`;
|
||||
let errorMessage;
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
switch (error.response.status) {
|
||||
case 403:
|
||||
errorMessage = "fs.delete.err_403";
|
||||
break;
|
||||
case 429:
|
||||
errorMessage = "fs.delete.err_429";
|
||||
break;
|
||||
}
|
||||
}
|
||||
errTxtEl.text(errorMessage);
|
||||
if (!errorMessage){
|
||||
errorMessage = "fs.delete.err_generic";
|
||||
}
|
||||
errTxtEl.removeAttr("data-i18n")
|
||||
errTxtEl.text($.t(errorMessage, {name: itemName}));
|
||||
errDivEl.removeClass("d-none");
|
||||
});
|
||||
}
|
||||
@@ -1371,17 +1443,17 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
let errDivEl = $('#errorMsg');
|
||||
let errTxtEl = $('#errorTxt');
|
||||
if (!newName){
|
||||
errTxtEl.text("New name is required");
|
||||
setI18NData(errTxtEl, "general.name_required");
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
if (newName == oldName){
|
||||
errTxtEl.text("The new name must be different from the current name");
|
||||
setI18NData(errTxtEl, "general.name_different");
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
if (newName.includes("/")){
|
||||
errTxtEl.text('"/" is not allowed in file or directory names');
|
||||
setI18NData(errTxtEl, "fs.invalid_name");
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
@@ -1398,16 +1470,22 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}).then(function (response) {
|
||||
location.reload();
|
||||
}).catch(function (error) {
|
||||
let errorMessage = `Unable to rename "${oldName}"`;
|
||||
let errorMessage;
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
switch (error.response.status) {
|
||||
case 403:
|
||||
errorMessage = "fs.rename.err_403";
|
||||
break;
|
||||
case 429:
|
||||
errorMessage = "fs.rename.err_429";
|
||||
break;
|
||||
}
|
||||
}
|
||||
errTxtEl.text(errorMessage);
|
||||
if (!errorMessage){
|
||||
errorMessage = "fs.rename.err_generic";
|
||||
}
|
||||
errTxtEl.removeAttr("data-i18n")
|
||||
errTxtEl.text($.t(errorMessage, {name: oldName}));
|
||||
errDivEl.removeClass("d-none");
|
||||
});
|
||||
}
|
||||
@@ -1444,12 +1522,12 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
let cancelButton = document.querySelector('#file_manager_cancel_folder');
|
||||
errDivEl.addClass("d-none");
|
||||
if (!dirName){
|
||||
errTxtEl.text("Folder name is required");
|
||||
setI18NData(errTxtEl, "fs.folder_name_required");
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
if (dirName.includes("/")){
|
||||
errTxtEl.text('"/" is not allowed in file or directory names');
|
||||
setI18NData(errTxtEl, "fs.invalid_name");
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
@@ -1470,16 +1548,21 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}).then(function (response) {
|
||||
location.reload();
|
||||
}).catch(function (error) {
|
||||
let errorMessage = "Unable to create the new folder";
|
||||
let errorMessage = "";
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
switch (error.response.status) {
|
||||
case 403:
|
||||
errorMessage = "fs.create_dir.err_403";
|
||||
break;
|
||||
case 429:
|
||||
errorMessage = "fs.create_dir.err_429";
|
||||
break;
|
||||
}
|
||||
}
|
||||
errTxtEl.text(errorMessage);
|
||||
if (!errorMessage){
|
||||
errorMessage = "fs.create_dir.err_generic";
|
||||
}
|
||||
setI18NData(errTxtEl, errorMessage);
|
||||
errDivEl.removeClass("d-none");
|
||||
submitButton.removeAttribute('data-kt-indicator');
|
||||
submitButton.disabled = false;
|
||||
@@ -1523,13 +1606,17 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
try {
|
||||
lastModified = f.lastModified;
|
||||
} catch (e) {
|
||||
console.log("unable to get last modified time from file: " + e.message);
|
||||
console.error("unable to get last modified time from file: " + e.message);
|
||||
lastModified = "";
|
||||
}
|
||||
|
||||
let uploadTxt = f.name;
|
||||
if (files.length > 1){
|
||||
uploadTxt = `Upload ${index+1}/${files.length}: ${uploadTxt}`;
|
||||
uploadTxt = $.t('fs.uploading', {
|
||||
idx: index + 1,
|
||||
total: files.length,
|
||||
name: uploadTxt
|
||||
});
|
||||
}
|
||||
|
||||
$('#loading_message').text(uploadTxt);
|
||||
@@ -1556,18 +1643,23 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
success++;
|
||||
uploadFile();
|
||||
}).catch(function (error) {
|
||||
let errorMessage = "Error uploading files";
|
||||
let errorMessage;
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
switch (error.response.status) {
|
||||
case 403:
|
||||
errorMessage = "fs.upload.err_403";
|
||||
break;
|
||||
case 429:
|
||||
errorMessage = "fs.upload.err_429";
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!errorMessage){
|
||||
errorMessage = "fs.upload.err_generic";
|
||||
}
|
||||
index++;
|
||||
has_errors = true;
|
||||
$('#errorTxt').text(errorMessage);
|
||||
setI18NData($('#errorTxt'), errorMessage);
|
||||
$('#errorMsg').removeClass("d-none");
|
||||
uploadFile();
|
||||
});
|
||||
@@ -1585,8 +1677,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
playerKeepAlive = setInterval(keepAlive, 300000);
|
||||
}
|
||||
|
||||
// On document ready
|
||||
KTUtil.onDOMContentLoaded(function () {
|
||||
$(document).on("i18nshow", function(){
|
||||
KTDatatablesServerSide.init();
|
||||
|
||||
var dropzone = new Dropzone("#upload_files", {
|
||||
@@ -1704,10 +1795,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<span class="path3"></span>
|
||||
</i>
|
||||
</div>
|
||||
<div class="menu menu-sub menu-sub-dropdown menu-column w-350px" data-kt-menu="true">
|
||||
<div class="menu menu-sub menu-sub-dropdown menu-column w-375px" data-kt-menu="true">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title"><span class="text-gray-700 fw-semibold fs-6">Quota usage</span></h3>
|
||||
<h3 class="card-title"><span data-i18n="fs.quota_usage.title" class="text-gray-700 fw-bold fs-6">Quota usage</span></h3>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
{{- if .QuotaUsage.HasDiskQuota}}
|
||||
@@ -1726,14 +1817,18 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-1 pe-3 flex-grow-1">
|
||||
<span class="fs-6 text-gray-900 fw-semibold">Disk quota</span>
|
||||
<span data-i18n="fs.quota_usage.disk" class="fs-6 text-gray-900 fw-semibold">Disk quota</span>
|
||||
{{- if $size}}
|
||||
{{- $percentage := .QuotaUsage.GetQuotaSizePercentage}}
|
||||
<div class="{{if .QuotaUsage.IsQuotaSizeLow}}text-warning{{else}}text-gray-700{{end}} fw-semibold fs-6">Size: {{$size}}{{if gt $percentage 0}} ({{$percentage}}%){{end}}</div>
|
||||
<div class="{{if .QuotaUsage.IsQuotaSizeLow}}text-warning{{else}}text-gray-700{{end}} fw-semibold fs-6">
|
||||
<span {{if gt $percentage 0}}data-i18n="fs.quota_usage.size_percentage" data-i18n-options='{ "val": "{{$size}}", "percentage": {{$percentage}} }'{{else}}data-i18n="fs.quota_usage.size" data-i18n-options='{ "val": "{{$size}}" }'{{end}}></span>
|
||||
</div>
|
||||
{{- end}}
|
||||
{{- if $files}}
|
||||
{{- $percentage := .QuotaUsage.GetQuotaFilesPercentage}}
|
||||
<div class="{{if .QuotaUsage.IsQuotaFilesLow}}text-warning{{else}}text-gray-700{{end}} fw-semibold fs-6">Files: {{$files}}{{if gt $percentage 0}} ({{$percentage}}%){{end}}</div>
|
||||
<div class="{{if .QuotaUsage.IsQuotaFilesLow}}text-warning{{else}}text-gray-700{{end}} fw-semibold fs-6">
|
||||
<span {{if gt $percentage 0}}data-i18n="fs.quota_usage.files_percentage" data-i18n-options='{ "val": "{{$files}}", "percentage": {{$percentage}} }'{{else}}data-i18n="fs.quota_usage.files" data-i18n-options='{ "val": "{{$files}}" }'{{end}}></span>
|
||||
</div>
|
||||
{{- end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1752,18 +1847,27 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</span>
|
||||
</div>
|
||||
<div class="mb-1 pe-3 flex-grow-1">
|
||||
<span class="fs-6 text-gray-900 fw-semibold">Transfer quota</span>
|
||||
<span data-i18n="fs.quota_usage.transfer" class="fs-6 text-gray-900 fw-semibold">Transfer quota</span>
|
||||
{{- if $total}}
|
||||
{{$percentage := .QuotaUsage.GetTotalTransferQuotaPercentage}}
|
||||
<div class="{{if .QuotaUsage.IsTotalTransferQuotaLow}}text-warning{{else}}text-gray-700{{end}} fw-semibold fs-6">Total: {{$total}}{{if gt $percentage 0}} ({{$percentage}}%){{end}}</div>
|
||||
<div class="{{if .QuotaUsage.IsTotalTransferQuotaLow}}text-warning{{else}}text-gray-700{{end}} fw-semibold fs-6">
|
||||
<span {{if gt $percentage 0}}data-i18n="fs.quota_usage.total_percentage" data-i18n-options='{ "val": "{{$total}}", "percentage": {{$percentage}} }'{{else}}data-i18n="fs.quota_usage.total" data-i18n-options='{ "val": "{{$total}}" }'{{end}}>
|
||||
</span>
|
||||
</div>
|
||||
{{- end}}
|
||||
{{- if $download}}
|
||||
{{$percentage := .QuotaUsage.GetDownloadTransferQuotaPercentage}}
|
||||
<div class="{{if .QuotaUsage.IsDownloadTransferQuotaLow}}text-warning{{else}}text-gray-700{{end}} fw-semibold fs-6">Download: {{$download}}{{if gt $percentage 0}} ({{$percentage}}%){{end}}</div>
|
||||
<div class="{{if .QuotaUsage.IsDownloadTransferQuotaLow}}text-warning{{else}}text-gray-700{{end}} fw-semibold fs-6">
|
||||
<span {{if gt $percentage 0}}data-i18n="fs.quota_usage.downloads_percentage" data-i18n-options='{ "val": "{{$download}}", "percentage": {{$percentage}} }'{{else}}data-i18n="fs.quota_usage.downloads" data-i18n-options='{ "val": "{{$download}}" }'{{end}}>
|
||||
</span>
|
||||
</div>
|
||||
{{- end}}
|
||||
{{- if $upload}}
|
||||
{{$percentage := .QuotaUsage.GetUploadTransferQuotaPercentage}}
|
||||
<div class="{{if .QuotaUsage.IsUploadTransferQuotaLow}}text-warning{{else}}text-gray-700{{end}} fw-semibold fs-6">Upload: {{$upload}}{{if gt $percentage 0}} ({{$percentage}}%){{end}}</div>
|
||||
<div class="{{if .QuotaUsage.IsUploadTransferQuotaLow}}text-warning{{else}}text-gray-700{{end}} fw-semibold fs-6">
|
||||
<span {{if gt $percentage 0}}data-i18n="fs.quota_usage.uploads_percentage" data-i18n-options='{ "val": "{{$upload}}", "percentage": {{$percentage}} }'{{else}}data-i18n="fs.quota_usage.uploads" data-i18n-options='{ "val": "{{$upload}}" }'{{end}}>
|
||||
</span>
|
||||
</div>
|
||||
{{- end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1780,8 +1884,8 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="modal-dialog modal-dialog-centered mw-600px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header border-0">
|
||||
<h3 class="modal-title">Upload files</h3>
|
||||
<div class="btn btn-icon btn-sm btn-active-color-primary" data-bs-dismiss="modal" aria-label="Close">
|
||||
<h3 data-i18n="fs.upload.text" class="modal-title">Upload files</h3>
|
||||
<div data-i18n="[aria-label]general.close" class="btn btn-icon btn-sm btn-active-color-primary" data-bs-dismiss="modal" aria-label="Close">
|
||||
<i class="ki-duotone ki-cross fs-1"><span class="path1"></span><span class="path2"></span></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1792,7 +1896,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="dz-message needsclick align-items-center">
|
||||
<i class="ki-duotone ki-file-up fs-3x text-primary"><span class="path1"></span><span class="path2"></span></i>
|
||||
<div class="ms-4">
|
||||
<h3 class="fs-5 fw-bold text-gray-900 mb-1">Drop files here or click to upload.</h3>
|
||||
<h3 data-i18n="fs.upload.message" class="fs-5 fw-bold text-gray-900 mb-1">Drop files here or click to upload.</h3>
|
||||
<!-- <span class="fs-7 fw-semibold text-gray-500">Upload up to 30 files</span> -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -1801,8 +1905,8 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer border-0">
|
||||
<button type="button" class="btn btn-light me-5" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="button" id="upload_files_button" class="btn btn-primary" data-bs-dismiss="modal">Submit</button>
|
||||
<button data-i18n="general.cancel" type="button" class="btn btn-light me-5" data-bs-dismiss="modal">Cancel</button>
|
||||
<button data-i18n="general.submit" type="button" id="upload_files_button" class="btn btn-primary" data-bs-dismiss="modal">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1815,14 +1919,14 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<h5 class="modal-title">
|
||||
<span id="video_title"></span>
|
||||
</h5>
|
||||
<div class="btn btn-icon btn-sm btn-active-color-primary" data-bs-dismiss="modal" aria-label="Close">
|
||||
<div data-i18n="[aria-label]general.close" class="btn btn-icon btn-sm btn-active-color-primary" data-bs-dismiss="modal" aria-label="Close">
|
||||
<i class="ki-duotone ki-cross fs-1"><span class="path1"></span><span class="path2"></span></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<video id="video_player" width="100%" height="auto" controls preload="metadata">
|
||||
Your browser does not support HTML5 video.
|
||||
<span data-i18n="general.html5_media_not_supported"></span>
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1837,7 +1941,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<h5 class="modal-title">
|
||||
<span id="rename_title"></span>
|
||||
</h5>
|
||||
<div class="btn btn-icon btn-sm btn-active-color-primary" data-bs-dismiss="modal" aria-label="Close">
|
||||
<div data-i18n="[aria-label]general.close" class="btn btn-icon btn-sm btn-active-color-primary" data-bs-dismiss="modal" aria-label="Close">
|
||||
<i class="ki-duotone ki-cross fs-1"><span class="path1"></span><span class="path2"></span></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1845,14 +1949,14 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="modal-body">
|
||||
<input id="rename_old_name" type="text" class="d-none"/>
|
||||
<div class="mb-10">
|
||||
<label for="rename_new_name" class="form-label">New name</label>
|
||||
<label data-i18n="fs.rename.new_name" for="rename_new_name" class="form-label"></label>
|
||||
<input id="rename_new_name" type="text" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer border-0">
|
||||
<button type="button" class="btn btn-secondary me-5" data-bs-dismiss="modal">Cancel</button>
|
||||
<button id="id_do_rename_button" type="button" class="btn btn-primary" data-bs-dismiss="modal">Submit</button>
|
||||
<button data-i18n="general.cancel" type="button" class="btn btn-secondary me-5" data-bs-dismiss="modal">Cancel</button>
|
||||
<button data-i18n="general.submit" id="id_do_rename_button" type="button" class="btn btn-primary" data-bs-dismiss="modal">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1862,17 +1966,17 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header border-0">
|
||||
<h3 class="modal-title">
|
||||
<h3 data-i18n="general.choose_target_folder" class="modal-title">
|
||||
Choose target folder
|
||||
</h3>
|
||||
<div class="btn btn-icon btn-sm btn-active-color-primary" data-bs-dismiss="modal" aria-label="Close">
|
||||
<div data-i18n="[aria-label]general.close" class="btn btn-icon btn-sm btn-active-color-primary" data-bs-dismiss="modal" aria-label="Close">
|
||||
<i class="ki-duotone ki-cross fs-1"><span class="path1"></span><span class="path2"></span></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div id="errorModalMsg" class="d-none alert alert-dismissible bg-light-warning d-flex align-items-center p-5 mb-10">
|
||||
<i class="ki-duotone ki-information-5 fs-3x text-warning me-5"><span class="path1"></span><span class="path2"></span><span class="path3"></span></i>
|
||||
<div id="errorModalMsg" class="d-none rounded border-warning border border-dashed bg-light-warning d-flex align-items-center p-5 mb-10">
|
||||
<i class="ki-duotone ki-information fs-3x text-warning me-5"><span class="path1"></span><span class="path2"></span><span class="path3"></span></i>
|
||||
<div class="text-gray-700 fw-bold fs-5 d-flex flex-column pe-0 pe-sm-10">
|
||||
<span id="errorModalTxt"></span>
|
||||
</div>
|
||||
@@ -1893,7 +1997,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<span class="path1"></span>
|
||||
<span class="path2"></span>
|
||||
</i>
|
||||
Add
|
||||
<span data-i18n="general.add"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1904,7 +2008,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<span class="path2"></span>
|
||||
</i>
|
||||
</span>
|
||||
<input id="dirsbrowser_new_folder_input" type="text" name="new_folder_name" placeholder="Enter the new folder name" class="form-control mw-250px me-3" />
|
||||
<input data-i18n="[placeholder]fs.create_folder_msg" id="dirsbrowser_new_folder_input" type="text" name="new_folder_name" placeholder="Enter the new folder name" class="form-control mw-250px me-3" />
|
||||
<button class="btn btn-icon btn-light-primary me-3" id="dirsbrowser_add_folder">
|
||||
<span class="indicator-label">
|
||||
<i class="ki-duotone ki-check fs-1"></i>
|
||||
@@ -1925,7 +2029,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<thead>
|
||||
<tr class="text-start text-muted fw-bold fs-7 text-uppercase gs-0">
|
||||
<th></th>
|
||||
<th class="min-w-250px">Name</th>
|
||||
<th data-i18n="general.name" class="min-w-250px">Name</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="dirsbrowser_list_body" class="text-gray-600 fw-semibold">
|
||||
@@ -1934,26 +2038,26 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
|
||||
<div class="form-floating d-none">
|
||||
<input type="text" class="form-control form-control-solid" id="move_copy_source"/>
|
||||
<label for="move_copy_source">Source name</label>
|
||||
<label data-i18n="general.source_name" for="move_copy_source">Source name</label>
|
||||
</div>
|
||||
|
||||
<div class="form-floating mb-5 mt-7">
|
||||
<input type="text" class="form-control form-control-solid" id="move_copy_folder"/>
|
||||
<label for="move_copy_folder">Target folder</label>
|
||||
<label data-i18n="general.target_folder" for="move_copy_folder">Target folder</label>
|
||||
</div>
|
||||
|
||||
<div class="form-floating" id="move_copy_name_container">
|
||||
<input type="text" class="form-control form-control-solid" id="move_copy_name"/>
|
||||
<label for="move_copy_name">Destination name</label>
|
||||
<label data-i18n="general.dest_name" for="move_copy_name">Destination name</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer border-0">
|
||||
{{- if .CanAddFiles }}
|
||||
<button id="id_copy_button" type="button" class="btn btn-light-primary me-5" data-bs-dismiss="modal">Copy</button>
|
||||
<button data-i18n="fs.copy.msg" id="id_copy_button" type="button" class="btn btn-light-primary me-5" data-bs-dismiss="modal">Copy</button>
|
||||
{{- end}}
|
||||
{{- if .CanRename }}
|
||||
<button id="id_move_button" type="button" class="btn btn-primary" data-bs-dismiss="modal">Move</button>
|
||||
<button data-i18n="fs.move.msg" id="id_move_button" type="button" class="btn btn-primary" data-bs-dismiss="modal">Move</button>
|
||||
{{- end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,8 +15,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{- template "baselogin" .}}
|
||||
|
||||
{{- define "title"}}{{.Title}}{{- end}}
|
||||
|
||||
{{- define "content"}}
|
||||
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
||||
<div class="container mb-10">
|
||||
@@ -34,22 +32,25 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mb-10">
|
||||
<h2 class="text-gray-900 mb-3">
|
||||
<h2 data-i18n="login.forgot_password" class="text-gray-900 mb-3">
|
||||
Forgot Password ?
|
||||
</h2>
|
||||
<div class="text-gray-600 fw-semibold fs-4">
|
||||
Enter your account username below, you will receive a password reset code by email.
|
||||
<span data-i18n="login.forgot_password_msg">
|
||||
Enter your account username below, you will receive a password reset code by email.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{{template "errmsg" .Error}}
|
||||
<div class="fv-row mb-10">
|
||||
<input class="form-control form-control-lg form-control-solid" type="text" placeholder="Your username" name="username" spellcheck="false" required />
|
||||
<input data-i18n="[placeholder]login.your_username" class="form-control form-control-lg form-control-solid" type="text" placeholder="Your username" name="username" spellcheck="false" required />
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
||||
<button type="submit" id="sign_in_submit" class="btn btn-lg btn-primary w-100 mb-5">
|
||||
<span class="indicator-label">Send Reset Code</span>
|
||||
<span class="indicator-progress">Please wait...
|
||||
<span data-i18n="login.send_reset_code" class="indicator-label">Send Reset Code</span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
@@ -15,8 +15,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{- template "baselogin" .}}
|
||||
|
||||
{{- define "title"}}Login{{- end}}
|
||||
|
||||
{{- define "content"}}
|
||||
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
||||
<div class="container mb-10">
|
||||
@@ -34,13 +32,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
{{template "errmsg" .Error}}
|
||||
{{- if not .FormDisabled}}
|
||||
<div class="fv-row mb-10">
|
||||
<input class="form-control form-control-lg form-control-solid" type="text" name="username" placeholder="Username" spellcheck="false" required />
|
||||
<input data-i18n="[placeholder]login.username" class="form-control form-control-lg form-control-solid" type="text" name="username" placeholder="Username" spellcheck="false" required />
|
||||
</div>
|
||||
<div class="fv-row mb-10">
|
||||
<input class="form-control form-control-lg form-control-solid" type="password" name="password" placeholder="Password" autocomplete="current-password" spellcheck="false" required />
|
||||
<input data-i18n="[placeholder]login.password" class="form-control form-control-lg form-control-solid" type="password" name="password" placeholder="Password" autocomplete="current-password" spellcheck="false" required />
|
||||
<div class="d-flex justify-content-end mt-2">
|
||||
{{- if .ForgotPwdURL}}
|
||||
<a href="{{.ForgotPwdURL}}" class="link-primary fs-6 fw-bold">Forgot Password ?</a>
|
||||
<a data-i18n="login.forgot_password" href="{{.ForgotPwdURL}}" class="link-primary fs-6 fw-bold">Forgot Password ?</a>
|
||||
{{- end}}
|
||||
</div>
|
||||
</div>
|
||||
@@ -49,18 +47,19 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
{{- if not .FormDisabled}}
|
||||
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
||||
<button type="submit" id="sign_in_submit" class="btn btn-lg btn-primary w-100 mb-5">
|
||||
<span class="indicator-label">Sign in</span>
|
||||
<span class="indicator-progress">Please wait...
|
||||
<span data-i18n="login.signin" class="indicator-label">Sign in</span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
{{- end}}
|
||||
{{- if .OpenIDLoginURL}}
|
||||
{{- if not .FormDisabled}}
|
||||
<div class="text-center text-muted text-uppercase fw-bold mb-5">or</div>
|
||||
<div data-i18n="general.or" class="text-center text-muted text-uppercase fw-bold mb-5">or</div>
|
||||
{{- end}}
|
||||
<a href="{{.OpenIDLoginURL}}" class="btn btn-flex flex-center btn-light btn-lg w-100 mb-5">
|
||||
<img alt="Logo" src="{{.StaticURL}}/img/openid-logo.png" class="h-20px me-3" />Sign in with OpenID</a>
|
||||
<img data-i18n="login.signin_openid" alt="Logo" src="{{.StaticURL}}/img/openid-logo.png" class="h-20px me-3" />Sign in with OpenID</a>
|
||||
{{- end}}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -15,7 +15,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{template "base" .}}
|
||||
|
||||
{{- define "title"}}{{.Title}}{{- end}}
|
||||
{{- define "page_body"}}
|
||||
<div class="d-flex flex-center flex-column flex-column-fluid p-10 pb-lg-20">
|
||||
{{- if not .LoggedUser.Username}}
|
||||
@@ -41,7 +40,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
{{- end}}
|
||||
<div class="card shadow-sm w-lg-600px">
|
||||
<div class="card-header bg-light">
|
||||
<h3 class="card-title text-primary">{{.Title}}</h3>
|
||||
<h3 data-i18n="{{.Title}}" class="card-title text-primary"></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{- if .Error}}
|
||||
@@ -54,7 +53,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="d-flex flex-stack flex-grow-1 ">
|
||||
<div class=" fw-semibold">
|
||||
<div class="fs-5 text-gray-800">
|
||||
{{.Error}}
|
||||
<span data-i18n="{{.Error}}"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,7 +69,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="d-flex flex-stack flex-grow-1 ">
|
||||
<div class=" fw-semibold">
|
||||
<div class="fs-5 text-gray-800">
|
||||
{{.Success}}
|
||||
<span data-i18n="{{.Success}}"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,12 +15,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{template "base" .}}
|
||||
|
||||
{{define "title"}}{{.Title}}{{end}}
|
||||
|
||||
{{- define "page_body"}}
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-light">
|
||||
<h3 class="card-title text-primary">Two-factor authentication using Authenticator apps</h3>
|
||||
<h3 data-i18n="2fa.title" class="card-title text-primary">Two-factor authentication using Authenticator apps</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="notice d-flex bg-light-primary rounded border-primary border border-dashed p-6 mb-5">
|
||||
@@ -32,23 +30,26 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="mb-3 mb-md-0 fw-semibold">
|
||||
<h4 class="text-gray-900 fw-bold">
|
||||
{{- if .TOTPConfig.Enabled}}
|
||||
Two-factor authentication is enabled {{- if gt (len .TOTPConfigs) 1 }}. Configuration: "{{$.TOTPConfig.ConfigName}}" {{- end}}
|
||||
<span data-i18n="2fa.msg_enabled">Two-factor authentication is enabled</span> {{- if gt (len .TOTPConfigs) 1 }} ({{$.TOTPConfig.ConfigName}}) {{- end}}
|
||||
{{- else}}
|
||||
Secure Your Account
|
||||
<span data-i18n="2fa.msg_disabled">Secure Your Account</span>
|
||||
{{- end}}
|
||||
</h4>
|
||||
<div class="fs-6 text-gray-800 pe-7">
|
||||
Two-factor authentication adds an extra layer of security to your account. To log in you'll need
|
||||
to provide an additional authentication code.
|
||||
<span data-i18n="2fa.msg_info">
|
||||
Two-factor authentication adds an extra layer of security to your account. To log in you'll need
|
||||
to provide an additional authentication code.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{{- if .TOTPConfig.Enabled}}
|
||||
<button type="button" id="disable_btn" class="btn btn-danger ms-4 px-6 align-self-center text-nowrap">
|
||||
<span class="indicator-label">
|
||||
<span data-i18n="general.disable" class="indicator-label">
|
||||
Disable
|
||||
</span>
|
||||
<span class="indicator-progress">
|
||||
Please wait... <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
{{- end}}
|
||||
@@ -58,10 +59,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
{{- template "errmsg" ""}}
|
||||
|
||||
<div class="form-group row mt-10">
|
||||
<label class="col-md-3 col-form-label">Configuration</label>
|
||||
<label data-i18n="general.configuration" class="col-md-3 col-form-label">Configuration</label>
|
||||
<div class="col-md-9">
|
||||
<select id="id_config" name="config_name" class="form-select" data-control="select2" data-hide-search="true">
|
||||
<option value="">None</option>
|
||||
<select id="id_config" name="config_name" class="form-select" data-control="i18n-select2" data-hide-search="true">
|
||||
<option data-i18n="general.none" value="">None</option>
|
||||
{{range .TOTPConfigs}}
|
||||
<option value="{{.}}" {{if eq . $.TOTPConfig.ConfigName}}selected{{end}}>{{.}}</option>
|
||||
{{end}}
|
||||
@@ -70,11 +71,11 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-10">
|
||||
<label class="col-md-3 col-form-label required">
|
||||
<label data-i18n="2fa.require_for" class="col-md-3 col-form-label required">
|
||||
Require 2FA for
|
||||
</label>
|
||||
<div class="col-md-9">
|
||||
<select id="id_protocols" name="multi_factor_protocols" class="form-select" data-control="select2" data-hide-search="true" data-close-on-select="false" multiple="multiple">
|
||||
<select id="id_protocols" name="multi_factor_protocols" class="form-select" data-control="i18n-select2" data-hide-search="true" data-close-on-select="false" multiple="multiple">
|
||||
<option></option>
|
||||
{{range $protocol := .Protocols}}
|
||||
<option value="{{$protocol}}" {{range $p :=$.TOTPConfig.Protocols }}{{if eq $p $protocol}}selected{{end}}{{end}}>{{$protocol}}
|
||||
@@ -87,18 +88,20 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="d-flex justify-content-end mt-15">
|
||||
{{- if .TOTPConfig.Enabled }}
|
||||
<button type="button" id="generate_secret_btn" class="btn btn-light-primary px-10 me-10 d-none">
|
||||
<span class="indicator-label">
|
||||
<span data-i18n="2fa.generate" class="indicator-label">
|
||||
Generate new secret
|
||||
</span>
|
||||
<span class="indicator-progress">
|
||||
Please wait... <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
{{- end}}
|
||||
<button type="button" id="save_btn" class="btn btn-primary px-10 d-none">
|
||||
<span id="save_label" class="indicator-label"></span>
|
||||
<span class="indicator-progress">
|
||||
Please wait... <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -114,27 +117,29 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</i>
|
||||
<div class="d-flex flex-stack flex-grow-1 flex-wrap flex-md-nowrap">
|
||||
<div class="mb-3 mb-md-0 fw-semibold">
|
||||
<h4 class="text-gray-900 fw-bold">
|
||||
<h4 data-i18n="2fa.recovery_codes" class="text-gray-900 fw-bold">
|
||||
Recovery codes
|
||||
</h4>
|
||||
<div class="fs-6 text-gray-800">
|
||||
<p>Recovery codes are a set of one time use codes that can be used in place of the authentication code to login to the web UI. You can use them if you lose access to your phone to login to your account and disable or regenerate two-factor configuration.</p>
|
||||
<p>To keep your account secure, don't share or distribute your recovery codes. We recommend saving them with a secure password manager.</p>
|
||||
<p>If you generate new recovery codes, you automatically invalidate old ones.</p>
|
||||
<p data-i18n="2fa.recovery_codes_msg1">Recovery codes are a set of one time use codes that can be used in place of the authentication code to login to the web UI. You can use them if you lose access to your phone to login to your account and disable or regenerate two-factor configuration.</p>
|
||||
<p data-i18n="2fa.recovery_codes_msg2">To keep your account secure, don't share or distribute your recovery codes. We recommend saving them with a secure password manager.</p>
|
||||
<p data-i18n="2fa.recovery_codes_msg3">If you generate new recovery codes, you automatically invalidate old ones.</p>
|
||||
</div>
|
||||
<div class="d-flex justify-content-center mt-10">
|
||||
<button type="button" id="generate_recovery_code_btn" class="btn btn-primary px-10 me-10">
|
||||
<span class="indicator-label">
|
||||
<span data-i18n="general.generate" class="indicator-label">
|
||||
Generate
|
||||
</span>
|
||||
<span class="indicator-progress">
|
||||
Please wait... <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
<button type="button" id="view_recovery_code_btn" class="btn btn-primary px-10">
|
||||
<span id="save_label" class="indicator-label">View</span>
|
||||
<span class="indicator-progress">
|
||||
Please wait... <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
<span data-i18n="general.view" id="save_label" class="indicator-label">View</span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -162,17 +167,16 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 id="idRecoveryCodesTitle" class="modal-title"></h3>
|
||||
<div class="btn btn-icon btn-sm btn-active-color-primary ms-2" data-bs-dismiss="modal" aria-label="Close">
|
||||
<div data-i18n="[aria-label]general.close" class="btn btn-icon btn-sm btn-active-color-primary ms-2" data-bs-dismiss="modal" aria-label="Close">
|
||||
<i class="ki-duotone ki-cross fs-1"><span class="path1"></span><span class="path2"></span></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="idRecoveryCodesList" class="d-flex flex-column">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary" type="button" data-bs-dismiss="modal">OK</button>
|
||||
<button data-i18n="general.ok" class="btn btn-primary" type="button" data-bs-dismiss="modal">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -182,23 +186,22 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Learn about two-factor authentication</h3>
|
||||
<div class="btn btn-icon btn-sm btn-active-color-primary ms-2" data-bs-dismiss="modal" aria-label="Close">
|
||||
<h3 data-i18n="2fa.info_title" class="modal-title">Learn about two-factor authentication</h3>
|
||||
<div data-i18n="[aria-label]general.close" class="btn btn-icon btn-sm btn-active-color-primary ms-2" data-bs-dismiss="modal" aria-label="Close">
|
||||
<i class="ki-duotone ki-cross fs-1"><span class="path1"></span><span class="path2"></span></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body fw-semibold fs-6">
|
||||
<p>SSH protocol (SFTP/SCP/SSH commands) will ask for the passcode if the client uses keyboard interactive
|
||||
authentication.</p>
|
||||
<p>HTTP protocol means Web UI and REST APIs. Web UI will ask for the passcode using a specific page. For REST API
|
||||
<p data-i18n="2fa.info1">SSH protocol (SFTP/SCP/SSH commands) will ask for the passcode if the client uses keyboard interactive authentication.</p>
|
||||
<p data-i18n="2fa.info2">HTTP protocol means Web UI and REST APIs. Web UI will ask for the passcode using a specific page. For REST API
|
||||
you have to add the passcode using an HTTP header.</p>
|
||||
<p>FTP has no standard way to support two factor authentication, if you enable the FTP support, you have to add the
|
||||
<p data-i18n="2fa.info3">FTP has no standard way to support two factor authentication, if you enable the FTP support, you have to add the
|
||||
TOTP passcode after the password. For example if your password is "password" and your one time passcode is
|
||||
"123456" you have to use "password123456" as password.</p>
|
||||
<p>WebDAV is not supported since each single request must be authenticated and a passcode cannot be reused.</p>
|
||||
<p data-i18n="2fa.info4">WebDAV is not supported since each single request must be authenticated and a passcode cannot be reused.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary" type="button" data-bs-dismiss="modal">OK</button>
|
||||
<button data-i18n="general.ok" class="btn btn-primary" type="button" data-bs-dismiss="modal">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -208,14 +211,16 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Set up two-factor authentication</h3>
|
||||
<div class="btn btn-icon btn-sm btn-active-color-primary ms-2" data-bs-dismiss="modal" aria-label="Close">
|
||||
<h3 data-i18n="2fa.setup_title" class="modal-title">Set up two-factor authentication</h3>
|
||||
<div data-i18n="[aria-label]general.close" class="btn btn-icon btn-sm btn-active-color-primary ms-2" data-bs-dismiss="modal" aria-label="Close">
|
||||
<i class="ki-duotone ki-cross fs-1"><span class="path1"></span><span class="path2"></span></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body scroll-y pt-10 pb-15 px-lg-17">
|
||||
<div class="text-gray-700 fw-semibold fs-6 mb-10">
|
||||
Use your preferred Authenticator App (e.g. Microsoft Authenticator, Google Authenticator, Authy, 1Password etc. ) to scan the QR code. It will generate an authentication code for you to enter below.
|
||||
<span data-i18n="2fa.setup_msg">
|
||||
Use your preferred Authenticator App (e.g. Microsoft Authenticator, Google Authenticator, Authy, 1Password etc. ) to scan the QR code. It will generate an authentication code for you to enter below.
|
||||
</span>
|
||||
</div>
|
||||
<div id="id_qr_code_container" class="pt-5 text-center">
|
||||
</div>
|
||||
@@ -227,15 +232,16 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</i>
|
||||
<div class="d-flex flex-stack flex-grow-1">
|
||||
<div class="fw-semibold">
|
||||
<div class="fs-6 text-gray-800">If you have trouble using the QR code, select manual entry on your app, and enter the code:
|
||||
<div class="fs-6 text-gray-800">
|
||||
<span data-i18n="2fa.setup_help">If you have trouble using the QR code, select manual entry on your app, and enter the code:</span>
|
||||
<span id="id_secret" class="fw-bold text-gray-900 pt-2"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="errorModalMsg" class="d-none alert alert-dismissible bg-light-warning d-flex align-items-center p-5 mb-10">
|
||||
<i class="ki-duotone ki-information-5 fs-3x text-warning me-5"><span class="path1"></span><span class="path2"></span><span class="path3"></span></i>
|
||||
<div id="errorModalMsg" class="d-none rounded border-warning border border-dashed bg-light-warning d-flex align-items-center p-5 mb-10">
|
||||
<i class="ki-duotone ki-information fs-3x text-warning me-5"><span class="path1"></span><span class="path2"></span><span class="path3"></span></i>
|
||||
<div class="text-gray-700 fw-bold fs-5 d-flex flex-column pe-0 pe-sm-10">
|
||||
<span id="errorModalTxt"></span>
|
||||
</div>
|
||||
@@ -245,17 +251,18 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
|
||||
<div class="fv-row">
|
||||
<input type="text" id="id_passcode" name="passcode" class="form-control form-control-lg form-control-solid" placeholder="Enter authentication code" spellcheck="false" />
|
||||
<input data-i18n="[placeholder]login.auth_code" type="text" id="id_passcode" name="passcode" class="form-control form-control-lg form-control-solid" placeholder="Enter authentication code" spellcheck="false" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button data-i18n="general.cancel" type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
<button type="button" class="btn btn-primary ms-6" id="passcode_btn">
|
||||
<span class="indicator-label">
|
||||
<span data-i18n="general.submit" class="indicator-label">
|
||||
Submit
|
||||
</span>
|
||||
<span class="indicator-progress">
|
||||
Please wait... <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -277,15 +284,15 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
} else {
|
||||
//{{- if .TOTPConfig.Enabled }}
|
||||
if (selectedConfig == "{{.TOTPConfig.ConfigName}}"){
|
||||
$('#save_label').text("Save");
|
||||
$('#save_label').text($.t('general.submit'));
|
||||
} else {
|
||||
$('#save_label').text("Enable");
|
||||
$('#save_label').text($.t('general.enable'));
|
||||
}
|
||||
$('#save_btn').removeClass("d-none");
|
||||
$('#generate_secret_btn').removeClass("d-none");
|
||||
//{{- else}}
|
||||
$('#save_btn').removeClass("d-none");
|
||||
$('#save_label').text("Enable");
|
||||
$('#save_label').text($.t('general.enable'));
|
||||
$('#generate_secret_btn').addClass("d-none");
|
||||
//{{- end}}
|
||||
}
|
||||
@@ -307,7 +314,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}).then(function (response){
|
||||
el.removeAttribute('data-kt-indicator');
|
||||
el.disabled = false;
|
||||
$('#idRecoveryCodesTitle').text("New recovery codes");
|
||||
$('#idRecoveryCodesTitle').text($.t('2fa.new_recovery_codes'));
|
||||
let recList = $('#idRecoveryCodesList');
|
||||
recList.empty();
|
||||
$.each(response.data, function(key, item) {
|
||||
@@ -318,19 +325,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}).catch(function (error){
|
||||
el.removeAttribute('data-kt-indicator');
|
||||
el.disabled = false;
|
||||
let errorMessage = "Failed to generate new recovery codes";
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
}
|
||||
}
|
||||
ModalAlert.fire({
|
||||
text: errorMessage,
|
||||
text: $.t('2fa.recovery_codes_gen_err'),
|
||||
icon: "warning",
|
||||
confirmButtonText: "OK",
|
||||
confirmButtonText: $.t('general.ok'),
|
||||
customClass: {
|
||||
confirmButton: "btn btn-danger"
|
||||
}
|
||||
@@ -354,7 +352,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}).then(function (response){
|
||||
el.removeAttribute('data-kt-indicator');
|
||||
el.disabled = false;
|
||||
$('#idRecoveryCodesTitle').text("Recovery codes");
|
||||
$('#idRecoveryCodesTitle').text($.t('2fa.recovery_codes'));
|
||||
let recList = $('#idRecoveryCodesList');
|
||||
recList.empty();
|
||||
$.each(response.data, function(key, item) {
|
||||
@@ -369,19 +367,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}).catch(function (error){
|
||||
el.removeAttribute('data-kt-indicator');
|
||||
el.disabled = false;
|
||||
let errorMessage = "Failed to get your recovery codes";
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
}
|
||||
}
|
||||
ModalAlert.fire({
|
||||
text: errorMessage,
|
||||
text: $.t('2fa.recovery_codes_get_err'),
|
||||
icon: "warning",
|
||||
confirmButtonText: "OK",
|
||||
confirmButtonText: $.t('general.ok'),
|
||||
customClass: {
|
||||
confirmButton: "btn btn-danger"
|
||||
}
|
||||
@@ -391,10 +380,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
|
||||
function disableConfig() {
|
||||
ModalAlert.fire({
|
||||
text: `Do you want to disable two-factor authentication?`,
|
||||
text: $.t('2fa.disable_question'),
|
||||
icon: "warning",
|
||||
confirmButtonText: "Confirm",
|
||||
cancelButtonText: 'Cancel',
|
||||
confirmButtonText: $.t('general.confirm'),
|
||||
cancelButtonText: $.t('general.cancel'),
|
||||
customClass: {
|
||||
confirmButton: "btn btn-danger",
|
||||
cancelButton: 'btn btn-secondary'
|
||||
@@ -410,12 +399,12 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
el = document.querySelector('#passcode_btn');
|
||||
let errDivEl = $('#errorModalMsg');
|
||||
let errTxtEl = $('#errorModalTxt');
|
||||
let errorMessage = "Failed to validate the provided authentication code";
|
||||
let errorMessage = '2fa.auth_code_invalid';
|
||||
let passcode = $('#id_passcode').val();
|
||||
|
||||
errDivEl.addClass("d-none");
|
||||
if (passcode == "") {
|
||||
errTxtEl.text("The authentication code is required");
|
||||
setI18NData(errTxtEl, '2fa.auth_code_required');
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
@@ -438,7 +427,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
el.removeAttribute('data-kt-indicator');
|
||||
el.disabled = false;
|
||||
if (!response.data.message) {
|
||||
errTxtEl.text(errorMessage);
|
||||
setI18NData(errTxtEl, errorMessage);
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
@@ -447,25 +436,17 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}).catch(function (error){
|
||||
el.removeAttribute('data-kt-indicator');
|
||||
el.disabled = false;
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
}
|
||||
}
|
||||
errTxtEl.text(errorMessage);
|
||||
setI18NData(errTxtEl, errorMessage);
|
||||
errDivEl.removeClass("d-none");
|
||||
});
|
||||
}
|
||||
|
||||
function confirmGenerateSecret() {
|
||||
ModalAlert.fire({
|
||||
text: `Do you want to generate a new secret and invalidate the previous one? Any registered Authenticator App will stop working`,
|
||||
text: $.t('2fa.generate_question'),
|
||||
icon: "warning",
|
||||
confirmButtonText: "Confirm",
|
||||
cancelButtonText: 'Cancel',
|
||||
confirmButtonText: $.t('general.confirm'),
|
||||
cancelButtonText: $.t('general.cancel'),
|
||||
customClass: {
|
||||
confirmButton: "btn btn-danger",
|
||||
cancelButton: 'btn btn-secondary'
|
||||
@@ -488,12 +469,12 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
let errDivEl = $('#errorMsg');
|
||||
let errTxtEl = $('#errorTxt');
|
||||
if ($('#id_protocols').find('option:selected').length == 0){
|
||||
errTxtEl.text("Please select at least a protocol");
|
||||
setI18NData(errTxtEl, '2fa.no_protocol');
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
|
||||
let errorMessage = "Failed to generate authentication secret";
|
||||
let errorMessage = '2fa.auth_secret_gen_err';
|
||||
|
||||
$('#id_secret').text("");
|
||||
errDivEl.addClass("d-none");
|
||||
@@ -514,7 +495,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
el.removeAttribute('data-kt-indicator');
|
||||
el.disabled = false;
|
||||
if (!response.data.secret) {
|
||||
errTxtEl.text(errorMessage);
|
||||
setI18NData(errTxtEl, errorMessage);
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
@@ -526,21 +507,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
let qrCodeImg = document.createElement("img");
|
||||
qrCodeImg.classList.add("mw-150px");
|
||||
qrCodeImg.src = "{{.MFAURL}}/qrcode?url="+encodeURIComponent(response.data.url);
|
||||
qrCodeImg.alt = "QR code";
|
||||
qrCodeImg.alt = $.t('general.qr_code');
|
||||
qrCodeContainer.appendChild(qrCodeImg);
|
||||
qrModal.show();
|
||||
}).catch(function (error){
|
||||
el.removeAttribute('data-kt-indicator');
|
||||
el.disabled = false;
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
}
|
||||
}
|
||||
errTxtEl.text(errorMessage);
|
||||
setI18NData(errTxtEl, errorMessage);
|
||||
errDivEl.removeClass("d-none");
|
||||
});
|
||||
}
|
||||
@@ -554,13 +527,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}
|
||||
let errDivEl = $('#errorMsg');
|
||||
let errTxtEl = $('#errorTxt');
|
||||
let errorMessage = "Failed to save configuration";
|
||||
let errorMessage = '2fa.save_err';
|
||||
let protocolsArray = [];
|
||||
$('#id_protocols').find('option:selected').each(function(){
|
||||
protocolsArray.push($(this).val());
|
||||
});
|
||||
if (protocolsArray.length == 0){
|
||||
errTxtEl.text("Please select at least a protocol");
|
||||
setI18NData(errTxtEl, '2fa.no_protocol');
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
@@ -595,14 +568,14 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
el.removeAttribute('data-kt-indicator');
|
||||
el.disabled = false;
|
||||
if (!response.data.message) {
|
||||
errTxtEl.text(errorMessage);
|
||||
setI18NData(errTxtEl, errorMessage);
|
||||
errDivEl.removeClass("d-none");
|
||||
return;
|
||||
}
|
||||
ModalAlert.fire({
|
||||
text: `Configuration saved`,
|
||||
text: $.t('general.config_saved'),
|
||||
icon: "success",
|
||||
confirmButtonText: "OK",
|
||||
confirmButtonText: $.t('general.ok'),
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-primary'
|
||||
}
|
||||
@@ -615,14 +588,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
el.removeAttribute('data-kt-indicator');
|
||||
el.disabled = false;
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
switch (error.response.status) {
|
||||
case 400:
|
||||
errorMessage = "2fa.save_err_proto";
|
||||
break;
|
||||
}
|
||||
}
|
||||
errTxtEl.text(errorMessage);
|
||||
setI18NData(errTxtEl, errorMessage);
|
||||
errDivEl.removeClass("d-none");
|
||||
});
|
||||
|
||||
@@ -638,7 +610,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
generateSecret(saveBtn, selectedConfig);
|
||||
}
|
||||
|
||||
KTUtil.onDOMContentLoaded(function () {
|
||||
$(document).on("i18nshow", function(){
|
||||
onConfigChanged();
|
||||
|
||||
var dismissErrorModalBtn = $('#id_dismiss_error_modal_msg');
|
||||
|
||||
@@ -15,18 +15,16 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{template "base" .}}
|
||||
|
||||
{{define "title"}}{{.Title}}{{end}}
|
||||
|
||||
{{- define "page_body"}}
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-light">
|
||||
<h3 class="card-title text-primary">My profile - {{.LoggedUser.Username}}</h3>
|
||||
<h3 data-i18n="general.my_profile" class="card-title text-primary">My profile</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{- template "errmsg" .Error}}
|
||||
<form id="page_form" action="{{.CurrentURL}}" method="POST">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label">Email</label>
|
||||
<label data-i18n="general.email" class="col-md-3 col-form-label">Email</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" id="idEmail" name="email" placeholder="" spellcheck="false"
|
||||
value="{{.Email}}" maxlength="255" autocomplete="nope" {{if not .LoggedUser.CanChangeInfo}}readonly{{end}}>
|
||||
@@ -34,7 +32,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-10">
|
||||
<label class="col-md-3 col-form-label">Description</label>
|
||||
<label data-i18n="general.description" class="col-md-3 col-form-label">Description</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" id="idDescription" name="description" placeholder=""
|
||||
value="{{.Description}}" maxlength="255" {{if not .LoggedUser.CanChangeInfo}}readonly{{end}}>
|
||||
@@ -42,11 +40,11 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
|
||||
<div class="form-group row align-items-center mt-10">
|
||||
<label class="col-md-3 col-form-label">API key authentication</label>
|
||||
<label data-i18n="general.api_key_auth" class="col-md-3 col-form-label">API key authentication</label>
|
||||
<div class="col-md-9">
|
||||
<div class="form-check form-switch form-check-custom form-check-solid">
|
||||
<input class="form-check-input" type="checkbox" id="idAllowAPIKeyAuth" name="allow_api_key_auth" {{if not .LoggedUser.CanChangeAPIKeyAuth}}disabled="disabled"{{end}} {{if .AllowAPIKeyAuth}}checked="checked"{{end}}/>
|
||||
<label class="form-check-label fw-semibold text-gray-800" for="idAllowAPIKeyAuth">
|
||||
<label data-i18n="general.api_key_auth_help" class="form-check-label fw-semibold text-gray-800" for="idAllowAPIKeyAuth">
|
||||
Allow to impersonate yourself, in REST API, using an API key
|
||||
</label>
|
||||
</div>
|
||||
@@ -56,7 +54,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
{{- if .LoggedUser.CanManagePublicKeys}}
|
||||
<div class="card card-rounded mt-10">
|
||||
<div class="card-header bg-light">
|
||||
<h3 class="card-title">Public keys</h3>
|
||||
<h3 data-i18n="general.pub_keys" class="card-title">Public keys</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="public_keys">
|
||||
@@ -66,11 +64,11 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div data-repeater-item>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-9">
|
||||
<textarea class="form-control mt-3 mt-md-8" name="public_key" rows="4"
|
||||
<textarea data-i18n="[placeholder]general.pub_key_placeholder" class="form-control mt-3 mt-md-8" name="public_key" rows="4"
|
||||
placeholder="Paste your public key here">{{$val}}</textarea>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a href="#" data-repeater-delete
|
||||
<a data-i18n="general.delete" href="#" data-repeater-delete
|
||||
class="btn btn-light-danger mt-3 mt-md-8">
|
||||
<i class="ki-duotone ki-trash fs-5">
|
||||
<span class="path1"></span>
|
||||
@@ -88,11 +86,11 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div data-repeater-item>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-9">
|
||||
<textarea class="form-control mt-3 mt-md-8" name="public_key" rows="4"
|
||||
<textarea data-i18n="[placeholder]general.pub_key_placeholder" class="form-control mt-3 mt-md-8" name="public_key" rows="4"
|
||||
placeholder="Paste your public key here"></textarea>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a href="#" data-repeater-delete
|
||||
<a data-i18n="general.delete" href="#" data-repeater-delete
|
||||
class="btn btn-light-danger mt-3 mt-md-8">
|
||||
<i class="ki-duotone ki-trash fs-5">
|
||||
<span class="path1"></span>
|
||||
@@ -111,7 +109,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-5">
|
||||
<a href="#" data-repeater-create class="btn btn-light-primary">
|
||||
<a data-i18n="general.add" href="#" data-repeater-create class="btn btn-light-primary">
|
||||
<i class="ki-duotone ki-plus fs-3"></i>
|
||||
Add
|
||||
</a>
|
||||
@@ -123,11 +121,12 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="d-flex justify-content-end mt-12">
|
||||
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
||||
<button type="submit" id="form_submit" class="btn btn-primary px-10">
|
||||
<span class="indicator-label">
|
||||
<span data-i18n="general.submit" class="indicator-label">
|
||||
Submit
|
||||
</span>
|
||||
<span class="indicator-progress">
|
||||
Please wait... <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -15,8 +15,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{- template "baselogin" .}}
|
||||
|
||||
{{- define "title"}}{{.Title}}{{- end}}
|
||||
|
||||
{{- define "content"}}
|
||||
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
||||
<div class="container mb-10">
|
||||
@@ -34,28 +32,31 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mb-10">
|
||||
<h2 class="text-gray-900 mb-3">
|
||||
<h2 data-i18n="login.reset_password" class="text-gray-900 mb-3">
|
||||
Reset Password
|
||||
</h2>
|
||||
<div class="text-gray-600 fw-semibold fs-4">
|
||||
Check your email for the confirmation code
|
||||
<span data-i18n="login.reset_pwd_msg">
|
||||
Check your email for the confirmation code
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{{template "errmsg" .Error}}
|
||||
<div class="fv-row mb-10">
|
||||
<input class="form-control form-control-lg form-control-solid" type="text" placeholder="Confirmation code" name="code" spellcheck="false" required />
|
||||
<input data-i18n="[placeholder]login.confirm_code" class="form-control form-control-lg form-control-solid" type="text" placeholder="Confirmation code" name="code" spellcheck="false" required />
|
||||
</div>
|
||||
<div class="fv-row mb-10">
|
||||
<input class="form-control form-control-lg form-control-solid" type="password" name="password" placeholder="New Password" autocomplete="new-password" spellcheck="false" required />
|
||||
<input data-i18n="[placeholder]general.new_password" class="form-control form-control-lg form-control-solid" type="password" name="password" placeholder="New Password" autocomplete="new-password" spellcheck="false" required />
|
||||
</div>
|
||||
<div class="fv-row mb-10">
|
||||
<input class="form-control form-control-lg form-control-solid" type="password" name="confirm_password" placeholder="Confirm Password" autocomplete="new-password" spellcheck="false" required />
|
||||
<input data-i18n="[placeholder]general.confirm_password" class="form-control form-control-lg form-control-solid" type="password" name="confirm_password" placeholder="Confirm Password" autocomplete="new-password" spellcheck="false" required />
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
||||
<button type="submit" id="sign_in_submit" class="btn btn-lg btn-primary w-100 mb-5">
|
||||
<span class="indicator-label">Update Password & Login</span>
|
||||
<span class="indicator-progress">Please wait...
|
||||
<span data-i18n="login.reset_submit" class="indicator-label">Update Password & Login</span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
@@ -15,18 +15,16 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{template "base" .}}
|
||||
|
||||
{{define "title"}}{{.Title}}{{end}}
|
||||
|
||||
{{- define "page_body"}}
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-light">
|
||||
<h3 class="card-title text-primary">{{if .IsAdd}}Add a new share{{else}}Edit share{{end}}</h3>
|
||||
<h3 {{if .IsAdd}}data-i18n="title.add_share"{{else}}data-i18n="title.update_share"{{end}} class="card-title text-primary"></h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{- template "errmsg" .Error}}
|
||||
<form id="share_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-3 col-form-label">Name</label>
|
||||
<label data-i18n="general.name" class="col-md-3 col-form-label">Name</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" placeholder="" name="name" value="{{.Share.Name}}"
|
||||
maxlength="255" autocomplete="nope" required {{if not .IsAdd}}readonly{{end}} />
|
||||
@@ -34,22 +32,22 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-10">
|
||||
<label class="col-md-3 col-form-label">Scope</label>
|
||||
<label data-i18n="share.scope" class="col-md-3 col-form-label">Scope</label>
|
||||
<div class="col-md-9">
|
||||
<select name="scope" class="form-select" data-control="select2" data-hide-search="true">
|
||||
<option value="1" {{if eq .Share.Scope 1 }}selected{{end}}>Read</option>
|
||||
<option value="2" {{if eq .Share.Scope 2 }}selected{{end}}>Write</option>
|
||||
<option value="3" {{if eq .Share.Scope 3 }}selected{{end}}>Read/Write</option>
|
||||
<select name="scope" class="form-select" data-control="i18n-select2" data-hide-search="true">
|
||||
<option data-i18n="share.scope_read" value="1" {{if eq .Share.Scope 1 }}selected{{end}}>Read</option>
|
||||
<option data-i18n="share.scope_write" value="2" {{if eq .Share.Scope 2 }}selected{{end}}>Write</option>
|
||||
<option data-i18n="share.scope_read_write" value="3" {{if eq .Share.Scope 3 }}selected{{end}}>Read/Write</option>
|
||||
</select>
|
||||
<div class="form-text">
|
||||
For scope "Write" and "Read&Write" you have to define one path and it must be a directory
|
||||
<div data-i18n="share.scope_help" class="form-text">
|
||||
For scope "Write" and "Read/Write" you have to define one path and it must be a directory
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card card-rounded mt-10">
|
||||
<div class="card-header bg-light">
|
||||
<h3 class="card-title">Paths</h3>
|
||||
<h3 data-i18n="share.paths" class="card-title">Paths</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div id="paths">
|
||||
@@ -59,12 +57,11 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div data-repeater-item>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control mt-3 mt-md-8"
|
||||
placeholder="file or directory path, i.e. /dir or /dir/file.txt"
|
||||
<input data-i18n="[placeholder]share.path_help" type="text" class="form-control mt-3 mt-md-8"
|
||||
name="path" value="{{$val}}" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a href="#" data-repeater-delete
|
||||
<a data-i18n="general.delete" href="#" data-repeater-delete
|
||||
class="btn btn-light-danger mt-3 mt-md-8">
|
||||
<i class="ki-duotone ki-trash fs-5">
|
||||
<span class="path1"></span>
|
||||
@@ -82,12 +79,11 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div data-repeater-item>
|
||||
<div class="form-group row">
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control mt-3 mt-md-8"
|
||||
placeholder="file or directory path, i.e. /dir or /dir/file.txt"
|
||||
<input data-i18n="[placeholder]share.path_help" type="text" class="form-control mt-3 mt-md-8"
|
||||
name="path" value="" />
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<a href="#" data-repeater-delete
|
||||
<a data-i18n="general.delete" href="#" data-repeater-delete
|
||||
class="btn btn-light-danger mt-3 mt-md-8">
|
||||
<i class="ki-duotone ki-trash fs-5">
|
||||
<span class="path1"></span>
|
||||
@@ -106,7 +102,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-5">
|
||||
<a href="#" data-repeater-create class="btn btn-light-primary">
|
||||
<a data-i18n="general.add" href="#" data-repeater-create class="btn btn-light-primary">
|
||||
<i class="ki-duotone ki-plus fs-3"></i>
|
||||
Add
|
||||
</a>
|
||||
@@ -116,20 +112,20 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-10">
|
||||
<label class="col-md-3 col-form-label">Password</label>
|
||||
<label data-i18n="login.password" class="col-md-3 col-form-label">Password</label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" class="form-control" name="password" autocomplete="new-password"
|
||||
placeholder="" spellcheck="false" value="{{.Share.Password}}" />
|
||||
<div class="form-text">
|
||||
<div data-i18n="share.password_help" class="form-text">
|
||||
If set the share will be password-protected
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-10">
|
||||
<label class="col-md-3 col-form-label">Expiration</label>
|
||||
<label data-i18n="share.expiration" class="col-md-3 col-form-label">Expiration</label>
|
||||
<div class="col-md-9 d-flex">
|
||||
<input id="id_expiration" class="form-control" placeholder="Pick an expiration date" />
|
||||
<input data-i18n="[placeholder]share.expiration_help" id="id_expiration" class="form-control" placeholder="Pick an expiration date" />
|
||||
<button class="btn btn-icon btn-light-danger ms-2 d-none" id="id_expiration_clear">
|
||||
<i class="ki-duotone ki-cross fs-1">
|
||||
<span class="path1"></span>
|
||||
@@ -140,28 +136,28 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-10">
|
||||
<label class="col-md-3 col-form-label">Max tokens</label>
|
||||
<label data-i18n="share.max_tokens" class="col-md-3 col-form-label">Max tokens</label>
|
||||
<div class="col-md-9">
|
||||
<input type="number" min="0" class="form-control" name="max_tokens" value="{{.Share.MaxTokens}}" />
|
||||
<div class="form-text">
|
||||
<div data-i18n="share.max_tokens_help" class="form-text">
|
||||
Maximum number of times this share can be accessed. 0 means no limit
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-10">
|
||||
<label class="col-md-3 col-form-label">Allowed IP/Mask</label>
|
||||
<label data-i18n="general.allowed_ip_mask" class="col-md-3 col-form-label">Allowed IP/Mask</label>
|
||||
<div class="col-md-9">
|
||||
<textarea class="form-control" name="allowed_ip" rows="3"
|
||||
placeholder="">{{.Share.GetAllowedFromAsString}}</textarea>
|
||||
<div class="form-text">
|
||||
<div data-i18n="general.allowed_ip_mask_help" class="form-text">
|
||||
Comma separated IP/Mask in CIDR format, for example "192.168.1.0/24,10.8.0.100/32"
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mt-10">
|
||||
<label class="col-md-3 col-form-label">Description</label>
|
||||
<label data-i18n="general.description" class="col-md-3 col-form-label">Description</label>
|
||||
<div class="col-md-9">
|
||||
<textarea class="form-control" name="description" rows="3"
|
||||
placeholder="">{{.Share.Description}}</textarea>
|
||||
@@ -172,11 +168,12 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<input type="hidden" name="expiration_date" id="hidden_start_datetime" value="">
|
||||
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
||||
<button type="submit" id="form_submit" class="btn btn-primary px-10">
|
||||
<span class="indicator-label">
|
||||
<span data-i18n="general.submit" class="indicator-label">
|
||||
Submit
|
||||
</span>
|
||||
<span class="indicator-progress">
|
||||
Please wait... <span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -188,14 +185,21 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
{{- define "extra_js"}}
|
||||
<script {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}} src="{{.StaticURL}}/assets/plugins/custom/formrepeater/formrepeater.bundle.js"></script>
|
||||
<script type="text/javascript" {{- if .CSPNonce}} nonce="{{.CSPNonce}}"{{- end}}>
|
||||
KTUtil.onDOMContentLoaded(function () {
|
||||
$(document).on("i18nshow", function(){
|
||||
initRepeater('#paths');
|
||||
initRepeaterItems();
|
||||
|
||||
const picker = $('#id_expiration').flatpickr({
|
||||
enableTime: false,
|
||||
time_24hr: true,
|
||||
dateFormat: "Y-m-d",
|
||||
formatDate: (date, format, locale) => {
|
||||
return $.t('general.datetime', {
|
||||
val: new Date(date),
|
||||
formatParams: {
|
||||
val: { year: 'numeric', month: 'numeric', day: 'numeric' },
|
||||
}
|
||||
});
|
||||
},
|
||||
defaultHour: 23,
|
||||
defaultMinute: 59,
|
||||
onChange: function(selectedDates, dateStr, instance) {
|
||||
|
||||
@@ -14,7 +14,7 @@ therefore cannot be used in derivative works/products without an
|
||||
explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{template "base" .}}
|
||||
{{- define "title"}}{{.Title}}{{- end}}
|
||||
|
||||
{{- define "page_body"}}
|
||||
<div class="d-flex flex-center flex-column flex-column-fluid p-10 pb-lg-20">
|
||||
<div class="mb-12">
|
||||
@@ -27,11 +27,11 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
<div class="card shadow-sm w-lg-600px">
|
||||
<div class="card-header bg-light">
|
||||
<h3 class="card-title text-primary">Your download is ready</h3>
|
||||
<h3 data-i18n="fs.download_ready" class="card-title text-primary">Your download is ready</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div>
|
||||
<a href="{{.DownloadLink}}" class="btn btn-primary btn-user-custom btn-block">Download</a>
|
||||
<a data-i18n="fs.download" href="{{.DownloadLink}}" class="btn btn-primary btn-user-custom btn-block">Download</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,8 +15,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{- template "baselogin" .}}
|
||||
|
||||
{{- define "title"}}Share login{{- end}}
|
||||
|
||||
{{- define "content"}}
|
||||
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
||||
<div class="container mb-10">
|
||||
@@ -33,13 +31,14 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
{{template "errmsg" .Error}}
|
||||
<div class="fv-row mb-10">
|
||||
<input class="form-control form-control-lg form-control-solid" type="password" name="share_password" placeholder="Password" spellcheck="false" required />
|
||||
<input data-i18n="[placeholder]login.password" class="form-control form-control-lg form-control-solid" type="password" name="share_password" placeholder="Password" spellcheck="false" required />
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
||||
<button type="submit" id="sign_in_submit" class="btn btn-lg btn-primary w-100 mb-5">
|
||||
<span class="indicator-label">Sign in</span>
|
||||
<span class="indicator-progress">Please wait...
|
||||
<span data-i18n="login.signin" class="indicator-label">Sign in</span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
@@ -15,8 +15,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{template "base" .}}
|
||||
|
||||
{{define "title"}}{{.Title}}{{end}}
|
||||
|
||||
{{- define "extra_css"}}
|
||||
<link href="{{.StaticURL}}/assets/plugins/custom/datatables/datatables.bundle.css" rel="stylesheet" type="text/css"/>
|
||||
{{- end}}
|
||||
@@ -26,13 +24,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-header bg-light">
|
||||
<h3 class="card-title text-primary">View and manage shares</h3>
|
||||
<h3 data-i18n="share.view_manage" class="card-title text-primary">View and manage shares</h3>
|
||||
</div>
|
||||
<div id="card_body" class="card-body">
|
||||
{{- template "errmsg" ""}}
|
||||
<div id="loader" class="align-items-center text-center my-10">
|
||||
<span class="spinner-border w-15px h-15px text-muted align-middle me-2"></span>
|
||||
<span class="text-gray-600">Loading...</span>
|
||||
<span data-i18n="general.loading" class="text-gray-600">Loading...</span>
|
||||
</div>
|
||||
<div id="card_content" class="d-none">
|
||||
<div class="d-flex flex-stack mb-5">
|
||||
@@ -41,12 +39,12 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<span class="path1"></span>
|
||||
<span class="path2"></span>
|
||||
</i>
|
||||
<input type="text" data-share-table-filter="search"
|
||||
<input data-i18n="[placeholder]general.search" type="text" data-share-table-filter="search"
|
||||
class="form-control form-control-solid w-200px ps-15" placeholder="Search" />
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end" data-share-table-toolbar="base">
|
||||
<a href="{{.ShareURL}}" class="btn btn-primary">
|
||||
<a data-i18n="general.add" href="{{.ShareURL}}" class="btn btn-primary">
|
||||
<i class="ki-duotone ki-plus fs-2"></i>
|
||||
Add
|
||||
</a>
|
||||
@@ -56,13 +54,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<table id="dataTable" class="table align-middle table-row-dashed fs-6 gy-5">
|
||||
<thead>
|
||||
<tr class="text-start text-muted fw-bold fs-6 gs-0">
|
||||
<th>Name</th>
|
||||
<th>Scope</th>
|
||||
<th>Info</th>
|
||||
<th data-i18n="general.name">Name</th>
|
||||
<th data-i18n="share.scope">Scope</th>
|
||||
<th data-i18n="general.info">Info</th>
|
||||
<th class="min-w-100px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-gray-800 fw-semibold"></tbody>
|
||||
<tbody id="table_body" class="text-gray-800 fw-semibold"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -77,7 +75,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<h3 class="modal-title">
|
||||
Share access links
|
||||
</h3>
|
||||
<div class="btn btn-icon btn-sm btn-active-color-primary" data-bs-dismiss="modal" aria-label="Close">
|
||||
<div data-i18n="[aria-label]general.close" class="btn btn-icon btn-sm btn-active-color-primary" data-bs-dismiss="modal" aria-label="Close">
|
||||
<i class="ki-duotone ki-cross fs-1"><span class="path1"></span><span class="path2"></span></i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -114,10 +112,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
errDivEl.addClass("d-none");
|
||||
|
||||
ModalAlert.fire({
|
||||
text: `Do you want to delete the selected share? This action is irreversible`,
|
||||
text: $.t('general.delete_confirm_generic'),
|
||||
icon: "warning",
|
||||
confirmButtonText: "Delete",
|
||||
cancelButtonText: 'Cancel',
|
||||
confirmButtonText: $.t('general.delete'),
|
||||
cancelButtonText: $.t('general.cancel'),
|
||||
customClass: {
|
||||
confirmButton: "btn btn-danger",
|
||||
cancelButton: 'btn btn-secondary'
|
||||
@@ -140,16 +138,21 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
location.reload();
|
||||
}).catch(function(error){
|
||||
KTApp.hidePageLoading();
|
||||
let errorMessage = `Unable to delete the selected share`;
|
||||
let errorMessage;
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
switch (error.response.status) {
|
||||
case 403:
|
||||
errorMessage = "general.delete_error_403";
|
||||
break;
|
||||
case 404:
|
||||
errorMessage = "general.delete_error_404";
|
||||
break;
|
||||
}
|
||||
}
|
||||
errTxtEl.text(errorMessage);
|
||||
if (!errorMessage){
|
||||
errorMessage = "general.delete_error_generic";
|
||||
}
|
||||
setI18NData(errTxtEl, errorMessage);
|
||||
errDivEl.removeClass("d-none");
|
||||
});
|
||||
}
|
||||
@@ -167,7 +170,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
$('#readShare').hide();
|
||||
} else {
|
||||
let shareURL = '{{.BasePublicSharesURL}}' + "/" + encodeURIComponent(shareID);
|
||||
if (shareScope == 'Read') {
|
||||
if (shareScope == '1') {
|
||||
$('#expiredShare').hide();
|
||||
$('#writeShare').hide();
|
||||
$('#readShare').show();
|
||||
@@ -190,7 +193,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
|
||||
const tableData = [];
|
||||
{{- range .Shares}}
|
||||
tableData.push(['{{.Name}}','{{.GetScopeAsString}}','{{.GetInfoString}}','{{.ShareID}}','{{- if .IsExpired}}1{{- else}}0{{- end}}']);
|
||||
tableData.push(['{{.Name}}','{{.Scope}}','{{- if .Password}}1{{- else}}0{{- end}}','{{.ShareID}}','{{- if .IsExpired}}1{{- else}}0{{- end}}', '{{.ExpiresAt}}', '{{.LastUseAt}}', '{{.UsedTokens}}', '{{.MaxTokens}}']);
|
||||
{{- end}}
|
||||
|
||||
var sharesDatatable = function(){
|
||||
@@ -200,6 +203,67 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
dt = $('#dataTable').DataTable({
|
||||
data: tableData,
|
||||
columnDefs: [
|
||||
{
|
||||
target: 0,
|
||||
render: function(data, type, row) {
|
||||
if (type === 'display') {
|
||||
return escapeHTML(data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
target: 1,
|
||||
render: function (data, type, row) {
|
||||
if (type === 'display') {
|
||||
switch (data){
|
||||
case "2":
|
||||
return $.t('share.scope_write');
|
||||
case "3":
|
||||
return $.t('share.scope_read_write');
|
||||
default:
|
||||
return $.t('share.scope_read');
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
target: 2,
|
||||
searchable: false,
|
||||
orderable: false,
|
||||
render: function (data, type, row) {
|
||||
if (type === 'display') {
|
||||
let info = "";
|
||||
if (row[5] > 0){
|
||||
info+= $.t('share.expiration_date', {
|
||||
val: new Date(parseInt(row[5], 10)),
|
||||
formatParams: {
|
||||
val: { year: 'numeric', month: 'numeric', day: 'numeric' },
|
||||
}
|
||||
});
|
||||
}
|
||||
if (row[6] > 0){
|
||||
info+= $.t('share.last_use', {
|
||||
val: new Date(parseInt(row[6], 10)),
|
||||
formatParams: {
|
||||
val: { year: 'numeric', month: 'numeric', day: 'numeric' },
|
||||
}
|
||||
});
|
||||
}
|
||||
if (row[8] > 0){
|
||||
info+= $.t('share.usage', {used: row[7], total: row[8]})
|
||||
} else {
|
||||
info+= $.t('share.used_tokens', {used: row[7]})
|
||||
}
|
||||
if (data == "1"){
|
||||
info+= $.t('share.password_protected')
|
||||
}
|
||||
return info;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
},
|
||||
{
|
||||
targets: 3,
|
||||
searchable: false,
|
||||
@@ -228,10 +292,10 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</button>
|
||||
<div class="menu menu-sub menu-sub-dropdown menu-column menu-rounded menu-gray-600 menu-state-bg-light-primary fw-semibold fs-7 w-150px py-4" data-kt-menu="true">
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link px-3" data-share-table-action="edit_row">Edit</a>
|
||||
<a data-i18n="general.edit" href="#" class="menu-link px-3" data-share-table-action="edit_row">Edit</a>
|
||||
</div>
|
||||
<div class="menu-item px-3">
|
||||
<a href="#" class="menu-link text-danger px-3" data-share-table-action="delete_row">Delete</a>
|
||||
<a data-i18n="general.delete" href="#" class="menu-link text-danger px-3" data-share-table-action="delete_row">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -239,15 +303,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}
|
||||
return "";
|
||||
}
|
||||
},
|
||||
{
|
||||
targets: [0, 2],
|
||||
render: function (data, type, row) {
|
||||
if (type === 'display') {
|
||||
return escapeHTML(data);
|
||||
}
|
||||
return data
|
||||
}
|
||||
}
|
||||
],
|
||||
deferRender: true,
|
||||
@@ -260,7 +315,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}
|
||||
},
|
||||
language: {
|
||||
emptyTable: "No share defined"
|
||||
info: $.t('datatable.info'),
|
||||
infoEmpty: $.t('datatable.info_empty'),
|
||||
infoFiltered: $.t('datatable.info_filtered'),
|
||||
loadingRecords: "",
|
||||
processing: $.t('datatable.processing'),
|
||||
zeroRecords: "",
|
||||
emptyTable: $.t('share.no_share')
|
||||
},
|
||||
order: [[1, 'asc']],
|
||||
initComplete: function(settings, json) {
|
||||
@@ -270,12 +331,14 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
api.columns.adjust().draw("page");
|
||||
KTMenu.createInstances();
|
||||
handleRowActions();
|
||||
$('#table_body').localize();
|
||||
}
|
||||
});
|
||||
|
||||
dt.on('draw', function () {
|
||||
KTMenu.createInstances();
|
||||
handleRowActions();
|
||||
$('#table_body').localize();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -327,7 +390,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
}
|
||||
}();
|
||||
|
||||
KTUtil.onDOMContentLoaded(function () {
|
||||
$(document).on("i18nshow", function(){
|
||||
sharesDatatable.init();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -15,8 +15,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{- template "base" .}}
|
||||
|
||||
{{- define "title"}}{{.Title}}{{- end}}
|
||||
|
||||
{{- define "page_body"}}
|
||||
<div class="d-flex flex-center flex-column flex-column-fluid p-10 pb-lg-20">
|
||||
<div class="mb-12">
|
||||
@@ -29,7 +27,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
<div class="card shadow-sm w-lg-600px">
|
||||
<div class="card-header bg-light">
|
||||
<h3 class="card-title text-primary">Upload one or more files to share "{{.Share.Name}}"</h3>
|
||||
<h3 data-i18n="title.upload_to_share" class="card-title text-primary">Upload one or more files to share</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{- template "errmsg" ""}}
|
||||
@@ -39,13 +37,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="dz-message needsclick align-items-center">
|
||||
<i class="ki-duotone ki-file-up fs-3x text-primary"><span class="path1"></span><span class="path2"></span></i>
|
||||
<div class="ms-4">
|
||||
<h3 class="fs-5 fw-bold text-gray-900 mb-1">Drop files here or click to upload.</h3>
|
||||
<h3 data-i18n="fs.upload.message" class="fs-5 fw-bold text-gray-900 mb-1">Drop files here or click to upload.</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end mt-10">
|
||||
<button type="button" id="upload_files_button" class="btn btn-primary">Submit</button>
|
||||
<button data-i18n="general.submit" type="button" id="upload_files_button" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -69,9 +67,9 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
KTApp.hidePageLoading();
|
||||
if (!has_errors) {
|
||||
ModalAlert.fire({
|
||||
text: `File/s uploaded successfully`,
|
||||
text: $.t('fs.upload.success'),
|
||||
icon: "success",
|
||||
confirmButtonText: "OK",
|
||||
confirmButtonText: $.t('general.ok'),
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-primary'
|
||||
}
|
||||
@@ -90,13 +88,17 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
try {
|
||||
lastModified = f.lastModified;
|
||||
} catch (e) {
|
||||
console.log("unable to get last modified time from file: " + e.message);
|
||||
console.error("unable to get last modified time from file: " + e.message);
|
||||
lastModified = "";
|
||||
}
|
||||
|
||||
let uploadTxt = f.name;
|
||||
if (files.length > 1){
|
||||
uploadTxt = `Upload ${index+1}/${files.length}: ${uploadTxt}`;
|
||||
uploadTxt = $.t('fs.uploading', {
|
||||
idx: index + 1,
|
||||
total: files.length,
|
||||
name: uploadTxt
|
||||
});
|
||||
}
|
||||
|
||||
$('#loading_message').text(uploadTxt);
|
||||
@@ -123,18 +125,23 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
success++;
|
||||
uploadFile();
|
||||
}).catch(function (error) {
|
||||
let errorMessage = "Error uploading files";
|
||||
let errorMessage;
|
||||
if (error && error.response) {
|
||||
if (error.response.data.message) {
|
||||
errorMessage = error.response.data.message;
|
||||
}
|
||||
if (error.response.data.error) {
|
||||
errorMessage += ": " + error.response.data.error;
|
||||
switch (error.response.status) {
|
||||
case 403:
|
||||
errorMessage = "fs.upload.err_403";
|
||||
break;
|
||||
case 429:
|
||||
errorMessage = "fs.upload.err_429";
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!errorMessage){
|
||||
errorMessage = "fs.upload.err_generic";
|
||||
}
|
||||
index++;
|
||||
has_errors = true;
|
||||
$('#errorTxt').text(errorMessage);
|
||||
setI18NData($('#errorTxt'), errorMessage);
|
||||
$('#errorMsg').removeClass("d-none");
|
||||
uploadFile();
|
||||
});
|
||||
|
||||
@@ -15,8 +15,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{- template "baselogin" .}}
|
||||
|
||||
{{- define "title"}}{{.Title}}{{- end}}
|
||||
|
||||
{{- define "content"}}
|
||||
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
||||
<div class="container mb-10">
|
||||
@@ -33,13 +31,14 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
{{template "errmsg" .Error}}
|
||||
<div class="fv-row mb-10">
|
||||
<input class="form-control form-control-lg form-control-solid" type="text" name="recovery_code" placeholder="Recovery code" spellcheck="false" required />
|
||||
<input data-i18n="[placeholder]login.recovery_code" class="form-control form-control-lg form-control-solid" type="text" name="recovery_code" placeholder="Recovery code" spellcheck="false" required />
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
||||
<button type="submit" id="sign_in_submit" class="btn btn-lg btn-primary w-100 mb-5">
|
||||
<span class="indicator-label">Verify</span>
|
||||
<span class="indicator-progress">Please wait...
|
||||
<span data-i18n="general.verify" class="indicator-label">Verify</span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
@@ -53,7 +52,9 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="d-flex flex-stack flex-grow-1 flex-wrap flex-md-nowrap">
|
||||
<div class="mb-3 mb-md-0 fw-semibold">
|
||||
<div class="fs-6 text-gray-800">
|
||||
You can enter one of your recovery codes in case you lost access to your mobile device.
|
||||
<span data-i18n="login.recovery_code_msg">
|
||||
You can enter one of your recovery codes in case you lost access to your mobile device.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,8 +15,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
-->
|
||||
{{- template "baselogin" .}}
|
||||
|
||||
{{- define "title"}}{{.Title}}{{- end}}
|
||||
|
||||
{{- define "content"}}
|
||||
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
||||
<div class="container mb-10">
|
||||
@@ -33,13 +31,14 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
</div>
|
||||
{{template "errmsg" .Error}}
|
||||
<div class="fv-row mb-10">
|
||||
<input class="form-control form-control-lg form-control-solid" type="text" placeholder="Authentication code" name="passcode" spellcheck="false" required />
|
||||
<input data-i18n="[placeholder]login.auth_code" class="form-control form-control-lg form-control-solid" type="text" placeholder="Authentication code" name="passcode" spellcheck="false" required />
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<input type="hidden" name="_form_token" value="{{.CSRFToken}}">
|
||||
<button type="submit" id="sign_in_submit" class="btn btn-lg btn-primary w-100 mb-5">
|
||||
<span class="indicator-label">Verify</span>
|
||||
<span class="indicator-progress">Please wait...
|
||||
<span data-i18n="general.verify" class="indicator-label">Verify</span>
|
||||
<span data-i18n="general.wait" class="indicator-progress">
|
||||
Please wait...
|
||||
<span class="spinner-border spinner-border-sm align-middle ms-2"></span>
|
||||
</span>
|
||||
</button>
|
||||
@@ -54,11 +53,13 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<div class="d-flex flex-stack flex-grow-1 flex-wrap flex-md-nowrap">
|
||||
<div class="mb-3 mb-md-0 fw-semibold">
|
||||
<div class="fs-6 text-gray-700">
|
||||
Open the two-factor authentication app on your device to view your authentication code and verify your identity.
|
||||
<span data-i18n="login.two_factor_help">
|
||||
Open the two-factor authentication app on your device to view your authentication code and verify your identity.
|
||||
</span>
|
||||
</div>
|
||||
<div class="fs-6 text-gray-800 mt-5">
|
||||
<p class="fw-bold">Having problems?</p>
|
||||
<p><a href="{{.RecoveryURL}}">Enter a two-factor recovery code</a></p>
|
||||
<p data-i18n="general.problems" class="fw-bold">Having problems?</p>
|
||||
<p><a data-i18n="login.two_factor_msg" href="{{.RecoveryURL}}">Enter a two-factor recovery code</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -18,7 +18,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>{{.Title}}</title>
|
||||
<title></title>
|
||||
|
||||
{{range .Branding.ExtraCSS}}
|
||||
<link href="{{$.StaticURL}}{{.}}" rel="stylesheet" type="text/css">
|
||||
|
||||
Reference in New Issue
Block a user