aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2024-09-19 09:13:36 +0200
committerMartin Ridgers <[email protected]>2024-09-24 10:57:34 +0200
commitf4cdd85d493c43f0d45caee5f3fac6f0e134ee9e (patch)
treeb0fb9fb35a568c22726d92944c9b61ffdb5c8535
parentMin/max width for dashboard content (diff)
downloadzen-f4cdd85d493c43f0d45caee5f3fac6f0e134ee9e.tar.xz
zen-f4cdd85d493c43f0d45caee5f3fac6f0e134ee9e.zip
add_section() is provided by Page base
-rw-r--r--src/zenserver/frontend/html/zen.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/zenserver/frontend/html/zen.js b/src/zenserver/frontend/html/zen.js
index 7adbe12d5..3d2241f4c 100644
--- a/src/zenserver/frontend/html/zen.js
+++ b/src/zenserver/frontend/html/zen.js
@@ -274,6 +274,7 @@ class Page
{
this._parent = parent;
this._params = params;
+ this._sectormatron = new Sectormatron(parent);
}
get_param(name, fallback=undefined)
@@ -281,6 +282,11 @@ class Page
var ret = this._params.get(name);
return (ret != undefined) ? ret : fallback;
}
+
+ add_section(name)
+ {
+ return this._sectormatron.add_section(name);
+ }
}
@@ -324,8 +330,7 @@ class Oplog extends Page
const project = this.get_param("project");
const oplog = this.get_param("oplog");
- var builder = new Sectormatron(this._parent);
- var section = builder.add_section(project + " - " + oplog);
+ var section = this.add_section(project + " - " + oplog);
this._entry_table = new Table(section, ["key"]);
await this._build_table();
@@ -387,10 +392,8 @@ class Project extends Page
{
zen_title("project");
- var builder = new Sectormatron(this._parent);
-
// info
- var section = builder.add_section("info");
+ var section = this.add_section("info");
const project = this.get_param("project");
const prefix = "/prj/" + project;
@@ -406,7 +409,7 @@ class Project extends Page
}
// oplog
- section = builder.add_section("oplogs");
+ section = this.add_section("oplogs");
var oplog_table = new Table(section, ["name", "actions"])
@@ -433,7 +436,7 @@ class Project extends Page
// files
/*
- section = builder.add_section("files");
+ section = this.add_section("files");
for (const oplog of info["oplogs"])
{
const name = oplog["id"];
@@ -488,8 +491,7 @@ class Start extends Page
{
zen_title("main");
- var builder = new Sectormatron(this._parent);
- var section = builder.add_section("projects");
+ var section = this.add_section("projects");
// project list
var columns = [
@@ -513,7 +515,7 @@ class Start extends Page
}
// stats
- section = builder.add_section("stats");
+ section = this.add_section("stats");
var providers = zen_fetch("/stats");
for (var provider of (await providers)["providers"])
{