π A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
π¦ Bring back old layout (#2094)
Alicia Sykes6d38ee211a3d
diff --git a/docs/configuring.md b/docs/configuring.mdindex 78c25b14..0697a85a 100644--- a/docs/configuring.md+++ b/docs/configuring.md@@ -119,7 +119,7 @@ For more info, see the[Multi-Page docs](/docs/pages-and-sections.md#multi-page-s**`faviconApi`** | `enum` | _Optional_ | Only applicable if you are using favicons for item icons. Specifies which service to use to resolve favicons. Set to `local` to do this locally, without using an API. Services running locally will use this option always. Available options are: `local`, `allesedv`, `iconhorse`, `faviconkit`, `duckduckgo`, `yandex`, `google`, `besticon`, `webmasterapi` and `mcapi`. Defaults to `allesedv`. See [Icons](/docs/icons.md#favicons) for more info**`auth`** | `object` | _Optional_ | All settings relating to user authentication. See [`auth`](#appconfigauth-optional)**`defaultIcon`** | `string` | _Optional_ | An icon to be applied to any items, which don't already have an icon set. See [Icon Docs](/docs/icons.md#default-icon) for more info-**`layout`** | `enum` | _Optional_ | Layout for homepage, either `horizontal`, `vertical` or `auto`. Defaults to `auto`. This specifies the layout and direction of how sections are positioned on the home screen. `auto` uses a responsive masonry grid: sections flow into the next available slot so shorter ones fill the gaps left by taller neighbours; `section.displayData.cols` still controls width, but `rows` is ignored (heights are driven by content). This can also be modified and overridden from the UI.+**`layout`** | `enum` | _Optional_ | Layout for homepage, one of `auto`, `horizontal`, `vertical` or `masonry`. Defaults to `auto`. Specifies the layout and direction of how sections are positioned on the home screen. `auto` uses a responsive CSS grid where each section's footprint is controlled by `displayData.cols` and `displayData.rows`. `masonry` uses a responsive grid where heights follow content, so shorter sections flow into the gaps left by taller neighbours (`rows` is ignored, `cols` still controls width). This can also be modified and overridden from the UI.**`iconSize`** | `enum` | _Optional_ | The size of link items / icons. Can be either `small`, `medium,` or `large`. Defaults to `medium`. This can also be set directly from the UI.**`colCount`** | `number` | _Optional_ | The number of columns of sections displayed on the homepage, using the default view. Should be in integer between `1` and `8`. Note that by default this is applied responsively, based on current screen size, and specifying a value here will override this behavior, which may not be desirable.**`contentMaxWidth`** | `string` or `number` | _Optional_ | Sets the max width of the main sections area on the homepage, overriding the responsive default. Can be a percentage, or any CSS unit@@ -312,7 +312,7 @@ For more info, see the **[Authentication Docs](/docs/authentication.md)****`sortBy`** | `string` | _Optional_ | The sort order for items within the current section. By default items are displayed in the order in which they are listed in within the config. The following sort options are supported: `most-used` (most opened apps first), `last-used` (the most recently used apps), `alphabetical`, `reverse-alphabetical`, `random` and `default`**`collapsed`** | `boolean` | _Optional_ | If true, the section will be collapsed initially, and will need to be clicked to open. Useful for less regularly used, or very long sections. Defaults to `false`**`cutToHeight`** | `boolean` | _Optional_ | By default, sections will fill available space. Set this option to true to match section height with content height-**`rows`** | `number` | _Optional_ | _Deprecated._ Previously set a section's vertical row-span. The `auto` layout now uses masonry (heights follow content) and `horizontal`/`vertical` are flex-based, so this value is accepted for config compatibility but no longer applied.+**`rows`** | `number` | _Optional_ | Height of the section, specified as the number of rows it should span vertically, e.g. `2`. Defaults to `1`. Max is `5`. Applies to the default `auto` layout; ignored by `masonry` (where heights follow content) and the flex-based `horizontal`/`vertical` layouts.**`cols`** | `number` | _Optional_ | Width of the section, specified as the number of columns the section should span horizontally, e.g. `2`. Defaults to `1`. Max is `5`. Will be clamped to the page's active column count so that a section never exceeds the available grid width.**`itemSize`** | `string` | _Optional_ | Specify the size for items within this group, either `small`, `medium` or `large`. Note that this will override any settings specified through the UI**`color`** | `string` | _Optional_ | A custom accent color for the section, as a hex code or HTML color (e.g. `#fff`)diff --git a/docs/pages-and-sections.md b/docs/pages-and-sections.mdindex 589d8e5e..c24b2c1b 100644--- a/docs/pages-and-sections.md+++ b/docs/pages-and-sections.md@@ -117,25 +117,27 @@ The view switcher, sub-page nav links, and section deep-links all preserve your`appConfig.layout` controls how your sections sit on the page:-- `auto` (default): masonry grid, shorter sections fill the gaps under taller ones+- `auto` (default): responsive CSS grid, sections size by `displayData.cols`/`rows`- `horizontal`: sections stacked top to bottom, each full width- `vertical`: sections side by side in columns+- `masonry`: responsive grid where heights follow content so shorter sections fill gaps under taller ones (`rows` is ignored)You can also switch between these from the settings menu. Add `appConfig.colCount` to force a specific number of columns.-### Making a section wider+### Making a section wider or taller-Use `displayData.cols` (1 to 5) to make a section span extra columns:+Use `displayData.cols` (1 to 5) and `displayData.rows` (1 to 5) to control a section's footprint:```yaml- name: Important LinksdisplayData:cols: 2+ rows: 2collapsed: falseitems: [...]```-Section heights follow their content, so there's no `rows` option.+`rows` is honoured by the `auto` layout. Under `masonry`, section heights always follow content.### Items inside a sectiondiff --git a/docs/privacy.md b/docs/privacy.mdindex 1dd62b44..df0d4e6d 100644--- a/docs/privacy.md+++ b/docs/privacy.md@@ -67,7 +67,7 @@ The following section outlines all data that is stored in the browsers, as cooki- `LANGUAGE` - The locale to show app text in- `HIDE_INFO_NOTIFICATION` - Set to true once user dismissed welcome message, so that it's not shown again-- `LAYOUT_ORIENTATION` - Preferred section layout, either horizontal, vertical or auto+- `LAYOUT_ORIENTATION` - Preferred section layout, either auto, horizontal, vertical or masonry- `COLLAPSE_STATE` - Remembers which sections are collapsed- `ICON_SIZE` - Size of items, either small, medium or large- `THEME` - Users applied themediff --git a/src/assets/interface-icons/layout-masonry.svg b/src/assets/interface-icons/layout-masonry.svgnew file mode 100644index 00000000..eafd3706--- /dev/null+++ b/src/assets/interface-icons/layout-masonry.svg@@ -0,0 +1 @@+<svg aria-hidden="true" focusable="false" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M48 32C21.49 32 0 53.49 0 80v144c0 8.84 7.16 16 16 16h208c8.84 0 16-7.16 16-16V80c0-26.51-21.49-48-48-48H48zm240 0c-8.84 0-16 7.16-16 16v96c0 8.84 7.16 16 16 16h176c26.51 0 48-21.49 48-48V80c0-26.51-21.49-48-48-48H288zm0 160c-8.84 0-16 7.16-16 16v224c0 26.51 21.49 48 48 48h144c26.51 0 48-21.49 48-48V208c0-8.84-7.16-16-16-16H288zM16 272c-8.84 0-16 7.16-16 16v144c0 26.51 21.49 48 48 48h176c8.84 0 16-7.16 16-16V288c0-8.84-7.16-16-16-16H16z"></path></svg>diff --git a/src/assets/locales/en.json b/src/assets/locales/en.jsonindex adce569f..ac6217c8 100644--- a/src/assets/locales/en.json+++ b/src/assets/locales/en.json@@ -147,6 +147,7 @@"layout-auto": "Auto","layout-horizontal": "Horizontal","layout-vertical": "Vertical",+ "layout-masonry": "Masonry","item-size-label": "Item Size","item-size-small": "Small","item-size-medium": "Medium",diff --git a/src/components/InteractiveEditor/EditSection.vue b/src/components/InteractiveEditor/EditSection.vueindex c90b1a97..7b145d97 100644--- a/src/components/InteractiveEditor/EditSection.vue+++ b/src/components/InteractiveEditor/EditSection.vue@@ -44,6 +44,7 @@ const SECTION_SCHEMA = {description: sectionProps.displayData.description,properties: {sortBy: displayProps.sortBy,+ rows: displayProps.rows,cols: displayProps.cols,collapsed: displayProps.collapsed,hideForGuests: displayProps.hideForGuests,diff --git a/src/components/LinkItems/Collapsable.vue b/src/components/LinkItems/Collapsable.vueindex 1dac6cc9..5e851378 100644--- a/src/components/LinkItems/Collapsable.vue+++ b/src/components/LinkItems/Collapsable.vue@@ -2,7 +2,7 @@<divv-bind:class="[{ 'is-open': isExpanded, 'full-height': cutToHeight && !isMasonry },- `collapsable ${colSpanClass}`, sectionClassName+ `collapsable ${rowColSpanClass}`, sectionClassName]":style="dynamicStyle">@@ -55,6 +55,7 @@ export default {icon: { type: String, default: '' }, // An optional section iconcollapsed: Boolean, // Optional override collapse statecols: { type: Number, default: undefined }, // Set section horizontal col span / width+ rows: { type: Number, default: undefined }, // Set section vertical row span / heightcolor: { type: String, default: '' }, // Optional color overridecustomStyles: { type: String, default: '' }, // Optional custom stylingscutToHeight: Boolean, // To set section height with content height@@ -76,8 +77,8 @@ export default {sectionKey() {return `collapsible-${this.uniqueKey}`;},- colSpanClass() {- return this.checkSpanNum(this.cols, 'col');+ rowColSpanClass() {+ return `${this.checkSpanNum(this.cols, 'col')} ${this.checkSpanNum(this.rows, 'row')}`;},dynamicStyle() {const parts = [];@@ -138,7 +139,7 @@ export default {toggle() {this.checkboxState = !this.checkboxState;},- /* Clamp a user-supplied column-span to a sane range, returning a CSS class name */+ /* Clamp a user-supplied row/column-span to a sane range, returning a CSS class name */checkSpanNum(span, classPrefix) {const maxSpan = 6;let numSpan = /^\d*$/.test(span) ? parseInt(span, 10) : 1;@@ -201,10 +202,16 @@ export default {box-shadow: var(--item-group-shadow);background: var(--item-group-outer-background);- /* Section column spanning (heights are driven by masonry / content). */+ /* Options allowing sections to SPAN multiple rows or columns */+ grid-row-start: span 1;+ &.row-2 { grid-row-start: span 2; }+ &.row-3 { grid-row-start: span 3; }+ &.row-4 { grid-row-start: span 4; }+ &.row-5 { grid-row-start: span 5; }+ &.row-6 { grid-row-start: span 6; }grid-column-start: span 1;@include tablet-up {- &.col-2, &.col-3, &.col-4, &.col-5, &.col-6 { grid-column-start: span 2; }+ &.col-2, &.col-3, &.col-4, &.col-5, &.col-6 { grid-column-start: span 2; }}@include laptop-up {&.col-2 { grid-column-start: span 2; }diff --git a/src/components/LinkItems/Section.vue b/src/components/LinkItems/Section.vueindex 51252524..a1cef879 100644--- a/src/components/LinkItems/Section.vue+++ b/src/components/LinkItems/Section.vue@@ -5,6 +5,7 @@:uniqueKey="groupId":collapsed="displayData.collapsed":cols="effectiveColsSpan"+ :rows="displayData.rows":color="displayData.color":customStyles="displayData.customStyles":cutToHeight="displayData.cutToHeight"diff --git a/src/components/Settings/LayoutSelector.vue b/src/components/Settings/LayoutSelector.vueindex adae7484..9ce9c64b 100644--- a/src/components/Settings/LayoutSelector.vue+++ b/src/components/Settings/LayoutSelector.vue@@ -20,6 +20,12 @@:class="`layout-icon ${layout === 'vertical' ? 'selected' : ''}`"tabindex="-2"/>+ <IconMasonry+ @click="updateDisplayLayout('masonry')"+ v-tooltip="tooltip($t('settings.layout-masonry'))"+ :class="`layout-icon ${layout === 'masonry' ? 'selected' : ''}`"+ tabindex="-2"+ /></div></div></template>@@ -29,6 +35,7 @@ import StoreKeys from '@/utils/StoreMutations';import IconDeafault from '@/assets/interface-icons/layout-default.svg';import IconHorizontal from '@/assets/interface-icons/layout-horizontal.svg';import IconVertical from '@/assets/interface-icons/layout-vertical.svg';+import IconMasonry from '@/assets/interface-icons/layout-masonry.svg';export default {name: 'LayoutSelector',@@ -36,6 +43,7 @@ export default {IconDeafault,IconHorizontal,IconVertical,+ IconMasonry,},computed: {layout() {diff --git a/src/mixins/MasonryItem.js b/src/mixins/MasonryItem.jsindex 5d508b42..905edd6a 100644--- a/src/mixins/MasonryItem.js+++ b/src/mixins/MasonryItem.js@@ -1,5 +1,5 @@/**- * Lets a direct child of `.item-group-container.orientation-auto` participate+ * Lets a direct child of `.item-group-container.orientation-masonry` participate* in the masonry grid. Measures its root element's height + vertical margins,* converts to a `grid-row: span N` value against the container's* `grid-auto-rows` unit, and keeps it in sync via a ResizeObserver.@@ -15,7 +15,7 @@ export default {}),computed: {isMasonry() {- return this.$store.getters.layout === 'auto';+ return this.$store.getters.layout === 'masonry';},masonryStyle() {if (!this.isMasonry || !this.masonryRowSpan) return '';diff --git a/src/styles/themes/_flat-themes.scss b/src/styles/themes/_flat-themes.scssindex 0121d1fc..22ff5987 100644--- a/src/styles/themes/_flat-themes.scss+++ b/src/styles/themes/_flat-themes.scss@@ -47,7 +47,8 @@ html[data-theme='fallout'] {border-radius: 1px;&:not(:last-child) { border-right: var(--accent-line-width, 1px) solid var(--secondary); }}- .orientation-auto .collapsable .collapsible-content {+ .orientation-auto .collapsable .collapsible-content,+ .orientation-masonry .collapsable .collapsible-content {border-top: var(--accent-line-width, 1px) solid var(--secondary);}}diff --git a/src/utils/config/ConfigSchema.json b/src/utils/config/ConfigSchema.jsonindex bd27376d..c00c9f28 100644--- a/src/utils/config/ConfigSchema.json+++ b/src/utils/config/ConfigSchema.json@@ -335,10 +335,11 @@"horizontal","vertical","auto",+ "masonry","sidebar"],"default": "auto",- "description": "Specifies sections layout orientation on the home screen"+ "description": "Specifies sections layout orientation on the home screen. Use 'masonry' for a responsive grid where shorter sections fill gaps left by taller ones."},"iconSize": {"title": "Default Icon Size",@@ -856,8 +857,7 @@"minimum": 1,"maximum": 5,"default": 1,- "deprecated": true,- "description": "Deprecated. Section heights now follow content in the masonry layout; this value is accepted for backwards compatibility but has no effect."+ "description": "The amount of space that the section spans vertically (applies to the default 'auto' layout; ignored by 'masonry' where heights follow content)"},"cols": {"title": "Num Cols",diff --git a/src/views/Home.vue b/src/views/Home.vueindex 47e2b54b..2f17e404 100644--- a/src/views/Home.vue+++ b/src/views/Home.vue@@ -199,9 +199,9 @@ export default {max-width: var(--content-max-width, 85%);}- /* Default layout - A masonry grid so sections are auto-positioned to make best use of space- * Row span is computed per-section from content height against --masonry-row-unit */- &.orientation-auto {+ /* Masonry layout - sections auto-positioned to make best use of space.+ * Row span is computed per-section from content height against --masonry-row-unit */+ &.orientation-masonry {grid-auto-rows: var(--masonry-row-unit, 8px);grid-auto-flow: row dense;row-gap: 0;