implement remaining features of the server page (#9)

* implement remaining features of the server page

* fix fm init

* ?
This commit is contained in:
UUBulb
2024-11-21 22:20:14 +08:00
committed by GitHub
parent 6166d9de3f
commit 33b2ffb40c
18 changed files with 994 additions and 32 deletions

View File

@@ -93,6 +93,12 @@ export interface GithubComNaibaNezhaModelCommonResponseModelConfig {
success: boolean;
}
export interface GithubComNaibaNezhaModelCommonResponseModelForceUpdateResponse {
data: ModelForceUpdateResponse;
error: string;
success: boolean;
}
export interface GithubComNaibaNezhaModelCommonResponseModelLoginResponse {
data: ModelLoginResponse;
error: string;
@@ -279,6 +285,12 @@ export interface ModelDDNSProfile {
webhook_url: string;
}
export interface ModelForceUpdateResponse {
failure?: number[];
offline?: number[];
success?: number[];
}
export interface ModelHost {
arch: string;
boot_time: number;

37
src/types/fm.ts Normal file
View File

@@ -0,0 +1,37 @@
export interface FMEntry {
type: number,
name: string,
}
export enum FMOpcode {
List,
Download,
Upload,
}
export const FMIdentifier = {
file: new Uint8Array([0x4E, 0x5A, 0x54, 0x44]), // NZTD
fileName: new Uint8Array([0x4E, 0x5A, 0x46, 0x4E]), // NZFN
error: new Uint8Array([0x4E, 0x45, 0x52, 0x52]), // NERR
complete: new Uint8Array([0x4E, 0x5A, 0x55, 0x50]), // NZUP
}
export interface FMWorkerPost {
operation: number;
arrayBuffer: ArrayBuffer;
fileName: string;
}
export enum FMWorkerOpcode {
Error,
Progress,
Result,
}
export interface FMWorkerData {
type: FMWorkerOpcode,
error: string,
blob?: Blob,
progress?: string,
fileName?: string,
}

View File

@@ -10,3 +10,4 @@ export * from './notification';
export * from './alert-rule';
export * from './notificationStore';
export * from './notificationContext';
export * from './fm';