mirror of
https://github.com/norohind/SquadsActivityMonitor.git
synced 2025-04-13 05:17:12 +03:00
Frontend table builder performance impoves
This commit is contained in:
parent
7d132ecb5f
commit
cebe77cc09
2
utils.py
2
utils.py
@ -181,7 +181,7 @@ activity_table_html_template = """
|
||||
<script src="/js/json2htmltable.js"></script>
|
||||
<script type="text/javascript">
|
||||
window.onload = () => {
|
||||
document.body.appendChild(buildHtmlTable(JSON.parse({items}))); // build table
|
||||
document.body.appendChild(buildHtmlTable({items})); // build table
|
||||
|
||||
var table = document.querySelector("body > table")
|
||||
var header = table.rows[0]
|
||||
|
4
web.py
4
web.py
@ -61,7 +61,7 @@ class ActivityHtml:
|
||||
table_in_json: str = resp.text
|
||||
resp.content_type = falcon.MEDIA_HTML
|
||||
|
||||
resp.text = utils.activity_table_html_template.replace('{items}', json.dumps(table_in_json))
|
||||
resp.text = utils.activity_table_html_template.replace('{items}', table_in_json)
|
||||
# what? f-strings? .format? never heard about them
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ class ActivityDiffHtml:
|
||||
resp.content_type = falcon.MEDIA_HTML
|
||||
# table: str = json.dumps(model.get_diff_action_id(action_id))
|
||||
resp.text = utils.activity_table_html_template.replace(
|
||||
'{items}', json.dumps(json.dumps(model.get_diff_action_id(action_id)))
|
||||
'{items}', json.dumps(model.get_diff_action_id(action_id))
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user