浏览代码

feat: open dashboard from shortcut

Ahmad Kholid 2 年之前
父节点
当前提交
76725ed350
共有 2 个文件被更改,包括 19 次插入1 次删除
  1. 17 1
      src/content/commandPalette/App.vue
  2. 2 0
      src/content/commandPalette/icons.js

+ 17 - 1
src/content/commandPalette/App.vue

@@ -9,7 +9,7 @@
       id="workflows-container"
       class="absolute w-full max-w-2xl"
       padding="p-0"
-      style="left: 50%; top: 70px; transform: translateX(-50%)"
+      style="left: 50%; top: 50px; transform: translateX(-50%)"
     >
       <div class="p-4">
         <label
@@ -136,6 +136,19 @@
           </template>
         </template>
       </div>
+      <div class="px-4 py-2">
+        <p
+          class="inline-flex items-center cursor-pointer text-gray-600"
+          @click="openDashboard"
+        >
+          Open dashboard
+          <v-remixicon
+            name="riExternalLinkLine"
+            class="inline-block ml-1"
+            size="20"
+          />
+        </p>
+      </div>
     </ui-card>
   </div>
 </template>
@@ -331,6 +344,9 @@ function onInput(event) {
     state.query = value;
   }
 }
+function openDashboard() {
+  sendMessage('open:dashboard', '', 'background');
+}
 
 watch(inputRef, () => {
   if (!inputRef.value) return;

+ 2 - 0
src/content/commandPalette/icons.js

@@ -12,6 +12,7 @@ import {
   riCursorLine,
   riDownloadLine,
   riCommandLine,
+  riExternalLinkLine,
 } from 'v-remixicon/icons';
 
 export default {
@@ -28,4 +29,5 @@ export default {
   riCursorLine,
   riDownloadLine,
   riCommandLine,
+  riExternalLinkLine,
 };