@@ -8,7 +8,7 @@ import { NodeInfo } from "../config_default.js";
8
8
9
9
const patch = init ( [ classModule , propsModule , styleModule , eventListenersModule ] ) ;
10
10
11
- function showStatImg ( nodeInfo : NodeInfo , node : NodeData ) {
11
+ function showStatImg ( nodeInfo : NodeInfo , node : NodeData ) : HTMLDivElement {
12
12
let config = window . config ;
13
13
let subst = {
14
14
"{NODE_ID}" : node . node_id ,
@@ -199,14 +199,11 @@ export function Node(el: HTMLElement, node: NodeData, linkScale: (t: any) => any
199
199
200
200
let devicePictures = showDevicePictures ( config . devicePictures , node ) ;
201
201
let devicePicturesContainerData = {
202
- attrs : {
202
+ props : {
203
203
class : "hw-img-container" ,
204
204
} ,
205
205
} ;
206
- devicePicture = patch (
207
- devicePicture ,
208
- devicePictures ? h ( "div" , devicePicturesContainerData , devicePictures ) : h ( "div" ) ,
209
- ) as unknown as HTMLDivElement ;
206
+ patch ( devicePicture , devicePictures ? h ( "div" , devicePicturesContainerData , devicePictures ) : h ( "div" ) ) ;
210
207
211
208
let children = [ ] ;
212
209
@@ -237,9 +234,8 @@ export function Node(el: HTMLElement, node: NodeData, linkScale: (t: any) => any
237
234
children . push ( h ( "tr" , [ h ( "th" , _ . t ( "node.gateway" ) ) , showGateway ( node ) ] ) ) ;
238
235
239
236
let elNew = h ( "table" , children ) ;
240
- table = patch ( table , elNew ) as unknown as HTMLTableElement ;
241
- // @ts -ignore
242
- table . elm . classList . add ( "attributes" ) ;
237
+ patch ( table , elNew ) ;
238
+ table . classList . add ( "attributes" ) ;
243
239
244
240
patch ( neighbours , h ( "h3" , _ . t ( "node.link" , node . neighbours . length ) + " (" + node . neighbours . length + ")" ) ) ;
245
241
if ( node . neighbours . length > 0 ) {
@@ -253,7 +249,7 @@ export function Node(el: HTMLElement, node: NodeData, linkScale: (t: any) => any
253
249
img . push ( h ( "h4" , nodeInfo . name ) as unknown as HTMLElement ) ;
254
250
img . push ( showStatImg ( nodeInfo , node ) ) ;
255
251
} ) ;
256
- images = patch ( images , h ( "div" , img ) ) as unknown as HTMLDivElement ;
252
+ patch ( images , h ( "div" , img ) ) ;
257
253
}
258
254
} ;
259
255
0 commit comments