mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-13 03:15:48 +02:00
feat: inspect configurations #69
This commit is contained in:
parent
561771cf10
commit
768da42e35
23 changed files with 346 additions and 144 deletions
|
@ -1,13 +1,12 @@
|
|||
package api
|
||||
|
||||
import (
|
||||
"github.com/0xJacky/Nginx-UI/server/pkg/config_list"
|
||||
"github.com/0xJacky/Nginx-UI/server/pkg/nginx"
|
||||
"github.com/gin-gonic/gin"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"github.com/0xJacky/Nginx-UI/server/pkg/config_list"
|
||||
"github.com/0xJacky/Nginx-UI/server/pkg/nginx"
|
||||
"github.com/gin-gonic/gin"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
func GetConfigs(c *gin.Context) {
|
||||
|
@ -126,7 +125,7 @@ func AddConfig(c *gin.Context) {
|
|||
|
||||
output := nginx.Reload()
|
||||
|
||||
if output != "" && strings.Contains(output, "error") {
|
||||
if nginx.GetLogLevel(output) >= nginx.Warn {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{
|
||||
"message": output,
|
||||
})
|
||||
|
@ -172,7 +171,7 @@ func EditConfig(c *gin.Context) {
|
|||
|
||||
output := nginx.Reload()
|
||||
|
||||
if output != "" && strings.Contains(output, "error") {
|
||||
if nginx.GetLogLevel(output) >= nginx.Warn {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{
|
||||
"message": output,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue