π A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Vue awesomedashboarddockerhomelabhomepagemitnodejsorganizationproductivitypwaself-hostedstartpagevue
Add opening method option for custom search widget.
Phillip Whelan1b7791733552
diff --git a/src/components/Widgets/CustomSearch.vue b/src/components/Widgets/CustomSearch.vueindex 0cd2cdb2..68de9a75 100644--- a/src/components/Widgets/CustomSearch.vue+++ b/src/components/Widgets/CustomSearch.vue@@ -7,7 +7,7 @@<div class="buttons"><buttonv-for="(engine, key) in engines" :key="key"- v-on:click="search(engine)">+ v-on:click="search(engine, openingMethod)">{{ engine.title }}</button></div>@@ -15,7 +15,9 @@</template><script>+import router from '@/router';import WidgetMixin from '@/mixins/WidgetMixin';+import ErrorHandler from '@/utils/ErrorHandler';export default {mixins: [WidgetMixin],@@ -35,11 +37,28 @@ export default {defaultEngine() {return this.engines[0];},+ openingMethod() {+ return this.options.openingMethod || '';+ },},methods: {- search(engine) {+ search(engine, openingMethod) {if (engine !== undefined && this.query !== '') {- window.open(engine.url + this.query, '_blank');+ const url = engine.url + this.query;+ switch (openingMethod) {+ case 'newtab':+ window.open(url, '_blank');+ break;+ case 'sametab':+ window.open(url, '_self');+ break;+ case 'workspace':+ router.push({ name: 'workspace', query: { url } });+ break;+ default:+ ErrorHandler(`Unknown opening method: ${openingMethod}`);+ window.open(url, '_blank');+ }}},},