mirror of
https://github.com/norohind/SquadsActivityMonitor.git
synced 2025-04-13 13:27:13 +03:00
make action_id clickable -> to diff page
This commit is contained in:
parent
0e35b86a5b
commit
bce2f9dd4d
20
utils.py
20
utils.py
@ -197,7 +197,25 @@ activity_table_html_template = """
|
||||
<script src="/js/json2htmltable.js"></script>
|
||||
<script type="text/javascript">
|
||||
window.onload = () => {
|
||||
document.body.appendChild(buildHtmlTable(JSON.parse({items})));
|
||||
document.body.appendChild(buildHtmlTable(JSON.parse({items}))); // build table
|
||||
|
||||
var table = document.querySelector("body > table")
|
||||
var header = table.rows[0]
|
||||
|
||||
for (var i = 0, cell; cell = header.cells[i]; i++){
|
||||
if (cell.innerText.includes('ActionId')){
|
||||
var action_id_id = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (action_id_id == null) { // don't to anything if no action_id in the table
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 1, row; row = table.rows[i]; i++) { // append to action_id filed onclick action
|
||||
row.cells[action_id_id].setAttribute("onclick", "location.href='/diff/action_id'".replace('action_id', row.cells[action_id_id].innerText));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<link type="text/css" rel="stylesheet" href="/js/table_styles.css">
|
||||
|
Loading…
x
Reference in New Issue
Block a user