feat: add workspace templates and tab visibility

This commit is contained in:
2026-07-10 21:32:48 +08:00
parent 2007b909d1
commit e412cfc45a
14 changed files with 739 additions and 67 deletions
+2
View File
@@ -72,6 +72,8 @@ export function ListVaultTrash(arg1:string):Promise<Array<files.TrashEntry>|stri
export function ListWorkspaces():Promise<Array<workspace.Workspace>|string>;
export function ListWorkspaceTemplates():Promise<Array<workspace.WorkspaceTemplate>|string>;
export function MoveVaultPath(arg1:string,arg2:string,arg3:string,arg4:files.MoveOptions):Promise<string>;
export function MoveWorkspaceNode(arg1:string,arg2:string):Promise<string>;
+4
View File
@@ -130,6 +130,10 @@ export function ListWorkspaces() {
return window['go']['api']['App']['ListWorkspaces']();
}
export function ListWorkspaceTemplates() {
return window['go']['api']['App']['ListWorkspaceTemplates']();
}
export function MoveVaultPath(arg1, arg2, arg3, arg4) {
return window['go']['api']['App']['MoveVaultPath'](arg1, arg2, arg3, arg4);
}
+25
View File
@@ -1213,12 +1213,34 @@ export namespace workbench {
}
export namespace workspace {
export class WorkspaceTemplate {
id: string;
name: string;
description: string;
version: number;
workspaceTools: string[];
static createFrom(source: any = {}) {
return new WorkspaceTemplate(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.name = source["name"];
this.description = source["description"];
this.version = source["version"];
this.workspaceTools = source["workspaceTools"];
}
}
export class TemplateSnapshot {
templateId: string;
templateName: string;
templateVersion: number;
appliedAt: string;
workspaceTools?: string[];
static createFrom(source: any = {}) {
return new TemplateSnapshot(source);
@@ -1230,6 +1252,7 @@ export namespace workspace {
this.templateName = source["templateName"];
this.templateVersion = source["templateVersion"];
this.appliedAt = source["appliedAt"];
this.workspaceTools = source["workspaceTools"];
}
}
export class Metadata {
@@ -1237,6 +1260,7 @@ export namespace workspace {
createdFromTemplate?: TemplateSnapshot;
features?: Record<string, boolean>;
folders?: Record<string, string>;
workspaceTools?: string[];
updatedAt?: string;
static createFrom(source: any = {}) {
@@ -1249,6 +1273,7 @@ export namespace workspace {
this.createdFromTemplate = this.convertValues(source["createdFromTemplate"], TemplateSnapshot);
this.features = source["features"];
this.folders = source["folders"];
this.workspaceTools = source["workspaceTools"];
this.updatedAt = source["updatedAt"];
}