This commit is contained in:
@@ -20,6 +20,7 @@ const pagePathsEl = el("pagePaths");
|
||||
const pagePathGuidesEl = el("pagePathGuides");
|
||||
const pageMonitoringEl = el("pageMonitoring");
|
||||
const pageHelpEl = el("pageHelp");
|
||||
const pageSimulationEl = el("pageSimulation");
|
||||
const contentEl = document.querySelector(".content");
|
||||
const contentRightEl = el("contentRight");
|
||||
const overviewBackendEl = el("overviewBackend");
|
||||
@@ -132,7 +133,7 @@ const state = {
|
||||
};
|
||||
|
||||
function setActivePage(page) {
|
||||
const valid = ["dashboard", "config", "maps", "missions", "sounds", "transitions", "user-groups", "io-modules", "paths", "path-guides", "users", "settings", "integrations", "monitoring", "help"];
|
||||
const valid = ["dashboard", "config", "maps", "missions", "sounds", "transitions", "user-groups", "io-modules", "paths", "path-guides", "users", "settings", "integrations", "monitoring", "simulation", "help"];
|
||||
let p = valid.includes(page) ? page : "missions";
|
||||
if (window.AuthApp && !window.AuthApp.canAccessPage(p)) {
|
||||
const fallback = valid.find((v) => window.AuthApp.canAccessPage(v));
|
||||
@@ -153,6 +154,7 @@ function setActivePage(page) {
|
||||
if (pageSettingsEl) pageSettingsEl.hidden = p !== "settings";
|
||||
if (pageIntegrationsEl) pageIntegrationsEl.hidden = p !== "integrations";
|
||||
if (pageMonitoringEl) pageMonitoringEl.hidden = p !== "monitoring";
|
||||
if (pageSimulationEl) pageSimulationEl.hidden = p !== "simulation";
|
||||
if (pageHelpEl) pageHelpEl.hidden = p !== "help";
|
||||
if (configSplitterEl) configSplitterEl.hidden = p !== "config";
|
||||
if (contentRightEl) contentRightEl.hidden = p !== "config";
|
||||
@@ -171,6 +173,7 @@ function setActivePage(page) {
|
||||
contentEl.classList.toggle("content--settings", p === "settings");
|
||||
contentEl.classList.toggle("content--integrations", p === "integrations");
|
||||
contentEl.classList.toggle("content--monitoring", p === "monitoring");
|
||||
contentEl.classList.toggle("content--simulation", p === "simulation");
|
||||
contentEl.classList.toggle("content--help", p === "help");
|
||||
}
|
||||
if (p === "missions" && window.MissionsApp) window.MissionsApp.onPageShow();
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
}
|
||||
|
||||
function canAccessPage(page) {
|
||||
if (page === "config") return isDistributor();
|
||||
if (page === "config" || page === "simulation") return isDistributor();
|
||||
|
||||
const map = {
|
||||
dashboard: "dashboard",
|
||||
|
||||
16
www/i18n.js
16
www/i18n.js
@@ -64,6 +64,7 @@
|
||||
"nav.expand": "Mở menu",
|
||||
"nav.dashboards": "Dashboards",
|
||||
"nav.setup": "Setup",
|
||||
"nav.robot-plus": "Robot+",
|
||||
"nav.monitoring": "Monitoring",
|
||||
"nav.system": "System",
|
||||
"nav.settings": "Settings",
|
||||
@@ -80,7 +81,8 @@
|
||||
"nav.paths": "Paths",
|
||||
"nav.path-guides": "Path guides",
|
||||
"nav.users": "Users",
|
||||
"nav.build-robot": "Build Robot",
|
||||
"nav.robot": "Robot",
|
||||
"nav.simulation": "Simulation",
|
||||
"nav.monitoring-log": "System log",
|
||||
"nav.analytics": "Analytics",
|
||||
"nav.error-logs": "Error logs",
|
||||
@@ -1035,6 +1037,10 @@
|
||||
"settings.tile.advanced": "Advanced",
|
||||
"settings.tile.advancedSub": "Retention và logging.",
|
||||
|
||||
"simulation.title": "Simulation",
|
||||
"simulation.subtitle": "Robot+ → Simulation — mô phỏng robot trong môi trường ảo.",
|
||||
"simulation.comingSoon": "Tính năng đang phát triển.",
|
||||
|
||||
"help.api.title": "API documentation",
|
||||
"help.api.subtitle": "Help → API — tham chiếu REST MiR v2.0.0 cho tích hợp bên ngoài.",
|
||||
"help.api.body1": "Xem chi tiết endpoint tại System → Tích hợp hoặc tài liệu /api/v2.0.0/.",
|
||||
@@ -1099,6 +1105,7 @@
|
||||
"nav.expand": "Expand menu",
|
||||
"nav.dashboards": "Dashboards",
|
||||
"nav.setup": "Setup",
|
||||
"nav.robot-plus": "Robot+",
|
||||
"nav.monitoring": "Monitoring",
|
||||
"nav.system": "System",
|
||||
"nav.settings": "Settings",
|
||||
@@ -1115,7 +1122,8 @@
|
||||
"nav.paths": "Paths",
|
||||
"nav.path-guides": "Path guides",
|
||||
"nav.users": "Users",
|
||||
"nav.build-robot": "Build Robot",
|
||||
"nav.robot": "Robot",
|
||||
"nav.simulation": "Simulation",
|
||||
"nav.monitoring-log": "System log",
|
||||
"nav.analytics": "Analytics",
|
||||
"nav.error-logs": "Error logs",
|
||||
@@ -2070,6 +2078,10 @@
|
||||
"settings.tile.advanced": "Advanced",
|
||||
"settings.tile.advancedSub": "Retention and logging.",
|
||||
|
||||
"simulation.title": "Simulation",
|
||||
"simulation.subtitle": "Robot+ → Simulation — simulate the robot in a virtual environment.",
|
||||
"simulation.comingSoon": "Feature in development.",
|
||||
|
||||
"help.api.title": "API documentation",
|
||||
"help.api.subtitle": "Help → API — MiR v2.0.0 REST reference for external integration.",
|
||||
"help.api.body1": "See endpoint details under System → Integrations or /api/v2.0.0/ docs.",
|
||||
|
||||
@@ -108,6 +108,18 @@
|
||||
</svg>
|
||||
<span class="mirNavRailLabel" data-i18n="nav.setup">Setup</span>
|
||||
</button>
|
||||
<button type="button" class="mirNavRailItem" data-module="robot-plus">
|
||||
<svg class="mirNavRailIcon" viewBox="0 0 24 24" width="26" height="26" aria-hidden="true">
|
||||
<rect x="4" y="9" width="14" height="9" rx="2.2" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/>
|
||||
<path d="M11 7v2" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
|
||||
<path d="M9.5 8.5 11 6.8 12.5 8.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<circle cx="11" cy="13.5" r="2" fill="none" stroke="currentColor" stroke-width="1.6"/>
|
||||
<circle cx="6.5" cy="19" r="1.3" fill="none" stroke="currentColor" stroke-width="1.5"/>
|
||||
<circle cx="15.5" cy="19" r="1.3" fill="none" stroke="currentColor" stroke-width="1.5"/>
|
||||
<path d="M18 4.5v5M15.5 7h5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
|
||||
</svg>
|
||||
<span class="mirNavRailLabel" data-i18n="nav.robot-plus">Robot+</span>
|
||||
</button>
|
||||
<button type="button" class="mirNavRailItem" data-module="monitoring">
|
||||
<svg class="mirNavRailIcon" viewBox="0 0 24 24" width="26" height="26" aria-hidden="true">
|
||||
<path d="M3 3v18h18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
|
||||
@@ -2741,6 +2753,18 @@ GET /api/v2.0.0/status</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page" id="pageSimulation" data-page-content="simulation" hidden>
|
||||
<div class="mapsMirPage">
|
||||
<header class="mapsMirHeader">
|
||||
<div class="mapsMirHeaderText">
|
||||
<h1 class="mapsMirTitle" data-i18n="simulation.title">Simulation</h1>
|
||||
<p class="mapsMirSubtitle" data-i18n="simulation.subtitle">Robot+ → Simulation — mô phỏng robot trong môi trường ảo.</p>
|
||||
</div>
|
||||
</header>
|
||||
<p class="mapsMirEmpty" data-i18n="simulation.comingSoon">Tính năng đang phát triển.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page" id="pageHelp" data-page-content="help" hidden>
|
||||
<section class="card">
|
||||
<div class="cardHeader">
|
||||
|
||||
16
www/nav.js
16
www/nav.js
@@ -22,7 +22,12 @@
|
||||
{ section: "io-modules", page: "io-modules" },
|
||||
{ section: "paths", page: "paths" },
|
||||
{ section: "path-guides", page: "path-guides" },
|
||||
{ section: "build-robot", page: "config" },
|
||||
],
|
||||
},
|
||||
"robot-plus": {
|
||||
items: [
|
||||
{ section: "robot", page: "config" },
|
||||
{ section: "simulation", page: "simulation" },
|
||||
],
|
||||
},
|
||||
monitoring: {
|
||||
@@ -48,7 +53,8 @@
|
||||
|
||||
const PAGE_NAV = {
|
||||
dashboard: { module: "dashboards", section: "dashboard-list" },
|
||||
config: { module: "setup", section: "build-robot" },
|
||||
config: { module: "robot-plus", section: "robot" },
|
||||
simulation: { module: "robot-plus", section: "simulation" },
|
||||
maps: { module: "setup", section: "maps" },
|
||||
missions: { module: "setup", section: "missions" },
|
||||
sounds: { module: "setup", section: "sounds" },
|
||||
@@ -260,8 +266,10 @@
|
||||
const savedMod = localStorage.getItem(STORAGE_MODULE);
|
||||
const savedSec = localStorage.getItem(STORAGE_SECTION);
|
||||
const savedFlyout = localStorage.getItem(STORAGE_FLYOUT);
|
||||
if (savedMod && MODULES[savedMod]) activeModule = savedMod;
|
||||
if (savedSec) activeSection = savedSec;
|
||||
if (savedMod === "build") activeModule = "robot-plus";
|
||||
else if (savedMod && MODULES[savedMod]) activeModule = savedMod;
|
||||
if (savedSec === "build-robot") activeSection = "robot";
|
||||
else if (savedSec) activeSection = savedSec;
|
||||
if (savedFlyout === "0") flyoutOpen = false;
|
||||
} catch {
|
||||
/* ignore */
|
||||
|
||||
@@ -1018,6 +1018,7 @@ canvas {
|
||||
.content.content--sounds,
|
||||
.content.content--integrations,
|
||||
.content.content--monitoring,
|
||||
.content.content--simulation,
|
||||
.content.content--help {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
max-width: none;
|
||||
@@ -1030,6 +1031,7 @@ canvas {
|
||||
.content.content--sounds > .page,
|
||||
.content.content--integrations > .page,
|
||||
.content.content--monitoring > .page,
|
||||
.content.content--simulation > .page,
|
||||
.content.content--help > .page {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
|
||||
Reference in New Issue
Block a user