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

Function build_docs

python3_cron_scripts/create_graphs2.py:223–279  ·  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

221
222
223def build_docs(node, zone, groups):
224 """
225 Build the docs that are shown in the Graph UI when you click on a node
226 """
227
228 html = "<h3>" + node["id"] + "</h3><br/>"
229
230 html += "<b>Type:</b> " + node["data_type"] + "<br/>"
231
232 html += "<b>Group:</b> " + groups[node["type"]].replace(REPLACE_CHAR, ".") + "<br/>"
233
234 html += "<b>Depends:</b><br/>"
235 if node["depends"] == []:
236 html += "None<br/>"
237 else:
238 for dependency in node["depends"]:
239 html += " " + dependency + ","
240 html = html[:-1] + "<br>"
241
242 html += "<b>Depended on by:</b><br>"
243 if node["dependedOnBy"] == []:
244 html += "None<br/>"
245 else:
246 for dependency in node["dependedOnBy"]:
247 html += " " + dependency + ","
248
249 html = html[:-1] + "<br><br>"
250
251 if node["data_type"] == "ip":
252 html += (
253 '<a href="/ip?search='
254 + node["id"]
255 + '" target="_blank">Link to full IP details</a>'
256 )
257 elif node["data_type"] == "tld":
258 html += (
259 '<a href="/zone?search='
260 + node["id"]
261 + '" target="_blank">Link to full zone details</a>'
262 )
263 else:
264 if groups[node["type"]].replace(REPLACE_CHAR, ".") == zone:
265 html += (
266 '<a href="/domain?search='
267 + node["id"]
268 + "."
269 + zone
270 + '" target="_blank">Link to full host details</a>'
271 )
272 else:
273 html += (
274 '<a href="/domain?search='
275 + node["id"]
276 + '" target="_blank">Link to full host details</a>'
277 )
278
279 return html
280

Callers 1

reformat_dataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected