Commit 74d3616
authored
Feat/tags (#255)
This pull request introduces support for editable fields in the
`TextInfo` component and adds a tagging system for devices in the
network visualization. The most significant changes include updates to
the `TextInfo` class to allow inline editing of certain fields, the
addition of a `tag` property to devices, and the use of device tags as
identifiers in various components.
### Editable Fields in `TextInfo`:
*
[`src/graphics/basic_components/text_info.ts`](diffhunk://#diff-d8873354465d98b848d2fc3b34957af25885e7e1e77dedbf6fdbcd98e750b765R17-R18):
Added `editable` and `onEdit` properties to `InfoField` and updated the
`addField` method to support these properties. Modified the
`createDetailElement` method to render an input field for editable
fields and handle user edits.
[[1]](diffhunk://#diff-d8873354465d98b848d2fc3b34957af25885e7e1e77dedbf6fdbcd98e750b765R17-R18)
[[2]](diffhunk://#diff-d8873354465d98b848d2fc3b34957af25885e7e1e77dedbf6fdbcd98e750b765L45-R52)
[[3]](diffhunk://#diff-d8873354465d98b848d2fc3b34957af25885e7e1e77dedbf6fdbcd98e750b765L66-R85)
[[4]](diffhunk://#diff-d8873354465d98b848d2fc3b34957af25885e7e1e77dedbf6fdbcd98e750b765L119-R139)
[[5]](diffhunk://#diff-d8873354465d98b848d2fc3b34957af25885e7e1e77dedbf6fdbcd98e750b765L138-R162)
*
[`src/styles/info.css`](diffhunk://#diff-491a767362663fa382b6668f53918a33594c6cff6f34f616a22ae85b4dfbac53R55-R77):
Added styles for the new `.editable-field` class to style editable input
fields.
### Tagging System for Devices:
*
[`src/types/data-devices/dDevice.ts`](diffhunk://#diff-96da61e6f9b86c4b8e4877068e5896132265c26e24436c5fe0ccb670597cf240R15):
Introduced a `tag` property to `DataDevice` and added methods to get and
set the tag.
[[1]](diffhunk://#diff-96da61e6f9b86c4b8e4877068e5896132265c26e24436c5fe0ccb670597cf240R15)
[[2]](diffhunk://#diff-96da61e6f9b86c4b8e4877068e5896132265c26e24436c5fe0ccb670597cf240R40)
[[3]](diffhunk://#diff-96da61e6f9b86c4b8e4877068e5896132265c26e24436c5fe0ccb670597cf240R58-R67)
*
[`src/types/view-devices/vDevice.ts`](diffhunk://#diff-2bb090dfab27a6fdd9154c9d52e4bb771254dcb3685cea653537c1266720bd4eR65):
Updated `ViewDevice` to include a `tag` property, use it as a label if
available, and synchronize it with the data graph. Added methods for
managing tags and retrieving device identifiers.
[[1]](diffhunk://#diff-2bb090dfab27a6fdd9154c9d52e4bb771254dcb3685cea653537c1266720bd4eR65)
[[2]](diffhunk://#diff-2bb090dfab27a6fdd9154c9d52e4bb771254dcb3685cea653537c1266720bd4eR107-R112)
[[3]](diffhunk://#diff-2bb090dfab27a6fdd9154c9d52e4bb771254dcb3685cea653537c1266720bd4eL135-R138)
[[4]](diffhunk://#diff-2bb090dfab27a6fdd9154c9d52e4bb771254dcb3685cea653537c1266720bd4eL249-R288)
* Updated all `ViewDevice` subclasses (`ViewHost`, `ViewRouter`,
`ViewSwitch`, etc.) to pass the `tag` property during initialization.
[[1]](diffhunk://#diff-7887bc08a95b49d0d793156a43696b2d0124f450833dcd46e9ac1cd287e2f104R51)
[[2]](diffhunk://#diff-7887bc08a95b49d0d793156a43696b2d0124f450833dcd46e9ac1cd287e2f104R63)
[[3]](diffhunk://#diff-8b60a0a40123dfb655fb928b7de3e711094e1b2d393b1c80306aa9bebd6c13c7R36-R40)
[[4]](diffhunk://#diff-221c2585585eef7ff9eafd84467d1c0bcef658af348a8673d2d00f752d06e35aR43)
[[5]](diffhunk://#diff-221c2585585eef7ff9eafd84467d1c0bcef658af348a8673d2d00f752d06e35aR57)
[[6]](diffhunk://#diff-273582e218624a21744b6795e7b5c241816fd31a72ae8b5c0bea983aecf72adfR33)
[[7]](diffhunk://#diff-273582e218624a21744b6795e7b5c241816fd31a72ae8b5c0bea983aecf72adfR43)
### Identifier Updates Across Components:
* Updated various components to use the new `getIdentifier` method
(which prioritizes tags) instead of raw device IDs. This includes
changes in `EdgeInfo`, `PacketInfo`, and dropdown labels in
`program_info.ts`.
[[1]](diffhunk://#diff-b2ff09f0ed37556256344e68555579178a82eced6c6e055568aa8aefbaf18dfdL55-R60)
[[2]](diffhunk://#diff-b2ff09f0ed37556256344e68555579178a82eced6c6e055568aa8aefbaf18dfdL97-R97)
[[3]](diffhunk://#diff-b2ff09f0ed37556256344e68555579178a82eced6c6e055568aa8aefbaf18dfdL122-R122)
[[4]](diffhunk://#diff-dad6a431ca480d540d428efc2a8a75565208ed4e64ed84388af2b429357970b5L41-R46)
[[5]](diffhunk://#diff-dad6a431ca480d540d428efc2a8a75565208ed4e64ed84388af2b429357970b5L61-R66)
Ff392e25L48R48,
[[6]](diffhunk://#diff-b8494f225cac1cb8b3c9735dac84eb3d2fa18c0fb6b32469b70ba095c0b87d69L86-R93)
These changes collectively enhance the user experience by enabling
inline editing of information fields and providing a more user-friendly
way to identify and label devices.
close #641 parent 4a76015 commit 74d3616
File tree
15 files changed
+143
-33
lines changed- src
- graphics
- basic_components
- renderables
- styles
- types
- data-devices
- graphs
- view-devices
- utils/constants
15 files changed
+143
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
| 47 | + | |
46 | 48 | | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | | - | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
66 | | - | |
67 | 70 | | |
68 | | - | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
76 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
77 | 86 | | |
78 | 87 | | |
79 | 88 | | |
| |||
116 | 125 | | |
117 | 126 | | |
118 | 127 | | |
119 | | - | |
120 | 128 | | |
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
| 132 | + | |
| 133 | + | |
124 | 134 | | |
125 | 135 | | |
126 | | - | |
| 136 | + | |
127 | 137 | | |
128 | 138 | | |
129 | | - | |
| 139 | + | |
130 | 140 | | |
131 | 141 | | |
132 | 142 | | |
| |||
135 | 145 | | |
136 | 146 | | |
137 | 147 | | |
138 | | - | |
139 | | - | |
140 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
141 | 163 | | |
142 | 164 | | |
143 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
92 | | - | |
| 96 | + | |
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
55 | 78 | | |
56 | 79 | | |
57 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | | - | |
| 47 | + | |
47 | 48 | | |
48 | | - | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
132 | | - | |
| 135 | + | |
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
| |||
249 | 252 | | |
250 | 253 | | |
251 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
252 | 260 | | |
253 | 261 | | |
254 | 262 | | |
255 | 263 | | |
256 | 264 | | |
257 | 265 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
264 | 292 | | |
265 | 293 | | |
266 | 294 | | |
| |||
0 commit comments