further implementing server page (#4)

* further implementing server page

* optimize icon button

* rename some unnecessary file extensions

* add terminal page & fm card
This commit is contained in:
UUBulb
2024-11-18 20:48:30 +08:00
committed by GitHub
parent f4fbc9f488
commit bf7ffd36e0
25 changed files with 1248 additions and 149 deletions
+6
View File
@@ -0,0 +1,6 @@
import { ModelCreateFMResponse } from "@/types";
import { fetcher, FetcherMethod } from "./api"
export const createFM = async (id: string): Promise<ModelCreateFMResponse> => {
return fetcher<ModelCreateFMResponse>(FetcherMethod.GET, `/api/v1/file?id=${id}`, null);
}
+10
View File
@@ -0,0 +1,10 @@
import { ModelServerForm } from "@/types"
import { fetcher, FetcherMethod } from "./api"
export const updateServer = async (id: number, data: ModelServerForm): Promise<void> => {
return fetcher<void>(FetcherMethod.PATCH, `/api/v1/server/${id}`, data)
}
export const deleteServer = async (id: number[]): Promise<void> => {
return fetcher<void>(FetcherMethod.POST, '/api/v1/batch-delete/server', id)
}
+8
View File
@@ -0,0 +1,8 @@
import { ModelTerminalForm, ModelCreateTerminalResponse } from "@/types";
import { fetcher, FetcherMethod } from "./api"
export const createTerminal = async (id: number): Promise<ModelCreateTerminalResponse> => {
return fetcher<ModelCreateTerminalResponse>(FetcherMethod.POST, '/api/v1/terminal', {
server_id: id,
});
}