2019-07-15 08:58:03 +00:00
|
|
|
<template>
|
|
|
|
<div id="app">
|
2019-07-18 20:36:04 +00:00
|
|
|
<nav class="navbar" role="navigation" aria-label="main navigation">
|
|
|
|
<div class="navbar-brand">
|
|
|
|
<a class="navbar-item" href="/dashboard">
|
|
|
|
<img
|
|
|
|
src="./assets/images/traefik_logo@3x.svg"
|
|
|
|
alt="Traefik Webui"
|
|
|
|
width="112"
|
|
|
|
height="28"
|
|
|
|
/>
|
|
|
|
</a>
|
2019-08-12 15:48:04 +00:00
|
|
|
|
|
|
|
<a
|
|
|
|
:class="{ 'is-active': isActive }"
|
|
|
|
role="button"
|
|
|
|
class="navbar-burger burger"
|
|
|
|
aria-label="menu"
|
|
|
|
aria-expanded="false"
|
|
|
|
data-target="navbarBasicExample"
|
|
|
|
@click="toggle"
|
|
|
|
>
|
|
|
|
<span aria-hidden="true"></span>
|
|
|
|
<span aria-hidden="true"></span>
|
|
|
|
<span aria-hidden="true"></span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
:class="{ 'is-active': isActive }"
|
|
|
|
class="navbar-menu"
|
|
|
|
v-if="version.Version"
|
|
|
|
>
|
|
|
|
<div class="navbar-start">
|
|
|
|
<a class="navbar-item" :href="documentationUrl">
|
|
|
|
Documentation
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="navbar-end">
|
|
|
|
<div class="navbar-item">Version: {{ version.Version }}</div>
|
|
|
|
</div>
|
2019-07-18 20:36:04 +00:00
|
|
|
</div>
|
|
|
|
</nav>
|
2019-07-15 08:58:03 +00:00
|
|
|
<router-view />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2019-08-12 15:48:04 +00:00
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: "App",
|
|
|
|
data: () => ({
|
|
|
|
version: {},
|
|
|
|
isActive: false
|
|
|
|
}),
|
|
|
|
computed: {
|
|
|
|
parsedVersion() {
|
|
|
|
if (this.version.Version === "dev") {
|
|
|
|
return "master";
|
|
|
|
} else {
|
|
|
|
const matches = this.version.Version.match(/^(v?\d+\.\d+)/);
|
|
|
|
return matches ? matches[1] : "master";
|
|
|
|
}
|
|
|
|
},
|
|
|
|
documentationUrl() {
|
|
|
|
return `https://docs.traefik.io/${this.parsedVersion}`;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.fetchVersion();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
fetchVersion() {
|
|
|
|
return fetch("/api/version")
|
|
|
|
.then(response => response.json())
|
|
|
|
.then(response => (this.version = response));
|
|
|
|
},
|
|
|
|
toggle() {
|
|
|
|
this.isActive = !this.isActive;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2019-07-15 08:58:03 +00:00
|
|
|
<style lang="sass">
|
|
|
|
|
|
|
|
@import 'styles/typography'
|
|
|
|
@import 'styles/colors'
|
|
|
|
|
|
|
|
html
|
|
|
|
font-family: $open-sans
|
|
|
|
height: 100%
|
|
|
|
background: $background
|
|
|
|
</style>
|