mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 15:28:05 +03:00
WebUI add title to all pages
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -19,24 +19,26 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
pageMFATitle = "Two-factor authentication"
|
pageMFATitle = "Two-factor authentication"
|
||||||
page400Title = "Bad request"
|
page400Title = "Bad request"
|
||||||
page403Title = "Forbidden"
|
page403Title = "Forbidden"
|
||||||
page404Title = "Not found"
|
page404Title = "Not found"
|
||||||
page404Body = "The page you are looking for does not exist."
|
page404Body = "The page you are looking for does not exist."
|
||||||
page500Title = "Internal Server Error"
|
page500Title = "Internal Server Error"
|
||||||
page500Body = "The server is unable to fulfill your request."
|
page500Body = "The server is unable to fulfill your request."
|
||||||
webDateTimeFormat = "2006-01-02 15:04:05" // YYYY-MM-DD HH:MM:SS
|
pageTwoFactorTitle = "Two-Factor authentication"
|
||||||
redactedSecret = "[**redacted**]"
|
pageTwoFactorRecoveryTitle = "Two-Factor recovery"
|
||||||
csrfFormToken = "_form_token"
|
webDateTimeFormat = "2006-01-02 15:04:05" // YYYY-MM-DD HH:MM:SS
|
||||||
csrfHeaderToken = "X-CSRF-TOKEN"
|
redactedSecret = "[**redacted**]"
|
||||||
templateCommonDir = "common"
|
csrfFormToken = "_form_token"
|
||||||
templateTwoFactor = "twofactor.html"
|
csrfHeaderToken = "X-CSRF-TOKEN"
|
||||||
templateTwoFactorRecovery = "twofactor-recovery.html"
|
templateCommonDir = "common"
|
||||||
templateForgotPassword = "forgot-password.html"
|
templateTwoFactor = "twofactor.html"
|
||||||
templateResetPassword = "reset-password.html"
|
templateTwoFactorRecovery = "twofactor-recovery.html"
|
||||||
templateCommonCSS = "sftpgo.css"
|
templateForgotPassword = "forgot-password.html"
|
||||||
templateCommonBase = "base.html"
|
templateResetPassword = "reset-password.html"
|
||||||
|
templateCommonCSS = "sftpgo.css"
|
||||||
|
templateCommonBase = "base.html"
|
||||||
)
|
)
|
||||||
|
|
||||||
type loginPage struct {
|
type loginPage struct {
|
||||||
@@ -62,6 +64,7 @@ type twoFactorPage struct {
|
|||||||
CSPNonce string
|
CSPNonce string
|
||||||
StaticURL string
|
StaticURL string
|
||||||
RecoveryURL string
|
RecoveryURL string
|
||||||
|
Title string
|
||||||
Branding UIBranding
|
Branding UIBranding
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,8 +120,8 @@ const (
|
|||||||
pageIPListsTitle = "IP Lists"
|
pageIPListsTitle = "IP Lists"
|
||||||
pageEventsTitle = "Logs"
|
pageEventsTitle = "Logs"
|
||||||
pageConfigsTitle = "Configurations"
|
pageConfigsTitle = "Configurations"
|
||||||
pageForgotPwdTitle = "SFTPGo Admin - Forgot password"
|
pageForgotPwdTitle = "Forgot password"
|
||||||
pageResetPwdTitle = "SFTPGo Admin - Reset password"
|
pageResetPwdTitle = "Reset password"
|
||||||
pageSetupTitle = "Create first admin user"
|
pageSetupTitle = "Create first admin user"
|
||||||
defaultQueryLimit = 1000
|
defaultQueryLimit = 1000
|
||||||
inversePatternType = "inverse"
|
inversePatternType = "inverse"
|
||||||
@@ -828,6 +828,7 @@ func (s *httpdServer) renderResetPwdPage(w http.ResponseWriter, r *http.Request,
|
|||||||
|
|
||||||
func (s *httpdServer) renderTwoFactorPage(w http.ResponseWriter, r *http.Request, error, ip string) {
|
func (s *httpdServer) renderTwoFactorPage(w http.ResponseWriter, r *http.Request, error, ip string) {
|
||||||
data := twoFactorPage{
|
data := twoFactorPage{
|
||||||
|
Title: pageTwoFactorTitle,
|
||||||
CurrentURL: webAdminTwoFactorPath,
|
CurrentURL: webAdminTwoFactorPath,
|
||||||
Version: version.Get().Version,
|
Version: version.Get().Version,
|
||||||
Error: error,
|
Error: error,
|
||||||
@@ -842,6 +843,7 @@ func (s *httpdServer) renderTwoFactorPage(w http.ResponseWriter, r *http.Request
|
|||||||
|
|
||||||
func (s *httpdServer) renderTwoFactorRecoveryPage(w http.ResponseWriter, r *http.Request, error, ip string) {
|
func (s *httpdServer) renderTwoFactorRecoveryPage(w http.ResponseWriter, r *http.Request, error, ip string) {
|
||||||
data := twoFactorPage{
|
data := twoFactorPage{
|
||||||
|
Title: pageTwoFactorRecoveryTitle,
|
||||||
CurrentURL: webAdminTwoFactorRecoveryPath,
|
CurrentURL: webAdminTwoFactorRecoveryPath,
|
||||||
Version: version.Get().Version,
|
Version: version.Get().Version,
|
||||||
Error: error,
|
Error: error,
|
||||||
|
|||||||
@@ -71,8 +71,8 @@ const (
|
|||||||
pageClientChangePwdTitle = "Change password"
|
pageClientChangePwdTitle = "Change password"
|
||||||
pageClient2FATitle = "Two-factor auth"
|
pageClient2FATitle = "Two-factor auth"
|
||||||
pageClientEditFileTitle = "Edit file"
|
pageClientEditFileTitle = "Edit file"
|
||||||
pageClientForgotPwdTitle = "SFTPGo WebClient - Forgot password"
|
pageClientForgotPwdTitle = "Forgot password"
|
||||||
pageClientResetPwdTitle = "SFTPGo WebClient - Reset password"
|
pageClientResetPwdTitle = "Reset password"
|
||||||
pageExtShareTitle = "Shared files"
|
pageExtShareTitle = "Shared files"
|
||||||
pageUploadToShareTitle = "Upload to share"
|
pageUploadToShareTitle = "Upload to share"
|
||||||
pageDownloadFromShareTitle = "Download shared file"
|
pageDownloadFromShareTitle = "Download shared file"
|
||||||
@@ -665,6 +665,7 @@ func (s *httpdServer) renderClientNotFoundPage(w http.ResponseWriter, r *http.Re
|
|||||||
|
|
||||||
func (s *httpdServer) renderClientTwoFactorPage(w http.ResponseWriter, r *http.Request, error, ip string) {
|
func (s *httpdServer) renderClientTwoFactorPage(w http.ResponseWriter, r *http.Request, error, ip string) {
|
||||||
data := twoFactorPage{
|
data := twoFactorPage{
|
||||||
|
Title: pageTwoFactorTitle,
|
||||||
CurrentURL: webClientTwoFactorPath,
|
CurrentURL: webClientTwoFactorPath,
|
||||||
Version: version.Get().Version,
|
Version: version.Get().Version,
|
||||||
Error: error,
|
Error: error,
|
||||||
@@ -682,6 +683,7 @@ func (s *httpdServer) renderClientTwoFactorPage(w http.ResponseWriter, r *http.R
|
|||||||
|
|
||||||
func (s *httpdServer) renderClientTwoFactorRecoveryPage(w http.ResponseWriter, r *http.Request, error, ip string) {
|
func (s *httpdServer) renderClientTwoFactorRecoveryPage(w http.ResponseWriter, r *http.Request, error, ip string) {
|
||||||
data := twoFactorPage{
|
data := twoFactorPage{
|
||||||
|
Title: pageTwoFactorRecoveryTitle,
|
||||||
CurrentURL: webClientTwoFactorRecoveryPath,
|
CurrentURL: webClientTwoFactorRecoveryPath,
|
||||||
Version: version.Get().Version,
|
Version: version.Get().Version,
|
||||||
Error: error,
|
Error: error,
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
<meta name="author" content="">
|
<meta name="author" content="">
|
||||||
|
|
||||||
<title>{{.Branding.Name}} - Forgot password</title>
|
<title>{{.Branding.Name}} - {{.Title}}</title>
|
||||||
|
|
||||||
<link rel="shortcut icon" href="{{.StaticURL}}{{.Branding.FaviconPath}}" />
|
<link rel="shortcut icon" href="{{.StaticURL}}{{.Branding.FaviconPath}}" />
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
<meta name="author" content="">
|
<meta name="author" content="">
|
||||||
|
|
||||||
<title>{{.Branding.Name}} - Reset password</title>
|
<title>{{.Branding.Name}} - {{.Title}}</title>
|
||||||
|
|
||||||
<link rel="shortcut icon" href="{{.StaticURL}}{{.Branding.FaviconPath}}" />
|
<link rel="shortcut icon" href="{{.StaticURL}}{{.Branding.FaviconPath}}" />
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
-->
|
-->
|
||||||
{{template "baselogin" .}}
|
{{template "baselogin" .}}
|
||||||
|
|
||||||
{{define "title"}}Two-Factor recovery{{end}}
|
{{define "title"}}{{.Title}}{{end}}
|
||||||
|
|
||||||
{{define "content"}}
|
{{define "content"}}
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
-->
|
-->
|
||||||
{{template "baselogin" .}}
|
{{template "baselogin" .}}
|
||||||
|
|
||||||
{{define "title"}}Two-Factor authentication{{end}}
|
{{define "title"}}{{.Title}}{{end}}
|
||||||
|
|
||||||
{{define "content"}}
|
{{define "content"}}
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||||||
-->
|
-->
|
||||||
{{- template "baselogin" .}}
|
{{- template "baselogin" .}}
|
||||||
|
|
||||||
{{- define "title"}}Forgot password{{- end}}
|
{{- define "title"}}{{.Title}}{{- end}}
|
||||||
|
|
||||||
{{- define "content"}}
|
{{- define "content"}}
|
||||||
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||||||
-->
|
-->
|
||||||
{{- template "baselogin" .}}
|
{{- template "baselogin" .}}
|
||||||
|
|
||||||
{{- define "title"}}Reset password{{- end}}
|
{{- define "title"}}{{.Title}}{{- end}}
|
||||||
|
|
||||||
{{- define "content"}}
|
{{- define "content"}}
|
||||||
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||||||
-->
|
-->
|
||||||
{{- template "baselogin" .}}
|
{{- template "baselogin" .}}
|
||||||
|
|
||||||
{{- define "title"}}Two-Factor recovery{{- end}}
|
{{- define "title"}}{{.Title}}{{- end}}
|
||||||
|
|
||||||
{{- define "content"}}
|
{{- define "content"}}
|
||||||
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||||||
-->
|
-->
|
||||||
{{- template "baselogin" .}}
|
{{- template "baselogin" .}}
|
||||||
|
|
||||||
{{- define "title"}}Two-Factor authentication{{- end}}
|
{{- define "title"}}{{.Title}}{{- end}}
|
||||||
|
|
||||||
{{- define "content"}}
|
{{- define "content"}}
|
||||||
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
<form class="form w-100" id="sign_in_form" action="{{.CurrentURL}}" method="POST">
|
||||||
|
|||||||
Reference in New Issue
Block a user