(nodes)
| 161 | data(); |
| 162 | }, |
| 163 | updateNodes = (nodes) => { |
| 164 | let currentnodelist = root[0].children; |
| 165 | for (let node of nodes) { |
| 166 | if (!nodeOrContainerExists(currentnodelist, node.ID)) { |
| 167 | updateNode(node, 'ready'); |
| 168 | |
| 169 | addNode(node); |
| 170 | } else { |
| 171 | for (let currentnode of currentnodelist) { |
| 172 | if (node.ID == currentnode.ID) { |
| 173 | name = node.Description.Hostname; |
| 174 | if (name.length > 0) { |
| 175 | currentnode.Description.Hostname = name; |
| 176 | currentnode.name = name + " <br/><span class='noderole'>" + node.Spec.Role + |
| 177 | "</span><br/><span class='nodemem'>" + (currentnode.Description.Resources.MemoryBytes / 1024 / 1024 / 1024).toFixed(3) + "G RAM</span><br/>" + |
| 178 | "<span class='nodeplatform'>" + (currentnode.Description.Platform.Architecture) + "/" + (currentnode.Description.Platform.OS) + "</span>" + |
| 179 | "<div class='labelarea'>"; |
| 180 | for (var key in node.Spec.Labels) { |
| 181 | if (node.Spec.Labels[key].length > 0) { |
| 182 | currentnode.name += " <br/><span class='nodelabel'>" + key + "=" + node.Spec.Labels[key] + "</span>"; |
| 183 | } else { |
| 184 | currentnode.name += " <br/><span class='nodelabel'>" + key + "</span>"; |
| 185 | } |
| 186 | } |
| 187 | currentnode.name += "</div>" |
| 188 | } |
| 189 | updateNode(currentnode, node.state, node.Spec); |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | } |
| 194 | } |
| 195 | for (let node of currentnodelist) { |
| 196 | if (!nodeOrContainerExists(nodes, node.ID)) { |
| 197 | updateNode(node, 'down'); |
| 198 | } |
| 199 | } |
| 200 | }, |
| 201 | updateContainers = (containers, services) => { |
| 202 | let nodes = root[0].children; |
| 203 | // clearn all current children before rendering |
no test coverage detected