Restructurated frontend
This commit is contained in:
@@ -54,6 +54,7 @@ export function fireUpdateRequest(){
|
||||
window.dispatchEvent(new Event(eventUpdateName))
|
||||
}
|
||||
|
||||
|
||||
export async function resetfiregex(delete_data:boolean = false){
|
||||
const { status } = await postapi("reset",{delete:delete_data}) as ServerResponse;
|
||||
return (status === "ok"?undefined:status)
|
||||
@@ -67,18 +68,6 @@ export async function getstatus(){
|
||||
return await getapi(`status`) as ServerStatusResponse;
|
||||
}
|
||||
|
||||
export async function generalstats(){
|
||||
return await getapi("nfregex/stats") as GeneralStats;
|
||||
}
|
||||
|
||||
export async function servicelist(){
|
||||
return await getapi("nfregex/services") as Service[];
|
||||
}
|
||||
|
||||
export async function serviceinfo(service_id:string){
|
||||
return await getapi(`nfregex/service/${service_id}`) as Service;
|
||||
}
|
||||
|
||||
export async function logout(){
|
||||
window.localStorage.removeItem("access_token")
|
||||
}
|
||||
@@ -104,56 +93,56 @@ export async function login(data:PasswordSend) {
|
||||
return status;
|
||||
}
|
||||
|
||||
export async function deleteregex(regex_id:number){
|
||||
const { status } = await getapi(`nfregex/regex/${regex_id}/delete`) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
export const nfregex = {
|
||||
stats: async () => {
|
||||
return await getapi("nfregex/stats") as GeneralStats;
|
||||
},
|
||||
services: async () => {
|
||||
return await getapi("nfregex/services") as Service[];
|
||||
},
|
||||
serviceinfo: async (service_id:string) => {
|
||||
return await getapi(`nfregex/service/${service_id}`) as Service;
|
||||
},
|
||||
regexdelete: async (regex_id:number) => {
|
||||
const { status } = await getapi(`nfregex/regex/${regex_id}/delete`) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
},
|
||||
regexenable: async (regex_id:number) => {
|
||||
const { status } = await getapi(`nfregex/regex/${regex_id}/enable`) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
},
|
||||
regexdisable: async (regex_id:number) => {
|
||||
const { status } = await getapi(`nfregex/regex/${regex_id}/disable`) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
},
|
||||
servicestart: async (service_id:string) => {
|
||||
const { status } = await getapi(`nfregex/service/${service_id}/start`) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
},
|
||||
servicerename: async (service_id:string, name: string) => {
|
||||
const { status } = await postapi(`nfregex/service/${service_id}/rename`,{ name }) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
},
|
||||
servicestop: async (service_id:string) => {
|
||||
const { status } = await getapi(`nfregex/service/${service_id}/stop`) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
},
|
||||
servicesadd: async (data:ServiceAddForm) => {
|
||||
return await postapi("nfregex/services/add",data) as ServiceAddResponse;
|
||||
},
|
||||
servicedelete: async (service_id:string) => {
|
||||
const { status } = await getapi(`nfregex/service/${service_id}/delete`) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
},
|
||||
regexesadd: async (data:RegexAddForm) => {
|
||||
const { status } = await postapi("nfregex/regexes/add",data) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
},
|
||||
serviceregexes: async (service_id:string) => {
|
||||
return await getapi(`nfregex/service/${service_id}/regexes`) as RegexFilter[];
|
||||
}
|
||||
}
|
||||
|
||||
export async function activateregex(regex_id:number){
|
||||
const { status } = await getapi(`nfregex/regex/${regex_id}/enable`) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
}
|
||||
|
||||
export async function deactivateregex(regex_id:number){
|
||||
const { status } = await getapi(`nfregex/regex/${regex_id}/disable`) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
}
|
||||
|
||||
export async function startservice(service_id:string){
|
||||
const { status } = await getapi(`nfregex/service/${service_id}/start`) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
}
|
||||
|
||||
export async function renameservice(service_id:string, name: string){
|
||||
const { status } = await postapi(`nfregex/service/${service_id}/rename`,{ name }) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
}
|
||||
|
||||
export async function stopservice(service_id:string){
|
||||
const { status } = await getapi(`nfregex/service/${service_id}/stop`) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
}
|
||||
|
||||
export async function addservice(data:ServiceAddForm) {
|
||||
return await postapi("nfregex/services/add",data) as ServiceAddResponse;
|
||||
}
|
||||
|
||||
export async function deleteservice(service_id:string) {
|
||||
const { status } = await getapi(`nfregex/service/${service_id}/delete`) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
}
|
||||
|
||||
|
||||
export async function addregex(data:RegexAddForm) {
|
||||
const { status } = await postapi("nfregex/regexes/add",data) as ServerResponse;
|
||||
return status === "ok"?undefined:status
|
||||
}
|
||||
|
||||
export async function serviceregexlist(service_id:string){
|
||||
return await getapi(`nfregex/service/${service_id}/regexes`) as RegexFilter[];
|
||||
}
|
||||
|
||||
|
||||
export function errorNotify(title:string, description:string ){
|
||||
showNotification({
|
||||
autoClose: 2000,
|
||||
|
||||
Reference in New Issue
Block a user