Merge branch 'v0.2.0-wip' of github.com:AlchemillaHQ/Sylve into v0.2.0-wip

This commit is contained in:
hayzam
2026-03-26 20:30:58 +05:30
3 changed files with 10 additions and 6 deletions
-1
View File
@@ -123,7 +123,6 @@ func SetupDatabase(cfg *internal.SylveConfig, isTest bool) *gorm.DB {
&infoModels.Note{},
&infoModels.ZPoolHistorical{},
&zfsModels.PeriodicSnapshot{},
&networkModels.ManualSwitch{},
+5 -3
View File
@@ -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 {
+5 -2
View File
@@ -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;