mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-16 08:15:48 +00:00
Display toast when Gameyfin restarts
This commit is contained in:
@@ -1,14 +1,25 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import {SystemEndpoint} from "Frontend/generated/endpoints";
|
import {SystemEndpoint} from "Frontend/generated/endpoints";
|
||||||
import withConfigPage from "Frontend/components/administration/withConfigPage";
|
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";
|
import Section from "Frontend/components/general/Section";
|
||||||
|
|
||||||
function SystemManagementLayout() {
|
function SystemManagementLayout() {
|
||||||
|
|
||||||
|
function restart() {
|
||||||
|
SystemEndpoint.restart().then(() =>
|
||||||
|
addToast({
|
||||||
|
title: "Restarting",
|
||||||
|
description: "Gameyfin is restarting. This may take a few moments.",
|
||||||
|
color: "success"
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col mt-4">
|
<div className="flex flex-col mt-4">
|
||||||
<Section title="Restart Gameyfin"/>
|
<Section title="Restart Gameyfin"/>
|
||||||
<Button onPress={() => SystemEndpoint.restart()}>Restart</Button>
|
<Button onPress={restart}>Restart</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user