Skip to content
Snippets Groups Projects
Commit 731657fc authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

ENH: more sophisiticated display of changed entities

parent 19ca15d6
No related branches found
No related tags found
1 merge request!22Release 0.3
......@@ -354,6 +354,27 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
from xml.sax.saxutils import escape
# TODO move path related stuff to sss_helper
form = """
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Crawler</title>
<link rel="stylesheet" href="https://caosdb1.awi.de:10443/webinterface/css/webcaosdb.css"/>
<link rel="stylesheet" href="https://caosdb1.awi.de:10443/webinterface/css/bootstrap.css">
<script src="https://caosdb1.awi.de:10443/webinterface/js/jquery.js"></script>
<script src="https://caosdb1.awi.de:10443/webinterface/js/loglevel.js"></script>
<script src="https://caosdb1.awi.de:10443/webinterface/js/bootstrap.js"></script>
<script src="https://caosdb1.awi.de:10443/webinterface/js/webcaosdb.js"></script>
<script src="https://caosdb1.awi.de:10443/webinterface/js/plotly.js"></script>
<script src="https://caosdb1.awi.de:10443/webinterface/js/caosdb.js"></script>
<script src="https://caosdb1.awi.de:10443/webinterface/js/state-machine.js"></script>
<script src="https://caosdb1.awi.de:10443/webinterface/js/showdown.js"></script>
<script src="https://caosdb1.awi.de:10443/webinterface/js/preview.js"></script>
<script src="https://caosdb1.awi.de:10443/webinterface/js/ext_references.js"></script>
<script src="https://caosdb1.awi.de:10443/webinterface/js/ext_bottom_line.js"></script>
</head>
<body>
<form method="post" action="{url}/scripting">
<input type="hidden" name="call" value="crawl.py"/>
<input type="hidden" name="-p0" value=""/>
......@@ -366,6 +387,32 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
{changes}
</code>
</pre>
<script>
const wrapper = $(`
<div class="container caosdb-f-main">
<div class="row caosdb-v-main-col">
<div class="panel-group caosdb-f-main-entities"></div>
</div>
</div>`);
const code_element = $("code").remove();
const entities_str = `<Response>${code_element.text()}</Response>`;
const entities = str2xml(entities_str);
transformation.transformEntities(entities).then((html) => {
wrapper.find(".caosdb-f-main-entities").append(html);
wrapper.find(".caosdb-v-entity-header-buttons-list .glyphicon-comment").hide();
$(document.body).append(wrapper);
const message_bodies = $(wrapper).find(".caosdb-messages div div");
console.log(message_bodies);
for (const body of message_bodies.toArray()) {
const text = body.innerHTML;
console.log(text);
body.innerHTML = markdown.textToHtml(text);
}
});
</script>
</body>
</html>
""".format(url=db.configuration.get_config()["Connection"]["url"],
rid=self.run_id,
changes=escape("\n".join(changes)),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment