mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
enhance: removed the ability to modify nginx log path settings online
This commit is contained in:
parent
abd76ff930
commit
27f751671b
4 changed files with 9 additions and 8 deletions
|
@ -3,6 +3,7 @@ package settings
|
|||
import (
|
||||
"github.com/0xJacky/Nginx-UI/api"
|
||||
"github.com/0xJacky/Nginx-UI/internal/cron"
|
||||
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
||||
"github.com/0xJacky/Nginx-UI/settings"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
|
@ -15,6 +16,8 @@ func GetServerName(c *gin.Context) {
|
|||
}
|
||||
|
||||
func GetSettings(c *gin.Context) {
|
||||
settings.NginxSettings.AccessLogPath = nginx.GetAccessLogPath()
|
||||
settings.NginxSettings.ErrorLogPath = nginx.GetErrorLogPath()
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"server": settings.ServerSettings,
|
||||
"nginx": settings.NginxSettings,
|
||||
|
|
|
@ -14,7 +14,7 @@ const errors: Record<string, Record<string, string>> = inject('errors') as Recor
|
|||
? $gettext('File not found')
|
||||
: ''"
|
||||
>
|
||||
<AInput v-model:value="data.nginx.access_log_path" />
|
||||
{{ data.nginx.access_log_path }}
|
||||
</AFormItem>
|
||||
<AFormItem
|
||||
:label="$gettext('Nginx Error Log Path')"
|
||||
|
@ -23,7 +23,7 @@ const errors: Record<string, Record<string, string>> = inject('errors') as Recor
|
|||
? $gettext('File not found')
|
||||
: ''"
|
||||
>
|
||||
<AInput v-model:value="data.nginx.error_log_path" />
|
||||
{{ data.nginx.error_log_path }}
|
||||
</AFormItem>
|
||||
</AForm>
|
||||
</template>
|
||||
|
|
|
@ -33,12 +33,10 @@ func GetConfPath(dir ...string) (confPath string) {
|
|||
}
|
||||
|
||||
joined := filepath.Clean(filepath.Join(confPath, filepath.Join(dir...)))
|
||||
|
||||
if !helper.IsUnderDirectory(confPath, joined) {
|
||||
if !helper.IsUnderDirectory(joined, confPath) {
|
||||
return confPath
|
||||
}
|
||||
|
||||
return
|
||||
return joined
|
||||
}
|
||||
|
||||
func GetPIDPath() (path string) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package settings
|
||||
|
||||
type Nginx struct {
|
||||
AccessLogPath string `json:"access_log_path" binding:"omitempty,file"`
|
||||
ErrorLogPath string `json:"error_log_path" binding:"omitempty,file"`
|
||||
AccessLogPath string `json:"access_log_path" protected:"true"`
|
||||
ErrorLogPath string `json:"error_log_path" protected:"true"`
|
||||
ConfigDir string `json:"config_dir" protected:"true"`
|
||||
PIDPath string `json:"pid_path" protected:"true"`
|
||||
TestConfigCmd string `json:"test_config_cmd" protected:"true"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue