Adds option for custom section colors and additional styles

This commit is contained in:
Alicia Sykes 2021-03-31 21:52:02 +01:00
parent 36bbb490c1
commit d040d212fc
4 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,7 @@
<template> <template>
<div :class="`collapsable ${checkSpanNum(cols, 'col')} ${checkSpanNum(rows, 'row')}`"> <div :class="`collapsable ${checkSpanNum(cols, 'col')} ${checkSpanNum(rows, 'row')}`"
:style="`${color ? 'background: '+color : ''}; ${customStyles}`"
>
<input <input
:id="`collapsible-${uniqueKey}`" :id="`collapsible-${uniqueKey}`"
class="toggle" class="toggle"
@ -28,6 +30,8 @@ export default {
collapsed: Boolean, collapsed: Boolean,
cols: Number, cols: Number,
rows: Number, rows: Number,
color: String,
customStyles: String,
}, },
data() { data() {
return { return {

View File

@ -5,6 +5,8 @@
:collapsed="displayData.collapsed" :collapsed="displayData.collapsed"
:cols="displayData.cols" :cols="displayData.cols"
:rows="displayData.rows" :rows="displayData.rows"
:color="displayData.color"
:customStyles="displayData.customStyles"
> >
<div v-if="!items || items.length < 1" class="no-items"> <div v-if="!items || items.length < 1" class="no-items">
No Items to Show Yet No Items to Show Yet

View File

@ -47,10 +47,6 @@ sections:
iconType: img iconType: img
url: https://192.168.1.1/ui/wireguard/general url: https://192.168.1.1/ui/wireguard/general
- name: DNS Device - name: DNS Device
displayData:
collapsed: false
rows: 2
cols: 2
collapsed: false collapsed: false
items: items:
- title: Pi-Hole - title: Pi-Hole

View File

@ -59,8 +59,7 @@ export default {
}); });
}, },
getDisplayData(section) { getDisplayData(section) {
const defaultDisplayData = { collapsed: null, rows: null, cols: null }; return !section.displayData ? {} : section.displayData;
return !section.displayData ? defaultDisplayData : section.displayData;
}, },
}, },
}; };