Minor changes

This commit is contained in:
DomySh
2022-06-15 16:34:55 +02:00
parent b699eb4269
commit 0f912ce1b9
5 changed files with 3409 additions and 757 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -22,11 +22,13 @@
"react-dom": "^18.1.0",
"react-icons": "^4.4.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"sass": "^1.52.3",
"typescript": "^4.7.3",
"web-vitals": "^2.1.4"
},
"devDependencies": {
"react-scripts": "5.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",

View File

@@ -21,12 +21,12 @@ function Header() {
const navigator = useNavigate()
const updateInfo = () => {
generalstats().then(res => {
setGeneralStats(res)
}).catch(
err => errorNotify("General Info Auto-Update failed!", err.toString())
)
const updateInfo = () => {
generalstats().then(res => {
setGeneralStats(res)
}).catch(
err => errorNotify("General Info Auto-Update failed!", err.toString())
)
}
useEffect(()=>{

View File

@@ -38,6 +38,7 @@ function ServiceRow({ service, onClick, additional_buttons }:{ service:Service,
await stopservice(service.id).then(res => {
if(!res){
okNotify(`Service ${service.id} stopped successfully!`,`The service ${service.name} has been stopped!`)
updateInfo();
}else{
errorNotify(`An error as occurred during the stopping of the service ${service.id}`,`Error: ${res}`)
}
@@ -45,7 +46,6 @@ function ServiceRow({ service, onClick, additional_buttons }:{ service:Service,
errorNotify(`An error as occurred during the stopping of the service ${service.id}`,`Error: ${err}`)
})
setButtonLoading(false);
updateInfo();
}
const startService = async () => {
@@ -53,6 +53,7 @@ function ServiceRow({ service, onClick, additional_buttons }:{ service:Service,
await startservice(service.id).then(res => {
if(!res){
okNotify(`Service ${service.id} started successfully!`,`The service ${service.name} has been started!`)
updateInfo();
}else{
errorNotify(`An error as occurred during the starting of the service ${service.id}`,`Error: ${res}`)
}
@@ -60,7 +61,6 @@ function ServiceRow({ service, onClick, additional_buttons }:{ service:Service,
errorNotify(`An error as occurred during the starting of the service ${service.id}`,`Error: ${err}`)
})
setButtonLoading(false)
updateInfo();
}
const pauseService = async () => {
@@ -68,6 +68,7 @@ function ServiceRow({ service, onClick, additional_buttons }:{ service:Service,
await pauseservice(service.id).then(res => {
if(!res){
okNotify(`Service ${service.id} paused successfully!`,`The service ${service.name} has been paused (Transparent mode)!`)
updateInfo();
}else{
errorNotify(`An error as occurred during the pausing of the service ${service.id}`,`Error: ${res}`)
}
@@ -75,7 +76,7 @@ function ServiceRow({ service, onClick, additional_buttons }:{ service:Service,
errorNotify(`An error as occurred during the pausing of the service ${service.id}`,`Error: ${err}`)
})
setButtonLoading(false)
updateInfo();
}
return <>

View File

@@ -62,26 +62,27 @@ function ServiceDetails() {
const deleteService = () => {
deleteservice(serviceInfo.id).then(res => {
if (!res)
if (!res){
okNotify("Service delete complete!",`The service ${serviceInfo.id} has been deleted!`)
else
updateInfo();
}else
errorNotify("An error occurred while deleting a service",`Error: ${res}`)
}).catch(err => {
errorNotify("An error occurred while deleting a service",`Error: ${err}`)
})
updateInfo();
}
const changePort = () => {
regenport(serviceInfo.id).then(res => {
if (!res)
if (!res){
okNotify("Service port regeneration completed!",`The service ${serviceInfo.id} has changed the internal port!`)
else
updateInfo();
}else
errorNotify("An error occurred while changing the internal service port",`Error: ${res}`)
}).catch(err => {
errorNotify("An error occurred while changing the internal service port",`Error: ${err}`)
})
updateInfo();
}
return <div>