Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

:zap: Adds support for widgets in Minimal View

Alicia Sykes41d9ead46bbe
diff --git a/src/components/MinimalView/MinimalSection.vue b/src/components/MinimalView/MinimalSection.vue
index 60a69326..706f58d8 100644
--- a/src/components/MinimalView/MinimalSection.vue
+++ b/src/components/MinimalView/MinimalSection.vue
@@ -1,6 +1,6 @@
<template>
<div :class="`minimal-section-inner ${selected ? 'selected' : ''} ${showAll ? 'show-all': ''}`">
- <div class="section-items" v-if="selected || showAll">
+ <div class="section-items" v-if="items && (selected || showAll)">
<Item
v-for="(item, index) in items"
:id="`${index}_${makeId(item.title)}`"
@@ -22,6 +22,15 @@
@triggerModal="triggerModal"
/>
</div>
+ <div v-if="widgets && (selected || showAll)">
+ <WidgetBase
+ v-for="(widget, widgetIndx) in widgets"
+ :key="widgetIndx"
+ :widget="widget"
+ :index="widgetIndx"
+ @navigateToSection="navigateToSection"
+ />
+ </div>
<IframeModal
:ref="`iframeModal-${groupId}`"
:name="`iframeModal-${groupId}`"
@@ -31,7 +40,9 @@
</template>
<script>
+import router from '@/router';
import Item from '@/components/LinkItems/Item.vue';
+import WidgetBase from '@/components/Widgets/WidgetBase';
import IframeModal from '@/components/LinkItems/IframeModal.vue';
export default {
@@ -42,6 +53,7 @@ export default {
icon: String,
displayData: Object,
items: Array,
+ widgets: Array,
itemSize: String,
modalOpen: Boolean,
index: Number,
@@ -55,6 +67,7 @@ export default {
},
components: {
Item,
+ WidgetBase,
IframeModal,
},
methods: {
@@ -80,6 +93,13 @@ export default {
if (interval < 1) interval = 0;
return interval;
},
+ /* Navigate to the section's single-section view page */
+ navigateToSection() {
+ const parse = (section) => section.replace(' ', '-').toLowerCase().trim();
+ const sectionIdentifier = parse(this.title);
+ router.push({ path: `/home/${sectionIdentifier}` });
+ this.closeContextMenu();
+ },
},
};
</script>
diff --git a/src/views/Minimal.vue b/src/views/Minimal.vue
index 37429b5a..c71d57dc 100644
--- a/src/views/Minimal.vue
+++ b/src/views/Minimal.vue
@@ -34,6 +34,7 @@
:icon="section.icon || undefined"
:groupId="`section-${index}`"
:items="filterTiles(section.items)"
+ :widgets="section.widgets"
:selected="selectedSection === index"
:showAll="!tabbedView"
itemSize="small"
@@ -104,7 +105,9 @@ export default {
else {
let itemsFound = true;
this.sections.forEach((section) => {
- if (this.filterTiles(section.items).length > 0) itemsFound = false;
+ if (section.widgets || this.filterTiles(section.items).length > 0) {
+ itemsFound = false;
+ }
});
return itemsFound;
}