mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
enhance: validate settings value before save
This commit is contained in:
parent
d70e37c857
commit
d67b8428e4
8 changed files with 83 additions and 26 deletions
|
@ -1,13 +1,13 @@
|
|||
package settings
|
||||
|
||||
type Casdoor struct {
|
||||
Endpoint string `json:"endpoint"`
|
||||
ClientId string `json:"client_id"`
|
||||
ClientSecret string `json:"client_secret"`
|
||||
Certificate string `json:"certificate"`
|
||||
Organization string `json:"organization"`
|
||||
Application string `json:"application"`
|
||||
RedirectUri string `json:"redirect_uri"`
|
||||
Endpoint string `json:"endpoint" protected:"true"`
|
||||
ClientId string `json:"client_id" protected:"true"`
|
||||
ClientSecret string `json:"client_secret" protected:"true"`
|
||||
Certificate string `json:"certificate" protected:"true"`
|
||||
Organization string `json:"organization" protected:"true"`
|
||||
Application string `json:"application" protected:"true"`
|
||||
RedirectUri string `json:"redirect_uri" protected:"true"`
|
||||
}
|
||||
|
||||
var CasdoorSettings = Casdoor{
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package settings
|
||||
|
||||
type Nginx struct {
|
||||
AccessLogPath string `json:"access_log_path"`
|
||||
ErrorLogPath string `json:"error_log_path"`
|
||||
AccessLogPath string `json:"access_log_path" binding:"omitempty,file"`
|
||||
ErrorLogPath string `json:"error_log_path" binding:"omitempty,file"`
|
||||
ConfigDir string `json:"config_dir" protected:"true"`
|
||||
PIDPath string `json:"pid_path" protected:"true"`
|
||||
TestConfigCmd string `json:"test_config_cmd" protected:"true"`
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package settings
|
||||
|
||||
type OpenAI struct {
|
||||
BaseUrl string `json:"base_url"`
|
||||
Token string `json:"token"`
|
||||
Proxy string `json:"proxy"`
|
||||
Model string `json:"model"`
|
||||
BaseUrl string `json:"base_url" binding:"omitempty,url"`
|
||||
Token string `json:"token" binding:"omitempty,alphanumdash"`
|
||||
Proxy string `json:"proxy" binding:"omitempty,url"`
|
||||
Model string `json:"model" binding:"omitempty,alphanumdash"`
|
||||
}
|
||||
|
||||
var OpenAISettings = OpenAI{}
|
||||
|
|
|
@ -10,10 +10,10 @@ type Server struct {
|
|||
Email string `json:"email" protected:"true"`
|
||||
Database string `json:"database" protected:"true"`
|
||||
StartCmd string `json:"start_cmd" protected:"true"`
|
||||
CADir string `json:"ca_dir"`
|
||||
CADir string `json:"ca_dir" binding:"omitempty,url"`
|
||||
Demo bool `json:"demo" protected:"true"`
|
||||
PageSize int `json:"page_size" protected:"true"`
|
||||
GithubProxy string `json:"github_proxy"`
|
||||
GithubProxy string `json:"github_proxy" binding:"omitempty,url"`
|
||||
}
|
||||
|
||||
var ServerSettings = Server{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue