Skip to content

Commit be26e54

Browse files
committed
UI banner
Signed-off-by: Frank Jogeleit <[email protected]>
1 parent fd09517 commit be26e54

File tree

8 files changed

+9
-4
lines changed

8 files changed

+9
-4
lines changed

backend/pkg/config/config.go

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ type DefaultFilter struct {
169169

170170
type UI struct {
171171
Path string `mapstructure:"path"`
172+
Banner string `mapstructure:"banner"`
172173
Disabled bool `mapstructure:"enabled"`
173174
DisplayMode string `mapstructure:"displayMode"`
174175
LabelFilter []string `mapstructure:"labelFilter"`

backend/pkg/config/mapper.go

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func MapConfig(c *Config) *api.Config {
3131
Clusters: clusters,
3232
Default: current,
3333
OAuth: c.OpenIDConnect.Enabled,
34+
Banner: c.UI.Banner,
3435
DefaultFilter: api.DefaultFilter{
3536
Resources: c.UI.DefaultFilter.Resources,
3637
ClusterResources: c.UI.DefaultFilter.ClusterResources,

backend/pkg/server/api/model.go

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ type Config struct {
4141
Clusters []Cluster `json:"clusters"`
4242
Sources []Source `json:"sources"`
4343
Default string `json:"default"`
44+
Banner string `json:"banner"`
4445
DefaultFilter DefaultFilter `json:"defaultFilter"`
4546
OAuth bool `json:"oauth"`
4647
}

frontend/composables/source.ts

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export const useSourceStore = (key?: string) => {
5050
callAPI(api => api.clusterKinds(source as string[])),
5151
callAPI(api => api.categoryTree(undefined, { sources: source as string[] })),
5252
]).then(([namespaces, nsKinds, clusterKinds, categoryTrees]) => {
53-
console.log(nsKinds, clusterKinds)
5453
loadStore.kinds.namespaced = nsKinds || []
5554
loadStore.kinds.cluster = clusterKinds || []
5655
loadStore.namespaces = namespaces || []

frontend/layouts/default.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<v-app-bar elevation="1" prominent>
44
<v-app-bar-nav-icon icon="mdi-menu" @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
55
<v-avatar image="/logo.png" rounded="0" class="ml-4" />
6-
<v-toolbar-title>Policy Reporter</v-toolbar-title>
6+
<v-toolbar-title>Policy Reporter{{ config.banner ? ` - ${config.banner}` : ''}}</v-toolbar-title>
77
<template #append>
88
<form-cluster-select />
99
<form-display-mode-select />

frontend/modules/core/components/resource/StatusChips.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<script setup lang="ts">
88
import { Status } from '~/modules/core/types'
99
import { type PropType } from "vue";
10-
import { useStatusInjection } from "~/composables/status";
1110
import {injectSourceContext} from "~/composables/source";
1211
1312
defineProps({
@@ -16,7 +15,7 @@ defineProps({
1615
exceptions: { type: Boolean, default: false },
1716
showSkipped: { type: Boolean, default: false },
1817
showed: { type: Array as PropType<Status[]>, default: false },
19-
category: { type: String, default: false },
18+
category: { type: String, default: undefined },
2019
})
2120
2221
const source = injectSourceContext()

frontend/modules/core/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ export type Config = {
251251
sources: SourceConfig[];
252252
oauth: boolean;
253253
default: string;
254+
banner: string;
254255
defaultFilter: {
255256
resources: string[];
256257
clusterResources: string[];

frontend/store/config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ type State = {
99
plugins: string[];
1010
clusters: Cluster[];
1111
oauth: boolean;
12+
banner: string;
1213
error?: Error;
1314
}
1415

@@ -18,6 +19,7 @@ export const useConfigStore = defineStore('config', {
1819
plugins: [],
1920
clusters: [],
2021
oauth: false,
22+
banner: '',
2123
}),
2224
getters: {
2325
multiCluster: (state: State) => state.clusters.length > 0,
@@ -36,6 +38,7 @@ export const useConfigStore = defineStore('config', {
3638
this.error = config.error
3739
this.clusters = config.clusters
3840
this.oauth = config.oauth
41+
this.banner = config.banner
3942
},
4043
setDisplayMode(mode: DisplayMode) {
4144
if (!mode || mode === this.displayMode) return;

0 commit comments

Comments
 (0)