1
|
|
|
module.exports = function () { |
2
|
|
|
return { |
3
|
|
|
'reverseGeocodingApi': 'https://nominatim.openstreetmap.org/reverse', |
4
|
|
|
'maxAge': 14, |
5
|
|
|
'maxAgeAlert': 3, |
6
|
|
|
'nodeZoom': 18, |
7
|
|
|
'labelZoom': 13, |
8
|
|
|
'clientZoom': 15, |
9
|
|
|
'nodeAttr': [ |
10
|
|
|
// value can be a node attribute (1 depth) or a a function in utils/node with prefix show |
11
|
|
|
{ |
12
|
|
|
'name': 'node.status', |
13
|
|
|
'value': 'Status' |
14
|
|
|
}, |
15
|
|
|
{ |
16
|
|
|
'name': 'node.gateway', |
17
|
|
|
'value': 'Gateway' |
18
|
|
|
}, |
19
|
|
|
{ |
20
|
|
|
'name': 'node.coordinates', |
21
|
|
|
'value': 'GeoURI' |
22
|
|
|
}, |
23
|
|
|
// { |
24
|
|
|
// "name": "node.contact", |
25
|
|
|
// "value": "owner" |
26
|
|
|
// }, |
27
|
|
|
|
28
|
|
|
// Examples for functions |
29
|
|
|
// { |
30
|
|
|
// // no name will remove first column |
31
|
|
|
// 'value': function (d) { |
32
|
|
|
// var moment = require('moment'); |
33
|
|
|
// var V = require('snabbdom').default; |
34
|
|
|
// return V.h('td', { props: { colSpan: 2 }, style: { background: '#49a' } }, |
35
|
|
|
// _.t('sidebar.nodeOnline') + ' translate, ' + moment(d.firstseen).get('month') + |
36
|
|
|
// ' Month require libs like moment, access config ' + config.siteName); |
37
|
|
|
// } |
38
|
|
|
// }, |
39
|
|
|
// { |
40
|
|
|
// 'name': 'Neighbour first seen', |
41
|
|
|
// 'value': function (d, nodeDict) { |
42
|
|
|
// return nodeDict[d.gateway_nexthop].firstseen.format() + 'access node object'; |
43
|
|
|
// } |
44
|
|
|
// }, |
45
|
|
|
{ |
46
|
|
|
'name': 'node.hardware', |
47
|
|
|
'value': 'model' |
48
|
|
|
}, |
49
|
|
|
{ |
50
|
|
|
'name': 'node.primaryMac', |
51
|
|
|
'value': 'mac' |
52
|
|
|
}, |
53
|
|
|
{ |
54
|
|
|
'name': 'node.firmware', |
55
|
|
|
'value': 'Firmware' |
56
|
|
|
}, |
57
|
|
|
{ |
58
|
|
|
'name': 'node.uptime', |
59
|
|
|
'value': 'Uptime' |
60
|
|
|
}, |
61
|
|
|
{ |
62
|
|
|
'name': 'node.firstSeen', |
63
|
|
|
'value': 'FirstSeen' |
64
|
|
|
}, |
65
|
|
|
{ |
66
|
|
|
'name': 'node.systemLoad', |
67
|
|
|
'value': 'Load' |
68
|
|
|
}, |
69
|
|
|
{ |
70
|
|
|
'name': 'node.ram', |
71
|
|
|
'value': 'RAM' |
72
|
|
|
}, |
73
|
|
|
{ |
74
|
|
|
'name': 'node.ipAddresses', |
75
|
|
|
'value': 'IPs' |
76
|
|
|
}, |
77
|
|
|
{ |
78
|
|
|
'name': 'node.update', |
79
|
|
|
'value': 'Autoupdate' |
80
|
|
|
}, |
81
|
|
|
{ |
82
|
|
|
'name': 'node.site', |
83
|
|
|
'value': 'Site' |
84
|
|
|
}, |
85
|
|
|
{ |
86
|
|
|
'name': 'node.clients', |
87
|
|
|
'value': 'Clients' |
88
|
|
|
} |
89
|
|
|
], |
90
|
|
|
'supportedLocale': [ |
91
|
|
|
'en', |
92
|
|
|
'de', |
93
|
|
|
'fr', |
94
|
|
|
'ru' |
95
|
|
|
], |
96
|
|
|
// Color configs |
97
|
|
|
'icon': { |
98
|
|
|
'base': { |
99
|
|
|
'fillOpacity': 0.6, |
100
|
|
|
'opacity': 0.6, |
101
|
|
|
'weight': 2, |
102
|
|
|
'radius': 6, |
103
|
|
|
'className': 'stroke-first' |
104
|
|
|
}, |
105
|
|
|
'online': { |
106
|
|
|
'color': '#1566A9', |
107
|
|
|
'fillColor': '#1566A9' |
108
|
|
|
}, |
109
|
|
|
'offline': { |
110
|
|
|
'color': '#D43E2A', |
111
|
|
|
'fillColor': '#D43E2A', |
112
|
|
|
'radius': 3 |
113
|
|
|
}, |
114
|
|
|
'lost': { |
115
|
|
|
'color': '#D43E2A', |
116
|
|
|
'fillColor': '#D43E2A', |
117
|
|
|
'radius': 4 |
118
|
|
|
}, |
119
|
|
|
'alert': { |
120
|
|
|
'color': '#D43E2A', |
121
|
|
|
'fillColor': '#D43E2A', |
122
|
|
|
'radius': 5 |
123
|
|
|
}, |
124
|
|
|
'new': { |
125
|
|
|
'color': '#1566A9', |
126
|
|
|
'fillColor': '#93E929' |
127
|
|
|
} |
128
|
|
|
}, |
129
|
|
|
'client': { |
130
|
|
|
'wifi24': 'rgba(220, 0, 103, 0.7)', |
131
|
|
|
'wifi5': 'rgba(10, 156, 146, 0.7)', |
132
|
|
|
'other': 'rgba(227, 166, 25, 0.7)' |
133
|
|
|
}, |
134
|
|
|
'map': { |
135
|
|
|
'labelNewColor': '#459c18', |
136
|
|
|
'tqFrom': '#F02311', |
137
|
|
|
'tqTo': '#04C714', |
138
|
|
|
'highlightNode': { |
139
|
|
|
'color': '#ad2358', |
140
|
|
|
'weight': 8, |
141
|
|
|
'fillOpacity': 1, |
142
|
|
|
'opacity': 0.4, |
143
|
|
|
'className': 'stroke-first' |
144
|
|
|
}, |
145
|
|
|
'highlightLink': { |
146
|
|
|
'weight': 4, |
147
|
|
|
'opacity': 1, |
148
|
|
|
'dashArray': '5, 10' |
149
|
|
|
} |
150
|
|
|
}, |
151
|
|
|
'forceGraph': { |
152
|
|
|
'nodeColor': '#fff', |
153
|
|
|
'highlightColor': 'rgba(255, 255, 255, 0.2)', |
154
|
|
|
'labelColor': '#fff', |
155
|
|
|
'tqFrom': '#770038', |
156
|
|
|
'tqTo': '#dc0067' |
157
|
|
|
}, |
158
|
|
|
'locate': { |
159
|
|
|
'outerCircle': { |
160
|
|
|
'stroke': false, |
161
|
|
|
'color': '#4285F4', |
162
|
|
|
'opacity': 1, |
163
|
|
|
'fillOpacity': 0.3, |
164
|
|
|
'clickable': false, |
165
|
|
|
'radius': 16 |
166
|
|
|
}, |
167
|
|
|
'innerCircle': { |
168
|
|
|
'stroke:': true, |
169
|
|
|
'color': '#ffffff', |
170
|
|
|
'fillColor': '#4285F4', |
171
|
|
|
'weight': 1.5, |
172
|
|
|
'clickable': false, |
173
|
|
|
'opacity': 1, |
174
|
|
|
'fillOpacity': 1, |
175
|
|
|
'radius': 7 |
176
|
|
|
}, |
177
|
|
|
'accuracyCircle': { |
178
|
|
|
'stroke': true, |
179
|
|
|
'color': '#4285F4', |
180
|
|
|
'weight': 1, |
181
|
|
|
'clickable': false, |
182
|
|
|
'opacity': 0.7, |
183
|
|
|
'fillOpacity': 0.2 |
184
|
|
|
} |
185
|
|
|
}, |
186
|
|
|
'cacheBreaker': '<!-- inject:cache-breaker -->' |
187
|
|
|
}; |
188
|
|
|
}; |
189
|
|
|
|