feat(ui): Add support for buttons below header (#106)

This commit is contained in:
TwiN
2022-04-25 20:20:32 -04:00
parent dcb997f501
commit 9ede992e4e
11 changed files with 97 additions and 15 deletions

View File

@ -1,6 +1,6 @@
{
"name": "gatus",
"version": "3.6.0",
"version": "3.7.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --mode development",

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<script type="text/javascript">
window.config = {logo: "{{ .Logo }}", header: "{{ .Header }}", link: "{{ .Link }}"};
window.config = {logo: "{{ .Logo }}", header: "{{ .Header }}", link: "{{ .Link }}", buttons: []};{{- range .Buttons}}window.config.buttons.push({name:"{{ .Name }}",link:"{{ .Link }}"});{{end}}
</script>
<title>{{ .Title }}</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">

View File

@ -13,6 +13,11 @@
</a>
</div>
</div>
<div v-if="buttons" class="flex flex-wrap">
<a v-for="button in buttons" :key="button.name" :href="button.link" target="_blank" class="px-2 py-0.5 font-medium select-none text-gray-600 hover:text-gray-500 dark:text-gray-300 dark:hover:text-gray-400 hover:underline">
{{ button.name }}
</a>
</div>
</div>
<router-view @showTooltip="showTooltip" />
</div>
@ -85,6 +90,9 @@ export default {
},
link() {
return window.config && window.config.link && window.config.link !== '{{ .Link }}' ? window.config.link : null;
},
buttons() {
return window.config && window.config.buttons ? window.config.buttons : [];
}
},
data() {