mirror of
https://github.com/AlchemillaHQ/Sylve.git
synced 2026-06-14 00:46:34 +03:00
Merge branch 'v0.2.0-wip' of github.com:AlchemillaHQ/Sylve into v0.2.0-wip
This commit is contained in:
@@ -123,7 +123,6 @@ func SetupDatabase(cfg *internal.SylveConfig, isTest bool) *gorm.DB {
|
||||
&infoModels.Note{},
|
||||
|
||||
&infoModels.ZPoolHistorical{},
|
||||
|
||||
&zfsModels.PeriodicSnapshot{},
|
||||
|
||||
&networkModels.ManualSwitch{},
|
||||
|
||||
@@ -16,7 +16,9 @@ import {
|
||||
type VMLogs,
|
||||
type VMTemplate,
|
||||
type VMDomain,
|
||||
type VMStat
|
||||
type VMStat,
|
||||
type OutcomeResponse,
|
||||
OutcomeResponseSchema
|
||||
} from '$lib/types/vm/vm';
|
||||
import { apiRequest } from '$lib/utils/http';
|
||||
import { z } from 'zod/v4';
|
||||
@@ -113,8 +115,8 @@ export async function actionVm(
|
||||
rid: number | string,
|
||||
action: string,
|
||||
hostname?: string
|
||||
): Promise<APIResponse> {
|
||||
return await apiRequest(`/vm/${action}/${rid}`, APIResponseSchema, 'POST', undefined, { hostname });
|
||||
): Promise<OutcomeResponse | APIResponse> {
|
||||
return await apiRequest(`/vm/${action}/${rid}`, OutcomeResponseSchema, 'POST', undefined, { hostname });
|
||||
}
|
||||
|
||||
export interface ConvertVMToTemplateRequest {
|
||||
|
||||
@@ -277,6 +277,10 @@ export const QGAInfoSchema = z.object({
|
||||
interfaces: z.array(QGANetworkInterfaceSchema).nullable()
|
||||
});
|
||||
|
||||
export const OutcomeResponseSchema = z.object({
|
||||
outcome: z.string()
|
||||
});
|
||||
|
||||
export type VM = z.infer<typeof VMSchema>;
|
||||
export type VMCPUPinning = z.infer<typeof VMCPUPinningSchema>;
|
||||
export type VMStorage = z.infer<typeof VMStorageSchema>;
|
||||
@@ -290,10 +294,9 @@ export type VMTemplate = z.infer<typeof VMTemplateSchema>;
|
||||
export type VMTemplateStorage = z.infer<typeof VMTemplateStorageSchema>;
|
||||
export type VMTemplateNetwork = z.infer<typeof VMTemplateNetworkSchema>;
|
||||
export type QGAInfo = z.infer<typeof QGAInfoSchema>;
|
||||
|
||||
export type VMLifecycleAction = 'start' | 'stop' | 'shutdown' | 'reboot';
|
||||
|
||||
export type VMLifecycleBadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline';
|
||||
export type OutcomeResponse = z.infer<typeof OutcomeResponseSchema>;
|
||||
|
||||
export interface VMLifecycleBadgeStyle {
|
||||
variant: VMLifecycleBadgeVariant;
|
||||
|
||||
Reference in New Issue
Block a user