mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-09-19 09:40:13 +00:00
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:
@@ -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);
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user