mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +02:00
refactor: refactor app and api
This commit is contained in:
parent
5ab50b8a93
commit
287ef7527d
157 changed files with 8116 additions and 3587 deletions
|
@ -1,16 +1,49 @@
|
|||
import http from '@/lib/http'
|
||||
|
||||
export interface NgxConfig {
|
||||
file_name?: string
|
||||
name: string
|
||||
upstreams?: NgxUpstream[]
|
||||
servers: NgxServer[]
|
||||
custom?: string
|
||||
}
|
||||
|
||||
export interface NgxServer {
|
||||
directives?: NgxDirective[]
|
||||
locations?: NgxLocation[]
|
||||
comments?: string
|
||||
}
|
||||
|
||||
export interface NgxUpstream {
|
||||
name: string
|
||||
directives: NgxDirective[]
|
||||
comments?: string
|
||||
}
|
||||
|
||||
export interface NgxDirective {
|
||||
idx?: number
|
||||
directive: string
|
||||
params: string
|
||||
comments?: string
|
||||
}
|
||||
|
||||
export interface NgxLocation {
|
||||
path: string
|
||||
content: string
|
||||
comments: string
|
||||
}
|
||||
|
||||
const ngx = {
|
||||
build_config(ngxConfig: any) {
|
||||
build_config(ngxConfig: NgxConfig) {
|
||||
return http.post('/ngx/build_config', ngxConfig)
|
||||
},
|
||||
|
||||
tokenize_config(content: string) {
|
||||
return http.post('/ngx/tokenize_config', {content})
|
||||
return http.post('/ngx/tokenize_config', { content })
|
||||
},
|
||||
|
||||
format_code(content: string) {
|
||||
return http.post('/ngx/format_code', {content})
|
||||
return http.post('/ngx/format_code', { content })
|
||||
},
|
||||
|
||||
status() {
|
||||
|
@ -27,7 +60,7 @@ const ngx = {
|
|||
|
||||
test() {
|
||||
return http.post('/nginx/test')
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export default ngx
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue