fix(detmir): repair portal deep links

This commit is contained in:
igor04091968
2026-06-02 21:01:08 +03:00
parent 8cf45de4da
commit 87453a4ef0
4 changed files with 23 additions and 9 deletions
+7
View File
@@ -1580,6 +1580,13 @@ systemctl is-active tsj-guardian-bot tsj-guardian-watchdog gost-tg
`.playwright-cli/page-2026-06-02T17-31-49-049Z.png`,
`.playwright-cli/page-2026-06-02T17-33-50-318Z.png`,
`.playwright-cli/page-2026-06-02T17-34-04-725Z.png`.
- portal link repair after Grafana/gateway smoke: quick links now open in a
separate tab, `worktime_report` points to explicit HTML
`/reports/worktime/management?format=html&host=SHARKON2025`,
`1С действия` is shown in the portal, and gateway `/r/aw-worktime` is
pinned to the same HTML report. Production smoke: AW UI, Worktime, 1C
brief, and 1C actions returned `200 text/html`; Grafana links correctly
redirect to `/login` when no Grafana session exists.
Отложить:
+7 -2
View File
@@ -622,7 +622,7 @@ fn links() -> PortalLinks {
"/d/detmir-aw-main/detmir-activitywatch?orgId=1&from=now-48h&to=now&timezone=browser&var-host=SHARKON2025&refresh=5m"
.to_string(),
aw_ui: "/r/aw/".to_string(),
worktime_report: "/r/aw-worktime".to_string(),
worktime_report: "/reports/worktime/management?format=html&host=SHARKON2025".to_string(),
file1c_brief: "/r/file1c/brief".to_string(),
file1c_actions: "/r/file1c/actions".to_string(),
}
@@ -935,7 +935,12 @@ mod tests {
fn links_are_gateway_relative() {
let links = links();
assert!(links.detmir_activitywatch.starts_with("/d/"));
assert_eq!(links.worktime_report, "/r/aw-worktime");
assert!(
links
.worktime_report
.starts_with("/reports/worktime/management?")
);
assert!(links.worktime_report.contains("format=html"));
}
#[test]
@@ -52,12 +52,14 @@ function label(name) {
}
function renderLinks(links) {
const link = (text, href) => `<a class="button" href="${escapeHtml(href)}" target="_blank" rel="noopener noreferrer">${escapeHtml(text)}</a>`;
return `<div class="links">
<a class="button" href="${links.detmir_activitywatch}">DetMir ActivityWatch</a>
<a class="button" href="${links.grafana_dashboards}">Grafana</a>
<a class="button" href="${links.aw_ui}">AW UI</a>
<a class="button" href="${links.worktime_report}">Worktime</a>
<a class="button" href="${links.file1c_brief}">1C brief</a>
${link("DetMir ActivityWatch", links.detmir_activitywatch)}
${link("Grafana", links.grafana_dashboards)}
${link("AW UI", links.aw_ui)}
${link("Рабочее время", links.worktime_report)}
${link("1С сводка", links.file1c_brief)}
${link("1С действия", links.file1c_actions)}
</div>`;
}