Skip to content

Commit 1bc60e8

Browse files
committed
cmd
1 parent 66862ce commit 1bc60e8

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dist-ssr
1313
*.local
1414

1515
# Editor directories and files
16+
*.code-workspace
1617
.vscode/*
1718
!.vscode/extensions.json
1819
!.vscode/settings.json

src/App.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ watch(data, (msg) => {
135135
wsRxBus.emit(m);
136136
return;
137137
}
138-
message().warning(`unknown message code ${m.code}: ${m}`);
138+
const t = `unknown message code ${m.code}: ${JSON.stringify(m)}`;
139+
console.log(t);
140+
message().warning(t);
139141
});
140142
141143
const wsstatus = computed(() => {

src/components/ce_control.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ function getT(name: string, role: string) {
132132
function exec() {
133133
console.log("run");
134134
wsSend({
135-
code: WsMsgCodes.config_commit,
136-
// payload: { cmd: value.value },
135+
code: WsMsgCodes.config_cmd,
136+
msg: value.value,
137137
});
138138
}
139139

src/utils/types.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ export enum WsMsgCodes {
5555
render = 300,
5656
save = 100,
5757
echo = 1,
58-
config_commit = 400,
59-
config_compare = 401,
58+
config_cmd = 400,
6059
}
6160

6261
export interface WsMessage {

src/views/graphView.vue

+5-3
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ import {
265265
SelectOption,
266266
NDropdown,
267267
NIcon,
268+
useMessage,
268269
} from "naive-ui";
269270
import JSwitch from "@/components/j_switch.vue";
270271
import { RefreshSharp } from "@vicons/material";
@@ -281,6 +282,7 @@ import { WsMsgCodes, LinkLabels, NodeLabels, WsTemplate } from "@/utils/types";
281282
import { useLocalStorage, watchDebounced } from "@vueuse/core";
282283
import { labelDirection } from "@/utils/helpers";
283284
285+
(window as any).$message = useMessage();
284286
const store = useMainStore();
285287
const selectedNodes = ref<string[]>([]);
286288
const selectedLinks = ref<string[]>([]);
@@ -406,9 +408,6 @@ function centerGraph() {
406408
407409
onMounted(() => {
408410
logEvent("mounted", {});
409-
setTimeout(centerGraph, 200);
410-
setTimeout(centerGraph, 1000);
411-
//nextTick(centerGraph);
412411
});
413412
414413
wsTxBus.on((ev) => {
@@ -422,6 +421,9 @@ wsRxBus.on((ev) => {
422421
if (ev.code === WsMsgCodes.save) {
423422
logEvent("WS load", {});
424423
nextTick(centerGraph);
424+
setTimeout(centerGraph, 200);
425+
setTimeout(centerGraph, 1000);
426+
//nextTick(centerGraph);
425427
}
426428
});
427429

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
],
1919
"types": [
2020
"vite/client",
21-
"naive-ui/volar"
21+
"naive-ui/volar",
22+
"node"
2223
],
2324
"paths": {
2425
"@/*": [

0 commit comments

Comments
 (0)