aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/frontend
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2024-12-12 14:27:33 +0100
committerGitHub Enterprise <[email protected]>2024-12-12 14:27:33 +0100
commit774eb5623fe23137b70a673cfda7365f2ab53d13 (patch)
tree17cd46389ede42fb6d9146dd86ed1af15ce957be /src/zenserver/frontend
parent5.5.16-pre1 (diff)
downloadzen-774eb5623fe23137b70a673cfda7365f2ab53d13.tar.xz
zen-774eb5623fe23137b70a673cfda7365f2ab53d13.zip
Dashboard: view -> list rename, table style fix, file name appended to downloads (#264)
* Single-column tables could overflow their maximum width * Suffix oplog entry data's file name when downloading * Renamed "view" link to "list" * Ensure all undesirable characters are removed from page name * Updated embedded frontend Zip archive * Wrote some entries into the changelog
Diffstat (limited to 'src/zenserver/frontend')
-rw-r--r--src/zenserver/frontend/html.zipbin154690 -> 154898 bytes
-rw-r--r--src/zenserver/frontend/html/pages/entry.js2
-rw-r--r--src/zenserver/frontend/html/pages/project.js2
-rw-r--r--src/zenserver/frontend/html/util/widgets.js3
-rw-r--r--src/zenserver/frontend/html/zen.js6
5 files changed, 8 insertions, 5 deletions
diff --git a/src/zenserver/frontend/html.zip b/src/zenserver/frontend/html.zip
index 6f077d6e7..e0a1888e6 100644
--- a/src/zenserver/frontend/html.zip
+++ b/src/zenserver/frontend/html.zip
Binary files differ
diff --git a/src/zenserver/frontend/html/pages/entry.js b/src/zenserver/frontend/html/pages/entry.js
index a0e3ee915..65a3ef39b 100644
--- a/src/zenserver/frontend/html/pages/entry.js
+++ b/src/zenserver/frontend/html/pages/entry.js
@@ -120,11 +120,13 @@ export class Page extends ZenPage
const row = table.add_row(file_name, size, raw_size);
+ var base_name = file_name.split("/").pop().split("\\").pop();
const project = this.get_param("project");
const oplog = this.get_param("oplog");
const link = row.get_cell(0).link(
"/" + ["prj", project, "oplog", oplog, io_hash].join("/")
);
+ link.first_child().attr("download", `${io_hash}_${base_name}`);
const do_nothing = () => void(0);
const action_tb = new Toolbar(row.get_cell(-1), true);
diff --git a/src/zenserver/frontend/html/pages/project.js b/src/zenserver/frontend/html/pages/project.js
index 05e8efc9f..42ae30c8c 100644
--- a/src/zenserver/frontend/html/pages/project.js
+++ b/src/zenserver/frontend/html/pages/project.js
@@ -53,7 +53,7 @@ export class Page extends ZenPage
cell = row.get_cell(-1);
const action_tb = new Toolbar(cell, true).left();
- this.as_link(action_tb.add("view"), "oplog", name);
+ this.as_link(action_tb.add("list"), "oplog", name);
this.as_link(action_tb.add("tree"), "tree", name);
action_tb.add("drop").on_click((x) => this.drop_oplog(x), name);
diff --git a/src/zenserver/frontend/html/util/widgets.js b/src/zenserver/frontend/html/util/widgets.js
index 78998b7ff..d4f9875cd 100644
--- a/src/zenserver/frontend/html/util/widgets.js
+++ b/src/zenserver/frontend/html/util/widgets.js
@@ -64,7 +64,8 @@ export class Table extends Widget
var column_style;
if (flags & Table.Flag_FitLeft) column_style = "max-content";
- else if (flags & Table.Flag_BiasLeft) column_style = `minmax(${column_width * 2}%, 2fr)`;
+ else if (column_names.length == 1) column_style = "1fr";
+ else if (flags & Table.Flag_BiasLeft) column_style = `minmax(${column_width * 2}%, 1fr)`;
else column_style = `minmax(${column_width}%, 1fr)`;
for (var i = 1; i < column_names.length; ++i)
{
diff --git a/src/zenserver/frontend/html/zen.js b/src/zenserver/frontend/html/zen.js
index 19f3ec69f..3e5514173 100644
--- a/src/zenserver/frontend/html/zen.js
+++ b/src/zenserver/frontend/html/zen.js
@@ -32,9 +32,9 @@ async function main()
const params = new URLSearchParams(window.location.search);
var page = params.get("page") || "start";
- page = page.replace(".", "");
- page = page.replace("/", "");
- page = page.replace("\\", "");
+ page = page.replaceAll(".", "");
+ page = page.replaceAll("/", "");
+ page = page.replaceAll("\\", "");
root.id(page);
const module = await import(`./pages/${page}.js`);
new module.Page(root, params).main();