Instant Update fixed
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
|
||||
|
||||
export const update_freq = 2000;
|
||||
export const notification_time = 1500;
|
||||
|
||||
export type GeneralStats = {
|
||||
services:number,
|
||||
closed:number,
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import { showNotification } from "@mantine/notifications";
|
||||
import { ImCross } from "react-icons/im";
|
||||
import { TiTick } from "react-icons/ti"
|
||||
import { GeneralStats, Service, ServiceAddForm, ServerResponse, RegexFilter, notification_time, RegexAddForm, ServerStatusResponse, PasswordSend, ChangePassword } from "./models";
|
||||
import { GeneralStats, Service, ServiceAddForm, ServerResponse, RegexFilter, RegexAddForm, ServerStatusResponse, PasswordSend, ChangePassword } from "./models";
|
||||
|
||||
var Buffer = require('buffer').Buffer
|
||||
|
||||
export const eventUpdateName = "update-info"
|
||||
|
||||
const custom_url = (!process.env.NODE_ENV || process.env.NODE_ENV === 'development')?"http://127.0.0.1:8080":""
|
||||
|
||||
export async function getapi(path:string):Promise<any>{
|
||||
@@ -42,6 +44,10 @@ export async function postapi(path:string,data:any):Promise<any>{
|
||||
});
|
||||
}
|
||||
|
||||
export function fireUpdateRequest(){
|
||||
window.dispatchEvent(new Event(eventUpdateName))
|
||||
}
|
||||
|
||||
export async function getstatus(){
|
||||
return await getapi(`status`) as ServerStatusResponse;
|
||||
}
|
||||
@@ -139,7 +145,7 @@ export function getHumanReadableRegex(regexB64:string){
|
||||
|
||||
export function errorNotify(title:string, description:string ){
|
||||
showNotification({
|
||||
autoClose: notification_time,
|
||||
autoClose: 2000,
|
||||
title: title,
|
||||
message: description,
|
||||
color: 'red',
|
||||
@@ -149,7 +155,7 @@ export function errorNotify(title:string, description:string ){
|
||||
|
||||
export function okNotify(title:string, description:string ){
|
||||
showNotification({
|
||||
autoClose: notification_time,
|
||||
autoClose: 2000,
|
||||
title: title,
|
||||
message: description,
|
||||
color: 'teal',
|
||||
|
||||
Reference in New Issue
Block a user