Display toast when Gameyfin restarts

This commit is contained in:
grimsi
2025-09-02 14:13:46 +02:00
parent 3377f770f6
commit 989a5ef189
@@ -1,14 +1,25 @@
import React from "react";
import {SystemEndpoint} from "Frontend/generated/endpoints";
import withConfigPage from "Frontend/components/administration/withConfigPage";
import {Button} from "@heroui/react";
import {addToast, Button} from "@heroui/react";
import Section from "Frontend/components/general/Section";
function SystemManagementLayout() {
function restart() {
SystemEndpoint.restart().then(() =>
addToast({
title: "Restarting",
description: "Gameyfin is restarting. This may take a few moments.",
color: "success"
})
);
}
return (
<div className="flex flex-col mt-4">
<Section title="Restart Gameyfin"/>
<Button onPress={() => SystemEndpoint.restart()}>Restart</Button>
<Button onPress={restart}>Restart</Button>
</div>
);
}