π A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
:twisted_rightwards_arrows: Rebased from master
Alicia Sykes3694a3ad0312
diff --cc src/components/LinkItems/Item.vueindex 37bb3759,62184575..afec5c21--- a/src/components/LinkItems/Item.vue+++ b/src/components/LinkItems/Item.vue@@@ -1,9 -1,9 +1,9 @@@<template ref="container"><div :class="`item-wrapper wrap-size-${itemSize}`">- <a @click="beforeLaunchItem"- <a @click="itemOpened"++ <a @click="itemClicked"@mouseup.right="openContextMenu"@contextmenu.prevent- :href="hyperLinkHref"+ :href="url":target="anchorTarget":class="`item ${makeClassList}`"v-tooltip="getTooltipOptions()"@@@ -136,30 -151,59 +137,6 @@@ export default};},methods: {-- /* Called when an item is clicked, manages the opening of modal & resets the search field */- beforeLaunchItem(e) {- if (this.isEditMode) { // If in edit mode, open settings, don't launch app- itemOpened(e) {- if (this.isEditMode) {- // If in edit mode, open settings, and don't launch app- e.preventDefault();-- this.openItemSettings();-- return;-- }- if (e.altKey) {- // For certain opening methods, prevent default and manually navigate- if (e.ctrlKey) {-- e.preventDefault();- this.launchItem('modal');- } else if (this.accumulatedTarget === 'modal') {- this.launchItem('modal');- window.open(this.url, '_blank');- } else if (e.altKey || this.accumulatedTarget === 'modal') {- e.preventDefault();- this.$emit('triggerModal', this.url);-- } else if (this.accumulatedTarget === 'workspace') {- this.launchItem('workspace');- e.preventDefault();- router.push({ name: 'workspace', query: { url: this.url } });-- } else if (this.accumulatedTarget === 'clipboard') {- this.launchItem('clipboard');- e.preventDefault();- navigator.clipboard.writeText(this.url);- this.$toasted.show(this.$t('context-menus.item.copied-toast'));-- }- // Clear search bar- // Emit event to clear search field, etc-- this.$emit('itemClicked');--- // Update the most/ last used ledger, for smart-sorting-- if (!this.appConfig.disableSmartSort) {-- this.incrementMostUsedCount(this.id);-- this.incrementLastUsedCount(this.id);- }- },- /* Open custom context menu, and set position */- openContextMenu(e) {- this.contextMenuOpen = !this.contextMenuOpen;- if (e && window) {- // Calculate placement based on cursor and scroll position- this.contextPos = {- posX: e.clientX + window.pageXOffset,- posY: e.clientY + window.pageYOffset,- };-- }- },- /* Closes the context menu, called when user clicks literally anywhere */- closeContextMenu() {- this.contextMenuOpen = false;-- },/* Returns configuration object for the tooltip */getTooltipOptions() {if (!this.description && !this.provider) return {}; // If no description, then skip@@@ -179,7 -223,85 +156,6 @@@classes: `item-description-tooltip tooltip-is-${this.itemSize}`,};},- /* Open the Edit Item modal form */- /* Used by certain themes (material), to show animated CSS icon */- getUnicodeOpeningIcon() {- switch (this.accumulatedTarget) {- case 'newtab': return '"\\f360"';- case 'sametab': return '"\\f24d"';- case 'parent': return '"\\f3bf"';- case 'top': return '"\\f102"';- case 'modal': return '"\\f2d0"';- case 'workspace': return '"\\f0b1"';- case 'clipboard': return '"\\f0ea"';- default: return '"\\f054"';- }- },- /* Pulls together all user options, returns URL + Get params for ping endpoint */- makeApiUrl() {- const {- url,- statusCheckUrl,- statusCheckHeaders,- statusCheckAllowInsecure,- statusCheckAcceptCodes,- statusCheckMaxRedirects,- } = this;- const encode = (str) => encodeURIComponent(str);- this.statusResponse = undefined;- // Find base URL, where the API is hosted- const baseUrl = process.env.VUE_APP_DOMAIN || window.location.origin;- // Find correct URL to check, and encode- const urlToCheck = `?&url=${encode(statusCheckUrl || url)}`;- // Get, stringify and encode any headers- const headers = statusCheckHeaders- ? `&headers=${encode(JSON.stringify(statusCheckHeaders))}` : '';- // Deterimine if user disabled security- const enableInsecure = statusCheckAllowInsecure ? '&enableInsecure=true' : '';- const acceptCodes = statusCheckAcceptCodes ? `&acceptCodes=${statusCheckAcceptCodes}` : '';- const maxRedirects = statusCheckMaxRedirects ? `&maxRedirects=${statusCheckMaxRedirects}` : '';- // Construct the full API endpoint's URL with GET params- return `${baseUrl}${serviceEndpoints.statusCheck}/${urlToCheck}`- + `${headers}${enableInsecure}${acceptCodes}${maxRedirects}`;- },- /* Checks if a given service is currently online */- checkWebsiteStatus() {- const endpoint = this.makeApiUrl();- axios.get(endpoint)- .then((response) => {- if (response.data) this.statusResponse = response.data;- })- .catch(() => { // Something went very wrong.- this.statusResponse = {- statusText: 'Failed to make request',- statusSuccess: false,- };- });- },- /* Handle navigation options from the context menu */- launchItem(method) {- const { url } = this;- this.contextMenuOpen = false;- switch (method) {- case 'newtab':- window.open(url, '_blank');- break;- case 'sametab':- window.open(url, '_self');- break;- case 'modal':- this.$emit('triggerModal', url);- break;- case 'workspace':- router.push({ name: 'workspace', query: { url } });- break;- case 'clipboard':- navigator.clipboard.writeText(url);- this.$toasted.show(this.$t('context-menus.item.copied-toast'));- break;- default: window.open(url, '_blank');- }- },- /* Open the Edit Item moal form */openItemSettings() {this.editMenuOpen = true;this.contextMenuOpen = false;diff --cc src/components/LinkItems/Section.vueindex 4f24bd4a,a4e2fd96..f62c77eb--- a/src/components/LinkItems/Section.vue+++ b/src/components/LinkItems/Section.vue@@@ -21,44 -21,32 +21,45 @@@:class="`there-are-items ${isGridLayout? 'item-group-grid': ''} inner-size-${itemSize}`":style="gridStyle" :id="`section-${groupId}`"> <!-- Show for each item -->- <Item- v-for="(item) in sortedItems"- :id="item.id"- :key="item.id"- :url="item.url"- :title="item.title"- :description="item.description"- :icon="item.icon"- :target="item.target"- :color="item.color"- :backgroundColor="item.backgroundColor"- :statusCheckUrl="item.statusCheckUrl"- :statusCheckHeaders="item.statusCheckHeaders"- :itemSize="itemSize"- :hotkey="item.hotkey"- :provider="item.provider"- :parentSectionTitle="title"- :enableStatusCheck="item.statusCheck !== undefined ? item.statusCheck : enableStatusCheck"- :statusCheckInterval="statusCheckInterval"- :statusCheckAllowInsecure="item.statusCheckAllowInsecure"- :statusCheckAcceptCodes="item.statusCheckAcceptCodes"- :statusCheckMaxRedirects="item.statusCheckMaxRedirects"- @itemClicked="$emit('itemClicked')"- @triggerModal="triggerModal"- :isAddNew="false"- />+ <template v-for="(item) in sortedItems">+ <div v-if="item.subItems" :key="item.id" class="sub-items-group">+ <template v-for="(subItem, subIndex) in item.subItems">+ <SubItem+ :key="subIndex"+ :id="`${item.id}-sub-${subIndex}`"+ :url="subItem.url"+ :icon="subItem.icon"+ :title="subItem.title"+ />+ </template>+ </div>+ <Item+ v-else+ :id="item.id"+ :key="item.id"+ :url="item.url"+ :title="item.title"+ :description="item.description"+ :icon="item.icon"+ :target="item.target"+ :color="item.color"+ :backgroundColor="item.backgroundColor"+ :statusCheckUrl="item.statusCheckUrl"+ :statusCheckHeaders="item.statusCheckHeaders"+ :itemSize="itemSize"+ :hotkey="item.hotkey"+ :provider="item.provider"+ :parentSectionTitle="title"+ :enableStatusCheck="item.statusCheck !== undefined ? item.statusCheck : enableStatusCheck"+ :statusCheckInterval="statusCheckInterval"+ :statusCheckAllowInsecure="item.statusCheckAllowInsecure"+ :statusCheckAcceptCodes="item.statusCheckAcceptCodes"++ :statusCheckMaxRedirects="item.statusCheckMaxRedirects"+ @itemClicked="$emit('itemClicked')"+ @triggerModal="triggerModal"+ :isAddNew="false"+ />+ </template><!-- When in edit mode, show additional item, for Add New item --><Item v-if="isEditMode":isAddNew="true"