mirror of https://github.com/rancher/dashboard.git
106 lines
2.3 KiB
Vue
106 lines
2.3 KiB
Vue
<script>
|
|
import { mapPref, DEV } from '@shell/store/prefs';
|
|
import ActionMenu from '@shell/components/ActionMenu';
|
|
import Header from '@shell/components/nav/Header';
|
|
import PromptRemove from '@shell/components/PromptRemove';
|
|
import AssignTo from '@shell/components/AssignTo';
|
|
import IndentedPanel from '@shell/components/IndentedPanel';
|
|
import Brand from '@shell/mixins/brand';
|
|
import FixedBanner from '@shell/components/FixedBanner';
|
|
import GrowlManager from '@shell/components/GrowlManager';
|
|
import AwsComplianceBanner from '@shell/components/AwsComplianceBanner';
|
|
import AzureWarning from '@shell/components/auth/AzureWarning';
|
|
import BrowserTabVisibility from '@shell/mixins/browser-tab-visibility';
|
|
|
|
export default {
|
|
|
|
components: {
|
|
ActionMenu,
|
|
AssignTo,
|
|
Header,
|
|
IndentedPanel,
|
|
PromptRemove,
|
|
FixedBanner,
|
|
GrowlManager,
|
|
AwsComplianceBanner,
|
|
AzureWarning
|
|
},
|
|
|
|
middleware: ['authenticated'],
|
|
|
|
mixins: [Brand, BrowserTabVisibility],
|
|
|
|
data() {
|
|
return {
|
|
// Assume home pages have routes where the name is the key to use for string lookup
|
|
name: this.$route.name,
|
|
};
|
|
},
|
|
|
|
computed: { dev: mapPref(DEV) },
|
|
|
|
methods: {
|
|
toggleTheme() {
|
|
this.$store.dispatch('prefs/toggleTheme');
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div class="dashboard-root">
|
|
<FixedBanner :header="true" />
|
|
<AwsComplianceBanner />
|
|
<AzureWarning />
|
|
|
|
<div class="dashboard-content">
|
|
<Header :simple="true" />
|
|
<main>
|
|
<IndentedPanel class="pt-20">
|
|
<nuxt class="outlet" />
|
|
</IndentedPanel>
|
|
<ActionMenu />
|
|
<PromptRemove />
|
|
<AssignTo />
|
|
<button v-if="dev" v-shortkey.once="['shift','t']" class="hide" @shortkey="toggleTheme()" />
|
|
</main>
|
|
</div>
|
|
|
|
<FixedBanner :footer="true" />
|
|
<GrowlManager />
|
|
</div>
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
|
.dashboard-root {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100vh;
|
|
}
|
|
.dashboard-content {
|
|
display: grid;
|
|
flex-grow: 1;
|
|
|
|
grid-template-areas:
|
|
"header"
|
|
"main";
|
|
|
|
grid-template-columns: auto;
|
|
grid-template-rows: var(--header-height) auto;
|
|
|
|
> HEADER {
|
|
grid-area: header;
|
|
}
|
|
}
|
|
|
|
MAIN {
|
|
grid-area: main;
|
|
overflow: auto;
|
|
|
|
.outlet {
|
|
min-height: 100%;
|
|
padding: 0;
|
|
}
|
|
}
|
|
</style>
|