fix node layout error and support subtree

This commit is contained in:
codetypes committed 2024-03-11 09:35:39 +08:00
1 parent d3c5bf53e7
commit 258a006383
21 files changed
+6019 -11457

No files matched your search

+7 -3
View File
@@ -43,8 +43,8 @@ export default class Workspace {
const model = JSON.parse(str) as WorkspaceModel;
if (model.isRelative) {
const root = path.dirname(this.filepath);
this.nodeConfPath = path.join(root,model.nodeConfPath);
this.workdir = path.join(root,model.workdir);
this.nodeConfPath = path.join(root, model.nodeConfPath);
this.workdir = path.join(root, model.workdir);
} else {
this.nodeConfPath = model.nodeConfPath;
this.workdir = model.workdir;
@@ -86,7 +86,7 @@ export default class Workspace {
this.workdir = workdir;
}
getServers() {
if(this.model && this.model.servers) {
if (this.model && this.model.servers) {
return this.model.servers;
} else {
return [];
@@ -154,4 +154,8 @@ export default class Workspace {
getNodeConf(name: string) {
return this.name2conf[name] || unknowNodeType;
}
hasNodeConf(name: string) {
return !!this.name2conf[name];
}
}