Skip to content

Commit 0924119

Browse files
committed
rectangle
1 parent 16fc296 commit 0924119

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

src/components/div_graph.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
<template #override-node="{ nodeId, scale, config, ...slotProps }">
2727
<rect
2828
v-if="getNodeProps(nodeId).type == 'rect'"
29-
:x="(-config.width * scale) / 2"
30-
:y="(-config.height * scale) / 2"
31-
:width="config.width * scale"
32-
:height="config.height * scale"
29+
:x="-config.radius * scale"
30+
:y="-config.radius * scale"
31+
:width="config.radius * scale * 2"
32+
:height="config.radius * scale * 2"
3333
:fill="config.color"
3434
v-bind="slotProps"
3535
/>

src/stores/mainStore.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ export const useMainStore = defineStore("main", {
6565
split_vars: useLocalStorage("split_vars", true),
6666
/** dark theme */
6767
dark: useLocalStorage("dark_mode", false),
68+
69+
/** last save time */
70+
lastSave: 0,
6871
}),
6972
// optional getters
7073
getters: {
@@ -156,6 +159,10 @@ export const useMainStore = defineStore("main", {
156159
console.warn("no data to load")
157160
return
158161
}
162+
if (Date.now() - this.lastSave < 800) {
163+
console.debug("ignoring changes from server")
164+
return
165+
}
159166
this.context = data.context as Context
160167
console.debug("load layouts+", data.options)
161168
this.optHeight = Math.max(400, Math.min(900, data.options.height || 450))
@@ -256,6 +263,7 @@ export const useMainStore = defineStore("main", {
256263
save() {
257264
console.debug("save layouts+", this.wsState.uidata)
258265
wsSend(this.wsState)
266+
this.lastSave = Date.now()
259267
},
260268

261269
/* process a received websock message */
@@ -318,17 +326,6 @@ export const useMainStore = defineStore("main", {
318326
this.fetch_templates()
319327
return
320328
}
321-
if (this.context.topofile.endsWith(`/${name}`)) {
322-
console.error("topo file updated, should have received a WS msg")
323-
return
324-
}
325-
if (
326-
this.context.topofile.endsWith(`/${name.replace(".labctl.", ".clab.")}`)
327-
) {
328-
// updated when we move nodes
329-
// MsgWarning(`labctl file updated, you need to restart the labctl server`)
330-
return
331-
}
332329

333330
MsgWarning(`unhandled file change: ${name}`)
334331
},

0 commit comments

Comments
 (0)