-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathshow-user-registry.json
More file actions
76 lines (76 loc) · 1.95 KB
/
show-user-registry.json
File metadata and controls
76 lines (76 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
[
{
"id": "fe9d58b1f84fce63",
"type": "inject",
"z": "c63466f5ec185814",
"name": "show UserRegistry",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payloadType": "date",
"x": 790,
"y": 1020,
"wires": [
[
"663a2575d83ff39f"
]
]
},
{
"id": "80fab4a14a0c61a7",
"type": "comment",
"z": "c63466f5ec185814",
"name": "for testing purposes",
"info": "",
"x": 770,
"y": 960,
"wires": []
},
{
"id": "663a2575d83ff39f",
"type": "function",
"z": "c63466f5ec185814",
"name": "create output",
"func": "let UserRegistry = global.get('UserRegistry') || Object.create(null)\n let UserList = []\n for (let UserId in UserRegistry) {\n UserList.push(\n UserRegistry[UserId] == null ? '[' + UserId + ']' : UserId\n )\n }\nmsg.payload = (\n UserList.length === 0\n ? '(no user registered)'\n : 'registered users: \"' + UserList.join('\",\"') + '\"'\n)\nreturn msg",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1000,
"y": 1020,
"wires": [
[
"62b2658722dbd9e7"
]
]
},
{
"id": "62b2658722dbd9e7",
"type": "debug",
"z": "c63466f5ec185814",
"name": "show",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1170,
"y": 1020,
"wires": []
}
]