mirror of
https://github.com/MCSManager/MCSManager.git
synced 2025-01-18 15:04:04 +08:00
Feat: restart instance
This commit is contained in:
parent
d250c298bb
commit
ddb20ce11d
@ -73,6 +73,21 @@ export const stopInstance = useDefineApi<
|
||||
method: "GET"
|
||||
});
|
||||
|
||||
export const restartInstance = useDefineApi<
|
||||
{
|
||||
params: {
|
||||
uuid: string;
|
||||
remote_uuid: string;
|
||||
};
|
||||
},
|
||||
{
|
||||
instanceUuid: string;
|
||||
}
|
||||
>({
|
||||
url: "/api/protected_instance/restart",
|
||||
method: "GET"
|
||||
});
|
||||
|
||||
// 更新实例设置(普通用户)
|
||||
export const updateInstanceConfig = useDefineApi<
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ import { onMounted, computed, ref } from "vue";
|
||||
import { useLayoutCardTools } from "@/hooks/useCardTools";
|
||||
import { getRandomId } from "../../tools/randId";
|
||||
import IconBtn from "@/components/IconBtn.vue";
|
||||
import { openInstance, stopInstance } from "@/services/apis/instance";
|
||||
import { openInstance, stopInstance, restartInstance } from "@/services/apis/instance";
|
||||
import { CloseOutlined } from "@ant-design/icons-vue";
|
||||
import { GLOBAL_INSTANCE_NAME } from "../../config/const";
|
||||
import { INSTANCE_STATUS_TEXT } from "../../hooks/useInstance";
|
||||
@ -95,7 +95,12 @@ const instanceOperations = arrayFilter([
|
||||
title: t("TXT_CODE_47dcfa5"),
|
||||
icon: ReconciliationOutlined,
|
||||
click: () => {
|
||||
console.log(3);
|
||||
restartInstance().execute({
|
||||
params: {
|
||||
uuid: instanceId || "",
|
||||
remote_uuid: daemonId || ""
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user