From 6b96df3da5b7d0db970f0204e2bf1b522cc2f01f Mon Sep 17 00:00:00 2001
From: muwoo <2424880409@qq.com>
Date: Thu, 13 Jan 2022 12:04:53 +0800
Subject: [PATCH 1/5] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E5=A4=8D?=
=?UTF-8?q?=E5=88=B6=E6=96=87=E4=BB=B6bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/main/browsers/main.ts | 2 ++
src/renderer/components/search.vue | 9 ++++++++-
src/renderer/main.ts | 3 ++-
src/renderer/plugins-manager/clipboardWatch.ts | 2 +-
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/main/browsers/main.ts b/src/main/browsers/main.ts
index 757eb85..8fe167e 100644
--- a/src/main/browsers/main.ts
+++ b/src/main/browsers/main.ts
@@ -35,6 +35,8 @@ export default () => {
win.loadURL("app://./index.html");
}
+ win.webContents.openDevTools();
+
protocol.interceptFileProtocol("image", (req, callback) => {
const url = req.url.substr(8);
callback(decodeURI(url));
diff --git a/src/renderer/components/search.vue b/src/renderer/components/search.vue
index 3126e4c..e59b8c8 100644
--- a/src/renderer/components/search.vue
+++ b/src/renderer/components/search.vue
@@ -3,7 +3,8 @@
{{ currentPlugin.cmd }}
![]()
- {{ clipboardFile[0].name }}
+
{{ clipboardFile[0].name }}
+
{{ clipboardFile.length }}
{
left: 0;
width: 100%;
align-items: center;
+ .ellipse {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ max-width: 200px;
+ }
.select-tag {
white-space: pre;
user-select: none;
diff --git a/src/renderer/main.ts b/src/renderer/main.ts
index 3a986b0..bd6d386 100644
--- a/src/renderer/main.ts
+++ b/src/renderer/main.ts
@@ -1,5 +1,5 @@
import { createApp } from "vue";
-import { Button, List, Spin, Input, Avatar } from "ant-design-vue";
+import { Button, List, Spin, Input, Avatar, Tag } from "ant-design-vue";
import App from "./App.vue";
createApp(App)
@@ -8,4 +8,5 @@ createApp(App)
.use(Spin)
.use(Input)
.use(Avatar)
+ .use(Tag)
.mount("#app");
diff --git a/src/renderer/plugins-manager/clipboardWatch.ts b/src/renderer/plugins-manager/clipboardWatch.ts
index 588dc99..f493a7f 100644
--- a/src/renderer/plugins-manager/clipboardWatch.ts
+++ b/src/renderer/plugins-manager/clipboardWatch.ts
@@ -120,8 +120,8 @@ export default ({
clearClipboardFile();
window.setSubInputValue({ value: contentText });
}
+ clipboard.clear();
}
- clipboard.clear();
};
const clearClipboardFile = () => {
From 2beac06e7ce78427cbab053cb3a26b9c78fe3a70 Mon Sep 17 00:00:00 2001
From: muwoo <2424880409@qq.com>
Date: Thu, 13 Jan 2022 13:47:55 +0800
Subject: [PATCH 2/5] =?UTF-8?q?ref:=20=E4=BF=AE=E5=A4=8Dwin=E4=B8=8B?=
=?UTF-8?q?=E5=A4=9A=E6=96=87=E4=BB=B6=E5=A4=8D=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/package.json b/package.json
index 3429d12..6ea5896 100644
--- a/package.json
+++ b/package.json
@@ -19,6 +19,7 @@
"ant-design-vue": "^2.2.8",
"core-js": "^3.6.5",
"cross-spawn": "^7.0.3",
+ "electron-clipboard-ex": "^1.3.3",
"extract-file-icon": "^0.3.2",
"fix-path": "^3.0.0",
"get-mac-apps": "^1.0.2",
From e5ff21968558e3041a8945f12e121587d72ea414 Mon Sep 17 00:00:00 2001
From: muwoo <2424880409@qq.com>
Date: Thu, 13 Jan 2022 13:48:20 +0800
Subject: [PATCH 3/5] =?UTF-8?q?ref:=20=E4=BF=AE=E5=A4=8Dwin=E4=B8=8B?=
=?UTF-8?q?=E5=A4=9A=E6=96=87=E4=BB=B6=E5=A4=8D=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/common/utils/getCopyFiles.ts | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/common/utils/getCopyFiles.ts b/src/common/utils/getCopyFiles.ts
index 85b049f..1069058 100644
--- a/src/common/utils/getCopyFiles.ts
+++ b/src/common/utils/getCopyFiles.ts
@@ -17,8 +17,9 @@ export default function getCopyFiles(): Array | null {
return null;
}
} else if (commonConst.windows()) {
- const filePath = clipboard.readBuffer('FileNameW').toString('ucs2').replace(RegExp(String.fromCharCode(0), 'g'), '');
- fileInfo = [filePath];
+ /* eslint-disable */
+ const clipboardEx = require("electron-clipboard-ex");
+ fileInfo = clipboardEx.readFilePaths();
// todo
} else {
if (!commonConst.linux()) return null;
From 1e73ab5ee67dabbf8869bf4767027e675e4e95aa Mon Sep 17 00:00:00 2001
From: muwoo <2424880409@qq.com>
Date: Thu, 13 Jan 2022 18:38:44 +0800
Subject: [PATCH 4/5] =?UTF-8?q?:bug:=20#80=20=E4=BF=AE=E5=A4=8D=20win=20de?=
=?UTF-8?q?pd=20bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 3 +--
src/core/plugin-handler/index.ts | 25 -----------------------
src/renderer/components/result.vue | 16 ++++++++++++++-
src/renderer/components/search.vue | 2 +-
src/renderer/plugins-manager/options.ts | 27 ++++++++++++++++---------
5 files changed, 35 insertions(+), 38 deletions(-)
diff --git a/package.json b/package.json
index 6ea5896..d13c6a5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "rubick",
- "version": "2.0.1-beta.15",
+ "version": "2.0.1-beta.16",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
@@ -24,7 +24,6 @@
"fix-path": "^3.0.0",
"get-mac-apps": "^1.0.2",
"got": "^11.8.3",
- "libnpmsearch": "^3.1.2",
"lodash.throttle": "^4.1.1",
"pouchdb": "^7.2.2",
"vue": "^3.0.0",
diff --git a/src/core/plugin-handler/index.ts b/src/core/plugin-handler/index.ts
index c0db313..2e9c559 100644
--- a/src/core/plugin-handler/index.ts
+++ b/src/core/plugin-handler/index.ts
@@ -3,7 +3,6 @@ import {
AdapterInfo,
} from "@/core/plugin-handler/types";
import fs from "fs-extra";
-import search, { Result } from "libnpmsearch";
import path from "path";
import got from "got";
import fixPath from "fix-path";
@@ -90,30 +89,6 @@ class AdapterHandler {
await this.execCommand(installCmd, adapters);
}
- /**
- * 从 npm 搜索插件
- * 传入 streamFunc 可以流式处理
- * @param {string} adapter 插件名称
- * @param {(data: Result) => void} [streamFunc] 流式处理钩子
- * @memberof AdapterHandler
- */
- async search(adapter: string, streamFunc?: (data: Result) => void) {
- return await new Promise((resolve, reject) => {
- const result: Result[] = [];
- const stream = search.stream(adapter);
- stream.on("data", (data: Result) => {
- result.push(data);
- if (streamFunc !== undefined) streamFunc(data);
- });
- stream.on("end", () => {
- resolve(result);
- });
- stream.on("error", (e: any) => {
- reject(e);
- });
- });
- }
-
/**
* 更新指定插件
* @param {...string[]} adapters 插件名称
diff --git a/src/renderer/components/result.vue b/src/renderer/components/result.vue
index 845c134..b033fc7 100644
--- a/src/renderer/components/result.vue
+++ b/src/renderer/components/result.vue
@@ -1,6 +1,6 @@
-
+
item.click()"
@@ -66,6 +66,20 @@ const renderDesc = (desc) => {
}
return desc;
};
+
+const sort = (options) => {
+ for (let i = 0; i < options.length; i++) {
+ for (let j = i + 1; j < options.length; j++) {
+ if (options[j].zIndex > options[i].zIndex) {
+ let temp = options[i];
+ options[i] = options[j];
+ options[j] = temp;
+ }
+ }
+ }
+ return options;
+};
+