Skip to content

Commit b820289

Browse files
author
Joe Pavitt
committed
Change the browser tab title to match the page title
1 parent c3b1976 commit b820289

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

ui/src/App.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,19 @@ export default {
185185
const route = (this.setup.basePath + page.path).replace(/\/\//g, '/')
186186
187187
const routeName = 'Page:' + page.name
188+
let title = page.name
189+
const headerStyle = payload.dashboards[page.ui].headerContent
190+
if (headerStyle === 'dashboard') {
191+
title = payload.dashboards[page.ui].name
192+
} else if (headerStyle === 'dashpage') {
193+
title = `${payload.dashboards[page.ui].name} (${page.name})`
194+
}
188195
this.$router?.addRoute({
189196
path: route,
190197
name: routeName,
191198
component: layouts[page.layout],
192199
meta: {
193-
title: page.name, // the page name
200+
title, // the page name
194201
id: page.id, // the pages id
195202
dashboard: page.ui // the dashboard id - to simplify determining which dashboard we're on
196203
}

ui/src/layouts/Baseline.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@
55
<v-app-bar-nav-icon @click="handleNavigationClick" />
66
</template>
77
<v-app-bar-title>
8-
<template v-if="dashboard.headerContent === 'page'">
8+
<template v-if="dashboard.headerContent !== 'none' && dashboard.headerContent !== false">
99
{{ pageTitle }}
1010
</template>
11-
<template v-else-if="dashboard.headerContent === 'dashboard'">
12-
{{ dashboard.name }}
13-
</template>
14-
<template v-else-if="dashboard.headerContent === 'dashpage'">
15-
{{ dashboard.name }} ({{ pageTitle }})
16-
</template>
1711
<div id="app-bar-title" />
1812
</v-app-bar-title>
1913
<template #append>

0 commit comments

Comments
 (0)