MCPcopy Create free account
hub / github.com/adobe/Marinus / build_docs

Function build_docs

python3_cron_scripts/create_netaddr_graphs.py:269–325  ·  view source on GitHub ↗

Build the docs that are shown in the Graph UI when you click on a node

(node, zone, groups)

Source from the content-addressed store, hash-verified

267
268
269def build_docs(node, zone, groups):
270 """
271 Build the docs that are shown in the Graph UI when you click on a node
272 """
273
274 html = "<h3>" + node["id"] + "</h3><br/>"
275
276 html += "<b>Type:</b> " + node["data_type"] + "<br/>"
277
278 html += "<b>Group:</b> " + groups[node["type"]].replace(REPLACE_CHAR, ".") + "<br/>"
279
280 html += "<b>Depends:</b><br/>"
281 if node["depends"] == []:
282 html += "None<br/>"
283 else:
284 for dependency in node["depends"]:
285 html += " " + dependency + ","
286 html = html[:-1] + "<br>"
287
288 html += "<b>Depended on by:</b><br>"
289 if node["dependedOnBy"] == []:
290 html += "None<br/>"
291 else:
292 for dependency in node["dependedOnBy"]:
293 html += " " + dependency + ","
294
295 html = html[:-1] + "<br><br>"
296
297 if node["data_type"] == "ip":
298 html += (
299 '<a href="/ip?search='
300 + node["id"]
301 + '" target="_blank">Link to full IP details</a>'
302 )
303 elif node["data_type"] == "tld":
304 html += (
305 '<a href="/zone?search='
306 + node["id"]
307 + '" target="_blank">Link to full zone details</a>'
308 )
309 else:
310 if groups[node["type"]].replace(REPLACE_CHAR, ".") != node["id"]:
311 html += (
312 '<a href="/domain?search='
313 + node["id"]
314 + "."
315 + groups[node["type"]].replace(REPLACE_CHAR, ".")
316 + '" target="_blank">Link to full host details</a>'
317 )
318 else:
319 html += (
320 '<a href="/domain?search='
321 + node["id"]
322 + '" target="_blank">Link to full host details</a>'
323 )
324
325 return html
326

Callers 1

reformat_dataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected