Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions multiace/web/frontend/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,27 @@ createApp({
}
}
}
// The navigation entries, in order. The top bar renders this list, so
// a feature adds a tab by adding one entry here instead of editing the
// markup.
const navItems = computed(() => {
const items = [];
if (state.mode !== "normal") {
items.push({key: "dashboard", label: t("ui.tabs.dashboard")});
}
items.push({key: "spools", label: t("ui.tabs.spools")});
items.push({key: "config", label: t("ui.tabs.config")});
// Calibration hangs off Config: shown only while one of the two is
// open, so it cannot vanish under the user once selected.
if (CALIBRATION_TAB && state.mode !== "normal"
&& (tab.value === "config" || tab.value === "calibration")) {
items.push({key: "calibration", label: t("ui.tabs.calibration")});
}
for (const p of plugins.items) {
items.push({key: "plugin:" + p.name, label: p.label});
}
return items;
});
function pluginIframeSrc(p) {
const u = (p && p.ui_url) || "/";
return `/plugin/${p.name}${u.startsWith("/") ? u : "/" + u}`;
Expand Down Expand Up @@ -7414,6 +7435,7 @@ createApp({
headPlanMapping, multiTopology, slotHead, pinLabel,
updateState, updateCheck, updateApply,
debugState, debugEnable, debugDisable,
navItems,
plugins, refreshPlugins, pluginIframeSrc,
notifications, notifWarnOnly, notifTime, dismissNotification, dismissAllNotifications,
confirmDialog, okConfirm, altConfirm, cancelConfirm, confirmInputError,
Expand Down
13 changes: 2 additions & 11 deletions multiace/web/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,8 @@ <h1>m<span class="hl">U</span>lt<span class="hl">1</span>ACE
:title="t('ui.common.firmware') + ' ' + printerFw">· {{ printerName }}</small>
</h1>
<nav>
<button v-if="state.mode !== 'normal'"
:class="{active: tab==='dashboard'}" @click="tab='dashboard'">{{ t('ui.tabs.dashboard') }}</button>
<button :class="{active: tab==='spools'}" @click="tab='spools'">{{ t('ui.tabs.spools') }}</button>
<button :class="{active: tab==='config'}" @click="tab='config'">{{ t('ui.tabs.config') }}</button>
<!-- Calibration hangs off Config: shown only while one of the two is
open, so it cannot vanish under the user once selected. -->
<button v-if="CALIBRATION_TAB && state.mode !== 'normal' && (tab==='config' || tab==='calibration')"
:class="{active: tab==='calibration'}" @click="tab='calibration'">{{ t('ui.tabs.calibration') }}</button>
<button v-for="p in plugins.items" :key="p.name"
:class="{active: tab===('plugin:'+p.name)}"
@click="tab='plugin:'+p.name">{{ p.label }}</button>
<button v-for="it in navItems" :key="it.key"
:class="{active: tab===it.key}" @click="tab=it.key">{{ it.label }}</button>
</nav>
<input ref="uploadInput" type="file" accept=".gcode,.gco,.g"
class="upload-input" @change="onUploadGcode($event.target.files)">
Expand Down
Loading