From 4cb2a402f8f694d093e3ed90d4a9d2d3f08621b3 Mon Sep 17 00:00:00 2001 From: Ivan Oonincx <103519966+Ivan0348@users.noreply.github.com> Date: Thu, 9 Nov 2023 19:58:26 +0100 Subject: [PATCH] added button to remove profile before install server (#102) --- .idea/.gitignore | 1 + frontend/src/pages/InstallUpdater.tsx | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.idea/.gitignore b/.idea/.gitignore index 73f69e0..9fd8520 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -6,3 +6,4 @@ /dataSources.local.xml # Editor-based HTTP Client requests /httpRequests/ +/git_toolbox_prj.xml diff --git a/frontend/src/pages/InstallUpdater.tsx b/frontend/src/pages/InstallUpdater.tsx index 076b0e8..cc975d1 100644 --- a/frontend/src/pages/InstallUpdater.tsx +++ b/frontend/src/pages/InstallUpdater.tsx @@ -12,10 +12,11 @@ import { Typography } from "@mui/joy"; import {OpenDirectoryDialog} from "../../wailsjs/go/helpers/HelpersController"; -import {IconDownload} from "@tabler/icons-react"; +import {IconDownload, IconTrash} from "@tabler/icons-react"; import {InstallUpdateVerify} from "../../wailsjs/go/installer/InstallerController"; import {EventsOn} from "../../wailsjs/runtime"; import {useAlert} from "../components/AlertProvider"; +import {DeleteProfile} from "../../wailsjs/go/server/ServerController"; type Props = { setServ: React.Dispatch> @@ -48,6 +49,10 @@ export function InstallUpdater({setServ, serv, onInstalled}: Props) { }) } + function onCancelButtonClicked() { + DeleteProfile(serv.id).then(() => {addAlert("Deleted profile", "success"); setTimeout(() => {location.reload()}, 500) }).catch((err) => {console.error(err); addAlert(err, "danger")}) + } + useEffect(() => { EventsOn("installingUpdateAction", (data) => {setAction(data);}) EventsOn("installingUpdateProgress", (data) => {setProgress(data);}) @@ -55,9 +60,6 @@ export function InstallUpdater({setServ, serv, onInstalled}: Props) { }, []); - - - return (
@@ -87,11 +89,10 @@ export function InstallUpdater({setServ, serv, onInstalled}: Props) { Server Path -
- +
+ +
- -
);