Open WebCRT in its own module tab and fix UTC naive time display.

Config/NE/topology links now focus the webcrt window instead of replacing network routes; formatSystemTime treats naive API timestamps as UTC.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-07-31 11:13:22 +08:00
parent 3fc80f55bc
commit 68883d1a84
4 changed files with 27 additions and 13 deletions

View file

@ -780,7 +780,7 @@ export function NePage() {
className="link-btn"
onClick={() =>
openOrFocusModule({
moduleId: "network",
moduleId: "webcrt",
path: `/webcrt?ne_id=${encodeURIComponent(row.id)}`,
})
}

View file

@ -676,14 +676,14 @@ export function TopologyPage() {
const umeId = node?.data.ume_ne_id;
if (managedId) {
openOrFocusModule({
moduleId: "network",
moduleId: "webcrt",
path: `/webcrt?ne_id=${encodeURIComponent(managedId)}`,
});
return;
}
if (umeId) {
openOrFocusModule({
moduleId: "network",
moduleId: "webcrt",
path: `/webcrt?ne_id=${encodeURIComponent(umeId)}&source=ume`,
});
return;

View file

@ -1,5 +1,4 @@
import { useState } from "react";
import { Link } from "react-router-dom";
import { useQuery } from "@tanstack/react-query";
import {
downloadNeConfigSnapshot,
@ -9,6 +8,7 @@ import {
import { queryKeys } from "../../constants/queryKeys";
import { useI18n } from "../../i18n";
import { useToast } from "../../hooks/useToast";
import { openOrFocusModule } from "../../utils/moduleWindows";
import { pageCount } from "../../utils/display";
import { formatSystemTime } from "../../utils/time";
@ -161,11 +161,19 @@ export function NetworkConfigsPage() {
>
{t("networkConfigs.export")}
</button>
<Link
to={`/webcrt?${row.source === "ume" ? "ume_ne_id" : "ne_id"}=${encodeURIComponent(row.target_id)}`}
<button
type="button"
className="link-btn"
onClick={() => {
const path =
row.source === "ume"
? `/webcrt?ne_id=${encodeURIComponent(row.target_id)}&source=ume`
: `/webcrt?ne_id=${encodeURIComponent(row.target_id)}`;
openOrFocusModule({ moduleId: "webcrt", path });
}}
>
WebCRT
</Link>
</button>
</td>
</tr>
);