mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 10:14:35 +00:00
refactor(gui): refactor gui to use RemoteClient trait and RemoteManagement component (#1489)
* refactor(gui): refactor gui to use RemoteClient trait and RemoteManagement component * feat(gui): Add network config saving and refactor RemoteManagement
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { UUID } from './utils';
|
||||
import { NetworkConfig } from '../types/network';
|
||||
import { NetworkConfig, NetworkInstanceRunningInfo } from '../types/network';
|
||||
|
||||
export interface ValidateConfigResponse {
|
||||
toml_config: string;
|
||||
@@ -20,14 +20,21 @@ export interface ParseConfigResponse {
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface CollectNetworkInfoResponse {
|
||||
info: {
|
||||
map: Record<string, NetworkInstanceRunningInfo | undefined>;
|
||||
}
|
||||
}
|
||||
|
||||
export interface RemoteClient {
|
||||
validate_config(config: any): Promise<ValidateConfigResponse>;
|
||||
run_network(config: any): Promise<undefined>;
|
||||
get_network_info(inst_id: string): Promise<any>;
|
||||
validate_config(config: NetworkConfig): Promise<ValidateConfigResponse>;
|
||||
run_network(config: NetworkConfig): Promise<undefined>;
|
||||
get_network_info(inst_id: string): Promise<NetworkInstanceRunningInfo | undefined>;
|
||||
list_network_instance_ids(): Promise<ListNetworkInstanceIdResponse>;
|
||||
delete_network(inst_id: string): Promise<undefined>;
|
||||
update_network_instance_state(inst_id: string, disabled: boolean): Promise<undefined>;
|
||||
get_network_config(inst_id: string): Promise<any>;
|
||||
save_config(config: NetworkConfig): Promise<undefined>;
|
||||
get_network_config(inst_id: string): Promise<NetworkConfig>;
|
||||
generate_config(config: NetworkConfig): Promise<GenerateConfigResponse>;
|
||||
parse_config(toml_config: string): Promise<ParseConfigResponse>;
|
||||
}
|
||||
Reference in New Issue
Block a user