mirror of
https://github.com/rubickCenter/rubick
synced 2025-10-26 22:51:25 +08:00
Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c096fcd99 | ||
|
|
1656418c10 | ||
|
|
f671b83b6a | ||
|
|
dfb8446cfd | ||
|
|
4e59294b16 | ||
|
|
562a13fdff | ||
|
|
9663232864 | ||
|
|
3f7285b177 | ||
|
|
e8c8f40bae | ||
|
|
6ae15b8f37 | ||
|
|
a3a7dfde98 | ||
|
|
289165de82 | ||
|
|
6da9e2fe9c | ||
|
|
c00963fabb | ||
|
|
4b8f0e4657 | ||
|
|
28e7d2aa46 | ||
|
|
404cb4fcb5 | ||
|
|
5553170c5a | ||
|
|
d8fabc6b4c | ||
|
|
88e4e325f3 | ||
|
|
c0aaae08ee | ||
|
|
35598159a6 | ||
|
|
2a1a332fbb | ||
|
|
6d105e0f56 | ||
|
|
d2acdeaad6 | ||
|
|
54ad4ef7b2 | ||
|
|
7fb299d270 | ||
|
|
606cb8bb22 |
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -27,6 +27,10 @@ jobs:
|
||||
|
||||
# create steps
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.10'
|
||||
# step1: check out repository
|
||||
- name: Check out git repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# 确保脚本抛出遇到的错误
|
||||
set -e
|
||||
|
||||
# 生成静态文件
|
||||
cd docs && npm run docs:build
|
||||
# 进入生成的文件夹
|
||||
cd docs/.vuepress/dist
|
||||
|
||||
# 如果是发布到自定义域名
|
||||
# echo 'www.example.com' > CNAME
|
||||
|
||||
git init
|
||||
git add -A
|
||||
git commit -m 'deploy'
|
||||
|
||||
# 如果发布到 https://<USERNAME>.github.io
|
||||
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
|
||||
|
||||
# 如果发布到 https://<USERNAME>.github.io/<REPO>
|
||||
git push -f git@github.com:rubickCenter/rubick.git master:gh-pages
|
||||
|
||||
cd -
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
|
||||
@@ -86,6 +86,47 @@ Object.assign(window, {
|
||||
plugInfo.value.subInput = null;
|
||||
},
|
||||
});
|
||||
|
||||
window.enterFullScreenTrigger = () => {
|
||||
document.querySelector('.detach').classList.remove('darwin');
|
||||
};
|
||||
window.leaveFullScreenTrigger = () => {
|
||||
const titleDom = document.querySelector('.detach');
|
||||
if (!titleDom.classList.contains('darwin')) {
|
||||
titleDom.classList.add('darwin');
|
||||
}
|
||||
};
|
||||
|
||||
window.maximizeTrigger = () => {
|
||||
const btnMaximize = document.querySelector('.maximize')
|
||||
if (!btnMaximize || btnMaximize.classList.contains('unmaximize')) return;
|
||||
btnMaximize.classList.add('unmaximize');
|
||||
};
|
||||
|
||||
window.unmaximizeTrigger = () => {
|
||||
const btnMaximize = document.querySelector('.maximize');
|
||||
if (!btnMaximize) return;
|
||||
btnMaximize.classList.remove('unmaximize');
|
||||
};
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
window.onkeydown = (e) => {
|
||||
if (e.code === 'Escape') {
|
||||
ipcRenderer.send('detach:service', { type: 'endFullScreen' });
|
||||
return;
|
||||
}
|
||||
if (e.metaKey && (e.code === 'KeyW' || e.code === 'KeyQ')) {
|
||||
window.handle.close()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
window.onkeydown = (e) => {
|
||||
if (e.ctrlKey && e.code === 'KeyW') {
|
||||
window.handle.close()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
module.exports = {
|
||||
title: 'Rubick',
|
||||
description: '你的开源桌面插件应用',
|
||||
base: '/rubick/',
|
||||
themeConfig: {
|
||||
themeColor: {
|
||||
blue: "#2196f3",
|
||||
red: "#2196f3",
|
||||
green: "#2196f3",
|
||||
orange: "#2196f3",
|
||||
},
|
||||
logo: '/images/logo.png',
|
||||
nav: [
|
||||
{ text: '使用文档', link: '/guide/' },
|
||||
{ text: '开发者', link: '/dev/' },
|
||||
],
|
||||
sidebar: [
|
||||
{
|
||||
title: '使用文档', // 必要的
|
||||
path: '/guide/', // 可选的, 标题的跳转链接,应为绝对路径且必须存在
|
||||
sidebarDepth: 1, // 可选的, 默认值是 1
|
||||
},
|
||||
{
|
||||
title: '插件开发',
|
||||
path: '/dev/',
|
||||
},
|
||||
{
|
||||
title: '特殊服务',
|
||||
path: '/super/',
|
||||
},
|
||||
{
|
||||
title: 'API',
|
||||
path: '/api/',
|
||||
},
|
||||
{
|
||||
title: '贡献 rubick',
|
||||
path: '/run/',
|
||||
}
|
||||
],
|
||||
// 假定是 GitHub. 同时也可以是一个完整的 GitLab URL
|
||||
repo: 'https://github.com/rubickCenter/rubick',
|
||||
// 自定义仓库链接文字。默认从 `themeConfig.repo` 中自动推断为
|
||||
// "GitHub"/"GitLab"/"Bitbucket" 其中之一,或是 "Source"。
|
||||
repoLabel: 'Github',
|
||||
// 默认是 false, 设置为 true 来启用
|
||||
editLinks: true,
|
||||
// 默认为 "Edit this page"
|
||||
editLinkText: '帮助我们改善此页面!'
|
||||
}
|
||||
}
|
||||
Submodule docs/docs/.vuepress/dist deleted from 7b52f0fb4a
Binary file not shown.
|
Before Width: | Height: | Size: 47 KiB |
@@ -1,7 +0,0 @@
|
||||
$accentColor = #ff4ea4//默认主题颜色
|
||||
$codeBgColor = #282c34//默认背景颜色
|
||||
|
||||
//示例修改相关样式f12找到需要修改的地方找到对应class类拿过来直接用就行了
|
||||
.sidebar-group.is-sub-group > .sidebar-heading:not(.clickable){
|
||||
opacity :1
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
home: true
|
||||
heroImage: /images/logo.png
|
||||
heroText: Rubick
|
||||
tagline: 基于 Electron 开源的插件化工具箱
|
||||
actionText: 快速上手 →
|
||||
actionLink: /guide/
|
||||
features:
|
||||
- title: 极其轻量
|
||||
details: rubick 仅仅包含插件运行所需要的API,本身不内置任何插件,可以看成是 electron 的二次封装框架。
|
||||
- title: 更强大的插件能力
|
||||
details: 不仅仅支持ui插件(需要搜索呼起使用),还支持系统插件(不需要搜索,只要rubick在运行,系统插件即可用)
|
||||
- title: 更便捷的插件管理
|
||||
details: rubick 插件全部托管在 npm 仓库,rubick 插件的安装、使用、删除就是 npm 包的安装、使用、删除
|
||||
footer: MIT Licensed | Copyright (c) 2021 muwoo
|
||||
---
|
||||
@@ -1,261 +0,0 @@
|
||||
## 事件
|
||||
|
||||
### onPluginReady(callback)、onPluginEnter(callback)
|
||||
|
||||
* `callback` Function
|
||||
|
||||
`callback` 内会返回一个 `object` 对象,来描述进入当前插件的环境信息:
|
||||
|
||||
* `code` String
|
||||
|
||||
> plugin.json 配置的 feature.code
|
||||
|
||||
* `type` String
|
||||
|
||||
> plugin.json 配置的 feature.cmd.type,可以为 "text"、"img"、 "files"、 "regex"、 "over"、"window"
|
||||
|
||||
* payload String | Object | Array
|
||||
|
||||
> feature.cmd.type 对应匹配的数据
|
||||
|
||||
当插件装载成功,rubick 将会主动调用这个方法, 所有的 `api` 都应该在 `onPluginReady` 之后进行调用。
|
||||
|
||||
#### 示例
|
||||
|
||||
```js
|
||||
rubick.onPluginReady(({ code, type, payload }) => {
|
||||
console.log('插件装配完成,已准备好')
|
||||
})
|
||||
/*
|
||||
type 为 "files" 时, payload 值示例
|
||||
[
|
||||
{
|
||||
"isFile": true,
|
||||
"isDirectory": false,
|
||||
"name": "demo.js",
|
||||
"path": "C:\\demo.js"
|
||||
}
|
||||
]
|
||||
|
||||
type 为 "img" 时, payload 值示例
|
||||
data:image/png;base64,...
|
||||
|
||||
type 为 "text"、"regex"、 "over" 时, payload 值为进入插件时的主输入框文本
|
||||
*/
|
||||
```
|
||||
|
||||
### onPluginOut(callback)
|
||||
|
||||
* `callback` Function
|
||||
|
||||
每当插件从前台进入到后台时,rubick 将会主动调用这个方法。
|
||||
|
||||
## 窗口交互
|
||||
|
||||
### hideMainWindow()
|
||||
|
||||
隐藏主窗口
|
||||
|
||||
### showMainWindow()
|
||||
|
||||
显示主窗口
|
||||
|
||||
### setExpendHeight(height)
|
||||
|
||||
执行该方法将会修改插件窗口的高度。
|
||||
|
||||
* `height` Integer
|
||||
* 返回 `Boolean`
|
||||
|
||||
#### 示例
|
||||
|
||||
```js
|
||||
rubick.setExpendHeight(100)
|
||||
```
|
||||
|
||||
### setSubInput(onChange, placeholder)
|
||||
|
||||
设置插件输入框监听,当进入插件后,用户搜索会触发`onChange` 函数
|
||||
|
||||
* `onChange` Function
|
||||
* `Object`
|
||||
* `text` String
|
||||
|
||||
> 子输入框文本修改时触发
|
||||
|
||||
* `placeholder` String (可选)
|
||||
|
||||
> 子输入框占位符
|
||||
|
||||
* `isFocus` Boolean (可选)
|
||||
|
||||
> 子输入框是否获得焦点,默认 true
|
||||
|
||||
`返回 Boolean`
|
||||
|
||||
#### 示例
|
||||
|
||||
```js
|
||||
rubick.setSubInput(({ text }) => {
|
||||
console.log(text)
|
||||
}, '搜索')
|
||||
```
|
||||
|
||||
### setSubInputValue(value)
|
||||
|
||||
直接对子输入框的值进行设置。
|
||||
|
||||
* `value` String
|
||||
* `返回` Boolean
|
||||
|
||||
#### 示例
|
||||
|
||||
```js
|
||||
rubick.setSubInputValue('rubick')
|
||||
```
|
||||
|
||||
## 系统
|
||||
### showNotification(body)
|
||||
显示系统通知
|
||||
|
||||
* `body` String
|
||||
```js
|
||||
rubick.showNotification('Hi, rubick')
|
||||
```
|
||||
|
||||
### shellOpenPath(fullPath)
|
||||
打开给定路径的文件
|
||||
|
||||
* `fullPath` String
|
||||
|
||||
```js
|
||||
rubick.shellOpenPath('/path/file')
|
||||
```
|
||||
|
||||
### shellOpenExternal(url)
|
||||
浏览器打开URL
|
||||
|
||||
* `url` String
|
||||
|
||||
```js
|
||||
rubick.shellOpenExternal('https://www.baidu.com')
|
||||
```
|
||||
|
||||
### getPath(name)
|
||||
electron 内置 getPath 能力,详见 [electron API](https://www.electronjs.org/docs/latest/api/app#appgetpathname)
|
||||
|
||||
```js
|
||||
console.log(rubick.getPath('cache'));
|
||||
```
|
||||
|
||||
## 本地数据库
|
||||
|
||||
`rubick db` 是基于开源的 [pouchdb](https://github.com/pouchdb/pouchdb) 封装的
|
||||
|
||||
### rubick.db.put(doc)
|
||||
|
||||
* `doc` Object
|
||||
* `返回` Object
|
||||
|
||||
#### 示例
|
||||
|
||||
```js
|
||||
// 创建请求
|
||||
rubick.db.put({
|
||||
_id: "demo",
|
||||
data: "demo"
|
||||
})
|
||||
// 返回 {id: "demo", ok: true, rev: "1-05c9b92e6f24287dc1f4ec79d9a34fa8"}
|
||||
|
||||
// 更新请求
|
||||
rubick.db.put({
|
||||
_id: "demo",
|
||||
data: "demo",
|
||||
_rev: "1-05c9b92e6f24287dc1f4ec79d9a34fa8"
|
||||
})
|
||||
```
|
||||
|
||||
_id 代表这个文档在数据库中唯一值,如果值不存在,则会创建一个新的文档,如果值已经存在,则会进行更新。你可能已经注意到,返回对象中包含一个 rev
|
||||
属性,这是代表此文档的版本,每次对文档进行更新时,都要带上最新的版本号,否则更新将失败,版本化的意义在于解决同步时数据冲突。
|
||||
|
||||
另外需要注意,每次更新时都要传入完整的文档数据,无法对单个字段进行更新。
|
||||
|
||||
### rubick.db.get(id)
|
||||
|
||||
执行该方法将会根据文档 ID 获取数据
|
||||
|
||||
* `id` String
|
||||
* `返回` Object
|
||||
|
||||
```js
|
||||
rubick.db.get("demo")
|
||||
// 返回 {_id: "demo", _rev: "3-9836c5c68af5aef618e17d615882942a", data: "demo"}
|
||||
```
|
||||
|
||||
### rubick.db.remove(doc)
|
||||
|
||||
* `doc` String | Object
|
||||
* `返回` Object 执行该方法将会删除数据库文档,可以传入文档对象或文档 id 进行操作。
|
||||
|
||||
```js
|
||||
rubick.db.remove("demo")
|
||||
// 返回 {id: "demo", ok: true, rev: "2-effe5dbc23dffc180d8411b23f3108fb"}
|
||||
```
|
||||
|
||||
### rubick.db.bulkDocs(docs)
|
||||
|
||||
* `docs` Array
|
||||
* `返回` Array 执行该方法将会批量更新数据库文档,传入需要更改的文档对象合并成数组进行批量更新。
|
||||
|
||||
```js
|
||||
rubick.db.bulkDocs([{
|
||||
_id: "demo1",
|
||||
data: "demo",
|
||||
_rev: "1-c8817a74e292eda4cba1a45924853af6"
|
||||
}, {
|
||||
_id: "demo2",
|
||||
data: "demo",
|
||||
_rev: "1-f0399b42cc6123a9cc8503632ba7b3a7"
|
||||
}])
|
||||
/* 返回
|
||||
[{
|
||||
id: "demo1", ok: true, rev: "2-7857b2801bc0303d2cc0bb82e8afd796"
|
||||
}, {
|
||||
id: "demo2", ok: true, rev: "2-7857b2801bc0303d2cc0bb82e8afd796"
|
||||
}]
|
||||
*/
|
||||
```
|
||||
|
||||
### rubick.db.allDocs(key)
|
||||
|
||||
* `key` String | Array
|
||||
* `返回` Array 执行该方法将会获取所有数据库文档,如果传入字符串,则会返回以字符串开头的文档,也可以传入指定 ID 的数组,不传入则为获取所有文档。
|
||||
|
||||
```js
|
||||
// 获取所有文档
|
||||
rubick.db.allDocs()
|
||||
|
||||
// 传入字符串,则返回id以 demo 开头的文档
|
||||
rubick.db.allDocs("demo")
|
||||
/* 返回
|
||||
[{
|
||||
_id: "demo/123", _rev: "2-7857b2801bc0303d2cc0bb82e8afd796", data: "demo"
|
||||
}, {
|
||||
_id: "demo/124", _rev: "1-f0399b42cc6123a9cc8503632ba7b3a7", data: "demo"
|
||||
}, {
|
||||
_id: "demo/125", _rev: "1-f0399b42cc6123a9cc8503632ba7b3a7", data: "demo"
|
||||
}]
|
||||
*/
|
||||
// 根据id数组请求
|
||||
rubick.db.allDocs([
|
||||
"demo1",
|
||||
"demo2"
|
||||
])
|
||||
/* 返回
|
||||
[{
|
||||
_id: "demo1", _rev: "2-7857b2801bc0303d2cc0bb82e8afd796", data: "demo"
|
||||
}, {
|
||||
_id: "demo2", _rev: "1-f0399b42cc6123a9cc8503632ba7b3a7", data: "demo"
|
||||
}]
|
||||
*/
|
||||
```
|
||||
@@ -1,176 +0,0 @@
|
||||
## 插件说明
|
||||
`rubick` 插件分为 `UI插件` 和 `系统插件` 2类。下面分别介绍这 2 类插件的区别和作用。
|
||||
1. UI 插件 <Badge type="tip" text="最常用" />:都会有 UI 界面,用于和用户交互,且需要通过关键词搜索选择进行使用,比如 `斗图` 插件,有界面展示,且需要再搜索框内搜索关键词选择后进行呼起才能使用。
|
||||
2. 系统插件:可能不会有 UI 界面,在 `rubick` 启动的时候,会注册执行系统插件。比如`超级面板` 插件,安装完成后,即可在 `rubick` 运行时随时使用,不需要任何关键词和匹配。
|
||||
## 开发 UI 插件
|
||||
|
||||
一个最基础插件的目录是这样的:
|
||||
```
|
||||
rubick-plugin-demo
|
||||
|-- index.html
|
||||
|-- package.json
|
||||
|-- preload.js
|
||||
```
|
||||
### 文件说明
|
||||
#### package.json
|
||||
用于指定插件最基础的配置,一个最基础的配置信息如下:
|
||||
```json
|
||||
{
|
||||
"name": "rubick-ui-plugin-demo",
|
||||
"pluginName": "插件demo",
|
||||
"description": "rubick ui 插件demo",
|
||||
"author": "muwoo",
|
||||
"main": "index.html",
|
||||
"logo": "https://www.img/demo.png",
|
||||
"version": "0.0.1",
|
||||
"preload":"preload.js",
|
||||
"homePage": "https://gitee.com/rubick-center/rubick-ui-plugin-demo/raw/master/README.md",
|
||||
"pluginType": "ui",
|
||||
"features": [
|
||||
{
|
||||
"code": "index",
|
||||
"explain": "测试插件",
|
||||
"cmds":[
|
||||
"demo",
|
||||
"测试"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
核心字段说明:
|
||||
|
||||
* name: 插件 `npm` 包名称,<Badge type="tip" text="必填" />
|
||||
* pluginName: 插件显示名称,用于展示给使用者 <Badge type="tip" text="必填" />
|
||||
* description: 插件描述,描述这个插件的作用 <Badge type="tip" text="必填" />
|
||||
* author: 插件作者
|
||||
* main: 入口文件,一般为 `index.html`
|
||||
* logo: 尺寸建议 200 * 200, 插件的 logo, 需要是 http/https 在线地址,不支持本地logo <Badge type="tip" text="必填" />
|
||||
* version: 插件的版本 <Badge type="tip" text="必填" />
|
||||
* preload: 预加载脚本
|
||||
* homePage: 插件 readme raw 地址
|
||||
* pluginType: 插件类型,枚举:ui, system. 当前选 ui <Badge type="tip" text="必填" />
|
||||
* features: 插件核心功能列表 <Badge type="tip" text="必填" />
|
||||
* features.code: 插件某个功能的识别码,可用于区分不同的功能 <Badge type="tip" text="必填" />
|
||||
* features.explain: 插件某个功能的解释 <Badge type="tip" text="必填" />
|
||||
* features.cmds: 输入框内搜索该 cmd 进入插件 <Badge type="tip" text="必填" />
|
||||
|
||||
#### index.html
|
||||
插件的入口文件,用于展示插件的样式,一个最基础的 `html` 结构可以是这样:
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
hello Rubick
|
||||
<button id="showNotification">通知</button>
|
||||
</body>
|
||||
<script>
|
||||
document.getElementById('showNotification').addEventListener('click', () => {
|
||||
window.showNotification();
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
```
|
||||
|
||||
#### preload.js
|
||||
细心的同学可能已经注意到上面的 `index.html` 使用了一个全局函数 `showNotification` 那么这个函数是在哪里定义的呢?
|
||||
答案就是在 `preload.js` 里面。`preload.js` 可以为页面提供全局函数
|
||||
```js
|
||||
window.showNotification = function () {
|
||||
rubick.showNotification('HI, rubick')
|
||||
}
|
||||
```
|
||||
rubick 更多支持 API 能力参考:[rubick 全局API](https://github.com/rubickCenter/rubick/blob/master/public/preload.js)
|
||||
|
||||
### 测试写好的插件
|
||||
由于 `rubick` 插件是基于 `npm` 的管理方式,所以开发者调试插件,也是基于 `npm` 的软连接的方式进行调试。
|
||||
首先需要再插件 `package.json` 目录下执行:
|
||||
```shell
|
||||
$ npm link
|
||||
```
|
||||
然后将插件通过插件市场的 `开发者` 菜单进行安装,填写插件的 `name` 即可,如果插件需要调试,可以通过右上角 ... 来打开开发者工具进行调试,页面变更直接刷新即可:
|
||||
|
||||

|
||||
|
||||
|
||||
本小节所有代码:[rubick-ui-plugin-demo](https://gitee.com/rubick-center/rubick-ui-plugin-demo)
|
||||
|
||||
## 开发系统插件
|
||||
|
||||
一个最基础插件的目录是这样的:
|
||||
```
|
||||
rubick-system-plugin-demo
|
||||
|-- package.json
|
||||
|-- index.js
|
||||
```
|
||||
### 文件说明
|
||||
#### package.json
|
||||
用于指定插件最基础的配置,一个最基础的配置信息如下:
|
||||
```json
|
||||
{
|
||||
"name": "rubick-system-plugin-demo",
|
||||
"pluginName": "rubick 系统插件demo",
|
||||
"version": "0.0.0",
|
||||
"description": "rubick 系统插件demo",
|
||||
"entry": "index.js",
|
||||
"logo": "https://xxxx/upload/202112/08/5bac90649c5343cabb63930b131cf8e6.png",
|
||||
"pluginType": "system",
|
||||
"author": "muwoo",
|
||||
"homepage": ""
|
||||
}
|
||||
```
|
||||
核心字段说明:
|
||||
|
||||
* name: 插件 `npm` 包名称,<Badge type="tip" text="必填" />
|
||||
* pluginName: 插件显示名称,用于展示给使用者 <Badge type="tip" text="必填" />
|
||||
* description: 插件描述,描述这个插件的作用 <Badge type="tip" text="必填" />
|
||||
* author: 插件作者
|
||||
* entry: 入口文件,一般为 `index.js`
|
||||
* logo: 尺寸建议 200 * 200, 插件的 logo, 需要是 http/https 在线地址,不支持本地logo <Badge type="tip" text="必填" />
|
||||
* version: 插件的版本 <Badge type="tip" text="必填" />
|
||||
* homePage: 插件 readme raw 地址
|
||||
* pluginType: 插件类型,枚举:ui, system. 当前选 system <Badge type="tip" text="必填" />
|
||||
|
||||
#### index.js
|
||||
插件的入口文件,用于 rubick 主进程进行加载执行:
|
||||
```js
|
||||
module.exports = () => {
|
||||
return {
|
||||
onReady(ctx) {
|
||||
const { Notification } = ctx;
|
||||
new Notification({
|
||||
title: "测试系统插件",
|
||||
body: "这是一个系统插件,在rubick运行时,立即被加载"
|
||||
}).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
`index.js` 需要返回一个包含 `onReady` 生命周期的函数,该函数接受 `ctx` 对象作为参数,我们可以通过 `ctx` 使用 `electron` 主进程所有能力。
|
||||
同时也为 `ctx` 上扩展挂在了 `mainWindow` 对象。
|
||||
|
||||
#### 调试插件
|
||||
由于 `rubick` 插件是基于 `npm` 的管理方式,所以开发者调试插件,也是基于 `npm` 的软连接的方式进行调试。
|
||||
首先需要再插件 `package.json` 目录下执行:
|
||||
```shell
|
||||
$ npm link
|
||||
```
|
||||
然后将插件通过插件市场的 `开发者` 菜单进行安装,填写插件的 `name` 即可。由于插件依赖于主进程启动执行,所以安装完成后需要重启 rubick 后才能生效。
|
||||
|
||||

|
||||
|
||||
::: danger
|
||||
系统插件目前无法直接通过 `devtools` 进行调试,后面会进行优化
|
||||
:::
|
||||
|
||||
## 发布插件
|
||||
|
||||
这里介绍完了如何开发插件,最后非常欢迎为 `rubick` 贡献开源插件,发布插件也非常简单,首先需要把自己的插件发布到 `npm` 仓库:
|
||||
|
||||
```shell
|
||||
$ npm publish
|
||||
```
|
||||
|
||||
然后再给 [rubick-database/plugins/total-plugins.json](https://gitcode.net/rubickcenter/rubick-database/-/blob/master/plugins/total-plugins.json) 仓库提个 `pull request`, 把你的 `package.json` 信息加入 `json` 文件内,等我们 merge 了您的提交,插件将会自动上架。
|
||||
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
## 赞助
|
||||
`rubick` 是非盈利项目,开源不容易,如果该项目对你有用的话,可以打赏我们喝杯 coffee ☕️.
|
||||
|
||||
<img width=200 src=https://pic1.zhimg.com/80/v2-688385687a37e962fe32daf136139feb_720w.png />
|
||||
<img width=200 src=https://pica.zhimg.com/80/v2-1ba296fd2cece45ee1094ee7c259035c_720w.png />
|
||||
|
||||
## 前言
|
||||
rubick 之前的插件管理,依托于云服务器存储,我们需要为服务器存储支付一笔不小的开销。
|
||||
由于项目完全开源,所以几乎无任何收入,所以为了让 rubick 先生存下去,我们再三抉择把插件包管理方式托管到了`npm` 上。
|
||||
|
||||
由于 rubick 的插件管理体系是基于 npm 的包管理体系,所以当您需要使用插件的时候,需要手动保证当前电脑已经安装好了`node`环境。
|
||||
如果当前电脑已经安装过 `node`,那么您可以直接下载 `rubick` 进行使用啦!
|
||||
|
||||
[macos 下安装 nodejs 方法](https://juejin.cn/post/6844903886541553672)
|
||||
|
||||
[windows 下安装 nodejs 方法](https://juejin.cn/post/6892790243687137287)
|
||||
|
||||
## 下载 rubick
|
||||
[rubick 下载安装地址](https://github.com/rubickCenter/rubick/releases)
|
||||
|
||||
macos 选择 `pkg` 文件,windows 选择 `exe` 文件,Debian/Ubuntu选择`deb`。
|
||||
安装完成后打开 rubick 即可看到主搜索界面:
|
||||
|
||||

|
||||
|
||||
## 功能说明
|
||||
接下来详细介绍 rubick 所包含和支持的功能
|
||||
|
||||
### 1. 搜索系统应用
|
||||
支持拼音和缩写来搜索系统安装应用:
|
||||
|
||||

|
||||
|
||||
### 2. UI类插件安装
|
||||
点击搜索框右侧 `rubick` 图标,进入插件市场,选择所需插件,点击下载按钮即可下载,下载完成后在已安装 tab 下可以找到安装插件。
|
||||
安装完成后,输入插件呼起命令即可使用对应插件:
|
||||
|
||||

|
||||
|
||||
### 3. 系统类插件安装
|
||||
系统插件安装方式和UI类一样,在插件市场选择`系统分类`,寻找适合自己的系统插件安装即可。
|
||||
::: danger
|
||||
系统插件安装成功后,需要重启 `rubick` 才能生效
|
||||
:::
|
||||
|
||||
### 4. 输入框聚焦自动根据剪切板内容匹配插件
|
||||
在 `rubick` 内搜索`偏好设置`,然后开启`自动粘贴` 功能,即可匹配剪切板内容自动匹配适合插件进行使用。
|
||||
|
||||

|
||||
|
||||
### 内网部署
|
||||
::: tip
|
||||
如果把插件发布到公网 `npm` 如果不符合您的公司安全要求,`rubick` 支持内网私有源和私有插件库,如果您需要内网部署使用,可以自行配置以下规则。
|
||||
:::
|
||||
`rubick` 依赖 `npm` 仓库做插件管理,依赖 `gitcode` 做插件数据存储,所以如果要进行内网部署,主要需要替换这2个设置。详细设置:
|
||||
`插件市场 -> 设置 -> 内网部署设置`
|
||||
|
||||

|
||||
|
||||
#### 1. 替换 npm 源
|
||||
插件发布到私有 `npm` 源即可。
|
||||
|
||||
#### 2. 替换 `gitcode` 源为内网 `gitlab`: database url
|
||||
|
||||
* clone 下载 rubick 插件库:[https://gitcode.net/rubickcenter/rubick-database](https://gitcode.net/rubickcenter/rubick-database)
|
||||
* 提交仓库到私有 `gitlab` 库。
|
||||
|
||||
替换格式:`https://gitlab.xxx.com/api/v4/projects/{projectId}/repository/files/` 。因为接口为 `gitlab openAPI`,所以需要填写仓库 `access_token`
|
||||
|
||||
|
||||
### 更多功能
|
||||
如果您还需要更多功能,欢迎来这里给我们提建议:[issues](https://github.com/rubickCenter/rubick/issues) 。
|
||||
有价值的想法我们会加入到后期的开发当中。同时也欢迎一起加入共建。
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 92 KiB |
@@ -1,103 +0,0 @@
|
||||
## 赞助
|
||||
`rubick` 是非盈利项目,开源不容易,如果该项目对你有用的话,可以打赏我们喝杯 coffee ☕️.
|
||||
|
||||
<img width=200 src=https://pic1.zhimg.com/80/v2-688385687a37e962fe32daf136139feb_720w.png />
|
||||
<img width=200 src=https://pica.zhimg.com/80/v2-1ba296fd2cece45ee1094ee7c259035c_720w.png />
|
||||
|
||||
## 贡献代码
|
||||
### rubick 目录介绍
|
||||
|
||||
```shell
|
||||
.
|
||||
├── docs # 文档存方目录
|
||||
│ ├── docs
|
||||
│ ├── package-lock.json
|
||||
│ ├── package.json
|
||||
│ └── pnpm-lock.yaml
|
||||
├── feature # 插件市场插件
|
||||
│ ├── README.md
|
||||
│ ├── babel.config.js
|
||||
│ ├── package-lock.json
|
||||
│ ├── package.json
|
||||
│ ├── public
|
||||
│ ├── src
|
||||
│ ├── tsconfig.json
|
||||
│ └── vue.config.js
|
||||
├── public # rubick __static 目录
|
||||
│ ├── favicon.ico
|
||||
│ ├── feature
|
||||
│ ├── icons
|
||||
│ ├── index.html
|
||||
│ ├── preload.js
|
||||
│ └── tpl
|
||||
├── src # rubick 核心源码
|
||||
│ ├── common # 一些通用的函数
|
||||
│ ├── core # 一些核心的能力,比如 app search
|
||||
│ ├── main # 主进程
|
||||
│ └── renderer # 渲染进程
|
||||
├── tpl # rubick 模板插件
|
||||
│ ├── README.md
|
||||
│ ├── babel.config.js
|
||||
│ ├── package-lock.json
|
||||
│ ├── package.json
|
||||
│ ├── public
|
||||
│ ├── src
|
||||
│ ├── tsconfig.json
|
||||
│ └── vue.config.js
|
||||
├── LICENSE # MIT 协议
|
||||
├── README.md # 英文文档
|
||||
├── README.zh-CN.md # 中文文档
|
||||
├── babel.config.js
|
||||
├── deploy-doc.sh # rubick doc 发布脚本
|
||||
├── tsconfig.json
|
||||
├── package-lock.json
|
||||
├── package.json
|
||||
└── vue.config.js
|
||||
```
|
||||
|
||||
### 启动
|
||||
#### 1. 安装依赖
|
||||
`rubick` 启动主要涉及到3个目录:
|
||||
1. 根目录:`rubick` 核心进程
|
||||
2. feature:`rubick` 内置的插件市场插件
|
||||
3. tpl: `rubick` 内置的模板插件
|
||||
```shell
|
||||
$ npm i
|
||||
$ cd feature && npm i
|
||||
$ cd tpl && npm i
|
||||
```
|
||||
|
||||
#### 2. 启动核心进程
|
||||
|
||||
```shell
|
||||
$ npm run electron:serve
|
||||
```
|
||||
|
||||
#### 3. 启动插件中心 <Badge type="warning" text="非必须" vertical="top" />
|
||||
|
||||
```shell
|
||||
$ cd feature && npm run serve
|
||||
```
|
||||
|
||||
#### 4. 启动模板插件 <Badge type="warning" text="非必须" vertical="top" />
|
||||
|
||||
```shell
|
||||
$ cd tpl && npm run serve
|
||||
```
|
||||
|
||||
### 编译
|
||||
```shell
|
||||
$ cd feature && npm run build
|
||||
$ cd tpl && npm run build
|
||||
$ npm run electron:build
|
||||
```
|
||||
|
||||
### PR
|
||||
|
||||
1. Create an issue about the features, such as new components.
|
||||
2. Fork the repo to your own account.
|
||||
3. Clone your fork.
|
||||
4. Create a new branch base on dev, if you want to add new component, the branch name should be formatted as component-[Component Name]. (e.g. component-steps) And the commit info should be formatted as [Component Name]: Info about commit.
|
||||
5. Make sure that running npm run prepublish outputs the correct files.
|
||||
6. Rebase before creating a PR to keep commit history clear. (Merge request to branch dev)
|
||||
7. Provide some description about your PR.
|
||||
@@ -1,19 +0,0 @@
|
||||
# 特殊服务
|
||||
## 说明
|
||||
`rubick` 一直坚持开源免费,现在不会变,以后也不会变。但是纯开源 `MIT` 模式下,是一种 0 收入用爱发电的,完全依靠
|
||||
作者自己的爱好和激情。但这种用爱发电的模式很难持续维持,为了更好的持续迭代和发展壮大 `rubick`, 我们需要一定的现金持续激励 `rubick` 的核心开发者们,让更多的人成为 `rubick`
|
||||
的核心开发者。所以 `rubick` 开启了一个新的模式尝试,那是服务付费:`rubick` 用户可以购买我们提供技术支持、答疑解惑、定制化插件开发、二次定制化开发 `rubick` 等等官方服务...
|
||||
|
||||
## 可以提供哪些服务?
|
||||
我们收集了大量用户的问题,目前约定可以支持到的服务有:
|
||||
1. 二次定制化开发 `rubick`
|
||||
2. 轻量级插件开发
|
||||
3. `rubick` 实现原理手把手介绍
|
||||
4. `rubick` 使用答疑
|
||||
5. `rubick` 内网部署一条龙服务
|
||||
6. 前端圈各种技术支持(作者分别是前蚂蚁集团和字节跳动的前端技术专家)
|
||||
7. 未来能提供的一切...
|
||||
|
||||
## 如何加入特殊服务?
|
||||
扫描下方的二维码,加入知识星球即可:
|
||||
<img width=400 src=https://picx.zhimg.com/80/v2-6deabf65175d18080439ef813102d18c_720w.png />
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"name": "rubick-docs",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"docs:dev": "vuepress dev docs",
|
||||
"docs:build": "vuepress build docs"
|
||||
},
|
||||
"author": "muwoo",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"vuepress": "^1.8.2"
|
||||
}
|
||||
}
|
||||
8688
docs/yarn.lock
8688
docs/yarn.lock
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,7 @@
|
||||
"code": "installed",
|
||||
"explain": "已安装插件",
|
||||
"cmds":[
|
||||
"已安装插件"
|
||||
"已安装插件", "installed"
|
||||
]
|
||||
},{
|
||||
"code": "settings",
|
||||
|
||||
@@ -108,6 +108,7 @@ const changeMenu = (key: any) => {
|
||||
};
|
||||
|
||||
window.rubick.onPluginEnter(({ code }: { code: string }) => {
|
||||
code = code === '已安装插件' ? 'installed' : code;
|
||||
changeMenu(code);
|
||||
store.commit('commonUpdate', {active: [code]})
|
||||
});
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
@import "~ant-design-vue/dist/antd.less"; // 引入官方提供的 less 样式入口文件
|
||||
|
||||
@primary-color: #ff4ea4; // 全局主色
|
||||
@error-color: #ff4ea4; // 错误色
|
||||
|
||||
:root {
|
||||
--color-text-primary: rgba(0, 0, 0, 0.85);
|
||||
--color-text-content: #141414;
|
||||
@@ -15,6 +10,8 @@
|
||||
--color-input-hover: #fff;
|
||||
// 边框
|
||||
--color-border-light: #f0f0f0;
|
||||
// 输入框附带icon
|
||||
--color-action-color: rgba(0, 0, 0, 0.25);;
|
||||
}
|
||||
|
||||
.dark {
|
||||
@@ -29,4 +26,6 @@
|
||||
--color-input-hover: #444d;
|
||||
// 边框
|
||||
--color-border-light: #444d;
|
||||
// 输入框附带icon
|
||||
--color-action-color: #ffffff4d;
|
||||
}
|
||||
|
||||
BIN
feature/src/assets/delete.png
Normal file
BIN
feature/src/assets/delete.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 845 B |
@@ -33,6 +33,12 @@ import localConfig from './confOp';
|
||||
|
||||
const config: any = localConfig.getConfig();
|
||||
|
||||
// 暗夜模式
|
||||
if (config.perf.common.darkMode) {
|
||||
document.body.classList.add('dark');
|
||||
window.rubick.theme = 'dark';
|
||||
}
|
||||
|
||||
ConfigProvider.config({
|
||||
theme: config.perf.custom || {},
|
||||
});
|
||||
|
||||
@@ -103,7 +103,7 @@ const wrapperCol = { span: 14 };
|
||||
color: var(--color-text-content);
|
||||
}
|
||||
:deep(.ant-input) {
|
||||
background: var(--color-input-hover);
|
||||
background: var(--color-input-hover) !important;
|
||||
color: var(--color-text-content);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,8 @@ const addCmdToSuperPanel = ({ cmd, code }) => {
|
||||
},
|
||||
};
|
||||
superPanelPlugins.value.data.push(plugin);
|
||||
window.rubick.db.put(toRaw(superPanelPlugins.value));
|
||||
const { rev } = window.rubick.db.put(JSON.parse(JSON.stringify(superPanelPlugins.value)));
|
||||
superPanelPlugins.value._rev = rev;
|
||||
};
|
||||
|
||||
const removePluginToSuperPanel = ({ cmd, name }) => {
|
||||
@@ -195,7 +196,8 @@ const removePluginToSuperPanel = ({ cmd, name }) => {
|
||||
return item.cmd !== cmd;
|
||||
}
|
||||
);
|
||||
window.rubick.db.put(toRaw(superPanelPlugins.value));
|
||||
const { rev } = window.rubick.db.put(toRaw(superPanelPlugins.value));
|
||||
superPanelPlugins.value._rev = rev;
|
||||
};
|
||||
|
||||
const hasAdded = (cmd) => {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<ExportOutlined />
|
||||
</template>
|
||||
</a-button>
|
||||
<a-button @click="importData" danger size="small" style="margin-right: 10px;">
|
||||
<a-button @click="importData" danger size="small" style="margin-right: 10px; background-color: var(--color-input-hover)">
|
||||
导入数据
|
||||
<template #icon>
|
||||
<ImportOutlined />
|
||||
@@ -33,15 +33,20 @@
|
||||
<DatabaseOutlined style="font-size: 18px;"/>
|
||||
</a>
|
||||
</template>
|
||||
<a-list-item-meta :description="`${item.keys.length} 份文档`">
|
||||
<a-list-item-meta>
|
||||
<template #title>
|
||||
<div>
|
||||
<div style="color: var(--color-text-content)">
|
||||
<span>{{ item.plugin?.pluginName }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #avatar>
|
||||
<a-avatar shape="square" :src="item.plugin?.logo"/>
|
||||
</template>
|
||||
<template #description>
|
||||
<div style="color: var(--color-text-desc)">
|
||||
<span>{{ item.keys.length }} 份文档</span>
|
||||
</div>
|
||||
</template>
|
||||
</a-list-item-meta>
|
||||
</a-list-item>
|
||||
</template>
|
||||
@@ -52,6 +57,7 @@
|
||||
:closable="false"
|
||||
:title="currentSelect.plugin.pluginName"
|
||||
placement="right"
|
||||
class="exportDrawer"
|
||||
>
|
||||
<p
|
||||
class="key-item"
|
||||
@@ -64,7 +70,12 @@
|
||||
</a-drawer>
|
||||
<a-modal
|
||||
centered
|
||||
bodyStyle="max-height: 500px; overflow: auto"
|
||||
:bodyStyle="{
|
||||
maxHeight: '500px',
|
||||
overflow: 'auto',
|
||||
backgroundColor: 'var(--color-body-bg)',
|
||||
color: 'var(--color-text-primary)'
|
||||
}"
|
||||
:footer="null"
|
||||
:closable="false"
|
||||
v-model:visible="show"
|
||||
@@ -75,6 +86,7 @@
|
||||
v-model:visible="showSetting"
|
||||
title="webdav 账户配置"
|
||||
:footer="null"
|
||||
class="webdavModel"
|
||||
>
|
||||
<a-alert v-if="formState.suport === 'jianguo'" style="margin-bottom: 20px;" type="info" show-icon>
|
||||
<template #message>
|
||||
@@ -255,7 +267,7 @@ const downloadPlugin = async (plugin) => {
|
||||
.export-header {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
border-bottom: 1px solid #eee;
|
||||
border-bottom: 1px solid var(--color-border-light);
|
||||
text-align: right;
|
||||
}
|
||||
.key-item {
|
||||
@@ -265,4 +277,44 @@ const downloadPlugin = async (plugin) => {
|
||||
color: var(--ant-primary-color);
|
||||
}
|
||||
}
|
||||
.exportDrawer{
|
||||
.ant-drawer-header{
|
||||
background-color: var(--color-body-bg);
|
||||
border-bottom: 1px solid var(--color-border-light);
|
||||
.ant-drawer-title{
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
}
|
||||
.ant-drawer-body{
|
||||
background-color: var(--color-body-bg);
|
||||
color: var(--color-text-content)
|
||||
}
|
||||
}
|
||||
.webdavModel{
|
||||
.ant-modal-close-x{
|
||||
color: var(--color-text-content);
|
||||
}
|
||||
.ant-modal-header{
|
||||
background-color: var(--color-body-bg);
|
||||
border-bottom: 1px solid var(--color-border-light);
|
||||
.ant-modal-title{
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
}
|
||||
.ant-form-item-label>label {
|
||||
color: var(--color-text-content);
|
||||
}
|
||||
.ant-modal-body {
|
||||
background-color: var(--color-body-bg);
|
||||
.ant-input,
|
||||
.ant-input-password,
|
||||
.ant-select-selector {
|
||||
background: var(--color-input-hover) !important;
|
||||
color: var(--color-text-content);
|
||||
}
|
||||
.ant-input-password-icon, .ant-select-arrow {
|
||||
color: var(--color-action-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -512,6 +512,13 @@ const changeLanguage = (value) => {
|
||||
background: var(--color-list-hover);
|
||||
}
|
||||
}
|
||||
.ant-select-selector {
|
||||
background: var(--color-input-hover) !important;
|
||||
color: var(--color-text-content);
|
||||
}
|
||||
.ant-input-password-icon, .ant-select-arrow {
|
||||
color: var(--color-action-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rubick",
|
||||
"version": "4.0.5",
|
||||
"version": "4.1.6",
|
||||
"author": "muwoo <2424880409@qq.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@@ -30,9 +30,10 @@
|
||||
"fix-path": "^3.0.0",
|
||||
"get-mac-apps": "^1.0.2",
|
||||
"got": "^11.8.3",
|
||||
"lodash.throttle": "^4.1.1",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"memorystream": "^0.3.1",
|
||||
"node-key-sender": "^1.0.11",
|
||||
"npm": "6.14.7",
|
||||
"pinyin-match": "^1.2.4",
|
||||
"pouchdb": "^7.2.2",
|
||||
"pouchdb-load": "^1.4.6",
|
||||
|
||||
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>detach</title><link href="css/app.65d55ce4.css" rel="preload" as="style"><link href="js/app.bc494a66.js" rel="preload" as="script"><link href="js/chunk-vendors.b36194a6.js" rel="preload" as="script"><link href="css/app.65d55ce4.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but detach doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.b36194a6.js"></script><script src="js/app.bc494a66.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title></title><link href="css/app.65d55ce4.css" rel="preload" as="style"><link href="js/app.f4fdc34a.js" rel="preload" as="script"><link href="js/chunk-vendors.b36194a6.js" rel="preload" as="script"><link href="css/app.65d55ce4.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but detach doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.b36194a6.js"></script><script src="js/app.f4fdc34a.js"></script></body></html>
|
||||
@@ -1 +0,0 @@
|
||||
(function(e){function t(t){for(var c,o,l=t[0],a=t[1],i=t[2],d=0,p=[];d<l.length;d++)o=l[d],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&p.push(r[o][0]),r[o]=0;for(c in a)Object.prototype.hasOwnProperty.call(a,c)&&(e[c]=a[c]);s&&s(t);while(p.length)p.shift()();return u.push.apply(u,i||[]),n()}function n(){for(var e,t=0;t<u.length;t++){for(var n=u[t],c=!0,l=1;l<n.length;l++){var a=n[l];0!==r[a]&&(c=!1)}c&&(u.splice(t--,1),e=o(o.s=n[0]))}return e}var c={},r={app:0},u=[];function o(t){if(c[t])return c[t].exports;var n=c[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=c,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)o.d(n,c,function(t){return e[t]}.bind(null,c));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var l=window["webpackJsonp"]=window["webpackJsonp"]||[],a=l.push.bind(l);l.push=t,l=l.slice();for(var i=0;i<l.length;i++)t(l[i]);var s=a;u.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("cd49")},4011:function(e,t,n){},c549:function(e,t,n){},cd49:function(e,t,n){"use strict";n.r(t);var c=n("79c4"),r=n("c965"),u=n.n(r);const o={class:"info"},l=["src"],a=["value","placeholder"],i={key:1},s={class:"handle-container"},d={key:0,class:"window-handle"};var p={__name:"App",setup(e){const{ipcRenderer:t}=window.require("electron"),n=window.require("process"),r=Object(c["g"])(!1),p=localStorage.getItem("rubick-system-detach")||"{}",b=Object(c["g"])({});window.initDetach=e=>{b.value=e,r.value=e.subInput&&(!!e.subInput.value||!!e.subInput.placeholder),localStorage.setItem("rubick-system-detach",JSON.stringify(e))};try{window.initDetach(JSON.parse(p))}catch(g){}const v=u()(e=>{t.send("msg-trigger",{type:"detachInputChange",data:{text:e.target.value}})},500),f=()=>{t.send("msg-trigger",{type:"openPluginDevTools"})},O=()=>{t.send("detach:service",{type:"minimize"})},h=()=>{t.send("detach:service",{type:"maximize"})},j=()=>{t.send("detach:service",{type:"close"})};return Object.assign(window,{setSubInputValue:({value:e})=>{b.value.subInput.value=e},setSubInput:e=>{b.value.subInput.placeholder=e},removeSubInput:()=>{b.value.subInput=null}}),(e,t)=>{var u,p;return Object(c["f"])(),Object(c["c"])("div",{class:Object(c["e"])([Object(c["i"])(n).platform,"detach"])},[Object(c["d"])("div",o,[Object(c["d"])("img",{src:b.value.logo},null,8,l),r.value?(Object(c["f"])(),Object(c["c"])("input",{key:0,autofocus:"",onInput:t[0]||(t[0]=(...e)=>Object(c["i"])(v)&&Object(c["i"])(v)(...e)),value:null===(u=b.value.subInput)||void 0===u?void 0:u.value,placeholder:null===(p=b.value.subInput)||void 0===p?void 0:p.placeholder},null,40,a)):(Object(c["f"])(),Object(c["c"])("span",i,Object(c["h"])(b.value.pluginName),1))]),Object(c["d"])("div",s,[Object(c["d"])("div",{class:"handle"},[Object(c["d"])("div",{class:"devtool",onClick:f,title:"开发者工具"})]),"darwin"!==Object(c["i"])(n).platform?(Object(c["f"])(),Object(c["c"])("div",d,[Object(c["d"])("div",{class:"minimize",onClick:O}),Object(c["d"])("div",{class:"maximize",onClick:h}),Object(c["d"])("div",{class:"close",onClick:j})])):Object(c["b"])("",!0)])],2)}}};n("f8d8");const b=p;var v=b;n("4011");Object(c["a"])(v).mount("#app")},f8d8:function(e,t,n){"use strict";n("c549")}});
|
||||
1
public/detach/js/app.f4fdc34a.js
Normal file
1
public/detach/js/app.f4fdc34a.js
Normal file
@@ -0,0 +1 @@
|
||||
(function(e){function t(t){for(var c,o,a=t[0],l=t[1],u=t[2],d=0,p=[];d<a.length;d++)o=a[d],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&p.push(r[o][0]),r[o]=0;for(c in l)Object.prototype.hasOwnProperty.call(l,c)&&(e[c]=l[c]);s&&s(t);while(p.length)p.shift()();return i.push.apply(i,u||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],c=!0,a=1;a<n.length;a++){var l=n[a];0!==r[l]&&(c=!1)}c&&(i.splice(t--,1),e=o(o.s=n[0]))}return e}var c={},r={app:0},i=[];function o(t){if(c[t])return c[t].exports;var n=c[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=c,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)o.d(n,c,function(t){return e[t]}.bind(null,c));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="";var a=window["webpackJsonp"]=window["webpackJsonp"]||[],l=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var s=l;i.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("cd49")},3480:function(e,t,n){"use strict";n("a1ff")},4011:function(e,t,n){},a1ff:function(e,t,n){},cd49:function(e,t,n){"use strict";n.r(t);var c=n("79c4"),r=n("c965"),i=n.n(r);const o={class:"info"},a=["src"],l=["value","placeholder"],u={key:1},s={class:"handle-container"},d={key:0,class:"window-handle"};var p={__name:"App",setup(e){const{ipcRenderer:t}=window.require("electron"),n=window.require("process"),r=Object(c["g"])(!1),p=localStorage.getItem("rubick-system-detach")||"{}",v=Object(c["g"])({});window.initDetach=e=>{v.value=e,r.value=e.subInput&&(!!e.subInput.value||!!e.subInput.placeholder),localStorage.setItem("rubick-system-detach",JSON.stringify(e))};try{window.initDetach(JSON.parse(p))}catch(y){}const b=i()(e=>{t.send("msg-trigger",{type:"detachInputChange",data:{text:e.target.value}})},500),f=()=>{t.send("msg-trigger",{type:"openPluginDevTools"})},m=()=>{t.send("detach:service",{type:"minimize"})},w=()=>{t.send("detach:service",{type:"maximize"})},h=()=>{t.send("detach:service",{type:"close"})};return Object.assign(window,{setSubInputValue:({value:e})=>{v.value.subInput.value=e},setSubInput:e=>{v.value.subInput.placeholder=e},removeSubInput:()=>{v.value.subInput=null}}),window.enterFullScreenTrigger=()=>{document.querySelector(".detach").classList.remove("darwin")},window.leaveFullScreenTrigger=()=>{const e=document.querySelector(".detach");e.classList.contains("darwin")||e.classList.add("darwin")},window.maximizeTrigger=()=>{const e=document.querySelector(".maximize");e&&!e.classList.contains("unmaximize")&&e.classList.add("unmaximize")},window.unmaximizeTrigger=()=>{const e=document.querySelector(".maximize");e&&e.classList.remove("unmaximize")},"darwin"===n.platform?window.onkeydown=e=>{"Escape"!==e.code?!e.metaKey||"KeyW"!==e.code&&"KeyQ"!==e.code||window.handle.close():t.send("detach:service",{type:"endFullScreen"})}:window.onkeydown=e=>{e.ctrlKey&&"KeyW"===e.code&&window.handle.close()},(e,t)=>{var i,p;return Object(c["f"])(),Object(c["c"])("div",{class:Object(c["e"])([Object(c["i"])(n).platform,"detach"])},[Object(c["d"])("div",o,[Object(c["d"])("img",{src:v.value.logo},null,8,a),r.value?(Object(c["f"])(),Object(c["c"])("input",{key:0,autofocus:"",onInput:t[0]||(t[0]=(...e)=>Object(c["i"])(b)&&Object(c["i"])(b)(...e)),value:null===(i=v.value.subInput)||void 0===i?void 0:i.value,placeholder:null===(p=v.value.subInput)||void 0===p?void 0:p.placeholder},null,40,l)):(Object(c["f"])(),Object(c["c"])("span",u,Object(c["h"])(v.value.pluginName),1))]),Object(c["d"])("div",s,[Object(c["d"])("div",{class:"handle"},[Object(c["d"])("div",{class:"devtool",onClick:f,title:"开发者工具"})]),"darwin"!==Object(c["i"])(n).platform?(Object(c["f"])(),Object(c["c"])("div",d,[Object(c["d"])("div",{class:"minimize",onClick:m}),Object(c["d"])("div",{class:"maximize",onClick:w}),Object(c["d"])("div",{class:"close",onClick:h})])):Object(c["b"])("",!0)])],2)}}};n("3480");const v=p;var b=v;n("4011");Object(c["a"])(b).mount("#app")}});
|
||||
File diff suppressed because one or more lines are too long
1
public/feature/css/app.bb291762.css
Normal file
1
public/feature/css/app.bb291762.css
Normal file
@@ -0,0 +1 @@
|
||||
.ant-menu-submenu-popup .ant-menu{background:var(--color-body-bg2)!important;height:100%;border-right:none}.ant-menu-submenu-popup .ant-menu .ant-menu-item,.ant-menu-submenu-popup .ant-menu .ant-menu-submenu,.ant-menu-submenu-popup .ant-menu .ant-menu-submenu-arrow{color:var(--color-text-content)}.ant-menu-submenu-popup .ant-menu .ant-menu-item:active,.ant-menu-submenu-popup .ant-menu .ant-menu-submenu-arrow:active,.ant-menu-submenu-popup .ant-menu .ant-menu-submenu:active{background:none}.ant-menu-submenu-popup .ant-menu .ant-menu-item-selected,.ant-menu-submenu-popup .ant-menu .ant-menu-submenu-selected{background-color:var(--color-list-hover);color:var(--ant-primary-color)}.ant-menu-submenu-popup .ant-menu .ant-menu-item-selected .ant-menu-submenu-arrow,.ant-menu-submenu-popup .ant-menu .ant-menu-submenu-selected .ant-menu-submenu-arrow{color:var(--ant-primary-color)}.ant-menu-submenu-popup .ant-menu .ant-menu-item-selected:after,.ant-menu-submenu-popup .ant-menu .ant-menu-submenu-selected:after{display:none}.left-menu[data-v-435a1273]{width:183px;border-right:1px solid var(--color-border-light)}.left-menu .search-container[data-v-435a1273]{padding:10px}.left-menu .ant-input-affix-wrapper[data-v-435a1273]{border:none;background:var(--color-input-hover)}.left-menu .ant-input-affix-wrapper[data-v-435a1273] input{background:none;color:var(--color-text-desc)}.left-menu .ant-input-affix-wrapper[data-v-435a1273] .anticon{color:var(--color-text-desc)}.left-menu[data-v-435a1273] .ant-menu{background:var(--color-menu-bg);height:100%;border-right:none}.left-menu[data-v-435a1273] .ant-menu .ant-menu-item,.left-menu[data-v-435a1273] .ant-menu .ant-menu-submenu,.left-menu[data-v-435a1273] .ant-menu .ant-menu-submenu-arrow{color:var(--color-text-content)}.left-menu[data-v-435a1273] .ant-menu .ant-menu-item:active,.left-menu[data-v-435a1273] .ant-menu .ant-menu-submenu-arrow:active,.left-menu[data-v-435a1273] .ant-menu .ant-menu-submenu:active{background:none}.left-menu[data-v-435a1273] .ant-menu .ant-menu-item-selected,.left-menu[data-v-435a1273] .ant-menu .ant-menu-submenu-selected{background-color:var(--color-list-hover);color:var(--ant-primary-color)}.left-menu[data-v-435a1273] .ant-menu .ant-menu-item-selected .ant-menu-submenu-arrow,.left-menu[data-v-435a1273] .ant-menu .ant-menu-submenu-selected .ant-menu-submenu-arrow{color:var(--ant-primary-color)}.left-menu[data-v-435a1273] .ant-menu .ant-menu-item-selected:after,.left-menu[data-v-435a1273] .ant-menu .ant-menu-submenu-selected:after{display:none}[data-v-435a1273]{margin:0;padding:0}.main-container[data-v-435a1273]{-webkit-app-region:no-drag;display:flex;background:var(--color-body-bg);border-top:1px solid var(--color-border-light);height:100vh;box-sizing:border-box;align-items:flex-start;width:100%;overflow:hidden;background:var(--color-menu-bg)}.main-container .search[data-v-435a1273] .ant-btn,.main-container .search[data-v-435a1273] .ant-input,.main-container .search[data-v-435a1273] .ant-input-group-addon{color:var(--ant-primary-color)!important;background:var(--color-input-hover);border-color:var(--color-border-light)}.main-container .container[data-v-435a1273],.main-container .more[data-v-435a1273]{background:var(--color-body-bg);width:calc(100% - 183px);height:100%;box-sizing:border-box;padding:16px;position:relative;overflow:auto}.main-container .more[data-v-435a1273]{background:var(--color-body-bg2)}.main-container .left-menu[data-v-435a1273]{padding:24px 16px;position:relative;height:100vh}.main-container .left-menu[data-v-435a1273] .ant-menu-item{padding-left:12px!important;display:flex;align-items:center}.main-container .left-menu[data-v-435a1273] .ant-menu-item-selected,.main-container .left-menu[data-v-435a1273] .ant-menu-submenu-selected{background-color:var(--color-list-hover);border-radius:6px;color:var(--ant-primary-color)}.main-container .left-menu[data-v-435a1273] .user-info{position:absolute;bottom:32px}.main-container .left-menu[data-v-435a1273] .ant-avatar{background:transparent}:root{--color-text-primary:rgba(0,0,0,0.85);--color-text-content:#141414;--color-text-desc:rgba(0,0,0,0.45);--color-body-bg2:#eee;--color-body-bg:#fff;--color-menu-bg:#f8f8f8;--color-list-hover:#e9e9e9;--color-input-hover:#fff;--color-border-light:#f0f0f0;--color-action-color:rgba(0,0,0,0.25)}.dark{--color-text-primary:#e8e8f0;--color-text-content:#ccccd8;--color-text-desc:#8f8fa6;--color-body-bg:#1c1c28;--color-body-bg2:#2c2f3b;--color-menu-bg:#1c1c28;--color-list-hover:#2c2f3b;--color-input-hover:rgba(68,68,68,0.8666666666666667);--color-border-light:rgba(68,68,68,0.8666666666666667);--color-action-color:hsla(0,0%,100%,0.30196078431372547)}
|
||||
1
public/feature/css/chunk-197bc330.29812a6a.css
Normal file
1
public/feature/css/chunk-197bc330.29812a6a.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
.ant-message{box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.ant-message-notice{padding:8px;text-align:center}.ant-message-notice-content{display:inline-block;padding:10px 16px;background:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);pointer-events:all}.ant-message-success .anticon{color:#52c41a}.ant-message-error .anticon{color:#ff4d4f}.ant-message-warning .anticon{color:#faad14}.ant-message-info .anticon,.ant-message-loading .anticon{color:#1890ff}.ant-message .anticon{position:relative;top:1px;margin-right:8px;font-size:16px}.ant-message-notice.ant-move-up-leave.ant-move-up-leave-active{-webkit-animation-name:MessageMoveOut;animation-name:MessageMoveOut;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}@keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}.ant-message-rtl,.ant-message-rtl span{direction:rtl}.ant-message-rtl .anticon{margin-right:0;margin-left:8px}.dev[data-v-6fb0031c]{box-sizing:border-box;width:100%;overflow-x:hidden;height:calc(100vh - 34px)}.dev .view-title[data-v-6fb0031c]{font-size:16px;font-weight:500;margin-bottom:16px;color:var(--color-text-primary)}.dev .view-container[data-v-6fb0031c]{padding:10px;box-sizing:border-box;border-radius:8px;background:var(--color-body-bg);overflow:auto;height:calc(100vh - 84px)}.dev[data-v-6fb0031c] label{color:var(--color-text-content)}.dev[data-v-6fb0031c] .ant-input{background:var(--color-input-hover);color:var(--color-text-content)}
|
||||
.ant-message{box-sizing:border-box;margin:0;padding:0;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.ant-message-notice{padding:8px;text-align:center}.ant-message-notice-content{display:inline-block;padding:10px 16px;background:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);pointer-events:all}.ant-message-success .anticon{color:#52c41a}.ant-message-error .anticon{color:#ff4d4f}.ant-message-warning .anticon{color:#faad14}.ant-message-info .anticon,.ant-message-loading .anticon{color:#1890ff}.ant-message .anticon{position:relative;top:1px;margin-right:8px;font-size:16px}.ant-message-notice.ant-move-up-leave.ant-move-up-leave-active{-webkit-animation-name:MessageMoveOut;animation-name:MessageMoveOut;-webkit-animation-duration:.3s;animation-duration:.3s}@-webkit-keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}@keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}.ant-message-rtl,.ant-message-rtl span{direction:rtl}.ant-message-rtl .anticon{margin-right:0;margin-left:8px}.dev[data-v-2d26bea2]{box-sizing:border-box;width:100%;overflow-x:hidden;height:calc(100vh - 34px)}.dev .view-title[data-v-2d26bea2]{font-size:16px;font-weight:500;margin-bottom:16px;color:var(--color-text-primary)}.dev .view-container[data-v-2d26bea2]{padding:10px;box-sizing:border-box;border-radius:8px;background:var(--color-body-bg);overflow:auto;height:calc(100vh - 84px)}.dev[data-v-2d26bea2] label{color:var(--color-text-content)}.dev[data-v-2d26bea2] .ant-input{background:var(--color-input-hover)!important;color:var(--color-text-content)}
|
||||
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>feature</title><link href="css/chunk-0add5e88.2f22e37d.css" rel="prefetch"><link href="css/chunk-111de227.2450c00b.css" rel="prefetch"><link href="css/chunk-1af68a6e.2450c00b.css" rel="prefetch"><link href="css/chunk-1e4a75e5.ba6f3d8b.css" rel="prefetch"><link href="css/chunk-3fb623ce.2b9b7de2.css" rel="prefetch"><link href="css/chunk-596c6184.9be2495c.css" rel="prefetch"><link href="css/chunk-5cf3b9db.e273616c.css" rel="prefetch"><link href="css/chunk-88e69aa8.69c3b24d.css" rel="prefetch"><link href="css/chunk-93f94cf8.0f63dd4a.css" rel="prefetch"><link href="css/chunk-a2b32e48.67429700.css" rel="prefetch"><link href="css/chunk-cf61e458.9be2495c.css" rel="prefetch"><link href="css/chunk-f69c766e.9be2495c.css" rel="prefetch"><link href="js/chunk-0add5e88.26781f59.js" rel="prefetch"><link href="js/chunk-111de227.86b2c5e3.js" rel="prefetch"><link href="js/chunk-1af68a6e.2022b1a8.js" rel="prefetch"><link href="js/chunk-1e4a75e5.e9c5b1d4.js" rel="prefetch"><link href="js/chunk-2d0c49e7.20196ed0.js" rel="prefetch"><link href="js/chunk-3fb623ce.ee432c33.js" rel="prefetch"><link href="js/chunk-596c6184.a1398c77.js" rel="prefetch"><link href="js/chunk-5cf3b9db.d5ee71ed.js" rel="prefetch"><link href="js/chunk-88e69aa8.55955c4d.js" rel="prefetch"><link href="js/chunk-93f94cf8.7dd5e910.js" rel="prefetch"><link href="js/chunk-a2b32e48.20d42be1.js" rel="prefetch"><link href="js/chunk-cf61e458.20835e3d.js" rel="prefetch"><link href="js/chunk-f69c766e.230d2fbd.js" rel="prefetch"><link href="css/app.4abdfe3a.css" rel="preload" as="style"><link href="css/chunk-vendors.a52bdfa2.css" rel="preload" as="style"><link href="js/app.313735e9.js" rel="preload" as="script"><link href="js/chunk-vendors.c7dcd677.js" rel="preload" as="script"><link href="css/chunk-vendors.a52bdfa2.css" rel="stylesheet"><link href="css/app.4abdfe3a.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but feature doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.c7dcd677.js"></script><script src="js/app.313735e9.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>feature</title><link href="css/chunk-0add5e88.2f22e37d.css" rel="prefetch"><link href="css/chunk-111de227.2450c00b.css" rel="prefetch"><link href="css/chunk-197bc330.29812a6a.css" rel="prefetch"><link href="css/chunk-1af68a6e.2450c00b.css" rel="prefetch"><link href="css/chunk-3fb623ce.2b9b7de2.css" rel="prefetch"><link href="css/chunk-46496dac.da060b5a.css" rel="prefetch"><link href="css/chunk-596c6184.9be2495c.css" rel="prefetch"><link href="css/chunk-88e69aa8.69c3b24d.css" rel="prefetch"><link href="css/chunk-93f94cf8.0f63dd4a.css" rel="prefetch"><link href="css/chunk-a2b32e48.67429700.css" rel="prefetch"><link href="css/chunk-cf61e458.9be2495c.css" rel="prefetch"><link href="css/chunk-f69c766e.9be2495c.css" rel="prefetch"><link href="js/chunk-0add5e88.26781f59.js" rel="prefetch"><link href="js/chunk-111de227.86b2c5e3.js" rel="prefetch"><link href="js/chunk-197bc330.95c96fee.js" rel="prefetch"><link href="js/chunk-1af68a6e.2022b1a8.js" rel="prefetch"><link href="js/chunk-2d0c49e7.20196ed0.js" rel="prefetch"><link href="js/chunk-3fb623ce.ee432c33.js" rel="prefetch"><link href="js/chunk-46496dac.719cab20.js" rel="prefetch"><link href="js/chunk-596c6184.a1398c77.js" rel="prefetch"><link href="js/chunk-88e69aa8.55955c4d.js" rel="prefetch"><link href="js/chunk-93f94cf8.7dd5e910.js" rel="prefetch"><link href="js/chunk-a2b32e48.20d42be1.js" rel="prefetch"><link href="js/chunk-cf61e458.20835e3d.js" rel="prefetch"><link href="js/chunk-f69c766e.230d2fbd.js" rel="prefetch"><link href="css/app.bb291762.css" rel="preload" as="style"><link href="css/chunk-vendors.a52bdfa2.css" rel="preload" as="style"><link href="js/app.55a0112a.js" rel="preload" as="script"><link href="js/chunk-vendors.c7dcd677.js" rel="preload" as="script"><link href="css/chunk-vendors.a52bdfa2.css" rel="stylesheet"><link href="css/app.bb291762.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but feature doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.c7dcd677.js"></script><script src="js/app.55a0112a.js"></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
1
public/feature/js/chunk-197bc330.95c96fee.js
Normal file
1
public/feature/js/chunk-197bc330.95c96fee.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
public/feature/js/chunk-46496dac.719cab20.js
Normal file
1
public/feature/js/chunk-46496dac.719cab20.js
Normal file
@@ -0,0 +1 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-46496dac"],{"2b1c":function(e,t,n){"use strict";n("dc36")},"44e73":function(e,t,n){"use strict";n.r(t);var a=n("c7eb"),c=(n("c346"),n("e63d")),r=n.n(c),o=n("1da1"),u=(n("b0c0"),n("7a23")),i=n("47e2"),l={class:"dev"},s={class:"view-title"},d={class:"view-container"},f={__name:"index",setup:function(e){var t=Object(i["b"])(),n=t.t,c=Object(u["ref"])(),f=Object(u["reactive"])({name:void 0}),b={name:{required:!0,message:"Please input name"}},m=function(){c.value.validate().then((function(){v(f.name)}))},p=Object(u["ref"])(!1),v=function(){var e=Object(o["a"])(Object(a["a"])().mark((function e(t){return Object(a["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return p.value=!0,e.next=3,window.market.downloadPlugin({name:t,isDev:!0});case 3:r.a.success(n("feature.dev.installSuccess",{pluginName:t})),p.value=!1;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),j=function(){c.value.validate().then((function(){window.market.refreshPlugin({name:f.name}),r.a.success(n("feature.dev.refreshSuccess",{pluginName:f.name}))}))},O={span:4},w={span:14};return function(e,t){var n=Object(u["resolveComponent"])("a-alert"),a=Object(u["resolveComponent"])("a-input"),r=Object(u["resolveComponent"])("a-form-item"),o=Object(u["resolveComponent"])("a-button"),i=Object(u["resolveComponent"])("a-form");return Object(u["openBlock"])(),Object(u["createElementBlock"])("div",l,[Object(u["createElementVNode"])("div",s,Object(u["toDisplayString"])(e.$t("feature.dev.title")),1),Object(u["createElementVNode"])("div",d,[Object(u["createVNode"])(n,{style:{"margin-bottom":"40px"},message:e.$t("feature.dev.tips"),type:"warning"},null,8,["message"]),Object(u["createVNode"])(i,{ref_key:"formRef",ref:c,model:f,rules:b,"label-col":O,"wrapper-col":w},{default:Object(u["withCtx"])((function(){return[Object(u["createVNode"])(r,{label:e.$t("feature.dev.pluginName"),name:"name"},{default:Object(u["withCtx"])((function(){return[Object(u["createVNode"])(a,{value:f.name,"onUpdate:value":t[0]||(t[0]=function(e){return f.name=e})},null,8,["value"])]})),_:1},8,["label"]),Object(u["createVNode"])(r,{"wrapper-col":{span:14,offset:4}},{default:Object(u["withCtx"])((function(){return[Object(u["createVNode"])(o,{loading:p.value,type:"primary",onClick:m},{default:Object(u["withCtx"])((function(){return[Object(u["createTextVNode"])(Object(u["toDisplayString"])(e.$t("feature.dev.install")),1)]})),_:1},8,["loading"]),Object(u["createVNode"])(o,{onClick:j,style:{"margin-left":"10px"}},{default:Object(u["withCtx"])((function(){return[Object(u["createTextVNode"])(Object(u["toDisplayString"])(e.$t("feature.dev.refreshPlugins")),1)]})),_:1})]})),_:1})]})),_:1},8,["model"])])])}}},b=(n("2b1c"),n("6b0d")),m=n.n(b);const p=m()(f,[["__scopeId","data-v-2d26bea2"]]);t["default"]=p},a479:function(e,t,n){},c346:function(e,t,n){"use strict";n("fe5b"),n("a479")},dc36:function(e,t,n){}}]);
|
||||
@@ -1 +0,0 @@
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5cf3b9db"],{"44e73":function(e,t,n){"use strict";n.r(t);var a=n("c7eb"),c=(n("c346"),n("e63d")),r=n.n(c),o=n("1da1"),u=(n("b0c0"),n("7a23")),i=n("47e2"),l={class:"dev"},s={class:"view-title"},f={class:"view-container"},d={__name:"index",setup:function(e){var t=Object(i["b"])(),n=t.t,c=Object(u["ref"])(),d=Object(u["reactive"])({name:void 0}),b={name:{required:!0,message:"Please input name"}},m=function(){c.value.validate().then((function(){v(d.name)}))},p=Object(u["ref"])(!1),v=function(){var e=Object(o["a"])(Object(a["a"])().mark((function e(t){return Object(a["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return p.value=!0,e.next=3,window.market.downloadPlugin({name:t,isDev:!0});case 3:r.a.success(n("feature.dev.installSuccess",{pluginName:t})),p.value=!1;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),j=function(){c.value.validate().then((function(){window.market.refreshPlugin({name:d.name}),r.a.success(n("feature.dev.refreshSuccess",{pluginName:d.name}))}))},O={span:4},w={span:14};return function(e,t){var n=Object(u["resolveComponent"])("a-alert"),a=Object(u["resolveComponent"])("a-input"),r=Object(u["resolveComponent"])("a-form-item"),o=Object(u["resolveComponent"])("a-button"),i=Object(u["resolveComponent"])("a-form");return Object(u["openBlock"])(),Object(u["createElementBlock"])("div",l,[Object(u["createElementVNode"])("div",s,Object(u["toDisplayString"])(e.$t("feature.dev.title")),1),Object(u["createElementVNode"])("div",f,[Object(u["createVNode"])(n,{style:{"margin-bottom":"40px"},message:e.$t("feature.dev.tips"),type:"warning"},null,8,["message"]),Object(u["createVNode"])(i,{ref_key:"formRef",ref:c,model:d,rules:b,"label-col":O,"wrapper-col":w},{default:Object(u["withCtx"])((function(){return[Object(u["createVNode"])(r,{label:e.$t("feature.dev.pluginName"),name:"name"},{default:Object(u["withCtx"])((function(){return[Object(u["createVNode"])(a,{value:d.name,"onUpdate:value":t[0]||(t[0]=function(e){return d.name=e})},null,8,["value"])]})),_:1},8,["label"]),Object(u["createVNode"])(r,{"wrapper-col":{span:14,offset:4}},{default:Object(u["withCtx"])((function(){return[Object(u["createVNode"])(o,{loading:p.value,type:"primary",onClick:m},{default:Object(u["withCtx"])((function(){return[Object(u["createTextVNode"])(Object(u["toDisplayString"])(e.$t("feature.dev.install")),1)]})),_:1},8,["loading"]),Object(u["createVNode"])(o,{onClick:j,style:{"margin-left":"10px"}},{default:Object(u["withCtx"])((function(){return[Object(u["createTextVNode"])(Object(u["toDisplayString"])(e.$t("feature.dev.refreshPlugins")),1)]})),_:1})]})),_:1})]})),_:1},8,["model"])])])}}},b=(n("ef18"),n("6b0d")),m=n.n(b);const p=m()(d,[["__scopeId","data-v-6fb0031c"]]);t["default"]=p},a479:function(e,t,n){},c346:function(e,t,n){"use strict";n("fe5b"),n("a479")},ef18:function(e,t,n){"use strict";n("f44a")},f44a:function(e,t,n){}}]);
|
||||
@@ -18,7 +18,7 @@
|
||||
"code": "installed",
|
||||
"explain": "已安装插件",
|
||||
"cmds":[
|
||||
"已安装插件"
|
||||
"已安装插件", "installed"
|
||||
]
|
||||
},{
|
||||
"code": "settings",
|
||||
|
||||
BIN
public/icons/delete@2x.png
Normal file
BIN
public/icons/delete@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 845 B |
BIN
public/icons/pin@2x.png
Normal file
BIN
public/icons/pin@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 830 B |
BIN
public/icons/unpin@2x.png
Normal file
BIN
public/icons/unpin@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 747 B |
@@ -1,5 +1,11 @@
|
||||
const { ipcRenderer, shell } = require('electron');
|
||||
const { BrowserWindow, nativeTheme, screen, app } = require('@electron/remote');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
|
||||
const appPath = app.getPath('userData');
|
||||
|
||||
const baseDir = path.join(appPath, './rubick-plugins-new');
|
||||
|
||||
const ipcSendSync = (type, data) => {
|
||||
const returnValue = ipcRenderer.sendSync('msg-trigger', {
|
||||
@@ -19,9 +25,9 @@ const ipcSend = (type, data) => {
|
||||
|
||||
window.rubick = {
|
||||
hooks: {},
|
||||
__event__: {},
|
||||
// 事件
|
||||
onPluginEnter(cb) {
|
||||
console.log(window.rubick.hooks);
|
||||
typeof cb === 'function' && (window.rubick.hooks.onPluginEnter = cb);
|
||||
},
|
||||
onPluginReady(cb) {
|
||||
@@ -43,6 +49,10 @@ window.rubick = {
|
||||
showOpenDialog(options) {
|
||||
return ipcSendSync('showOpenDialog', options);
|
||||
},
|
||||
showSaveDialog(options) {
|
||||
return ipcSendSync('showSaveDialog', options);
|
||||
},
|
||||
|
||||
setExpendHeight(height) {
|
||||
ipcSendSync('setExpendHeight', height);
|
||||
},
|
||||
@@ -178,4 +188,57 @@ window.rubick = {
|
||||
simulateKeyboardTap: (key, ...modifier) => {
|
||||
ipcSend('simulateKeyboardTap', { key, modifier });
|
||||
},
|
||||
|
||||
getCursorScreenPoint: () => {
|
||||
return screen.getCursorScreenPoint();
|
||||
},
|
||||
|
||||
getDisplayNearestPoint: (point) => {
|
||||
return screen.getDisplayNearestPoint(point);
|
||||
},
|
||||
|
||||
outPlugin: () => {
|
||||
return ipcSend('removePlugin');
|
||||
},
|
||||
|
||||
createBrowserWindow: (url, options, callback) => {
|
||||
const winUrl = path.resolve(baseDir, 'node_modules', options.name);
|
||||
const winIndex = `file://${path.join(winUrl, './', url || '')}`;
|
||||
const preloadPath = path.join(
|
||||
winUrl,
|
||||
'./',
|
||||
options.webPreferences.preload || ''
|
||||
);
|
||||
let win = new BrowserWindow({
|
||||
useContentSize: true,
|
||||
resizable: true,
|
||||
title: '拉比克',
|
||||
show: false,
|
||||
backgroundColor: nativeTheme.shouldUseDarkColors ? '#1c1c28' : '#fff',
|
||||
...options,
|
||||
webPreferences: {
|
||||
webSecurity: false,
|
||||
backgroundThrottling: false,
|
||||
contextIsolation: false,
|
||||
webviewTag: true,
|
||||
nodeIntegration: true,
|
||||
spellcheck: false,
|
||||
partition: null,
|
||||
...(options.webPreferences || {}),
|
||||
preload: preloadPath,
|
||||
},
|
||||
});
|
||||
win.loadURL(winIndex);
|
||||
|
||||
win.on('closed', () => {
|
||||
win = undefined;
|
||||
});
|
||||
win.once('ready-to-show', () => {
|
||||
win.show();
|
||||
});
|
||||
win.webContents.on('dom-ready', () => {
|
||||
callback && callback();
|
||||
});
|
||||
return win;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1 +1 @@
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>tpl</title><link href="css/app.f5fd5a5f.css" rel="preload" as="style"><link href="js/app.bdf36c39.js" rel="preload" as="script"><link href="js/chunk-vendors.6a327047.js" rel="preload" as="script"><link href="css/app.f5fd5a5f.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but tpl doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.6a327047.js"></script><script src="js/app.bdf36c39.js"></script></body></html>
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>tpl</title><link href="css/app.f5fd5a5f.css" rel="preload" as="style"><link href="js/app.71511ff3.js" rel="preload" as="script"><link href="js/chunk-vendors.6a327047.js" rel="preload" as="script"><link href="css/app.f5fd5a5f.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but tpl doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.6a327047.js"></script><script src="js/app.71511ff3.js"></script></body></html>
|
||||
1
public/tpl/js/app.71511ff3.js
Normal file
1
public/tpl/js/app.71511ff3.js
Normal file
@@ -0,0 +1 @@
|
||||
(function(e){function t(t){for(var r,a,s=t[0],u=t[1],i=t[2],p=0,d=[];p<s.length;p++)a=s[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&d.push(o[a][0]),o[a]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);l&&l(t);while(d.length)d.shift()();return c.push.apply(c,i||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],r=!0,s=1;s<n.length;s++){var u=n[s];0!==o[u]&&(r=!1)}r&&(c.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},o={app:0},c=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],u=s.push.bind(s);s.push=t,s=s.slice();for(var i=0;i<s.length;i++)t(s[i]);var l=u;c.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("cd49")},"0378":function(e,t,n){"use strict";n("c7e8")},"0861":function(e,t,n){},3809:function(e,t,n){"use strict";n("0861")},c7e8:function(e,t,n){},cd49:function(e,t,n){"use strict";n.r(t);var r=n("79c4"),o=n("5084"),c={__name:"App",setup(e){const t=Object(o["d"])();return window.rubick.onPluginEnter(({code:e,type:n,payload:r})=>{const o=window.exports[e];"none"!==o.mode?t.push({name:o.mode,params:{code:e,type:n,payload:r}}):o.args.enter&&o.args.enter({code:e,type:n,payload:r})}),(e,t)=>{const n=Object(r["w"])("router-view");return Object(r["r"])(),Object(r["d"])(n)}}};n("0378");const a=c;var s=a;const u={class:"list-container"},i={class:"options"},l=["onClick"],p=["src"],d={class:"content"},b={class:"title"},v={class:"desc"};var f=Object(r["h"])({__name:"List",setup(e){const{ipcRenderer:t}=window.require("electron"),n=Object(o["c"])(),c=60,a=10,s=60,{code:f,type:O,payload:j}=n.params,y=window.exports[f];window.rubick.setExpendHeight(s);const w=Object(r["u"])([]);Object(r["B"])([w],()=>{const e=w.value.length>a?a*c:c*w.value.length;window.rubick.setExpendHeight(s+e)}),y.args.enter&&y.args.enter({code:f,type:O,payload:j},e=>{w.value=e});const g=Object(r["u"])(0);t.on("changeCurrent",(e,t)=>{g.value+t>w.value.length-1||w.value+t<0||(g.value=g.value+t)}),window.rubick.setSubInput(({text:e})=>{y.args.search&&y.args.search({code:f,type:"",payload:[]},e,e=>{w.value=e||[]})},"搜索");const h=e=>{y.args.select&&y.args.select({code:f,type:"",payload:[]},e)},m=e=>{if("Enter"===e.code)return h(w.value[g.value]);let t=0;"ArrowDown"===e.code&&(t=1),"ArrowUp"===e.code&&(t=-1),w.value.length&&(g.value+t>w.value.length-1||g.value+t<0||(g.value=g.value+t))};return window.addEventListener("keydown",m),Object(r["o"])(()=>{window.removeEventListener("keydown",m)}),(e,t)=>(Object(r["r"])(),Object(r["f"])("div",u,[Object(r["C"])(Object(r["g"])("div",i,[(Object(r["r"])(!0),Object(r["f"])(r["a"],null,Object(r["v"])(w.value,(e,t)=>(Object(r["r"])(),Object(r["f"])("div",{key:t,class:Object(r["m"])(g.value===t?"active op-item":"op-item"),onClick:t=>h(e)},[e.icon?(Object(r["r"])(),Object(r["f"])("img",{key:0,class:"icon",src:e.icon},null,8,p)):Object(r["e"])("",!0),Object(r["g"])("div",d,[Object(r["g"])("div",b,Object(r["y"])(e.title),1),Object(r["g"])("div",v,Object(r["y"])(decodeURIComponent(e.description)),1)])],10,l))),128))],512),[[r["A"],!!(w.value||[]).length]])]))}});n("3809");const O=f;var j=O;const y={class:"home"};function w(e,t){return Object(r["r"])(),Object(r["f"])("div",y)}var g=n("41ec"),h=n.n(g);const m={},k=h()(m,[["render",w]]);var x=k;const _=[{path:"/list",name:"list",component:j},{path:"/doc",name:"doc",component:x}],P=Object(o["a"])({history:Object(o["b"])(),routes:_});var E=P,S=n("b082"),C=Object(S["a"])({state:{},mutations:{},actions:{},modules:{}});Object(r["c"])(s).use(C).use(E).mount("#app")}});
|
||||
@@ -1 +0,0 @@
|
||||
(function(e){function t(t){for(var r,a,u=t[0],s=t[1],i=t[2],p=0,d=[];p<u.length;p++)a=u[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&d.push(o[a][0]),o[a]=0;for(r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r]);l&&l(t);while(d.length)d.shift()();return c.push.apply(c,i||[]),n()}function n(){for(var e,t=0;t<c.length;t++){for(var n=c[t],r=!0,u=1;u<n.length;u++){var s=n[u];0!==o[s]&&(r=!1)}r&&(c.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},o={app:0},c=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="";var u=window["webpackJsonp"]=window["webpackJsonp"]||[],s=u.push.bind(u);u.push=t,u=u.slice();for(var i=0;i<u.length;i++)t(u[i]);var l=s;c.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("cd49")},"0861":function(e,t,n){},3809:function(e,t,n){"use strict";n("0861")},"4b1f":function(e,t,n){},cd49:function(e,t,n){"use strict";n.r(t);var r=n("79c4"),o=n("5084"),c={__name:"App",setup(e){const t=Object(o["d"])();return window.rubick.onPluginEnter(({code:e,type:n,payload:r})=>{const o=window.exports[e];t.push({name:o.mode,params:{code:e,type:n,payload:r}})}),(e,t)=>{const n=Object(r["w"])("router-view");return Object(r["r"])(),Object(r["d"])(n)}}};n("da18");const a=c;var u=a;const s={class:"list-container"},i={class:"options"},l=["onClick"],p=["src"],d={class:"content"},b={class:"title"},v={class:"desc"};var f=Object(r["h"])({__name:"List",setup(e){const{ipcRenderer:t}=window.require("electron"),n=Object(o["c"])(),c=60,a=10,u=60,{code:f,type:O,payload:j}=n.params,y=window.exports[f];window.rubick.setExpendHeight(u);const w=Object(r["u"])([]);Object(r["B"])([w],()=>{const e=w.value.length>a?a*c:c*w.value.length;window.rubick.setExpendHeight(u+e)}),y.args.enter&&y.args.enter({code:f,type:O,payload:j},e=>{w.value=e});const h=Object(r["u"])(0);t.on("changeCurrent",(e,t)=>{h.value+t>w.value.length-1||w.value+t<0||(h.value=h.value+t)}),window.rubick.setSubInput(({text:e})=>{y.args.search&&y.args.search({code:f,type:"",payload:[]},e,e=>{w.value=e||[]})},"搜索");const g=e=>{y.args.select&&y.args.select({code:f,type:"",payload:[]},e)},m=e=>{if("Enter"===e.code)return g(w.value[h.value]);let t=0;"ArrowDown"===e.code&&(t=1),"ArrowUp"===e.code&&(t=-1),w.value.length&&(h.value+t>w.value.length-1||h.value+t<0||(h.value=h.value+t))};return window.addEventListener("keydown",m),Object(r["o"])(()=>{window.removeEventListener("keydown",m)}),(e,t)=>(Object(r["r"])(),Object(r["f"])("div",s,[Object(r["C"])(Object(r["g"])("div",i,[(Object(r["r"])(!0),Object(r["f"])(r["a"],null,Object(r["v"])(w.value,(e,t)=>(Object(r["r"])(),Object(r["f"])("div",{key:t,class:Object(r["m"])(h.value===t?"active op-item":"op-item"),onClick:t=>g(e)},[e.icon?(Object(r["r"])(),Object(r["f"])("img",{key:0,class:"icon",src:e.icon},null,8,p)):Object(r["e"])("",!0),Object(r["g"])("div",d,[Object(r["g"])("div",b,Object(r["y"])(e.title),1),Object(r["g"])("div",v,Object(r["y"])(decodeURIComponent(e.description)),1)])],10,l))),128))],512),[[r["A"],!!(w.value||[]).length]])]))}});n("3809");const O=f;var j=O;const y={class:"home"};function w(e,t){return Object(r["r"])(),Object(r["f"])("div",y)}var h=n("41ec"),g=n.n(h);const m={},k=g()(m,[["render",w]]);var x=k;const _=[{path:"/list",name:"list",component:j},{path:"/doc",name:"doc",component:x}],P=Object(o["a"])({history:Object(o["b"])(),routes:_});var E=P,S=n("b082"),C=Object(S["a"])({state:{},mutations:{},actions:{},modules:{}});Object(r["c"])(u).use(C).use(E).mount("#app")},da18:function(e,t,n){"use strict";n("4b1f")}});
|
||||
@@ -1,5 +1,6 @@
|
||||
export const WINDOW_WIDTH = 688;
|
||||
export const WINDOW_WIDTH = 800;
|
||||
export const WINDOW_HEIGHT = 60;
|
||||
export const WINDOW_PLUGIN_HEIGHT = 600;
|
||||
|
||||
export const GUIDE_WIDTH = 800;
|
||||
export const GUIDE_HEIGHT = 600;
|
||||
|
||||
@@ -3,7 +3,7 @@ import path from 'path';
|
||||
|
||||
const appPath = app.getPath('userData');
|
||||
|
||||
const PLUGIN_INSTALL_DIR = path.join(appPath, './rubick-plugins');
|
||||
const PLUGIN_INSTALL_DIR = path.join(appPath, './rubick-plugins-new');
|
||||
|
||||
const DECODE_KEY = {
|
||||
Backspace: 'Backspace',
|
||||
|
||||
@@ -3,6 +3,7 @@ import path from 'path';
|
||||
|
||||
const appPath = app.getPath('userData');
|
||||
|
||||
const PLUGIN_INSTALL_DIR = path.join(appPath, './rubick-plugins');
|
||||
const PLUGIN_INSTALL_DIR = path.join(appPath, './rubick-plugins-new');
|
||||
const PLUGIN_HISTORY = 'rubick-local-start-app';
|
||||
|
||||
export { PLUGIN_INSTALL_DIR };
|
||||
export { PLUGIN_INSTALL_DIR, PLUGIN_HISTORY };
|
||||
|
||||
@@ -9,7 +9,8 @@ const useDrag = () => {
|
||||
let draggable = true;
|
||||
|
||||
const onMouseDown = (e) => {
|
||||
// if (commonConst.macOS()) return;
|
||||
// 右击不移动
|
||||
if (e.button === 2) return;
|
||||
draggable = true;
|
||||
mouseX = e.clientX;
|
||||
mouseY = e.clientY;
|
||||
|
||||
@@ -17,10 +17,13 @@ export default function getCopyFiles(): Array<any> | null {
|
||||
return null;
|
||||
}
|
||||
} else if (process.platform === 'win32') {
|
||||
/* eslint-disable */
|
||||
const clipboardEx = require('electron-clipboard-ex');
|
||||
fileInfo = clipboardEx.readFilePaths();
|
||||
// todo
|
||||
try {
|
||||
/* eslint-disable */
|
||||
const clipboardEx = require('electron-clipboard-ex');
|
||||
fileInfo = clipboardEx.readFilePaths();
|
||||
} catch (e) {
|
||||
// todo
|
||||
}
|
||||
} else {
|
||||
if (!commonConst.linux()) return null;
|
||||
if (!clipboard.has('text/uri-list')) return null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const WINDOW_MAX_HEIGHT = 600;
|
||||
const WINDOW_MAX_HEIGHT = 620;
|
||||
const WINDOW_MIN_HEIGHT = 60;
|
||||
const PRE_ITEM_HEIGHT = 60;
|
||||
const PRE_ITEM_HEIGHT = 70;
|
||||
const HISTORY_HEIGHT = 70;
|
||||
|
||||
export default (searchList: Array<any>, historyList): number => {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import getLocalDataFile from './getLocalDataFile';
|
||||
import { PluginHandler } from '@/core';
|
||||
import { PLUGIN_INSTALL_DIR as baseDir } from '@/common/constans/main';
|
||||
import API from '@/main/common/api';
|
||||
|
||||
const configPath = path.join(getLocalDataFile(), './rubick-local-plugin.json');
|
||||
const configPath = path.join(baseDir, './rubick-local-plugin.json');
|
||||
|
||||
let registry;
|
||||
let pluginInstance;
|
||||
|
||||
@@ -4,7 +4,6 @@ import getMacApps from './get-mac-app';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import translate from './translate';
|
||||
import os from 'os';
|
||||
|
||||
const icondir = path.join(os.tmpdir(), 'ProcessIcon');
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import os from 'os';
|
||||
import translate from './translate';
|
||||
import { shell } from 'electron';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const fileIcon = require('extract-file-icon');
|
||||
|
||||
const filePath = path.resolve(
|
||||
'C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs'
|
||||
);
|
||||
@@ -29,6 +25,8 @@ if (!exists) {
|
||||
|
||||
const getico = (app) => {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const fileIcon = require('extract-file-icon');
|
||||
const buffer = fileIcon(app.desc, 32);
|
||||
const iconpath = path.join(icondir, `${app.name}.png`);
|
||||
|
||||
|
||||
@@ -7,10 +7,11 @@ import path from 'path';
|
||||
import got from 'got';
|
||||
import fixPath from 'fix-path';
|
||||
|
||||
import spawn from 'cross-spawn';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import axios from 'axios';
|
||||
|
||||
import npm from 'npm';
|
||||
|
||||
fixPath();
|
||||
|
||||
/**
|
||||
@@ -41,7 +42,7 @@ class AdapterHandler {
|
||||
}
|
||||
this.baseDir = options.baseDir;
|
||||
|
||||
let register = options.registry || 'https://registry.npm.taobao.org';
|
||||
let register = options.registry || 'https://registry.npmmirror.com/';
|
||||
|
||||
try {
|
||||
const dbdata = ipcRenderer.sendSync('msg-trigger', {
|
||||
@@ -157,44 +158,67 @@ class AdapterHandler {
|
||||
*/
|
||||
private async execCommand(cmd: string, modules: string[]): Promise<string> {
|
||||
return new Promise((resolve: any, reject: any) => {
|
||||
let args: string[] = [cmd].concat(
|
||||
const module =
|
||||
cmd !== 'uninstall' && cmd !== 'link'
|
||||
? modules.map((m) => `${m}@latest`)
|
||||
: modules
|
||||
);
|
||||
: modules;
|
||||
const config: any = {
|
||||
prefix: this.baseDir,
|
||||
save: true,
|
||||
cache: path.join(this.baseDir, 'cache'),
|
||||
};
|
||||
if (cmd !== 'link') {
|
||||
args = args
|
||||
.concat('--color=always')
|
||||
.concat('--save')
|
||||
.concat(`--registry=${this.registry}`);
|
||||
config.registry = this.registry;
|
||||
}
|
||||
npm.load(config, function (err) {
|
||||
npm.commands[cmd](module, function (er, data) {
|
||||
if (!err) {
|
||||
console.log(data);
|
||||
resolve({ code: -1, data });
|
||||
} else {
|
||||
reject({ code: -1, data: err });
|
||||
}
|
||||
});
|
||||
|
||||
const npm = spawn('npm', args, {
|
||||
cwd: this.baseDir,
|
||||
npm.on('log', function (message) {
|
||||
// log installation progress
|
||||
console.log(message);
|
||||
});
|
||||
});
|
||||
|
||||
console.log(args);
|
||||
// if (cmd !== 'link') {
|
||||
// args = args
|
||||
// .concat('--color=always')
|
||||
// .concat('--save')
|
||||
// .concat(`--registry=${this.registry}`);
|
||||
// }
|
||||
|
||||
let output = '';
|
||||
npm.stdout
|
||||
.on('data', (data: string) => {
|
||||
output += data; // 获取输出日志
|
||||
})
|
||||
.pipe(process.stdout);
|
||||
|
||||
npm.stderr
|
||||
.on('data', (data: string) => {
|
||||
output += data; // 获取报错日志
|
||||
})
|
||||
.pipe(process.stderr);
|
||||
|
||||
npm.on('close', (code: number) => {
|
||||
if (!code) {
|
||||
resolve({ code: 0, data: output }); // 如果没有报错就输出正常日志
|
||||
} else {
|
||||
reject({ code: code, data: output }); // 如果报错就输出报错日志
|
||||
}
|
||||
});
|
||||
// const npm = spawn('npm', args, {
|
||||
// cwd: this.baseDir,
|
||||
// });
|
||||
//
|
||||
// console.log(args);
|
||||
//
|
||||
// let output = '';
|
||||
// npm.stdout
|
||||
// .on('data', (data: string) => {
|
||||
// output += data; // 获取输出日志
|
||||
// })
|
||||
// .pipe(process.stdout);
|
||||
//
|
||||
// npm.stderr
|
||||
// .on('data', (data: string) => {
|
||||
// output += data; // 获取报错日志
|
||||
// })
|
||||
// .pipe(process.stderr);
|
||||
//
|
||||
// npm.on('close', (code: number) => {
|
||||
// if (!code) {
|
||||
// resolve({ code: 0, data: output }); // 如果没有报错就输出正常日志
|
||||
// } else {
|
||||
// reject({ code: code, data: output }); // 如果报错就输出报错日志
|
||||
// }
|
||||
// });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ export const handleScreenShots = (cb) => {
|
||||
|
||||
export default (mainWindow, cb) => {
|
||||
// 接收到截图后的执行程序
|
||||
mainWindow.hide();
|
||||
clipboard.writeText('');
|
||||
if (platform.macOS()) {
|
||||
handleScreenShots(cb);
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
import { BrowserWindow, ipcMain, nativeTheme } from 'electron';
|
||||
import { BrowserWindow, ipcMain, nativeTheme, screen } from 'electron';
|
||||
import localConfig from '../common/initLocalConfig';
|
||||
import commonConst from '@/common/utils/commonConst';
|
||||
import path from 'path';
|
||||
import { WINDOW_MIN_HEIGHT } from '@/common/constans/common';
|
||||
import mainInstance from '@/main';
|
||||
export default () => {
|
||||
let win: any;
|
||||
|
||||
const init = (pluginInfo, viewInfo, view) => {
|
||||
const init = async (pluginInfo, viewInfo, view) => {
|
||||
ipcMain.on('detach:service', async (event, arg: { type: string }) => {
|
||||
const data = await operation[arg.type]();
|
||||
event.returnValue = data;
|
||||
});
|
||||
createWindow(pluginInfo, viewInfo, view);
|
||||
const createWin = await createWindow(pluginInfo, viewInfo, view);
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require('@electron/remote/main').enable(win.webContents);
|
||||
require('@electron/remote/main').enable(createWin.webContents);
|
||||
};
|
||||
|
||||
const createWindow = async (pluginInfo, viewInfo, view) => {
|
||||
win = new BrowserWindow({
|
||||
const createWin = new BrowserWindow({
|
||||
height: viewInfo.height,
|
||||
minHeight: WINDOW_MIN_HEIGHT,
|
||||
width: viewInfo.width,
|
||||
@@ -38,35 +40,110 @@ export default () => {
|
||||
webviewTag: true,
|
||||
devTools: true,
|
||||
nodeIntegration: true,
|
||||
navigateOnDragDrop: true,
|
||||
spellcheck: false,
|
||||
},
|
||||
});
|
||||
if (process.env.WEBPACK_DEV_SERVER_URL) {
|
||||
// Load the url of the dev server if in development mode
|
||||
win.loadURL('http://localhost:8082');
|
||||
createWin.loadURL('http://localhost:8082');
|
||||
} else {
|
||||
win.loadURL(`file://${path.join(__static, './detach/index.html')}`);
|
||||
createWin.loadURL(`file://${path.join(__static, './detach/index.html')}`);
|
||||
}
|
||||
win.on('close', () => {
|
||||
createWin.on('close', () => {
|
||||
executeHooks('PluginOut', null);
|
||||
});
|
||||
win.on('closed', () => {
|
||||
createWin.on('closed', () => {
|
||||
view.webContents?.destroy();
|
||||
win = undefined;
|
||||
});
|
||||
createWin.on('focus', () => {
|
||||
win = createWin;
|
||||
view && win.webContents?.focus();
|
||||
});
|
||||
|
||||
win.once('ready-to-show', async () => {
|
||||
createWin.once('ready-to-show', async () => {
|
||||
const config = await localConfig.getConfig();
|
||||
const darkMode = config.perf.common.darkMode;
|
||||
darkMode &&
|
||||
win.webContents.executeJavaScript(
|
||||
createWin.webContents.executeJavaScript(
|
||||
`document.body.classList.add("dark");window.rubick.theme="dark"`
|
||||
);
|
||||
win.setBrowserView(view);
|
||||
win.webContents.executeJavaScript(
|
||||
view.setAutoResize({ width: true, height: true });
|
||||
createWin.setBrowserView(view);
|
||||
view.inDetach = true;
|
||||
createWin.webContents.executeJavaScript(
|
||||
`window.initDetach(${JSON.stringify(pluginInfo)})`
|
||||
);
|
||||
win.show();
|
||||
createWin.show();
|
||||
});
|
||||
|
||||
// 最大化设置
|
||||
createWin.on('maximize', () => {
|
||||
createWin.webContents.executeJavaScript('window.maximizeTrigger()');
|
||||
const view = createWin.getBrowserView();
|
||||
if (!view) return;
|
||||
const display = screen.getDisplayMatching(createWin.getBounds());
|
||||
view.setBounds({
|
||||
x: 0,
|
||||
y: WINDOW_MIN_HEIGHT,
|
||||
width: display.workArea.width,
|
||||
height: display.workArea.height - WINDOW_MIN_HEIGHT,
|
||||
});
|
||||
});
|
||||
// 最小化
|
||||
createWin.on('unmaximize', () => {
|
||||
createWin.webContents.executeJavaScript('window.unmaximizeTrigger()');
|
||||
const view = createWin.getBrowserView();
|
||||
if (!view) return;
|
||||
const bounds = createWin.getBounds();
|
||||
const display = screen.getDisplayMatching(bounds);
|
||||
const width =
|
||||
(display.scaleFactor * bounds.width) % 1 == 0
|
||||
? bounds.width
|
||||
: bounds.width - 2;
|
||||
const height =
|
||||
(display.scaleFactor * bounds.height) % 1 == 0
|
||||
? bounds.height
|
||||
: bounds.height - 2;
|
||||
view.setBounds({
|
||||
x: 0,
|
||||
y: WINDOW_MIN_HEIGHT,
|
||||
width,
|
||||
height: height - WINDOW_MIN_HEIGHT,
|
||||
});
|
||||
});
|
||||
|
||||
createWin.on('page-title-updated', (e) => {
|
||||
e.preventDefault();
|
||||
});
|
||||
createWin.webContents.once('render-process-gone', () => {
|
||||
createWin.close();
|
||||
});
|
||||
|
||||
if (commonConst.macOS()) {
|
||||
createWin.on('enter-full-screen', () => {
|
||||
createWin.webContents.executeJavaScript(
|
||||
'window.enterFullScreenTrigger()'
|
||||
);
|
||||
});
|
||||
createWin.on('leave-full-screen', () => {
|
||||
createWin.webContents.executeJavaScript(
|
||||
'window.leaveFullScreenTrigger()'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
view.webContents.on('before-input-event', (event, input) => {
|
||||
if (input.type !== 'keyDown') return;
|
||||
if (!(input.meta || input.control || input.shift || input.alt)) {
|
||||
if (input.key === 'Escape') {
|
||||
operation.endFullScreen();
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
const executeHooks = (hook, data) => {
|
||||
if (!view) return;
|
||||
const evalJs = `console.log(window.rubick);if(window.rubick && window.rubick.hooks && typeof window.rubick.hooks.on${hook} === 'function' ) {
|
||||
@@ -77,6 +154,7 @@ export default () => {
|
||||
`;
|
||||
view.webContents.executeJavaScript(evalJs);
|
||||
};
|
||||
return createWin;
|
||||
};
|
||||
|
||||
const getWindow = () => win;
|
||||
@@ -92,6 +170,9 @@ export default () => {
|
||||
close: () => {
|
||||
win.close();
|
||||
},
|
||||
endFullScreen: () => {
|
||||
win.isFullScreen() && win.setFullScreen(false);
|
||||
},
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
@@ -3,7 +3,11 @@ import path from 'path';
|
||||
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib';
|
||||
// import versonHandler from '../common/versionHandler';
|
||||
import localConfig from '@/main/common/initLocalConfig';
|
||||
import { WINDOW_HEIGHT, WINDOW_MIN_HEIGHT, WINDOW_WIDTH } from '@/common/constans/common';
|
||||
import {
|
||||
WINDOW_HEIGHT,
|
||||
WINDOW_MIN_HEIGHT,
|
||||
WINDOW_WIDTH,
|
||||
} from '@/common/constans/common';
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require('@electron/remote/main').initialize();
|
||||
|
||||
|
||||
@@ -3,6 +3,11 @@ import path from 'path';
|
||||
import commonConst from '../../common/utils/commonConst';
|
||||
import { PLUGIN_INSTALL_DIR as baseDir } from '@/common/constans/main';
|
||||
import localConfig from '@/main/common/initLocalConfig';
|
||||
import {
|
||||
WINDOW_HEIGHT,
|
||||
WINDOW_PLUGIN_HEIGHT,
|
||||
WINDOW_WIDTH,
|
||||
} from '@/common/constans/common';
|
||||
|
||||
const getRelativePath = (indexPath) => {
|
||||
return commonConst.windows()
|
||||
@@ -57,9 +62,14 @@ export default () => {
|
||||
const viewReadyFn = async (window, { pluginSetting, ext }) => {
|
||||
if (!view) return;
|
||||
const height = pluginSetting && pluginSetting.height;
|
||||
window.setSize(800, height || 600);
|
||||
view.setBounds({ x: 0, y: 60, width: 800, height: height || 540 });
|
||||
view.setAutoResize({ width: true });
|
||||
window.setSize(WINDOW_WIDTH, height || WINDOW_PLUGIN_HEIGHT);
|
||||
view.setBounds({
|
||||
x: 0,
|
||||
y: WINDOW_HEIGHT,
|
||||
width: WINDOW_WIDTH,
|
||||
height: height || WINDOW_PLUGIN_HEIGHT - WINDOW_HEIGHT,
|
||||
});
|
||||
view.setAutoResize({ width: true, height: true });
|
||||
executeHooks('PluginEnter', ext);
|
||||
executeHooks('PluginReady', ext);
|
||||
const config = await localConfig.getConfig();
|
||||
@@ -166,7 +176,12 @@ export default () => {
|
||||
const removeView = (window: BrowserWindow) => {
|
||||
if (!view) return;
|
||||
window.removeBrowserView(view);
|
||||
window.setSize(800, 60);
|
||||
if (!view.inDetach) {
|
||||
window.setBrowserView(null);
|
||||
view.webContents?.destroy();
|
||||
}
|
||||
|
||||
// window.setSize(800, 60);
|
||||
executeHooks('PluginOut', null);
|
||||
window.webContents?.executeJavaScript(`window.initRubick()`);
|
||||
view = undefined;
|
||||
@@ -175,14 +190,16 @@ export default () => {
|
||||
const getView = () => view;
|
||||
|
||||
const executeHooks = (hook, data) => {
|
||||
if (!view) return;
|
||||
const evalJs = `if(window.rubick && window.rubick.hooks && typeof window.rubick.hooks.on${hook} === 'function' ) {
|
||||
try {
|
||||
setTimeout(() => {
|
||||
if (!view) return;
|
||||
const evalJs = `if(window.rubick && window.rubick.hooks && typeof window.rubick.hooks.on${hook} === 'function' ) {
|
||||
try {
|
||||
window.rubick.hooks.on${hook}(${data ? JSON.stringify(data) : ''});
|
||||
} catch(e) {}
|
||||
} catch(e) {}
|
||||
}
|
||||
`;
|
||||
view.webContents?.executeJavaScript(evalJs);
|
||||
view.webContents?.executeJavaScript(evalJs);
|
||||
}, 300);
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
@@ -26,6 +26,7 @@ import { runner, detach } from '../browsers';
|
||||
import DBInstance from './db';
|
||||
import getWinPosition from './getWinPosition';
|
||||
import path from 'path';
|
||||
import commonConst from '@/common/utils/commonConst';
|
||||
|
||||
const runnerInstance = runner();
|
||||
const detachInstance = detach();
|
||||
@@ -97,7 +98,12 @@ class API extends DBInstance {
|
||||
? 'http://localhost:8083/#/'
|
||||
: `file://${__static}/tpl/index.html`;
|
||||
}
|
||||
if (!plugin.indexPath) {
|
||||
if (plugin.name === 'rubick-system-feature') {
|
||||
plugin.logo = plugin.logo || `file://${__static}/logo.png`;
|
||||
plugin.indexPath = commonConst.dev()
|
||||
? 'http://localhost:8081/#/'
|
||||
: `file://${__static}/feature/index.html`;
|
||||
} else if (!plugin.indexPath) {
|
||||
const pluginPath = path.resolve(baseDir, 'node_modules', plugin.name);
|
||||
plugin.indexPath = `file://${path.join(
|
||||
pluginPath,
|
||||
@@ -133,7 +139,6 @@ class API extends DBInstance {
|
||||
public hideMainWindow(arg, window) {
|
||||
window.hide();
|
||||
}
|
||||
|
||||
public showMainWindow(arg, window) {
|
||||
window.show();
|
||||
}
|
||||
@@ -142,6 +147,10 @@ class API extends DBInstance {
|
||||
return dialog.showOpenDialogSync(window, data);
|
||||
}
|
||||
|
||||
public showSaveDialog({ data }, window) {
|
||||
return dialog.showSaveDialogSync(window, data);
|
||||
}
|
||||
|
||||
public setExpendHeight({ data: height }, window: BrowserWindow, e) {
|
||||
const originWindow = this.getCurrentWindow(window, e);
|
||||
if (!originWindow) return;
|
||||
@@ -181,6 +190,7 @@ class API extends DBInstance {
|
||||
value: data.text,
|
||||
})})`
|
||||
);
|
||||
this.sendSubInputChangeEvent({ data });
|
||||
}
|
||||
|
||||
public getPath({ data }) {
|
||||
@@ -222,7 +232,7 @@ class API extends DBInstance {
|
||||
}
|
||||
|
||||
public getFeatures() {
|
||||
return this.currentPlugin.features;
|
||||
return this.currentPlugin?.features;
|
||||
}
|
||||
|
||||
public setFeature({ data }, window) {
|
||||
|
||||
@@ -15,10 +15,12 @@ const registerHotKey = (mainWindow: BrowserWindow): void => {
|
||||
// 设置开机启动
|
||||
const setAutoLogin = async () => {
|
||||
const config = await localConfig.getConfig();
|
||||
app.setLoginItemSettings({
|
||||
openAtLogin: config.perf.common.start,
|
||||
openAsHidden: true,
|
||||
});
|
||||
if (app.getLoginItemSettings().openAtLogin !== config.perf.common.start) {
|
||||
app.setLoginItemSettings({
|
||||
openAtLogin: config.perf.common.start,
|
||||
openAsHidden: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const setTheme = async () => {
|
||||
@@ -86,10 +88,6 @@ const registerHotKey = (mainWindow: BrowserWindow): void => {
|
||||
});
|
||||
});
|
||||
|
||||
// globalShortcut.register(config.perf.shortCut.separate, () => {
|
||||
//
|
||||
// });
|
||||
|
||||
globalShortcut.register(config.perf.shortCut.quit, () => {
|
||||
// mainWindow.webContents.send('init-rubick');
|
||||
// mainWindow.show();
|
||||
|
||||
@@ -27,18 +27,22 @@
|
||||
:currentSelect="currentSelect"
|
||||
:options="options"
|
||||
:clipboardFile="clipboardFile || []"
|
||||
@setPluginHistory="setPluginHistory"
|
||||
@choosePlugin="choosePlugin"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { watch, ref, nextTick, toRaw } from 'vue';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { watch, ref, toRaw } from 'vue';
|
||||
import Result from './components/result.vue';
|
||||
import Search from './components/search.vue';
|
||||
import getWindowHeight from '../common/utils/getWindowHeight';
|
||||
import createPluginManager from './plugins-manager';
|
||||
import useDrag from '../common/utils/dragWindow';
|
||||
import { getGlobal } from '@electron/remote';
|
||||
import { PLUGIN_HISTORY } from '@/common/constans/renderer';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
const { onMouseDown } = useDrag();
|
||||
const remote = window.require('@electron/remote');
|
||||
@@ -60,6 +64,8 @@ const {
|
||||
clearClipboardFile,
|
||||
readClipboardContent,
|
||||
pluginHistory,
|
||||
setPluginHistory,
|
||||
changePluginHistory,
|
||||
} = createPluginManager();
|
||||
|
||||
initPlugins();
|
||||
@@ -76,16 +82,22 @@ getPluginInfo({
|
||||
remote.getGlobal('LOCAL_PLUGINS').addPlugin(res);
|
||||
});
|
||||
|
||||
watch([options, pluginHistory], () => {
|
||||
currentSelect.value = 0;
|
||||
if (currentPlugin.value.name) return;
|
||||
nextTick(() => {
|
||||
ipcRenderer.sendSync('msg-trigger', {
|
||||
type: 'setExpendHeight',
|
||||
data: getWindowHeight(options.value, pluginHistory.value),
|
||||
});
|
||||
});
|
||||
});
|
||||
watch(
|
||||
[options, pluginHistory, currentPlugin],
|
||||
() => {
|
||||
currentSelect.value = 0;
|
||||
if (currentPlugin.value.name) return;
|
||||
window.rubick.setExpendHeight(
|
||||
getWindowHeight(
|
||||
options.value,
|
||||
pluginLoading.value ? [] : pluginHistory.value
|
||||
)
|
||||
);
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
const changeIndex = (index) => {
|
||||
if (!options.value.length) {
|
||||
@@ -122,13 +134,40 @@ const openMenu = (ext) => {
|
||||
|
||||
window.rubick.openMenu = openMenu;
|
||||
|
||||
const choosePlugin = () => {
|
||||
const choosePlugin = (plugin) => {
|
||||
if (options.value.length) {
|
||||
const currentChoose = options.value[currentSelect.value];
|
||||
currentChoose.click();
|
||||
} else {
|
||||
const currentChoose = pluginHistory.value[currentSelect.value];
|
||||
currentChoose.click();
|
||||
const localPlugins = getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||
const currentChoose = plugin || pluginHistory.value[currentSelect.value];
|
||||
let hasRemove = true;
|
||||
localPlugins.find((plugin) => {
|
||||
if (plugin.name === currentChoose.originName) {
|
||||
hasRemove = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (hasRemove) {
|
||||
const result = window.rubick.db.get(PLUGIN_HISTORY) || {};
|
||||
const history = result.data.filter(item => item.originName !== currentChoose.originName);
|
||||
setPluginHistory(history);
|
||||
return message.warning('插件已被卸载!');
|
||||
}
|
||||
changePluginHistory(currentChoose);
|
||||
window.rubick.openPlugin(
|
||||
JSON.parse(
|
||||
JSON.stringify({
|
||||
...currentChoose,
|
||||
ext: {
|
||||
code: currentChoose.feature.code,
|
||||
type: currentChoose.cmd.type || 'text',
|
||||
payload: null,
|
||||
},
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
<template>
|
||||
<div
|
||||
v-show="!currentPlugin.name"
|
||||
class="options"
|
||||
ref="scrollDom"
|
||||
>
|
||||
<div class="history-plugins" v-if="!options.length || !(searchValue || !!clipboardFile.length)">
|
||||
<div v-show="!currentPlugin.name" class="options">
|
||||
<div
|
||||
class="history-plugins"
|
||||
v-if="!options.length || !(searchValue || !!clipboardFile.length)"
|
||||
>
|
||||
<a-row>
|
||||
<a-col
|
||||
@click="() => item.click()"
|
||||
:class="currentSelect === index ? 'active history-item' : 'history-item'"
|
||||
@click="() => openPlugin(item)"
|
||||
@contextmenu.prevent="openMenu($event,item)"
|
||||
:class="
|
||||
currentSelect === index ? 'active history-item' : 'history-item'
|
||||
"
|
||||
:span="3"
|
||||
v-for="(item, index) in pluginHistory"
|
||||
:key="index"
|
||||
>
|
||||
<a-avatar style="width: 28px; height: 28px;" :src="item.icon" />
|
||||
<div class="name ellpise">{{item.pluginName || item._name || item.name}}</div>
|
||||
<a-avatar style="width: 28px; height: 28px" :src="item.icon" />
|
||||
<div class="name ellpise">
|
||||
{{ item.cmd || item.pluginName || item._name || item.name }}
|
||||
</div>
|
||||
<div class="badge" v-if="item.pin"></div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
@@ -39,16 +44,13 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import BScroll from '@better-scroll/core';
|
||||
import { defineProps, onMounted, ref } from 'vue';
|
||||
import {defineEmits, defineProps, reactive, toRaw, watch} from 'vue';
|
||||
const path = window.require('path');
|
||||
const remote = window.require('@electron/remote');
|
||||
|
||||
const scrollDom = ref(null);
|
||||
declare const __static: string;
|
||||
|
||||
onMounted(() => {
|
||||
new BScroll(scrollDom.value);
|
||||
});
|
||||
|
||||
const props = defineProps({
|
||||
const props: any = defineProps({
|
||||
searchValue: {
|
||||
type: [String, Number],
|
||||
default: '',
|
||||
@@ -66,14 +68,22 @@ const props = defineProps({
|
||||
clipboardFile: (() => [])(),
|
||||
});
|
||||
|
||||
const emit = defineEmits(['choosePlugin', 'setPluginHistory']);
|
||||
|
||||
const renderTitle = (title, match) => {
|
||||
if (typeof title !== 'string') return;
|
||||
if (!props.searchValue || !match) return title;
|
||||
const result = title.substring(match[0], match[1] + 1);
|
||||
return `<div>${title.substring(0, match[0])}<span style='color: var(--ant-error-color)'>${result}</span>${title.substring(match[1]+1, title.length)}</div>`;
|
||||
return `<div>${title.substring(
|
||||
0,
|
||||
match[0]
|
||||
)}<span style='color: var(--ant-error-color)'>${result}</span>${title.substring(
|
||||
match[1] + 1,
|
||||
title.length
|
||||
)}</div>`;
|
||||
};
|
||||
|
||||
const renderDesc = (desc) => {
|
||||
const renderDesc = (desc = '') => {
|
||||
if (desc.length > 80) {
|
||||
return `${desc.substr(0, 63)}...${desc.substr(
|
||||
desc.length - 14,
|
||||
@@ -93,17 +103,97 @@ const sort = (options) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
return options;
|
||||
return options.slice(0, 20);
|
||||
};
|
||||
|
||||
const openPlugin = (item) => {
|
||||
emit('choosePlugin', item);
|
||||
};
|
||||
|
||||
const menuState: any = reactive({
|
||||
plugin: null,
|
||||
});
|
||||
let mainMenus;
|
||||
|
||||
const openMenu = (e, item) => {
|
||||
const pinToMain = mainMenus.getMenuItemById('pinToMain');
|
||||
const unpinFromMain = mainMenus.getMenuItemById('unpinFromMain');
|
||||
pinToMain.visible = !item.pin;
|
||||
unpinFromMain.visible = item.pin;
|
||||
mainMenus.popup({
|
||||
x: e.pageX,
|
||||
y: e.pageY,
|
||||
});
|
||||
menuState.plugin = item;
|
||||
};
|
||||
|
||||
const initMainCmdMenus = () => {
|
||||
const menu = [
|
||||
{
|
||||
id: 'removeRecentCmd',
|
||||
label: '从"使用记录"中删除',
|
||||
icon: path.join(__static, 'icons', 'delete@2x.png'),
|
||||
click: () => {
|
||||
const history = props.pluginHistory.filter((item) => item.name !== menuState.plugin.name);
|
||||
emit('setPluginHistory', toRaw(history));
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'pinToMain',
|
||||
label: '固定到"搜索面板"',
|
||||
icon: path.join(__static, 'icons', 'pin@2x.png'),
|
||||
click: () => {
|
||||
const history = props.pluginHistory.map((item) => {
|
||||
if (item.name === menuState.plugin.name) {
|
||||
item.pin = true;
|
||||
}
|
||||
return item;
|
||||
});
|
||||
emit('setPluginHistory', toRaw(history));
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'unpinFromMain',
|
||||
label: '从"搜索面板"取消固定',
|
||||
icon: path.join(__static, 'icons', 'unpin@2x.png'),
|
||||
click: () => {
|
||||
const history = props.pluginHistory.map((item) => {
|
||||
if (item.name === menuState.plugin.name) {
|
||||
item.pin = false;
|
||||
}
|
||||
return item;
|
||||
});
|
||||
emit('setPluginHistory', toRaw(history));
|
||||
},
|
||||
},
|
||||
];
|
||||
mainMenus = remote.Menu.buildFromTemplate(menu);
|
||||
};
|
||||
|
||||
initMainCmdMenus();
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.ellpise {
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
display:-webkit-box;
|
||||
-webkit-line-clamp:1;
|
||||
-webkit-box-orient:vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.contextmenu {
|
||||
margin: 0;
|
||||
background: #fff;
|
||||
z-index: 3000;
|
||||
position: absolute;
|
||||
list-style-type: none;
|
||||
padding: 5px 0;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.options {
|
||||
@@ -120,6 +210,7 @@ const sort = (options) => {
|
||||
border-top: 1px dashed var(--color-border-light);
|
||||
box-sizing: border-box;
|
||||
.history-item {
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
height: 69px;
|
||||
display: flex;
|
||||
@@ -128,6 +219,19 @@ const sort = (options) => {
|
||||
flex-direction: column;
|
||||
color: var(--color-text-content);
|
||||
border-right: 1px dashed var(--color-border-light);
|
||||
position: relative;
|
||||
.badge {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 2px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-radius: 4px;
|
||||
border-top: 6px solid var(--ant-primary-4);
|
||||
border-right: 6px solid var(--ant-primary-4);
|
||||
border-left: 6px solid transparent;
|
||||
border-bottom: 6px solid transparent;
|
||||
}
|
||||
&.active {
|
||||
background: var(--color-list-hover);
|
||||
}
|
||||
@@ -141,7 +245,7 @@ const sort = (options) => {
|
||||
}
|
||||
.op-item {
|
||||
padding: 0 10px;
|
||||
height: 60px;
|
||||
height: 70px;
|
||||
line-height: 50px;
|
||||
max-height: 500px;
|
||||
overflow: auto;
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
<template #suffix>
|
||||
<div class="suffix-tool">
|
||||
<MoreOutlined
|
||||
v-show="!pluginLoading"
|
||||
@click="showSeparate()"
|
||||
class="icon-more"
|
||||
/>
|
||||
|
||||
@@ -8,7 +8,10 @@ import commonConst from '@/common/utils/commonConst';
|
||||
import { exec } from 'child_process';
|
||||
import searchManager from './search';
|
||||
import optionsManager from './options';
|
||||
import { PLUGIN_INSTALL_DIR as baseDir } from '@/common/constans/renderer';
|
||||
import {
|
||||
PLUGIN_INSTALL_DIR as baseDir,
|
||||
PLUGIN_HISTORY,
|
||||
} from '@/common/constans/renderer';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
const createPluginManager = (): any => {
|
||||
@@ -28,16 +31,22 @@ const createPluginManager = (): any => {
|
||||
const appList: any = ref([]);
|
||||
|
||||
const initPlugins = async () => {
|
||||
initPluginHistory();
|
||||
appList.value = await appSearch(nativeImage);
|
||||
initLocalStartPlugin();
|
||||
};
|
||||
|
||||
const initPluginHistory = () => {
|
||||
const result = window.rubick.db.get(PLUGIN_HISTORY) || {};
|
||||
if (result && result.data) {
|
||||
state.pluginHistory = result.data;
|
||||
}
|
||||
};
|
||||
|
||||
const initLocalStartPlugin = () => {
|
||||
const result = ipcRenderer.sendSync('msg-trigger', {
|
||||
type: 'dbGet',
|
||||
data: {
|
||||
id: 'rubick-local-start-app',
|
||||
},
|
||||
data: { id: PLUGIN_HISTORY },
|
||||
});
|
||||
if (result && result.value) {
|
||||
appList.value.push(...result.value);
|
||||
@@ -70,12 +79,12 @@ const createPluginManager = (): any => {
|
||||
const openPlugin = async (plugin, option) => {
|
||||
if (plugin.pluginType === 'ui' || plugin.pluginType === 'system') {
|
||||
if (state.currentPlugin && state.currentPlugin.name === plugin.name) {
|
||||
window.rubick.showMainWindow();
|
||||
return;
|
||||
}
|
||||
await loadPlugin(plugin);
|
||||
ipcRenderer.sendSync('msg-trigger', {
|
||||
type: 'openPlugin',
|
||||
data: JSON.parse(
|
||||
window.rubick.openPlugin(
|
||||
JSON.parse(
|
||||
JSON.stringify({
|
||||
...plugin,
|
||||
ext: plugin.ext || {
|
||||
@@ -84,8 +93,8 @@ const createPluginManager = (): any => {
|
||||
payload: null,
|
||||
},
|
||||
})
|
||||
),
|
||||
});
|
||||
)
|
||||
);
|
||||
}
|
||||
if (plugin.pluginType === 'app') {
|
||||
try {
|
||||
@@ -98,19 +107,52 @@ const createPluginManager = (): any => {
|
||||
changePluginHistory({
|
||||
...plugin,
|
||||
...option,
|
||||
originName: plugin.name,
|
||||
});
|
||||
};
|
||||
|
||||
const changePluginHistory = (plugin) => {
|
||||
state.pluginHistory.forEach((p, index) => {
|
||||
if (p.name === plugin.name) {
|
||||
state.pluginHistory.splice(index, 1);
|
||||
}
|
||||
});
|
||||
state.pluginHistory.unshift(plugin);
|
||||
if (state.pluginHistory.length > 8) {
|
||||
state.pluginHistory.pop();
|
||||
const unpin = state.pluginHistory.filter((plugin) => !plugin.pin);
|
||||
const pin = state.pluginHistory.filter((plugin) => plugin.pin);
|
||||
const isPin = state.pluginHistory.find((p) => p.name === plugin.name)?.pin;
|
||||
if (isPin) {
|
||||
pin.forEach((p, index) => {
|
||||
if (p.name === plugin.name) {
|
||||
plugin = pin.splice(index, 1)[0];
|
||||
}
|
||||
});
|
||||
pin.unshift(plugin);
|
||||
} else {
|
||||
unpin.forEach((p, index) => {
|
||||
if (p.name === plugin.name) {
|
||||
unpin.splice(index, 1);
|
||||
}
|
||||
});
|
||||
unpin.unshift(plugin);
|
||||
}
|
||||
if (state.pluginHistory.length > 8) {
|
||||
unpin.pop();
|
||||
}
|
||||
state.pluginHistory = [...pin, ...unpin];
|
||||
const result = window.rubick.db.get(PLUGIN_HISTORY) || {};
|
||||
window.rubick.db.put({
|
||||
_id: PLUGIN_HISTORY,
|
||||
_rev: result._rev,
|
||||
data: JSON.parse(JSON.stringify(state.pluginHistory)),
|
||||
});
|
||||
};
|
||||
|
||||
const setPluginHistory = (plugins) => {
|
||||
state.pluginHistory = plugins;
|
||||
const unpin = state.pluginHistory.filter((plugin) => !plugin.pin);
|
||||
const pin = state.pluginHistory.filter((plugin) => plugin.pin);
|
||||
state.pluginHistory = [...pin, ...unpin];
|
||||
const result = window.rubick.db.get(PLUGIN_HISTORY) || {};
|
||||
window.rubick.db.put({
|
||||
_id: PLUGIN_HISTORY,
|
||||
_rev: result._rev,
|
||||
data: JSON.parse(JSON.stringify(state.pluginHistory)),
|
||||
});
|
||||
};
|
||||
|
||||
const { searchValue, onSearch, setSearchValue, placeholder } =
|
||||
@@ -118,6 +160,7 @@ const createPluginManager = (): any => {
|
||||
const {
|
||||
options,
|
||||
searchFocus,
|
||||
setOptionsRef,
|
||||
clipboardFile,
|
||||
clearClipboardFile,
|
||||
readClipboardContent,
|
||||
@@ -169,6 +212,7 @@ const createPluginManager = (): any => {
|
||||
window.initRubick = () => {
|
||||
state.currentPlugin = {};
|
||||
setSearchValue('');
|
||||
setOptionsRef([]);
|
||||
window.setSubInput({ placeholder: '' });
|
||||
};
|
||||
|
||||
@@ -201,6 +245,8 @@ const createPluginManager = (): any => {
|
||||
clipboardFile,
|
||||
clearClipboardFile,
|
||||
readClipboardContent,
|
||||
setPluginHistory,
|
||||
changePluginHistory,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ref, watch } from 'vue';
|
||||
import throttle from 'lodash.throttle';
|
||||
import debounce from 'lodash.debounce';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { getGlobal } from '@electron/remote';
|
||||
import PinyinMatch from 'pinyin-match';
|
||||
@@ -41,6 +41,17 @@ const optionsManager = ({
|
||||
options[0].click();
|
||||
});
|
||||
|
||||
const getIndex = (cmd, value) => {
|
||||
let index = 0;
|
||||
if (PinyinMatch.match(cmd.label || cmd, value)) {
|
||||
index += 1;
|
||||
}
|
||||
if (cmd.label) {
|
||||
index -= 1;
|
||||
}
|
||||
return index;
|
||||
};
|
||||
|
||||
const getOptionsFromSearchValue = (value, strict = false) => {
|
||||
const localPlugins = getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||
let options: any = [];
|
||||
@@ -61,7 +72,7 @@ const optionsManager = ({
|
||||
desc: fe.explain,
|
||||
type: plugin.pluginType,
|
||||
match: PinyinMatch.match(cmd.label || cmd, value),
|
||||
zIndex: cmd.label ? 0 : 1, // 排序权重
|
||||
zIndex: getIndex(cmd, value), // 排序权重
|
||||
click: () => {
|
||||
pluginClickEvent({
|
||||
plugin,
|
||||
@@ -117,7 +128,7 @@ const optionsManager = ({
|
||||
.map((plugin) => {
|
||||
const option = {
|
||||
...plugin,
|
||||
zIndex: 1,
|
||||
zIndex: 0,
|
||||
click: () => {
|
||||
openPlugin(plugin, option);
|
||||
},
|
||||
@@ -130,7 +141,7 @@ const optionsManager = ({
|
||||
|
||||
watch(searchValue, () => search(searchValue.value));
|
||||
// search Input operation
|
||||
const search = throttle((value) => {
|
||||
const search = debounce((value) => {
|
||||
if (currentPlugin.value.name) return;
|
||||
if (clipboardFile.value.length) return;
|
||||
if (!value) {
|
||||
@@ -138,7 +149,7 @@ const optionsManager = ({
|
||||
return;
|
||||
}
|
||||
optionsRef.value = getOptionsFromSearchValue(value);
|
||||
}, 500);
|
||||
}, 100);
|
||||
|
||||
const setOptionsRef = (options) => {
|
||||
optionsRef.value = options;
|
||||
@@ -157,6 +168,7 @@ const optionsManager = ({
|
||||
});
|
||||
|
||||
return {
|
||||
setOptionsRef,
|
||||
options: optionsRef,
|
||||
searchFocus,
|
||||
clipboardFile,
|
||||
|
||||
@@ -8,6 +8,10 @@ import { useRouter } from "vue-router";
|
||||
const router = useRouter();
|
||||
window.rubick.onPluginEnter(({ code, type, payload }) => {
|
||||
const current = window.exports[code];
|
||||
if (current.mode === 'none') {
|
||||
current.args.enter && current.args.enter({ code: code, type, payload });
|
||||
return;
|
||||
}
|
||||
router.push({
|
||||
name: current.mode,
|
||||
params: {
|
||||
|
||||
@@ -24,6 +24,7 @@ module.exports = {
|
||||
externals: [
|
||||
'pouchdb',
|
||||
'extract-file-icon',
|
||||
'npm',
|
||||
'electron-screenshots',
|
||||
'@electron/remote',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user