mirror of https://github.com/Lissy93/dashy.git
Adds option for custom section colors and additional styles
This commit is contained in:
parent
36bbb490c1
commit
d040d212fc
|
@ -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 {
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue