mirror of
https://github.com/rubickCenter/rubick
synced 2025-08-09 04:54:01 +08:00
🔨 resolve conflicts
This commit is contained in:
commit
12a1961405
20
.eslintrc.js
20
.eslintrc.js
@ -4,17 +4,23 @@ module.exports = {
|
||||
node: true,
|
||||
},
|
||||
extends: [
|
||||
"plugin:vue/vue3-essential",
|
||||
"eslint:recommended",
|
||||
"@vue/typescript/recommended",
|
||||
"@vue/prettier",
|
||||
"@vue/prettier/@typescript-eslint",
|
||||
'plugin:vue/vue3-essential',
|
||||
'eslint:recommended',
|
||||
'@vue/typescript/recommended',
|
||||
'@vue/prettier',
|
||||
'@vue/prettier/@typescript-eslint',
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
},
|
||||
rules: {
|
||||
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'prettier/prettier': [
|
||||
'warn',
|
||||
{
|
||||
singleQuote: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -35,7 +35,7 @@ jobs:
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
node-version: 16.x
|
||||
|
||||
- name: Install system deps
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
|
19
.prettierrc
Normal file
19
.prettierrc
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"jsxSingleQuote": true,
|
||||
"trailingComma": "es5",
|
||||
"bracketSpacing": true,
|
||||
"jsxBracketSameLine": false,
|
||||
"arrowParens": "always",
|
||||
"printWidth": 80,
|
||||
"embeddedLanguageFormatting": "auto",
|
||||
"htmlWhitespaceSensitivity": "ignore",
|
||||
"preserve": "preserve",
|
||||
"insertPragma": false,
|
||||
"quoteProps": "as-needed",
|
||||
"requirePragma": false,
|
||||
"endOfLine": "auto"
|
||||
}
|
9401
detach/yarn.lock
Normal file
9401
detach/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
@ -9,13 +9,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons-vue": "^6.0.1",
|
||||
"ant-design-vue": "^2.2.8",
|
||||
"ant-design-vue": "3.2.14",
|
||||
"axios": "^0.24.0",
|
||||
"core-js": "^3.6.5",
|
||||
"lodash.debounce": "^4.0.8",
|
||||
"lodash.throttle": "^4.1.1",
|
||||
"markdown-it": "^12.2.0",
|
||||
"vue": "^3.0.0",
|
||||
"vue": "3.2.45",
|
||||
"vue-router": "^4.0.0-0",
|
||||
"vuex": "^4.0.0-0"
|
||||
},
|
||||
|
@ -33,7 +33,7 @@
|
||||
<a-tag>{{ pluginDetail.version }}</a-tag>
|
||||
</div>
|
||||
<div class="desc">
|
||||
开发者:{{ `${pluginDetail.author || "未知"}` }}
|
||||
开发者:{{ `${pluginDetail.author || '未知'}` }}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{ pluginDetail.description }}
|
||||
@ -63,18 +63,40 @@
|
||||
<a-tag
|
||||
:key="cmd"
|
||||
v-for="cmd in item.cmds"
|
||||
@close="removeFeature(cmd)"
|
||||
@click="
|
||||
!cmd.label &&
|
||||
openPlugin({
|
||||
code: item.code,
|
||||
cmd
|
||||
})
|
||||
"
|
||||
:class="{ executable: !cmd.label }"
|
||||
:color="!cmd.label && '#87d068'"
|
||||
>
|
||||
{{ cmd.label || cmd }}
|
||||
<span
|
||||
@click="
|
||||
!cmd.label &&
|
||||
openPlugin({
|
||||
code: item.code,
|
||||
cmd,
|
||||
})
|
||||
"
|
||||
>
|
||||
{{ cmd.label || cmd }}
|
||||
</span>
|
||||
<template v-if="!cmd.label" #icon>
|
||||
<a-tooltip
|
||||
v-if="!hasAdded(cmd)"
|
||||
placement="topLeft"
|
||||
title="点击+号,固定关键词到超级面板"
|
||||
>
|
||||
<PlusCircleOutlined
|
||||
@click="addCmdToSuperPanel({ code: item.code, cmd })"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip
|
||||
v-else
|
||||
placement="topLeft"
|
||||
title="点击-号,从超级面板移除关键词"
|
||||
>
|
||||
<MinusCircleOutlined
|
||||
@click="removePluginToSuperPanel(cmd)"
|
||||
/>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</a-tag>
|
||||
</div>
|
||||
</div>
|
||||
@ -89,27 +111,29 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useStore } from "vuex";
|
||||
import { computed, ref } from "vue";
|
||||
import path from "path";
|
||||
import MarkdownIt from "markdown-it";
|
||||
const { ipcRenderer } = window.require("electron");
|
||||
import { useStore } from 'vuex';
|
||||
import { computed, ref, toRaw } from 'vue';
|
||||
import path from 'path';
|
||||
import MarkdownIt from 'markdown-it';
|
||||
import { PlusCircleOutlined, MinusCircleOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
const { remote } = window.require("electron");
|
||||
const fs = window.require("fs");
|
||||
const { ipcRenderer } = window.require('electron');
|
||||
|
||||
const { remote } = window.require('electron');
|
||||
const fs = window.require('fs');
|
||||
const md = new MarkdownIt();
|
||||
|
||||
const appPath = remote.app.getPath("cache");
|
||||
const baseDir = path.join(appPath, "./rubick-plugins");
|
||||
const appPath = remote.app.getPath('cache');
|
||||
const baseDir = path.join(appPath, './rubick-plugins');
|
||||
|
||||
const store = useStore();
|
||||
const localPlugins = computed(() =>
|
||||
store.state.localPlugins.filter(
|
||||
plugin => plugin.name !== "rubick-system-feature"
|
||||
(plugin) => plugin.name !== 'rubick-system-feature'
|
||||
)
|
||||
);
|
||||
const updateLocalPlugin = () => store.dispatch("updateLocalPlugin");
|
||||
const startUnDownload = name => store.dispatch("startUnDownload", name);
|
||||
const updateLocalPlugin = () => store.dispatch('updateLocalPlugin');
|
||||
const startUnDownload = (name) => store.dispatch('startUnDownload', name);
|
||||
|
||||
const currentSelect = ref([0]);
|
||||
|
||||
@ -117,8 +141,50 @@ const pluginDetail = computed(() => {
|
||||
return localPlugins.value[currentSelect.value] || {};
|
||||
});
|
||||
|
||||
const superPanelPlugins = ref(
|
||||
window.rubick.db.get('super-panel-plugins') || {
|
||||
data: [],
|
||||
_id: 'super-panel-plugins',
|
||||
}
|
||||
);
|
||||
console.log(toRaw(superPanelPlugins.value.data));
|
||||
const addCmdToSuperPanel = ({ cmd, code }) => {
|
||||
const plugin = {
|
||||
...toRaw(pluginDetail.value),
|
||||
cmd,
|
||||
ext: {
|
||||
code,
|
||||
type: 'text',
|
||||
payload: null,
|
||||
},
|
||||
};
|
||||
superPanelPlugins.value.data.push(plugin);
|
||||
window.rubick.db.put(toRaw(superPanelPlugins.value));
|
||||
};
|
||||
|
||||
const removePluginToSuperPanel = (cmd) => {
|
||||
superPanelPlugins.value.data = toRaw(superPanelPlugins.value).data.filter(
|
||||
(item) => {
|
||||
return item.cmd !== cmd;
|
||||
}
|
||||
);
|
||||
console.log(toRaw(superPanelPlugins.value));
|
||||
window.rubick.db.put(toRaw(superPanelPlugins.value));
|
||||
};
|
||||
|
||||
const hasAdded = (cmd) => {
|
||||
let added = false;
|
||||
superPanelPlugins.value.data.some((item) => {
|
||||
if (item.cmd === cmd) {
|
||||
added = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return added;
|
||||
};
|
||||
|
||||
const openPlugin = ({ cmd, code }) => {
|
||||
console.log(pluginDetail.value);
|
||||
window.rubick.openPlugin(
|
||||
JSON.parse(
|
||||
JSON.stringify({
|
||||
@ -126,30 +192,30 @@ const openPlugin = ({ cmd, code }) => {
|
||||
cmd,
|
||||
ext: {
|
||||
code,
|
||||
type: "text",
|
||||
payload: null
|
||||
}
|
||||
type: 'text',
|
||||
payload: null,
|
||||
},
|
||||
})
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
const readme = computed(() => {
|
||||
if (!pluginDetail.value.name) return "";
|
||||
if (!pluginDetail.value.name) return '';
|
||||
const readmePath = path.resolve(
|
||||
baseDir,
|
||||
"node_modules",
|
||||
'node_modules',
|
||||
pluginDetail.value.name,
|
||||
"readme.md"
|
||||
'readme.md'
|
||||
);
|
||||
if (fs.existsSync(readmePath)) {
|
||||
const str = fs.readFileSync(readmePath, "utf-8");
|
||||
const str = fs.readFileSync(readmePath, 'utf-8');
|
||||
return md.render(str);
|
||||
}
|
||||
return "";
|
||||
return '';
|
||||
});
|
||||
|
||||
const deletePlugin = async plugin => {
|
||||
const deletePlugin = async (plugin) => {
|
||||
startUnDownload(plugin.name);
|
||||
await window.market.deletePlugin(plugin);
|
||||
updateLocalPlugin();
|
||||
@ -162,7 +228,8 @@ const deletePlugin = async plugin => {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
background: var(--color-body-bg);
|
||||
height: calc(~"100vh - 46px");
|
||||
height: calc(~'100vh - 46px');
|
||||
|
||||
.container {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
@ -171,6 +238,7 @@ const deletePlugin = async plugin => {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.installed-list {
|
||||
width: 40%;
|
||||
background: var(--color-body-bg);
|
||||
@ -178,6 +246,7 @@ const deletePlugin = async plugin => {
|
||||
padding: 10px 0;
|
||||
border-right: 1px solid var(--color-border-light);
|
||||
overflow: auto;
|
||||
|
||||
.item {
|
||||
padding: 10px 20px;
|
||||
display: flex;
|
||||
@ -188,14 +257,17 @@ const deletePlugin = async plugin => {
|
||||
height: 40px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.desc {
|
||||
color: var(--color-text-desc);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: var(--color-list-hover);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.plugin-detail {
|
||||
padding: 20px 20px 0 20px;
|
||||
box-sizing: border-box;
|
||||
@ -206,6 +278,7 @@ const deletePlugin = async plugin => {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
|
||||
.title {
|
||||
font-size: 20px;
|
||||
display: flex;
|
||||
@ -218,6 +291,7 @@ const deletePlugin = async plugin => {
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
font-size: 13px;
|
||||
color: var(--color-text-desc);
|
||||
@ -229,6 +303,7 @@ const deletePlugin = async plugin => {
|
||||
border-bottom: 1px solid var(--color-border-light);
|
||||
}
|
||||
}
|
||||
|
||||
.detail-container,
|
||||
.feature-container {
|
||||
height: 380px;
|
||||
@ -238,24 +313,29 @@ const deletePlugin = async plugin => {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.desc-item {
|
||||
border-bottom: 1px solid var(--color-border-light);
|
||||
padding: 10px 0;
|
||||
color: var(--color-text-content);
|
||||
.ant-tag {
|
||||
margin-top: 6px;
|
||||
|
||||
&.executable {
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.desc-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.desc-info {
|
||||
color: var(--color-text-desc);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div class="panel-item">
|
||||
<h3 class="title">{{ title }}</h3>
|
||||
<div class="list-item">
|
||||
<a-list :grid="{ gutter: 16, column: 2 }" :data-source="list">
|
||||
<a-list :grid="{ gutter: 16, column: 2 }" :data-source="list.filter(item => !!item)">
|
||||
<template #renderItem="{ item, index }">
|
||||
<a-list-item v-if="item" @click="showDetail(item)">
|
||||
<template #actions>
|
||||
|
@ -14,6 +14,12 @@
|
||||
</template>
|
||||
全局快捷键
|
||||
</a-menu-item>
|
||||
<a-menu-item key="superpanel">
|
||||
<template #icon>
|
||||
<FileAddOutlined />
|
||||
</template>
|
||||
超级面板设置
|
||||
</a-menu-item>
|
||||
<a-menu-item key="localhost">
|
||||
<template #icon>
|
||||
<DatabaseOutlined />
|
||||
@ -142,6 +148,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<Localhost v-if="currentSelect[0] === 'localhost'" />
|
||||
<SuperPanel v-if="currentSelect[0] === 'superpanel'" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -152,12 +159,14 @@ import {
|
||||
LaptopOutlined,
|
||||
DatabaseOutlined,
|
||||
MinusCircleOutlined,
|
||||
PlusCircleOutlined
|
||||
PlusCircleOutlined,
|
||||
FileAddOutlined,
|
||||
} from "@ant-design/icons-vue";
|
||||
import debounce from "lodash.debounce";
|
||||
import { ref, reactive, watch, toRefs, computed, toRaw } from "vue";
|
||||
import keycodes from "./keycode";
|
||||
import Localhost from "./localhost.vue";
|
||||
import SuperPanel from "./super-panel.vue";
|
||||
|
||||
const { remote, ipcRenderer } = window.require("electron");
|
||||
|
||||
|
77
feature/src/views/settings/super-panel.vue
Normal file
77
feature/src/views/settings/super-panel.vue
Normal file
@ -0,0 +1,77 @@
|
||||
<template>
|
||||
请选择需要添加到超级面板中的常用插件
|
||||
<div class="super-list-item panel-item">
|
||||
<a-list :grid="{ gutter: 16, column: 2 }" :data-source="localPlugins.filter(item => !!item)">
|
||||
<template #renderItem="{ item }">
|
||||
<a-list-item v-if="item">
|
||||
<template #actions>
|
||||
<a-button v-if="!hasAdded(item)" @click="addPluginToSuperPanel(item)" style="color: #7ec699" type="text">
|
||||
添加
|
||||
</a-button>
|
||||
<a-button v-else @click="removePluginToSuperPanel(item)" style="color: #ff4ea4;" type="text">
|
||||
移除
|
||||
</a-button>
|
||||
</template>
|
||||
<a-list-item-meta>
|
||||
<template #description>
|
||||
<span class="ellipse">{{ item.description }}</span>
|
||||
</template>
|
||||
<template #title>
|
||||
<span class="ellipse">{{ item.pluginName }}</span>
|
||||
</template>
|
||||
<template #avatar>
|
||||
<a-avatar :src="item.logo"/>
|
||||
</template>
|
||||
</a-list-item-meta>
|
||||
</a-list-item>
|
||||
</template>
|
||||
</a-list>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {useStore} from "vuex";
|
||||
import {computed, ref, toRaw} from "vue";
|
||||
|
||||
const store = useStore();
|
||||
const localPlugins = computed(() =>
|
||||
store.state.localPlugins.filter(
|
||||
plugin => plugin.name !== "rubick-system-feature" && plugin.name !== "rubick-system-super-panel"
|
||||
)
|
||||
);
|
||||
|
||||
const hasAdded = (plugin) => {
|
||||
let added = false;
|
||||
superPanelPlugins.value.data.some((item) => {
|
||||
if (item.name === plugin.name) {
|
||||
added = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return added;
|
||||
};
|
||||
|
||||
const superPanelPlugins = ref(window.rubick.db.get("super-panel-db") || {
|
||||
data: [],
|
||||
_id: "super-panel-db",
|
||||
});
|
||||
|
||||
const addPluginToSuperPanel = (plugin) => {
|
||||
superPanelPlugins.value.data.push(toRaw(plugin));
|
||||
window.rubick.db.put(toRaw(superPanelPlugins.value));
|
||||
};
|
||||
|
||||
const removePluginToSuperPanel = (plugin) => {
|
||||
superPanelPlugins.value.data = toRaw(superPanelPlugins.value).data.filter((item) => {
|
||||
return item.name !== plugin.name;
|
||||
});
|
||||
window.rubick.db.put(toRaw(superPanelPlugins.value));
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.super-list-item.panel-item {
|
||||
&:after {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -31,7 +31,7 @@
|
||||
resolved "https://registry.yarnpkg.com/@ant-design/icons-svg/-/icons-svg-4.2.1.tgz#8630da8eb4471a4aabdaed7d1ff6a97dcb2cf05a"
|
||||
integrity sha512-EB0iwlKDGpG93hW8f85CTJTs4SvMX7tt5ceupvhALp1IF44SeUFOMhKUOYqpsoYWQKAOuTRDMqn75rEaKDp0Xw==
|
||||
|
||||
"@ant-design/icons-vue@^6.0.0", "@ant-design/icons-vue@^6.0.1":
|
||||
"@ant-design/icons-vue@^6.0.1", "@ant-design/icons-vue@^6.1.0":
|
||||
version "6.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@ant-design/icons-vue/-/icons-vue-6.1.0.tgz#f9324fdc0eb4cea943cf626d2bf3db9a4ff4c074"
|
||||
integrity sha512-EX6bYm56V+ZrKN7+3MT/ubDkvJ5rK/O2t380WFRflDcVFgsvl3NLH7Wxeau6R8DbrO5jWR6DSTC3B6gYFp77AA==
|
||||
@ -1625,6 +1625,16 @@
|
||||
estree-walker "^2.0.2"
|
||||
source-map "^0.6.1"
|
||||
|
||||
"@vue/compiler-core@3.2.45":
|
||||
version "3.2.45"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.45.tgz#d9311207d96f6ebd5f4660be129fb99f01ddb41b"
|
||||
integrity sha512-rcMj7H+PYe5wBV3iYeUgbCglC+pbpN8hBLTJvRiK2eKQiWqu+fG9F+8sW99JdL4LQi7Re178UOxn09puSXvn4A==
|
||||
dependencies:
|
||||
"@babel/parser" "^7.16.4"
|
||||
"@vue/shared" "3.2.45"
|
||||
estree-walker "^2.0.2"
|
||||
source-map "^0.6.1"
|
||||
|
||||
"@vue/compiler-dom@3.2.36":
|
||||
version "3.2.36"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.36.tgz#16d911ff163ed5fc8087a01645bf14bb7f325401"
|
||||
@ -1633,7 +1643,31 @@
|
||||
"@vue/compiler-core" "3.2.36"
|
||||
"@vue/shared" "3.2.36"
|
||||
|
||||
"@vue/compiler-sfc@3.2.36", "@vue/compiler-sfc@^3.0.0":
|
||||
"@vue/compiler-dom@3.2.45":
|
||||
version "3.2.45"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.45.tgz#c43cc15e50da62ecc16a42f2622d25dc5fd97dce"
|
||||
integrity sha512-tyYeUEuKqqZO137WrZkpwfPCdiiIeXYCcJ8L4gWz9vqaxzIQRccTSwSWZ/Axx5YR2z+LvpUbmPNXxuBU45lyRw==
|
||||
dependencies:
|
||||
"@vue/compiler-core" "3.2.45"
|
||||
"@vue/shared" "3.2.45"
|
||||
|
||||
"@vue/compiler-sfc@3.2.45":
|
||||
version "3.2.45"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.45.tgz#7f7989cc04ec9e7c55acd406827a2c4e96872c70"
|
||||
integrity sha512-1jXDuWah1ggsnSAOGsec8cFjT/K6TMZ0sPL3o3d84Ft2AYZi2jWJgRMjw4iaK0rBfA89L5gw427H4n1RZQBu6Q==
|
||||
dependencies:
|
||||
"@babel/parser" "^7.16.4"
|
||||
"@vue/compiler-core" "3.2.45"
|
||||
"@vue/compiler-dom" "3.2.45"
|
||||
"@vue/compiler-ssr" "3.2.45"
|
||||
"@vue/reactivity-transform" "3.2.45"
|
||||
"@vue/shared" "3.2.45"
|
||||
estree-walker "^2.0.2"
|
||||
magic-string "^0.25.7"
|
||||
postcss "^8.1.10"
|
||||
source-map "^0.6.1"
|
||||
|
||||
"@vue/compiler-sfc@^3.0.0":
|
||||
version "3.2.36"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.36.tgz#e5065e7c0e5170ffa750e3c3dd93a29db109d0f2"
|
||||
integrity sha512-AvGb4bTj4W8uQ4BqaSxo7UwTEqX5utdRSMyHy58OragWlt8nEACQ9mIeQh3K4di4/SX+41+pJrLIY01lHAOFOA==
|
||||
@ -1657,6 +1691,14 @@
|
||||
"@vue/compiler-dom" "3.2.36"
|
||||
"@vue/shared" "3.2.36"
|
||||
|
||||
"@vue/compiler-ssr@3.2.45":
|
||||
version "3.2.45"
|
||||
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.45.tgz#bd20604b6e64ea15344d5b6278c4141191c983b2"
|
||||
integrity sha512-6BRaggEGqhWht3lt24CrIbQSRD5O07MTmd+LjAn5fJj568+R9eUD2F7wMQJjX859seSlrYog7sUtrZSd7feqrQ==
|
||||
dependencies:
|
||||
"@vue/compiler-dom" "3.2.45"
|
||||
"@vue/shared" "3.2.45"
|
||||
|
||||
"@vue/component-compiler-utils@^3.1.0", "@vue/component-compiler-utils@^3.1.2":
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-3.3.0.tgz#f9f5fb53464b0c37b2c8d2f3fbfe44df60f61dc9"
|
||||
@ -1708,43 +1750,59 @@
|
||||
estree-walker "^2.0.2"
|
||||
magic-string "^0.25.7"
|
||||
|
||||
"@vue/reactivity@3.2.36":
|
||||
version "3.2.36"
|
||||
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.2.36.tgz#026b14e716febffe80cd284fd8a2b33378968646"
|
||||
integrity sha512-c2qvopo0crh9A4GXi2/2kfGYMxsJW4tVILrqRPydVGZHhq0fnzy6qmclWOhBFckEhmyxmpHpdJtIRYGeKcuhnA==
|
||||
"@vue/reactivity-transform@3.2.45":
|
||||
version "3.2.45"
|
||||
resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.2.45.tgz#07ac83b8138550c83dfb50db43cde1e0e5e8124d"
|
||||
integrity sha512-BHVmzYAvM7vcU5WmuYqXpwaBHjsS8T63jlKGWVtHxAHIoMIlmaMyurUSEs1Zcg46M4AYT5MtB1U274/2aNzjJQ==
|
||||
dependencies:
|
||||
"@vue/shared" "3.2.36"
|
||||
"@babel/parser" "^7.16.4"
|
||||
"@vue/compiler-core" "3.2.45"
|
||||
"@vue/shared" "3.2.45"
|
||||
estree-walker "^2.0.2"
|
||||
magic-string "^0.25.7"
|
||||
|
||||
"@vue/runtime-core@3.2.36":
|
||||
version "3.2.36"
|
||||
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.2.36.tgz#be5115e665679c26bf3807d2326675dc1d847134"
|
||||
integrity sha512-PTWBD+Lub+1U3/KhbCExrfxyS14hstLX+cBboxVHaz+kXoiDLNDEYAovPtxeTutbqtClIXtft+wcGdC+FUQ9qQ==
|
||||
"@vue/reactivity@3.2.45":
|
||||
version "3.2.45"
|
||||
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.2.45.tgz#412a45b574de601be5a4a5d9a8cbd4dee4662ff0"
|
||||
integrity sha512-PRvhCcQcyEVohW0P8iQ7HDcIOXRjZfAsOds3N99X/Dzewy8TVhTCT4uXpAHfoKjVTJRA0O0K+6QNkDIZAxNi3A==
|
||||
dependencies:
|
||||
"@vue/reactivity" "3.2.36"
|
||||
"@vue/shared" "3.2.36"
|
||||
"@vue/shared" "3.2.45"
|
||||
|
||||
"@vue/runtime-dom@3.2.36":
|
||||
version "3.2.36"
|
||||
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.2.36.tgz#cd5d403ea23c18ee7c17767103a1b2f8263c54bb"
|
||||
integrity sha512-gYPYblm7QXHVuBohqNRRT7Wez0f2Mx2D40rb4fleehrJU9CnkjG0phhcGEZFfGwCmHZRqBCRgbFWE98bPULqkg==
|
||||
"@vue/runtime-core@3.2.45":
|
||||
version "3.2.45"
|
||||
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.2.45.tgz#7ad7ef9b2519d41062a30c6fa001ec43ac549c7f"
|
||||
integrity sha512-gzJiTA3f74cgARptqzYswmoQx0fIA+gGYBfokYVhF8YSXjWTUA2SngRzZRku2HbGbjzB6LBYSbKGIaK8IW+s0A==
|
||||
dependencies:
|
||||
"@vue/runtime-core" "3.2.36"
|
||||
"@vue/shared" "3.2.36"
|
||||
"@vue/reactivity" "3.2.45"
|
||||
"@vue/shared" "3.2.45"
|
||||
|
||||
"@vue/runtime-dom@3.2.45":
|
||||
version "3.2.45"
|
||||
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.2.45.tgz#1a2ef6ee2ad876206fbbe2a884554bba2d0faf59"
|
||||
integrity sha512-cy88YpfP5Ue2bDBbj75Cb4bIEZUMM/mAkDMfqDTpUYVgTf/kuQ2VQ8LebuZ8k6EudgH8pYhsGWHlY0lcxlvTwA==
|
||||
dependencies:
|
||||
"@vue/runtime-core" "3.2.45"
|
||||
"@vue/shared" "3.2.45"
|
||||
csstype "^2.6.8"
|
||||
|
||||
"@vue/server-renderer@3.2.36":
|
||||
version "3.2.36"
|
||||
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.2.36.tgz#1e7c1cf63bd17df7828d04e8c780ee6ca7a9ed7c"
|
||||
integrity sha512-uZE0+jfye6yYXWvAQYeHZv+f50sRryvy16uiqzk3jn8hEY8zTjI+rzlmZSGoE915k+W/Ol9XSw6vxOUD8dGkUg==
|
||||
"@vue/server-renderer@3.2.45":
|
||||
version "3.2.45"
|
||||
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.2.45.tgz#ca9306a0c12b0530a1a250e44f4a0abac6b81f3f"
|
||||
integrity sha512-ebiMq7q24WBU1D6uhPK//2OTR1iRIyxjF5iVq/1a5I1SDMDyDu4Ts6fJaMnjrvD3MqnaiFkKQj+LKAgz5WIK3g==
|
||||
dependencies:
|
||||
"@vue/compiler-ssr" "3.2.36"
|
||||
"@vue/shared" "3.2.36"
|
||||
"@vue/compiler-ssr" "3.2.45"
|
||||
"@vue/shared" "3.2.45"
|
||||
|
||||
"@vue/shared@3.2.36":
|
||||
version "3.2.36"
|
||||
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.36.tgz#35e11200542cf29068ba787dad57da9bdb82f644"
|
||||
integrity sha512-JtB41wXl7Au3+Nl3gD16Cfpj7k/6aCroZ6BbOiCMFCMvrOpkg/qQUXTso2XowaNqBbnkuGHurLAqkLBxNGc1hQ==
|
||||
|
||||
"@vue/shared@3.2.45":
|
||||
version "3.2.45"
|
||||
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.45.tgz#a3fffa7489eafff38d984e23d0236e230c818bc2"
|
||||
integrity sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg==
|
||||
|
||||
"@vue/web-component-wrapper@^1.2.0":
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@vue/web-component-wrapper/-/web-component-wrapper-1.3.0.tgz#b6b40a7625429d2bd7c2281ddba601ed05dc7f1a"
|
||||
@ -2014,22 +2072,23 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0:
|
||||
dependencies:
|
||||
color-convert "^2.0.1"
|
||||
|
||||
ant-design-vue@^2.2.8:
|
||||
version "2.2.8"
|
||||
resolved "https://registry.yarnpkg.com/ant-design-vue/-/ant-design-vue-2.2.8.tgz#fa87cf6842d8ee9a0d8af393ff4099ecc4072f2b"
|
||||
integrity sha512-3graq9/gCfJQs6hznrHV6sa9oDmk/D1H3Oo0vLdVpPS/I61fZPk8NEyNKCHpNA6fT2cx6xx9U3QS63uuyikg/Q==
|
||||
ant-design-vue@3.2.14:
|
||||
version "3.2.14"
|
||||
resolved "https://registry.yarnpkg.com/ant-design-vue/-/ant-design-vue-3.2.14.tgz#04684ef9b855380059582a76bc9dd3c937f0fcc3"
|
||||
integrity sha512-v4qeZGpmONUOvz6lyp/fJVoVthqV16CiG1rGrUZVB2IgRjCy59y2/F+RA67ZSJmjGIvqsE+tLoPmjJ0HVXg9XA==
|
||||
dependencies:
|
||||
"@ant-design/icons-vue" "^6.0.0"
|
||||
"@ant-design/colors" "^6.0.0"
|
||||
"@ant-design/icons-vue" "^6.1.0"
|
||||
"@babel/runtime" "^7.10.5"
|
||||
"@ctrl/tinycolor" "^3.4.0"
|
||||
"@simonwep/pickr" "~1.8.0"
|
||||
array-tree-filter "^2.1.0"
|
||||
async-validator "^3.3.0"
|
||||
async-validator "^4.0.0"
|
||||
dayjs "^1.10.5"
|
||||
dom-align "^1.12.1"
|
||||
dom-scroll-into-view "^2.0.0"
|
||||
lodash "^4.17.21"
|
||||
lodash-es "^4.17.15"
|
||||
moment "^2.27.0"
|
||||
omit.js "^2.0.0"
|
||||
resize-observer-polyfill "^1.5.1"
|
||||
scroll-into-view-if-needed "^2.2.25"
|
||||
shallow-equal "^1.0.0"
|
||||
@ -2192,10 +2251,10 @@ async-limiter@~1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd"
|
||||
integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==
|
||||
|
||||
async-validator@^3.3.0:
|
||||
version "3.5.2"
|
||||
resolved "https://registry.yarnpkg.com/async-validator/-/async-validator-3.5.2.tgz#68e866a96824e8b2694ff7a831c1a25c44d5e500"
|
||||
integrity sha512-8eLCg00W9pIRZSB781UUX/H6Oskmm8xloZfr09lz5bikRpBVDlJ3hRVuxxP1SxcwsEYfJ4IU8Q19Y8/893r3rQ==
|
||||
async-validator@^4.0.0:
|
||||
version "4.2.5"
|
||||
resolved "https://registry.yarnpkg.com/async-validator/-/async-validator-4.2.5.tgz#c96ea3332a521699d0afaaceed510a54656c6339"
|
||||
integrity sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==
|
||||
|
||||
async@^2.6.2:
|
||||
version "2.6.4"
|
||||
@ -3425,6 +3484,11 @@ dashdash@^1.12.0:
|
||||
dependencies:
|
||||
assert-plus "^1.0.0"
|
||||
|
||||
dayjs@^1.10.5:
|
||||
version "1.11.7"
|
||||
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2"
|
||||
integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==
|
||||
|
||||
debug@2.6.9, debug@^2.2.0, debug@^2.3.3:
|
||||
version "2.6.9"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
||||
@ -6225,11 +6289,6 @@ mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.1:
|
||||
dependencies:
|
||||
minimist "^1.2.6"
|
||||
|
||||
moment@^2.27.0:
|
||||
version "2.29.3"
|
||||
resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.3.tgz#edd47411c322413999f7a5940d526de183c031f3"
|
||||
integrity sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw==
|
||||
|
||||
move-concurrently@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92"
|
||||
@ -6552,11 +6611,6 @@ obuf@^1.0.0, obuf@^1.1.2:
|
||||
resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e"
|
||||
integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==
|
||||
|
||||
omit.js@^2.0.0:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/omit.js/-/omit.js-2.0.2.tgz#dd9b8436fab947a5f3ff214cb2538631e313ec2f"
|
||||
integrity sha512-hJmu9D+bNB40YpL9jYebQl4lsTW6yEHRTroJzNLqQJYHm7c+NQnJGfZmIWh8S3q3KoaxV1aLhV6B3+0N0/kyJg==
|
||||
|
||||
on-finished@2.4.1:
|
||||
version "2.4.1"
|
||||
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f"
|
||||
@ -9086,16 +9140,16 @@ vue-types@^3.0.0:
|
||||
dependencies:
|
||||
is-plain-object "3.0.1"
|
||||
|
||||
vue@^3.0.0:
|
||||
version "3.2.36"
|
||||
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.36.tgz#8daa996e2ced521708de97d066c7c998e8bc3378"
|
||||
integrity sha512-5yTXmrE6gW8IQgttzHW5bfBiFA6mx35ZXHjGLDmKYzW6MMmYvCwuKybANRepwkMYeXw2v1buGg3/lPICY5YlZw==
|
||||
vue@3.2.45:
|
||||
version "3.2.45"
|
||||
resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.45.tgz#94a116784447eb7dbd892167784619fef379b3c8"
|
||||
integrity sha512-9Nx/Mg2b2xWlXykmCwiTUCWHbWIj53bnkizBxKai1g61f2Xit700A1ljowpTIM11e3uipOeiPcSqnmBg6gyiaA==
|
||||
dependencies:
|
||||
"@vue/compiler-dom" "3.2.36"
|
||||
"@vue/compiler-sfc" "3.2.36"
|
||||
"@vue/runtime-dom" "3.2.36"
|
||||
"@vue/server-renderer" "3.2.36"
|
||||
"@vue/shared" "3.2.36"
|
||||
"@vue/compiler-dom" "3.2.45"
|
||||
"@vue/compiler-sfc" "3.2.45"
|
||||
"@vue/runtime-dom" "3.2.45"
|
||||
"@vue/server-renderer" "3.2.45"
|
||||
"@vue/shared" "3.2.45"
|
||||
|
||||
vuex@^4.0.0-0:
|
||||
version "4.0.2"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rubick",
|
||||
"version": "2.0.5",
|
||||
"version": "2.0.10",
|
||||
"author": "muwoo <2424880409@qq.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
@ -57,7 +57,7 @@
|
||||
"eslint-plugin-vue": "^7.0.0",
|
||||
"less": "^3.0.4",
|
||||
"less-loader": "^5.0.0",
|
||||
"prettier": "^2.2.1",
|
||||
"prettier": "^2.8.4",
|
||||
"typescript": "~4.1.5",
|
||||
"vue-cli-plugin-electron-builder": "~2.1.1",
|
||||
"worker-plugin": "^5.0.1"
|
||||
|
1
public/detach/css/app.2f947ac7.css
Normal file
1
public/detach/css/app.2f947ac7.css
Normal file
@ -0,0 +1 @@
|
||||
body,html{margin:0;padding:0;font-family:system-ui,PingFang SC,Helvetica Neue,Microsoft Yahei,sans-serif;-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:hidden}.detach{width:100%;height:56px;background:#eee;flex:1;display:flex;align-items:center;font-size:18px;padding-left:10px;font-weight:500;box-sizing:border-box;justify-content:space-between}.detach.darwin{padding-left:80px}.detach.darwin,.detach.win32{-webkit-app-region:drag}.detach img{width:36px;height:36px;margin-right:10px}.detach input{background-color:#fff;color:#333;width:360px;height:36px;line-height:36px;border-radius:4px;font-size:14px;border:none;padding:0 10px;outline:none;-webkit-app-region:no-drag}.detach input::-webkit-input-placeholder{color:#aaa;-webkit-user-select:none;user-select:none}.detach .info{display:flex;align-items:center}.handle{display:flex;-webkit-app-region:no-drag}.handle>div{width:36px;height:36px;border-radius:18px;cursor:pointer;margin-right:6px}.handle>div:hover{background-color:#dee2e6}.detach .devtool{background:50%/18px no-repeat url(../img/devtool.87e078f5.svg)}
|
@ -1 +0,0 @@
|
||||
body,html{margin:0;padding:0;font-family:system-ui,PingFang SC,Helvetica Neue,Microsoft Yahei,sans-serif;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden}.detach{width:100%;height:56px;background:#eee;flex:1;display:flex;align-items:center;font-size:18px;padding-left:10px;font-weight:500;box-sizing:border-box;justify-content:space-between}.detach.darwin{padding-left:80px}.detach.darwin,.detach.win32{-webkit-app-region:drag}.detach img{width:36px;height:36px;margin-right:10px}.detach input{background-color:#fff;color:#333;width:360px;height:36px;line-height:36px;border-radius:4px;font-size:14px;border:none;padding:0 10px;outline:none;-webkit-app-region:no-drag}.detach input::-webkit-input-placeholder{color:#aaa;-webkit-user-select:none;user-select:none}.detach .info{display:flex;align-items:center}.handle{display:flex;-webkit-app-region:no-drag}.handle>div{width:36px;height:36px;border-radius:18px;cursor:pointer;margin-right:6px}.handle>div:hover{background-color:#dee2e6}.detach .devtool{background:50%/18px no-repeat url(../img/devtool.87e078f5.svg)}
|
@ -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.9d15d34b.css" rel="preload" as="style"><link href="js/app.a7b22972.js" rel="preload" as="script"><link href="js/chunk-vendors.c073804a.js" rel="preload" as="script"><link href="css/app.9d15d34b.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.c073804a.js"></script><script src="js/app.a7b22972.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>detach</title><link href="css/app.2f947ac7.css" rel="preload" as="style"><link href="js/app.c42d4707.js" rel="preload" as="script"><link href="js/chunk-vendors.32f0b2e2.js" rel="preload" as="script"><link href="css/app.2f947ac7.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.32f0b2e2.js"></script><script src="js/app.c42d4707.js"></script></body></html>
|
@ -1,2 +0,0 @@
|
||||
(function(e){function t(t){for(var u,c,l=t[0],a=t[1],i=t[2],s=0,b=[];s<l.length;s++)c=l[s],Object.prototype.hasOwnProperty.call(r,c)&&r[c]&&b.push(r[c][0]),r[c]=0;for(u in a)Object.prototype.hasOwnProperty.call(a,u)&&(e[u]=a[u]);p&&p(t);while(b.length)b.shift()();return o.push.apply(o,i||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],u=!0,l=1;l<n.length;l++){var a=n[l];0!==r[a]&&(u=!1)}u&&(o.splice(t--,1),e=c(c.s=n[0]))}return e}var u={},r={app:0},o=[];function c(t){if(u[t])return u[t].exports;var n=u[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,c),n.l=!0,n.exports}c.m=e,c.c=u,c.d=function(e,t,n){c.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},c.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.t=function(e,t){if(1&t&&(e=c(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(c.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var u in e)c.d(n,u,function(t){return e[t]}.bind(null,u));return n},c.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return c.d(t,"a",t),t},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.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 p=a;o.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("cd49")},"146a":function(e,t,n){"use strict";n("6b62")},"6b62":function(e,t,n){},cd49:function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var u=n("7a23"),r=n("84a2"),o=n.n(r),c={class:"info"},l=["src"],a=["value","placeholder"],i={key:1},p={setup:function(e){var t=window.require("electron"),n=t.ipcRenderer,r=Object(u["f"])(window.process.platform),p=Object(u["f"])({}),s=Object(u["f"])(!1);window.initDetach=function(e){p.value=e,s.value=e.subInput&&(!!e.subInput.value||!!e.subInput.placeholder),console.log(s.value)};var b=o()((function(e){n.send("msg-trigger",{type:"detachInputChange",data:{text:e.target.value}})}),500),f=function(){n.send("msg-trigger",{type:"openPluginDevTools"})};return Object.assign(window,{setSubInputValue:function(e){var t=e.value;p.value.subInput.value=t},setSubInput:function(e){p.value.subInput.placeholder=e},removeSubInput:function(){p.value.subInput=null}}),function(e,t){var n,o;return Object(u["e"])(),Object(u["b"])("div",{class:Object(u["d"])([r.value,"detach"])},[Object(u["c"])("div",c,[Object(u["c"])("img",{src:p.value.logo},null,8,l),s.value?(Object(u["e"])(),Object(u["b"])("input",{key:0,autofocus:"",onInput:t[0]||(t[0]=function(){return Object(u["h"])(b)&&Object(u["h"])(b).apply(void 0,arguments)}),value:null===(n=p.value.subInput)||void 0===n?void 0:n.value,placeholder:null===(o=p.value.subInput)||void 0===o?void 0:o.placeholder},null,40,a)):(Object(u["e"])(),Object(u["b"])("span",i,Object(u["g"])(p.value.pluginName),1))]),Object(u["c"])("div",{class:"handle"},[Object(u["c"])("div",{class:"devtool",onClick:f,title:"开发者工具"})])],2)}}};n("146a");const s=p;var b=s;Object(u["a"])(b).mount("#app")}});
|
||||
//# sourceMappingURL=app.a7b22972.js.map
|
File diff suppressed because one or more lines are too long
2
public/detach/js/app.c42d4707.js
Normal file
2
public/detach/js/app.c42d4707.js
Normal file
@ -0,0 +1,2 @@
|
||||
(function(e){function t(t){for(var u,l,a=t[0],c=t[1],p=t[2],s=0,b=[];s<a.length;s++)l=a[s],Object.prototype.hasOwnProperty.call(r,l)&&r[l]&&b.push(r[l][0]),r[l]=0;for(u in c)Object.prototype.hasOwnProperty.call(c,u)&&(e[u]=c[u]);i&&i(t);while(b.length)b.shift()();return o.push.apply(o,p||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],u=!0,a=1;a<n.length;a++){var c=n[a];0!==r[c]&&(u=!1)}u&&(o.splice(t--,1),e=l(l.s=n[0]))}return e}var u={},r={app:0},o=[];function l(t){if(u[t])return u[t].exports;var n=u[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,l),n.l=!0,n.exports}l.m=e,l.c=u,l.d=function(e,t,n){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,t){if(1&t&&(e=l(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(l.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var u in e)l.d(n,u,function(t){return e[t]}.bind(null,u));return n},l.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="";var a=window["webpackJsonp"]=window["webpackJsonp"]||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var p=0;p<a.length;p++)t(a[p]);var i=c;o.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("cd49")},"146a":function(e,t,n){"use strict";n("6b62")},"6b62":function(e,t,n){},cd49:function(e,t,n){"use strict";n.r(t);var u=n("7a23"),r=n("84a2"),o=n.n(r);const l={class:"info"},a=["src"],c=["value","placeholder"],p={key:1};var i={__name:"App",setup(e){const{ipcRenderer:t}=window.require("electron"),n=Object(u["f"])(window.process.platform),r=Object(u["f"])({}),i=Object(u["f"])(!1);window.initDetach=e=>{r.value=e,i.value=e.subInput&&(!!e.subInput.value||!!e.subInput.placeholder),console.log(i.value)};const s=o()(e=>{t.send("msg-trigger",{type:"detachInputChange",data:{text:e.target.value}})},500),b=()=>{t.send("msg-trigger",{type:"openPluginDevTools"})};return Object.assign(window,{setSubInputValue:({value:e})=>{r.value.subInput.value=e},setSubInput:e=>{r.value.subInput.placeholder=e},removeSubInput:()=>{r.value.subInput=null}}),(e,t)=>{var o,v;return Object(u["e"])(),Object(u["b"])("div",{class:Object(u["d"])([n.value,"detach"])},[Object(u["c"])("div",l,[Object(u["c"])("img",{src:r.value.logo},null,8,a),i.value?(Object(u["e"])(),Object(u["b"])("input",{key:0,autofocus:"",onInput:t[0]||(t[0]=(...e)=>Object(u["h"])(s)&&Object(u["h"])(s)(...e)),value:null===(o=r.value.subInput)||void 0===o?void 0:o.value,placeholder:null===(v=r.value.subInput)||void 0===v?void 0:v.placeholder},null,40,c)):(Object(u["e"])(),Object(u["b"])("span",p,Object(u["g"])(r.value.pluginName),1))]),Object(u["c"])("div",{class:"handle"},[Object(u["c"])("div",{class:"devtool",onClick:b,title:"开发者工具"})])],2)}}};n("146a");const s=i;var b=s;Object(u["a"])(b).mount("#app")}});
|
||||
//# sourceMappingURL=app.c42d4707.js.map
|
1
public/detach/js/app.c42d4707.js.map
Normal file
1
public/detach/js/app.c42d4707.js.map
Normal file
File diff suppressed because one or more lines are too long
2
public/detach/js/chunk-vendors.32f0b2e2.js
Normal file
2
public/detach/js/chunk-vendors.32f0b2e2.js
Normal file
File diff suppressed because one or more lines are too long
1
public/detach/js/chunk-vendors.32f0b2e2.js.map
Normal file
1
public/detach/js/chunk-vendors.32f0b2e2.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
public/feature/css/app.33ea408c.css
Normal file
2
public/feature/css/app.33ea408c.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 @@
|
||||
<!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/app.efef6e76.css" rel="preload" as="style"><link href="js/app.b6f0fed9.js" rel="preload" as="script"><link href="js/chunk-vendors.335eb4e0.js" rel="preload" as="script"><link href="css/app.efef6e76.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.335eb4e0.js"></script><script src="js/app.b6f0fed9.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/app.33ea408c.css" rel="preload" as="style"><link href="js/app.7a04015c.js" rel="preload" as="script"><link href="js/chunk-vendors.53eaec48.js" rel="preload" as="script"><link href="css/app.33ea408c.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.53eaec48.js"></script><script src="js/app.7a04015c.js"></script></body></html>
|
2
public/feature/js/app.7a04015c.js
Normal file
2
public/feature/js/app.7a04015c.js
Normal file
File diff suppressed because one or more lines are too long
1
public/feature/js/app.7a04015c.js.map
Normal file
1
public/feature/js/app.7a04015c.js.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
11
public/feature/js/chunk-vendors.53eaec48.js
Normal file
11
public/feature/js/chunk-vendors.53eaec48.js
Normal file
File diff suppressed because one or more lines are too long
1
public/feature/js/chunk-vendors.53eaec48.js.map
Normal file
1
public/feature/js/chunk-vendors.53eaec48.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -1,19 +1,19 @@
|
||||
const { ipcRenderer, shell } = require("electron");
|
||||
const os = require("os");
|
||||
const { ipcRenderer, shell } = require('electron');
|
||||
const os = require('os');
|
||||
|
||||
const ipcSendSync = (type, data) => {
|
||||
const returnValue = ipcRenderer.sendSync("msg-trigger", {
|
||||
const returnValue = ipcRenderer.sendSync('msg-trigger', {
|
||||
type,
|
||||
data
|
||||
data,
|
||||
});
|
||||
if (returnValue instanceof Error) throw returnValue;
|
||||
return returnValue;
|
||||
};
|
||||
|
||||
const ipcSend = (type, data) => {
|
||||
ipcRenderer.send("msg-trigger", {
|
||||
ipcRenderer.send('msg-trigger', {
|
||||
type,
|
||||
data
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
@ -22,99 +22,99 @@ window.rubick = {
|
||||
// 事件
|
||||
onPluginEnter(cb) {
|
||||
console.log(window.rubick.hooks);
|
||||
typeof cb === "function" && (window.rubick.hooks.onPluginEnter = cb);
|
||||
typeof cb === 'function' && (window.rubick.hooks.onPluginEnter = cb);
|
||||
},
|
||||
onPluginReady(cb) {
|
||||
typeof cb === "function" && (window.rubick.hooks.onPluginReady = cb);
|
||||
typeof cb === 'function' && (window.rubick.hooks.onPluginReady = cb);
|
||||
},
|
||||
onPluginOut(cb) {
|
||||
typeof cb === "function" && (window.rubick.hooks.onPluginOut = cb);
|
||||
typeof cb === 'function' && (window.rubick.hooks.onPluginOut = cb);
|
||||
},
|
||||
openPlugin(plugin) {
|
||||
ipcSendSync("loadPlugin", plugin);
|
||||
ipcSendSync('loadPlugin', plugin);
|
||||
},
|
||||
// 窗口交互
|
||||
hideMainWindow() {
|
||||
ipcSendSync("hideMainWindow");
|
||||
ipcSendSync('hideMainWindow');
|
||||
},
|
||||
showMainWindow() {
|
||||
ipcSendSync("showMainWindow");
|
||||
ipcSendSync('showMainWindow');
|
||||
},
|
||||
showOpenDialog(options) {
|
||||
ipcSendSync("showOpenDialog", options);
|
||||
ipcSendSync('showOpenDialog', options);
|
||||
},
|
||||
setExpendHeight(height) {
|
||||
ipcSendSync("setExpendHeight", height);
|
||||
ipcSendSync('setExpendHeight', height);
|
||||
},
|
||||
setSubInput(onChange, placeholder = "", isFocus) {
|
||||
typeof onChange === "function" &&
|
||||
setSubInput(onChange, placeholder = '', isFocus) {
|
||||
typeof onChange === 'function' &&
|
||||
(window.rubick.hooks.onSubInputChange = onChange);
|
||||
ipcSendSync("setSubInput", {
|
||||
ipcSendSync('setSubInput', {
|
||||
placeholder,
|
||||
isFocus
|
||||
isFocus,
|
||||
});
|
||||
},
|
||||
removeSubInput() {
|
||||
delete window.rubick.hooks.onSubInputChange;
|
||||
ipcSendSync("removeSubInput");
|
||||
ipcSendSync('removeSubInput');
|
||||
},
|
||||
setSubInputValue(text) {
|
||||
ipcSendSync("setSubInputValue", { text });
|
||||
ipcSendSync('setSubInputValue', { text });
|
||||
},
|
||||
subInputBlur() {
|
||||
ipcSendSync("subInputBlur");
|
||||
ipcSendSync('subInputBlur');
|
||||
},
|
||||
getPath(name) {
|
||||
return ipcSendSync("getPath", { name });
|
||||
return ipcSendSync('getPath', { name });
|
||||
},
|
||||
showNotification(body, clickFeatureCode) {
|
||||
ipcSend("showNotification", { body, clickFeatureCode });
|
||||
ipcSend('showNotification', { body, clickFeatureCode });
|
||||
},
|
||||
copyImage(img) {
|
||||
return ipcSendSync("copyImage", { img });
|
||||
return ipcSendSync('copyImage', { img });
|
||||
},
|
||||
copyText(text) {
|
||||
return ipcSendSync("copyText", { text });
|
||||
return ipcSendSync('copyText', { text });
|
||||
},
|
||||
copyFile: file => {
|
||||
return ipcSendSync("copyFile", { file });
|
||||
copyFile: (file) => {
|
||||
return ipcSendSync('copyFile', { file });
|
||||
},
|
||||
db: {
|
||||
put: data => ipcSendSync("dbPut", { data }),
|
||||
get: id => ipcSendSync("dbGet", { id }),
|
||||
remove: doc => ipcSendSync("dbRemove", { doc }),
|
||||
bulkDocs: docs => ipcSendSync("dbBulkDocs", { docs }),
|
||||
allDocs: key => ipcSendSync("dbAllDocs", { key })
|
||||
put: (data) => ipcSendSync('dbPut', { data }),
|
||||
get: (id) => ipcSendSync('dbGet', { id }),
|
||||
remove: (doc) => ipcSendSync('dbRemove', { doc }),
|
||||
bulkDocs: (docs) => ipcSendSync('dbBulkDocs', { docs }),
|
||||
allDocs: (key) => ipcSendSync('dbAllDocs', { key }),
|
||||
},
|
||||
dbStorage: {
|
||||
setItem: (key, value) => {
|
||||
const target = { _id: String(key) };
|
||||
const result = ipcSendSync("dbGet", { id: target._id });
|
||||
const result = ipcSendSync('dbGet', { id: target._id });
|
||||
result && (target._rev = result._rev);
|
||||
target.value = value;
|
||||
const res = ipcSendSync("dbPut", { data: target });
|
||||
const res = ipcSendSync('dbPut', { data: target });
|
||||
if (res.error) throw new Error(res.message);
|
||||
},
|
||||
getItem: key => {
|
||||
const res = ipcSendSync("dbGet", { id: key });
|
||||
return res && "value" in res ? res.value : null;
|
||||
getItem: (key) => {
|
||||
const res = ipcSendSync('dbGet', { id: key });
|
||||
return res && 'value' in res ? res.value : null;
|
||||
},
|
||||
removeItem: (key) => {
|
||||
const res = ipcSendSync('dbGet', { id: key });
|
||||
res && ipcSendSync('dbRemove', { doc: res });
|
||||
},
|
||||
removeItem: key => {
|
||||
const res = ipcSendSync("dbGet", { id: key });
|
||||
res && ipcSendSync("dbRemove", { doc: res });
|
||||
}
|
||||
},
|
||||
isDarkColors() {
|
||||
return false;
|
||||
},
|
||||
getFeatures() {
|
||||
return ipcSendSync("getFeatures");
|
||||
return ipcSendSync('getFeatures');
|
||||
},
|
||||
setFeature(feature) {
|
||||
return ipcSendSync("setFeature", { feature });
|
||||
return ipcSendSync('setFeature', { feature });
|
||||
},
|
||||
removeFeature(code) {
|
||||
return ipcSendSync("removeFeature", { code });
|
||||
return ipcSendSync('removeFeature', { code });
|
||||
},
|
||||
|
||||
// 系统
|
||||
@ -123,29 +123,29 @@ window.rubick = {
|
||||
},
|
||||
|
||||
isMacOs() {
|
||||
return os.type() === "Darwin";
|
||||
return os.type() === 'Darwin';
|
||||
},
|
||||
|
||||
isWindows() {
|
||||
return os.type() === "Windows_NT";
|
||||
return os.type() === 'Windows_NT';
|
||||
},
|
||||
|
||||
isLinux() {
|
||||
return os.type() === "Linux";
|
||||
return os.type() === 'Linux';
|
||||
},
|
||||
|
||||
shellOpenPath(path) {
|
||||
shell.openPath(path);
|
||||
},
|
||||
|
||||
getLocalId: () => ipcSendSync("getLocalId"),
|
||||
getLocalId: () => ipcSendSync('getLocalId'),
|
||||
|
||||
removePlugin() {
|
||||
ipcSend("removePlugin");
|
||||
ipcSend('removePlugin');
|
||||
},
|
||||
|
||||
shellShowItemInFolder: path => {
|
||||
ipcSend("shellShowItemInFolder", { path });
|
||||
shellShowItemInFolder: (path) => {
|
||||
ipcSend('shellShowItemInFolder', { path });
|
||||
},
|
||||
|
||||
redirect: (label, payload) => {
|
||||
@ -153,6 +153,6 @@ window.rubick = {
|
||||
},
|
||||
|
||||
shellBeep: () => {
|
||||
ipcSend("shellBeep")
|
||||
ipcSend('shellBeep');
|
||||
},
|
||||
};
|
||||
|
@ -16,7 +16,7 @@ export default function getCopyFiles(): Array<any> | null {
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
} else if (commonConst.windows()) {
|
||||
} else if (process.platform === "win32") {
|
||||
/* eslint-disable */
|
||||
const clipboardEx = require("electron-clipboard-ex");
|
||||
fileInfo = clipboardEx.readFilePaths();
|
||||
|
@ -1,14 +1,14 @@
|
||||
import {
|
||||
AdapterHandlerOptions,
|
||||
AdapterInfo,
|
||||
} from "@/core/plugin-handler/types";
|
||||
import fs from "fs-extra";
|
||||
import path from "path";
|
||||
import got from "got";
|
||||
import fixPath from "fix-path";
|
||||
} from '@/core/plugin-handler/types';
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
import got from 'got';
|
||||
import fixPath from 'fix-path';
|
||||
|
||||
import spawn from "cross-spawn";
|
||||
import { ipcRenderer } from "electron";
|
||||
import spawn from 'cross-spawn';
|
||||
import { ipcRenderer } from 'electron';
|
||||
|
||||
fixPath();
|
||||
|
||||
@ -38,18 +38,18 @@ class AdapterHandler {
|
||||
}
|
||||
this.baseDir = options.baseDir;
|
||||
|
||||
let register = options.registry || "https://registry.npm.taobao.org";
|
||||
let register = options.registry || 'https://registry.npm.taobao.org';
|
||||
|
||||
try {
|
||||
const dbdata = ipcRenderer.sendSync("msg-trigger", {
|
||||
type: "dbGet",
|
||||
data: { id: "rubick-localhost-config" },
|
||||
const dbdata = ipcRenderer.sendSync('msg-trigger', {
|
||||
type: 'dbGet',
|
||||
data: { id: 'rubick-localhost-config' },
|
||||
});
|
||||
register = dbdata.data.register;
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
this.registry = register || "https://registry.npm.taobao.org";
|
||||
this.registry = register || 'https://registry.npm.taobao.org';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,11 +65,11 @@ class AdapterHandler {
|
||||
let adapterInfo: AdapterInfo;
|
||||
const infoPath =
|
||||
adapterPath ||
|
||||
path.resolve(this.baseDir, "node_modules", adapter, "plugin.json");
|
||||
path.resolve(this.baseDir, 'node_modules', adapter, 'plugin.json');
|
||||
// 从本地获取
|
||||
if (await fs.pathExists(infoPath)) {
|
||||
adapterInfo = JSON.parse(
|
||||
fs.readFileSync(infoPath, "utf-8")
|
||||
fs.readFileSync(infoPath, 'utf-8')
|
||||
) as AdapterInfo;
|
||||
} else {
|
||||
// 本地没有从远程获取
|
||||
@ -84,7 +84,7 @@ class AdapterHandler {
|
||||
|
||||
// 安装并启动插件
|
||||
async install(adapters: Array<string>, options: { isDev: boolean }) {
|
||||
const installCmd = options.isDev ? "link" : "install";
|
||||
const installCmd = options.isDev ? 'link' : 'install';
|
||||
// 安装
|
||||
await this.execCommand(installCmd, adapters);
|
||||
}
|
||||
@ -95,7 +95,7 @@ class AdapterHandler {
|
||||
* @memberof AdapterHandler
|
||||
*/
|
||||
async update(...adapters: string[]) {
|
||||
await this.execCommand("update", adapters);
|
||||
await this.execCommand('update', adapters);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -105,7 +105,7 @@ class AdapterHandler {
|
||||
* @memberof AdapterHandler
|
||||
*/
|
||||
async uninstall(adapters: string[], options: { isDev: boolean }) {
|
||||
const installCmd = options.isDev ? "unlink" : "uninstall";
|
||||
const installCmd = options.isDev ? 'unlink' : 'uninstall';
|
||||
// 卸载插件
|
||||
await this.execCommand(installCmd, adapters);
|
||||
}
|
||||
@ -116,7 +116,7 @@ class AdapterHandler {
|
||||
*/
|
||||
async list() {
|
||||
const installInfo = JSON.parse(
|
||||
await fs.readFile(`${this.baseDir}/package.json`, "utf-8")
|
||||
await fs.readFile(`${this.baseDir}/package.json`, 'utf-8')
|
||||
);
|
||||
const adapters: string[] = [];
|
||||
for (const adapter in installInfo.dependencies) {
|
||||
@ -124,37 +124,45 @@ class AdapterHandler {
|
||||
}
|
||||
return adapters;
|
||||
}
|
||||
private cleanCache() {
|
||||
spawn('npm', ['cache', 'clean', '-f'], {
|
||||
cwd: this.baseDir,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 运行包管理器
|
||||
* @memberof AdapterHandler
|
||||
*/
|
||||
private async execCommand(cmd: string, modules: string[]): Promise<string> {
|
||||
this.cleanCache();
|
||||
return new Promise((resolve: any, reject: any) => {
|
||||
let args: string[] = [cmd]
|
||||
.concat(modules)
|
||||
.concat("--color=always")
|
||||
.concat("--save");
|
||||
if (cmd !== "uninstall")
|
||||
.concat(
|
||||
cmd !== 'uninstall' ? modules.map((m) => `${m}@latest`) : modules
|
||||
)
|
||||
.concat('--color=always')
|
||||
.concat('--save');
|
||||
if (cmd !== 'uninstall')
|
||||
args = args.concat(`--registry=${this.registry}`);
|
||||
const npm = spawn("npm", args, {
|
||||
const npm = spawn('npm', args, {
|
||||
cwd: this.baseDir,
|
||||
});
|
||||
|
||||
let output = "";
|
||||
let output = '';
|
||||
npm.stdout
|
||||
.on("data", (data: string) => {
|
||||
.on('data', (data: string) => {
|
||||
output += data; // 获取输出日志
|
||||
})
|
||||
.pipe(process.stdout);
|
||||
|
||||
npm.stderr
|
||||
.on("data", (data: string) => {
|
||||
.on('data', (data: string) => {
|
||||
output += data; // 获取报错日志
|
||||
})
|
||||
.pipe(process.stderr);
|
||||
|
||||
npm.on("close", (code: number) => {
|
||||
npm.on('close', (code: number) => {
|
||||
if (!code) {
|
||||
resolve({ code: 0, data: output }); // 如果没有报错就输出正常日志
|
||||
} else {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { app, BrowserWindow, protocol } from "electron";
|
||||
import path from "path";
|
||||
import { app, BrowserWindow, protocol } from 'electron';
|
||||
import path from 'path';
|
||||
export default () => {
|
||||
let win: any;
|
||||
|
||||
@ -12,7 +12,7 @@ export default () => {
|
||||
height: viewInfo.height,
|
||||
width: viewInfo.width,
|
||||
autoHideMenuBar: true,
|
||||
titleBarStyle: "hidden",
|
||||
titleBarStyle: 'hidden',
|
||||
trafficLightPosition: { x: 12, y: 21 },
|
||||
title: pluginInfo.pluginName,
|
||||
resizable: true,
|
||||
@ -32,22 +32,34 @@ export default () => {
|
||||
});
|
||||
if (process.env.WEBPACK_DEV_SERVER_URL) {
|
||||
// Load the url of the dev server if in development mode
|
||||
win.loadURL("http://localhost:8082");
|
||||
win.loadURL('http://localhost:8082');
|
||||
} else {
|
||||
win.loadURL(`file://${path.join(__static, "./detach/index.html")}`);
|
||||
win.loadURL(`file://${path.join(__static, './detach/index.html')}`);
|
||||
}
|
||||
|
||||
win.on("closed", () => {
|
||||
win.on('close', () => {
|
||||
executeHooks('PluginOut', null);
|
||||
});
|
||||
win.on('closed', () => {
|
||||
win = undefined;
|
||||
});
|
||||
|
||||
win.once("ready-to-show", () => {
|
||||
win.once('ready-to-show', () => {
|
||||
win.setBrowserView(view);
|
||||
win.webContents.executeJavaScript(
|
||||
`window.initDetach(${JSON.stringify(pluginInfo)})`
|
||||
);
|
||||
win.show();
|
||||
});
|
||||
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' ) {
|
||||
try {
|
||||
window.rubick.hooks.on${hook}(${data ? JSON.stringify(data) : ''});
|
||||
} catch(e) {console.log(e)}
|
||||
}
|
||||
`;
|
||||
view.webContents.executeJavaScript(evalJs);
|
||||
};
|
||||
};
|
||||
|
||||
const getWindow = () => win;
|
||||
|
@ -1,19 +1,19 @@
|
||||
import { BrowserView, BrowserWindow, session } from "electron";
|
||||
import path from "path";
|
||||
import commonConst from "../../common/utils/commonConst";
|
||||
import { PLUGIN_INSTALL_DIR as baseDir } from "@/common/constans/main";
|
||||
import { BrowserView, BrowserWindow, session } from 'electron';
|
||||
import path from 'path';
|
||||
import commonConst from '../../common/utils/commonConst';
|
||||
import { PLUGIN_INSTALL_DIR as baseDir } from '@/common/constans/main';
|
||||
|
||||
const getRelativePath = indexPath => {
|
||||
const getRelativePath = (indexPath) => {
|
||||
return commonConst.windows()
|
||||
? indexPath.replace("file://", "")
|
||||
: indexPath.replace("file:", "");
|
||||
? indexPath.replace('file://', '')
|
||||
: indexPath.replace('file:', '');
|
||||
};
|
||||
|
||||
const getPreloadPath = (plugin, pluginIndexPath) => {
|
||||
const { name, preload, tplPath, indexPath } = plugin;
|
||||
if (!preload) return;
|
||||
if (commonConst.dev()) {
|
||||
if (name === "rubick-system-feature") {
|
||||
if (name === 'rubick-system-feature') {
|
||||
return path.resolve(__static, `../feature/public/preload.js`);
|
||||
}
|
||||
if (tplPath) {
|
||||
@ -37,15 +37,30 @@ export default () => {
|
||||
};
|
||||
|
||||
const createView = (plugin, window: BrowserWindow) => {
|
||||
let pluginIndexPath = plugin.tplPath || plugin.indexPath;
|
||||
const { tplPath, indexPath, development, name, main, pluginSetting, ext } =
|
||||
plugin;
|
||||
let pluginIndexPath = tplPath || indexPath;
|
||||
let preloadPath;
|
||||
let darkMode;
|
||||
if (!pluginIndexPath) {
|
||||
const pluginPath = path.resolve(baseDir, "node_modules", plugin.name);
|
||||
pluginIndexPath = `file://${path.join(pluginPath, "./", plugin.main)}`;
|
||||
// 开发环境
|
||||
if (commonConst.dev() && development) {
|
||||
pluginIndexPath = development;
|
||||
const pluginPath = path.resolve(baseDir, 'node_modules', name);
|
||||
preloadPath = `file://${path.join(pluginPath, './', main)}`;
|
||||
}
|
||||
const preload = getPreloadPath(plugin, pluginIndexPath);
|
||||
// 再尝试去找
|
||||
if (plugin.name === 'rubick-system-feature' && !pluginIndexPath) {
|
||||
pluginIndexPath = commonConst.dev()
|
||||
? 'http://localhost:8081/#/'
|
||||
: `file://${__static}/feature/index.html`;
|
||||
}
|
||||
if (!pluginIndexPath) {
|
||||
const pluginPath = path.resolve(baseDir, 'node_modules', name);
|
||||
pluginIndexPath = `file://${path.join(pluginPath, './', main)}`;
|
||||
}
|
||||
const preload = getPreloadPath(plugin, preloadPath || pluginIndexPath);
|
||||
|
||||
const ses = session.fromPartition("<" + plugin.name + ">");
|
||||
const ses = session.fromPartition('<' + name + '>');
|
||||
ses.setPreloads([`${__static}/preload.js`]);
|
||||
|
||||
view = new BrowserView({
|
||||
@ -57,17 +72,18 @@ export default () => {
|
||||
devTools: true,
|
||||
webviewTag: true,
|
||||
preload,
|
||||
session: ses
|
||||
}
|
||||
session: ses,
|
||||
},
|
||||
});
|
||||
window.setBrowserView(view);
|
||||
view.webContents.loadURL(pluginIndexPath);
|
||||
view.webContents.once("dom-ready", () => {
|
||||
window.setSize(800, 660);
|
||||
view.setBounds({ x: 0, y: 60, width: 800, height: 600 });
|
||||
view.webContents.once('dom-ready', () => {
|
||||
const height = pluginSetting && pluginSetting.height;
|
||||
window.setSize(800, height || 660);
|
||||
view.setBounds({ x: 0, y: 60, width: 800, height: height || 660 });
|
||||
view.setAutoResize({ width: true });
|
||||
executeHooks("PluginEnter", plugin.ext);
|
||||
executeHooks("PluginReady", plugin.ext);
|
||||
executeHooks('PluginEnter', plugin.ext);
|
||||
executeHooks('PluginReady', plugin.ext);
|
||||
darkMode = global.OP_CONFIG.get().perf.common.darkMode;
|
||||
darkMode &&
|
||||
view.webContents.executeJavaScript(
|
||||
@ -79,7 +95,7 @@ export default () => {
|
||||
view.webContents.session.webRequest.onBeforeSendHeaders(
|
||||
(details, callback) => {
|
||||
callback({
|
||||
requestHeaders: { referer: "*", ...details.requestHeaders }
|
||||
requestHeaders: { referer: '*', ...details.requestHeaders },
|
||||
});
|
||||
}
|
||||
);
|
||||
@ -88,9 +104,9 @@ export default () => {
|
||||
(details, callback) => {
|
||||
callback({
|
||||
responseHeaders: {
|
||||
"Access-Control-Allow-Origin": ["*"],
|
||||
...details.responseHeaders
|
||||
}
|
||||
'Access-Control-Allow-Origin': ['*'],
|
||||
...details.responseHeaders,
|
||||
},
|
||||
});
|
||||
}
|
||||
);
|
||||
@ -100,7 +116,7 @@ export default () => {
|
||||
if (!view) return;
|
||||
window.removeBrowserView(view);
|
||||
window.setSize(800, 60);
|
||||
executeHooks("PluginOut", null);
|
||||
executeHooks('PluginOut', null);
|
||||
window.webContents.executeJavaScript(`window.initRubick()`);
|
||||
view = undefined;
|
||||
};
|
||||
@ -111,7 +127,7 @@ export default () => {
|
||||
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) : ""});
|
||||
window.rubick.hooks.on${hook}(${data ? JSON.stringify(data) : ''});
|
||||
} catch(e) {}
|
||||
}
|
||||
`;
|
||||
@ -122,6 +138,6 @@ export default () => {
|
||||
init,
|
||||
getView,
|
||||
removeView,
|
||||
executeHooks
|
||||
executeHooks,
|
||||
};
|
||||
};
|
||||
|
@ -6,27 +6,27 @@ import {
|
||||
Notification,
|
||||
nativeImage,
|
||||
clipboard,
|
||||
shell
|
||||
} from "electron";
|
||||
import { runner, detach } from "../browsers";
|
||||
import fs from "fs";
|
||||
import { LocalDb } from "@/core";
|
||||
import plist from "plist";
|
||||
import { DECODE_KEY } from "@/common/constans/main";
|
||||
import mainInstance from "../index";
|
||||
shell,
|
||||
} from 'electron';
|
||||
import { runner, detach } from '../browsers';
|
||||
import fs from 'fs';
|
||||
import { LocalDb } from '@/core';
|
||||
import plist from 'plist';
|
||||
import { DECODE_KEY } from '@/common/constans/main';
|
||||
import mainInstance from '../index';
|
||||
const runnerInstance = runner();
|
||||
const detachInstance = detach();
|
||||
const dbInstance = new LocalDb(app.getPath("userData"));
|
||||
const dbInstance = new LocalDb(app.getPath('userData'));
|
||||
|
||||
dbInstance.init();
|
||||
|
||||
class API {
|
||||
public currentPlugin: null | any = null;
|
||||
private DBKEY = "RUBICK_DB_DEFAULT";
|
||||
private DBKEY = 'RUBICK_DB_DEFAULT';
|
||||
|
||||
init(mainWindow: BrowserWindow) {
|
||||
// 响应 preload.js 事件
|
||||
ipcMain.on("msg-trigger", async (event, arg) => {
|
||||
ipcMain.on('msg-trigger', async (event, arg) => {
|
||||
const window = arg.winId ? BrowserWindow.fromId(arg.winId) : mainWindow;
|
||||
const data = await this[arg.type](arg, window, event);
|
||||
event.returnValue = data;
|
||||
@ -41,9 +41,9 @@ class API {
|
||||
};
|
||||
|
||||
public __EscapeKeyDown = (event, input, window) => {
|
||||
if (input.type !== "keyDown") return;
|
||||
if (input.type !== 'keyDown') return;
|
||||
if (!(input.meta || input.control || input.shift || input.alt)) {
|
||||
if (input.key === "Escape") {
|
||||
if (input.key === 'Escape') {
|
||||
if (this.currentPlugin) {
|
||||
this.removePlugin(null, window);
|
||||
} else {
|
||||
@ -70,17 +70,17 @@ class API {
|
||||
this.currentPlugin = plugin;
|
||||
window.webContents.executeJavaScript(
|
||||
`window.setCurrentPlugin(${JSON.stringify({
|
||||
currentPlugin: this.currentPlugin
|
||||
currentPlugin: this.currentPlugin,
|
||||
})})`
|
||||
);
|
||||
window.show();
|
||||
// 按 ESC 退出插件
|
||||
window.webContents.on("before-input-event", (event, input) =>
|
||||
window.webContents.on('before-input-event', (event, input) =>
|
||||
this.__EscapeKeyDown(event, input, window)
|
||||
);
|
||||
runnerInstance
|
||||
.getView()
|
||||
.webContents.on("before-input-event", (event, input) =>
|
||||
.webContents.on('before-input-event', (event, input) =>
|
||||
this.__EscapeKeyDown(event, input, window)
|
||||
);
|
||||
}
|
||||
@ -91,7 +91,7 @@ class API {
|
||||
}
|
||||
|
||||
public openPluginDevTools() {
|
||||
runnerInstance.getView().webContents.openDevTools({ mode: "detach" });
|
||||
runnerInstance.getView().webContents.openDevTools({ mode: 'detach' });
|
||||
}
|
||||
|
||||
public hideMainWindow(arg, window) {
|
||||
@ -118,7 +118,7 @@ class API {
|
||||
if (!originWindow) return;
|
||||
originWindow.webContents.executeJavaScript(
|
||||
`window.setSubInput(${JSON.stringify({
|
||||
placeholder: data.placeholder
|
||||
placeholder: data.placeholder,
|
||||
})})`
|
||||
);
|
||||
}
|
||||
@ -128,7 +128,7 @@ class API {
|
||||
}
|
||||
|
||||
public sendSubInputChangeEvent({ data }) {
|
||||
runnerInstance.executeHooks("SubInputChange", data);
|
||||
runnerInstance.executeHooks('SubInputChange', data);
|
||||
}
|
||||
|
||||
public removeSubInput(data, window, e) {
|
||||
@ -142,7 +142,7 @@ class API {
|
||||
if (!originWindow) return;
|
||||
originWindow.webContents.executeJavaScript(
|
||||
`window.setSubInputValue(${JSON.stringify({
|
||||
value: data.text
|
||||
value: data.text,
|
||||
})})`
|
||||
);
|
||||
}
|
||||
@ -153,13 +153,13 @@ class API {
|
||||
|
||||
public showNotification({ data: { body } }) {
|
||||
if (!Notification.isSupported()) return;
|
||||
"string" != typeof body && (body = String(body));
|
||||
'string' != typeof body && (body = String(body));
|
||||
const plugin = this.currentPlugin;
|
||||
if (!plugin) return;
|
||||
const notify = new Notification({
|
||||
title: plugin.pluginName,
|
||||
body,
|
||||
icon: plugin.logo
|
||||
icon: plugin.logo,
|
||||
});
|
||||
notify.show();
|
||||
}
|
||||
@ -177,7 +177,7 @@ class API {
|
||||
public copyFile({ data }) {
|
||||
if (data.file && fs.existsSync(data.file)) {
|
||||
clipboard.writeBuffer(
|
||||
"NSFilenamesPboardType",
|
||||
'NSFilenamesPboardType',
|
||||
Buffer.from(plist.build([data.file]))
|
||||
);
|
||||
return true;
|
||||
@ -214,7 +214,7 @@ class API {
|
||||
...this.currentPlugin,
|
||||
features: (() => {
|
||||
let has = false;
|
||||
this.currentPlugin.features.some(feature => {
|
||||
this.currentPlugin.features.some((feature) => {
|
||||
has = feature.code === data.feature.code;
|
||||
return has;
|
||||
});
|
||||
@ -222,11 +222,11 @@ class API {
|
||||
return [...this.currentPlugin.features, data.feature];
|
||||
}
|
||||
return this.currentPlugin.features;
|
||||
})()
|
||||
})(),
|
||||
};
|
||||
window.webContents.executeJavaScript(
|
||||
`window.updatePlugin(${JSON.stringify({
|
||||
currentPlugin: this.currentPlugin
|
||||
currentPlugin: this.currentPlugin,
|
||||
})})`
|
||||
);
|
||||
return true;
|
||||
@ -235,16 +235,16 @@ class API {
|
||||
public removeFeature({ data }, window) {
|
||||
this.currentPlugin = {
|
||||
...this.currentPlugin,
|
||||
features: this.currentPlugin.features.filter(feature => {
|
||||
features: this.currentPlugin.features.filter((feature) => {
|
||||
if (data.code.type) {
|
||||
return feature.code.type !== data.code.type;
|
||||
}
|
||||
return feature.code !== data.code;
|
||||
})
|
||||
}),
|
||||
};
|
||||
window.webContents.executeJavaScript(
|
||||
`window.updatePlugin(${JSON.stringify({
|
||||
currentPlugin: this.currentPlugin
|
||||
currentPlugin: this.currentPlugin,
|
||||
})})`
|
||||
);
|
||||
return true;
|
||||
@ -255,14 +255,14 @@ class API {
|
||||
if (!code || !runnerInstance.getView()) return;
|
||||
if (modifiers.length > 0) {
|
||||
runnerInstance.getView().webContents.sendInputEvent({
|
||||
type: "keyDown",
|
||||
type: 'keyDown',
|
||||
modifiers,
|
||||
keyCode: code
|
||||
keyCode: code,
|
||||
});
|
||||
} else {
|
||||
runnerInstance.getView().webContents.sendInputEvent({
|
||||
type: "keyDown",
|
||||
keyCode: code
|
||||
type: 'keyDown',
|
||||
keyCode: code,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -273,11 +273,11 @@ class API {
|
||||
window.setBrowserView(null);
|
||||
window.webContents
|
||||
.executeJavaScript(`window.getMainInputInfo()`)
|
||||
.then(res => {
|
||||
.then((res) => {
|
||||
detachInstance.init(
|
||||
{
|
||||
...this.currentPlugin,
|
||||
subInput: res
|
||||
subInput: res,
|
||||
},
|
||||
window.getBounds(),
|
||||
view
|
||||
@ -293,7 +293,7 @@ class API {
|
||||
}
|
||||
|
||||
public getLocalId() {
|
||||
return encodeURIComponent(app.getPath("home"));
|
||||
return encodeURIComponent(app.getPath('home'));
|
||||
}
|
||||
|
||||
public shellShowItemInFolder({ data }) {
|
||||
|
@ -38,7 +38,6 @@ class App {
|
||||
this.onQuit();
|
||||
}
|
||||
}
|
||||
|
||||
beforeReady() {
|
||||
// 系统托盘
|
||||
if (commonConst.macOS()) {
|
||||
@ -55,7 +54,6 @@ class App {
|
||||
createWindow() {
|
||||
this.windowCreator.init();
|
||||
}
|
||||
|
||||
onReady() {
|
||||
const readyFunction = () => {
|
||||
this.createWindow();
|
||||
|
@ -36,13 +36,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { watch, ref, nextTick, toRaw } from "vue";
|
||||
import { ipcRenderer, remote } from "electron";
|
||||
import Result from "./components/result.vue";
|
||||
import Search from "./components/search.vue";
|
||||
import getWindowHeight from "../common/utils/getWindowHeight";
|
||||
import createPluginManager from "./plugins-manager";
|
||||
import commonConst from "@/common/utils/commonConst";
|
||||
import { watch, ref, nextTick, toRaw } from 'vue';
|
||||
import { ipcRenderer, remote } from 'electron';
|
||||
import Result from './components/result.vue';
|
||||
import Search from './components/search.vue';
|
||||
import getWindowHeight from '../common/utils/getWindowHeight';
|
||||
import createPluginManager from './plugins-manager';
|
||||
import commonConst from '@/common/utils/commonConst';
|
||||
|
||||
const {
|
||||
initPlugins,
|
||||
@ -59,35 +59,35 @@ const {
|
||||
clipboardFile,
|
||||
setSearchValue,
|
||||
clearClipboardFile,
|
||||
readClipboardContent
|
||||
readClipboardContent,
|
||||
} = createPluginManager();
|
||||
|
||||
initPlugins();
|
||||
|
||||
const currentSelect = ref(0);
|
||||
const menuPluginInfo = ref({});
|
||||
const menuPluginInfo: any = ref({});
|
||||
|
||||
getPluginInfo({
|
||||
pluginName: "feature",
|
||||
pluginName: 'feature',
|
||||
// eslint-disable-next-line no-undef
|
||||
pluginPath: `${__static}/feature/package.json`
|
||||
}).then(res => {
|
||||
pluginPath: `${__static}/feature/package.json`,
|
||||
}).then((res) => {
|
||||
menuPluginInfo.value = res;
|
||||
remote.getGlobal("LOCAL_PLUGINS").addPlugin(res);
|
||||
remote.getGlobal('LOCAL_PLUGINS').addPlugin(res);
|
||||
});
|
||||
|
||||
watch([options], () => {
|
||||
currentSelect.value = 0;
|
||||
if (currentPlugin.value.name) return;
|
||||
nextTick(() => {
|
||||
ipcRenderer.sendSync("msg-trigger", {
|
||||
type: "setExpendHeight",
|
||||
data: getWindowHeight(options.value)
|
||||
ipcRenderer.sendSync('msg-trigger', {
|
||||
type: 'setExpendHeight',
|
||||
data: getWindowHeight(options.value),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
const changeIndex = index => {
|
||||
const changeIndex = (index) => {
|
||||
if (!options.value.length) return;
|
||||
if (
|
||||
currentSelect.value + index > options.value.length - 1 ||
|
||||
@ -101,12 +101,12 @@ const openMenu = (ext) => {
|
||||
openPlugin({
|
||||
...toRaw(menuPluginInfo.value),
|
||||
feature: menuPluginInfo.value.features[0],
|
||||
cmd: "插件市场",
|
||||
ext
|
||||
cmd: '插件市场',
|
||||
ext,
|
||||
});
|
||||
};
|
||||
|
||||
window.rubick.openMenu = openMenu
|
||||
window.rubick.openMenu = openMenu;
|
||||
|
||||
const choosePlugin = () => {
|
||||
const currentChoose = options.value[currentSelect.value];
|
||||
@ -114,12 +114,12 @@ const choosePlugin = () => {
|
||||
};
|
||||
|
||||
const clearSearchValue = () => {
|
||||
setSearchValue("");
|
||||
setSearchValue('');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
@import "./assets/var.less";
|
||||
@import './assets/var.less';
|
||||
.drag-bar {
|
||||
-webkit-app-region: drag;
|
||||
width: 100%;
|
||||
@ -129,6 +129,7 @@ const clearSearchValue = () => {
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#components-layout {
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
@ -137,6 +138,7 @@ const clearSearchValue = () => {
|
||||
width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.drag {
|
||||
-webkit-app-region: drag;
|
||||
}
|
||||
|
@ -29,8 +29,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import BScroll from "@better-scroll/core";
|
||||
import { defineProps, onMounted, ref } from "vue";
|
||||
import BScroll from '@better-scroll/core';
|
||||
import { defineProps, onMounted, ref } from 'vue';
|
||||
|
||||
const scrollDom = ref(null);
|
||||
|
||||
onMounted(() => {
|
||||
@ -40,32 +41,32 @@ onMounted(() => {
|
||||
const props = defineProps({
|
||||
searchValue: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
default: '',
|
||||
},
|
||||
options: {
|
||||
type: Array,
|
||||
default: (() => [])()
|
||||
default: (() => [])(),
|
||||
},
|
||||
currentSelect: {
|
||||
type: Number,
|
||||
default: 0
|
||||
default: 0,
|
||||
},
|
||||
currentPlugin: {},
|
||||
clipboardFile: (() => [])()
|
||||
clipboardFile: (() => [])(),
|
||||
});
|
||||
|
||||
const renderTitle = title => {
|
||||
if (typeof title !== "string") return;
|
||||
const renderTitle = (title) => {
|
||||
if (typeof title !== 'string') return;
|
||||
if (!props.searchValue) return title;
|
||||
const result = title.toLowerCase().split(props.searchValue.toLowerCase());
|
||||
if (result && result.length > 1) {
|
||||
return `<div>${result[0]}<span style="color: red">${props.searchValue}</span>${result[1]}</div>`;
|
||||
return `<div>${result[0]}<span style='color: red'>${props.searchValue}</span>${result[1]}</div>`;
|
||||
} else {
|
||||
return `<div>${result[0]}</div>`;
|
||||
}
|
||||
};
|
||||
|
||||
const renderDesc = desc => {
|
||||
const renderDesc = (desc) => {
|
||||
if (desc.length > 80) {
|
||||
return `${desc.substr(0, 63)}...${desc.substr(
|
||||
desc.length - 14,
|
||||
@ -75,7 +76,7 @@ const renderDesc = desc => {
|
||||
return desc;
|
||||
};
|
||||
|
||||
const sort = options => {
|
||||
const sort = (options) => {
|
||||
for (let i = 0; i < options.length; i++) {
|
||||
for (let j = i + 1; j < options.length; j++) {
|
||||
if (options[j].zIndex > options[i].zIndex) {
|
||||
@ -96,7 +97,7 @@ const sort = options => {
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 99;
|
||||
max-height: calc(~"100vh - 64px");
|
||||
max-height: calc(~'100vh - 64px');
|
||||
overflow: auto;
|
||||
background: var(--color-body-bg);
|
||||
.op-item {
|
||||
|
@ -51,10 +51,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps, defineEmits, ref, computed } from "vue";
|
||||
import { ipcRenderer, remote } from "electron";
|
||||
import { LoadingOutlined, MoreOutlined } from "@ant-design/icons-vue";
|
||||
const opConfig = remote.getGlobal("OP_CONFIG");
|
||||
import { defineProps, defineEmits, ref } from 'vue';
|
||||
import { ipcRenderer, remote } from 'electron';
|
||||
import { LoadingOutlined, MoreOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
const opConfig = remote.getGlobal('OP_CONFIG');
|
||||
const { Menu } = remote;
|
||||
|
||||
const config = ref(opConfig.get());
|
||||
@ -62,63 +63,63 @@ const config = ref(opConfig.get());
|
||||
const props: any = defineProps({
|
||||
searchValue: {
|
||||
type: [String, Number],
|
||||
default: ""
|
||||
default: '',
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: ""
|
||||
default: '',
|
||||
},
|
||||
currentPlugin: {},
|
||||
pluginLoading: Boolean,
|
||||
clipboardFile: (() => [])()
|
||||
clipboardFile: (() => [])(),
|
||||
});
|
||||
|
||||
const changeValue = e => {
|
||||
if (props.currentPlugin.name === "rubick-system-feature") return;
|
||||
if (props.currentPlugin.name === 'rubick-system-feature') return;
|
||||
targetSearch({ value: e.target.value });
|
||||
emit("onSearch", e);
|
||||
emit('onSearch', e);
|
||||
};
|
||||
|
||||
const emit = defineEmits([
|
||||
"onSearch",
|
||||
"changeCurrent",
|
||||
"openMenu",
|
||||
"changeSelect",
|
||||
"choosePlugin",
|
||||
"focus",
|
||||
"clearSearchValue",
|
||||
"readClipboardContent"
|
||||
'onSearch',
|
||||
'changeCurrent',
|
||||
'openMenu',
|
||||
'changeSelect',
|
||||
'choosePlugin',
|
||||
'focus',
|
||||
'clearSearchValue',
|
||||
'readClipboardContent',
|
||||
]);
|
||||
|
||||
const keydownEvent = (e, key: string) => {
|
||||
const { ctrlKey, shiftKey, altKey, metaKey } = e;
|
||||
const modifiers: Array<string> = [];
|
||||
ctrlKey && modifiers.push("control");
|
||||
shiftKey && modifiers.push("shift");
|
||||
altKey && modifiers.push("alt");
|
||||
metaKey && modifiers.push("meta");
|
||||
ipcRenderer.send("msg-trigger", {
|
||||
type: "sendPluginSomeKeyDownEvent",
|
||||
ctrlKey && modifiers.push('control');
|
||||
shiftKey && modifiers.push('shift');
|
||||
altKey && modifiers.push('alt');
|
||||
metaKey && modifiers.push('meta');
|
||||
ipcRenderer.send('msg-trigger', {
|
||||
type: 'sendPluginSomeKeyDownEvent',
|
||||
data: {
|
||||
keyCode: e.code,
|
||||
modifiers
|
||||
}
|
||||
modifiers,
|
||||
},
|
||||
});
|
||||
const runPluginDisable = e.target.value === "" || props.currentPlugin.name;
|
||||
const runPluginDisable = e.target.value === '' || props.currentPlugin.name;
|
||||
switch (key) {
|
||||
case "up":
|
||||
emit("changeCurrent", -1);
|
||||
case 'up':
|
||||
emit('changeCurrent', -1);
|
||||
break;
|
||||
case "down":
|
||||
emit("changeCurrent", 1);
|
||||
case 'down':
|
||||
emit('changeCurrent', 1);
|
||||
break;
|
||||
case "enter":
|
||||
case 'enter':
|
||||
if (runPluginDisable) return;
|
||||
emit("choosePlugin");
|
||||
emit('choosePlugin');
|
||||
break;
|
||||
case "space":
|
||||
case 'space':
|
||||
if (runPluginDisable || !opConfig.get().perf.common.space) return;
|
||||
emit("choosePlugin");
|
||||
emit('choosePlugin');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -128,63 +129,63 @@ const keydownEvent = (e, key: string) => {
|
||||
const checkNeedInit = e => {
|
||||
const { ctrlKey, metaKey } = e;
|
||||
|
||||
if (e.target.value === "" && e.keyCode === 8) {
|
||||
if (e.target.value === '' && e.keyCode === 8) {
|
||||
closeTag();
|
||||
}
|
||||
// 手动粘贴
|
||||
if ((ctrlKey || metaKey) && e.key === "v") {
|
||||
emit("readClipboardContent");
|
||||
if ((ctrlKey || metaKey) && e.key === 'v') {
|
||||
emit('readClipboardContent');
|
||||
}
|
||||
};
|
||||
|
||||
const targetSearch = ({ value }) => {
|
||||
if (props.currentPlugin.name) {
|
||||
return ipcRenderer.sendSync("msg-trigger", {
|
||||
type: "sendSubInputChangeEvent",
|
||||
data: { text: value }
|
||||
return ipcRenderer.sendSync('msg-trigger', {
|
||||
type: 'sendSubInputChangeEvent',
|
||||
data: { text: value },
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const closeTag = () => {
|
||||
emit("changeSelect", {});
|
||||
emit("clearClipbord");
|
||||
ipcRenderer.send("msg-trigger", {
|
||||
type: "removePlugin"
|
||||
emit('changeSelect', {});
|
||||
emit('clearClipbord');
|
||||
ipcRenderer.send('msg-trigger', {
|
||||
type: 'removePlugin',
|
||||
});
|
||||
};
|
||||
|
||||
const showSeparate = () => {
|
||||
let pluginMenu: any = [
|
||||
{
|
||||
label: config.value.perf.common.hideOnBlur ? "钉住" : "自动隐藏",
|
||||
click: changeHideOnBlur
|
||||
}
|
||||
label: config.value.perf.common.hideOnBlur ? '钉住' : '自动隐藏',
|
||||
click: changeHideOnBlur,
|
||||
},
|
||||
];
|
||||
if (props.currentPlugin && props.currentPlugin.logo) {
|
||||
pluginMenu = pluginMenu.concat([
|
||||
{
|
||||
label: "开发者工具",
|
||||
label: '开发者工具',
|
||||
click: () => {
|
||||
ipcRenderer.send("msg-trigger", { type: "openPluginDevTools" });
|
||||
ipcRenderer.send('msg-trigger', { type: 'openPluginDevTools' });
|
||||
// todo
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "当前插件信息",
|
||||
label: '当前插件信息',
|
||||
submenu: [
|
||||
{
|
||||
label: "简介"
|
||||
label: '简介',
|
||||
},
|
||||
{
|
||||
label: "功能"
|
||||
}
|
||||
]
|
||||
label: '功能',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "分离窗口",
|
||||
click: newWindow
|
||||
}
|
||||
label: '分离窗口',
|
||||
click: newWindow,
|
||||
},
|
||||
]);
|
||||
}
|
||||
let menu = Menu.buildFromTemplate(pluginMenu);
|
||||
@ -201,13 +202,13 @@ const changeHideOnBlur = () => {
|
||||
const getIcon = () => {
|
||||
if (props.clipboardFile[0].dataUrl) return props.clipboardFile[0].dataUrl;
|
||||
return props.clipboardFile[0].isFile
|
||||
? require("../assets/file.png")
|
||||
: require("../assets/folder.png");
|
||||
? require('../assets/file.png')
|
||||
: require('../assets/folder.png');
|
||||
};
|
||||
|
||||
const newWindow = () => {
|
||||
ipcRenderer.send("msg-trigger", {
|
||||
type: "detachPlugin"
|
||||
ipcRenderer.send('msg-trigger', {
|
||||
type: 'detachPlugin',
|
||||
});
|
||||
// todo
|
||||
};
|
||||
@ -218,7 +219,7 @@ window.rubick.hooks.onShow = () => {
|
||||
};
|
||||
|
||||
window.rubick.hooks.onHide = () => {
|
||||
emit("clearSearchValue");
|
||||
emit('clearSearchValue');
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -238,6 +239,7 @@ window.rubick.hooks.onHide = () => {
|
||||
white-space: nowrap;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
.select-tag {
|
||||
white-space: pre;
|
||||
user-select: none;
|
||||
@ -252,6 +254,7 @@ window.rubick.hooks.onHide = () => {
|
||||
margin-right: 1px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.main-input {
|
||||
height: 60px !important;
|
||||
box-sizing: border-box;
|
||||
@ -270,6 +273,7 @@ window.rubick.hooks.onHide = () => {
|
||||
color: var(--color-text-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.rubick-logo,
|
||||
.icon-tool {
|
||||
width: 40px;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { createApp } from "vue";
|
||||
import { Button, List, Spin, Input, Avatar, Tag } from "ant-design-vue";
|
||||
import App from "./App.vue";
|
||||
import { createApp } from 'vue';
|
||||
import { Button, List, Spin, Input, Avatar, Tag } from 'ant-design-vue';
|
||||
import App from './App.vue';
|
||||
|
||||
createApp(App)
|
||||
.use(Button)
|
||||
@ -9,4 +9,4 @@ createApp(App)
|
||||
.use(Input)
|
||||
.use(Avatar)
|
||||
.use(Tag)
|
||||
.mount("#app");
|
||||
.mount('#app');
|
||||
|
@ -1,13 +1,13 @@
|
||||
import getCopyFiles from "@/common/utils/getCopyFiles";
|
||||
import { clipboard, nativeImage, remote, ipcRenderer } from "electron";
|
||||
import path from "path";
|
||||
import pluginClickEvent from "./pluginClickEvent";
|
||||
import { ref } from "vue";
|
||||
import getCopyFiles from '@/common/utils/getCopyFiles';
|
||||
import { clipboard, nativeImage, remote, ipcRenderer } from 'electron';
|
||||
import path from 'path';
|
||||
import pluginClickEvent from './pluginClickEvent';
|
||||
import { ref } from 'vue';
|
||||
|
||||
export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
const clipboardFile: any = ref([]);
|
||||
const searchFocus = () => {
|
||||
const config = remote.getGlobal("OP_CONFIG").get();
|
||||
const config = remote.getGlobal('OP_CONFIG').get();
|
||||
// 未开启自动粘贴
|
||||
if (!config.perf.common.autoPast) return;
|
||||
|
||||
@ -15,18 +15,18 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
const fileList = getCopyFiles();
|
||||
// 拷贝的是文件
|
||||
if (fileList) {
|
||||
window.setSubInputValue({ value: "" });
|
||||
window.setSubInputValue({ value: '' });
|
||||
clipboardFile.value = fileList;
|
||||
const localPlugins = remote.getGlobal("LOCAL_PLUGINS").getLocalPlugins();
|
||||
const localPlugins = remote.getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||
const options: any = [
|
||||
{
|
||||
name: "复制路径",
|
||||
value: "plugin",
|
||||
icon: require("../assets/link.png"),
|
||||
desc: "复制路径到剪切板",
|
||||
name: '复制路径',
|
||||
value: 'plugin',
|
||||
icon: require('../assets/link.png'),
|
||||
desc: '复制路径到剪切板',
|
||||
click: () => {
|
||||
clipboard.writeText(fileList.map((file) => file.path).join(","));
|
||||
ipcRenderer.send("msg-trigger", { type: "hideMainWindow" });
|
||||
clipboard.writeText(fileList.map((file) => file.path).join(','));
|
||||
ipcRenderer.send('msg-trigger', { type: 'hideMainWindow' });
|
||||
},
|
||||
},
|
||||
];
|
||||
@ -50,13 +50,13 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
fe.cmds.forEach((cmd) => {
|
||||
const regImg = /\.(png|jpg|gif|jpeg|webp)$/;
|
||||
if (
|
||||
cmd.type === "img" &&
|
||||
cmd.type === 'img' &&
|
||||
regImg.test(ext) &&
|
||||
fileList.length === 1
|
||||
) {
|
||||
options.push({
|
||||
name: cmd.label,
|
||||
value: "plugin",
|
||||
value: 'plugin',
|
||||
icon: plugin.logo,
|
||||
desc: fe.explain,
|
||||
type: plugin.pluginType,
|
||||
@ -67,7 +67,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
cmd,
|
||||
ext: {
|
||||
code: fe.code,
|
||||
type: cmd.type || "text",
|
||||
type: cmd.type || 'text',
|
||||
payload: nativeImage
|
||||
.createFromPath(fileList[0].path)
|
||||
.toDataURL(),
|
||||
@ -81,11 +81,11 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
// 如果是文件,且符合文件正则类型
|
||||
if (
|
||||
fileList.length > 1 ||
|
||||
(cmd.type === "file" && new RegExp(cmd.match).test(ext))
|
||||
(cmd.type === 'file' && new RegExp(cmd.match).test(ext))
|
||||
) {
|
||||
options.push({
|
||||
name: cmd,
|
||||
value: "plugin",
|
||||
value: 'plugin',
|
||||
icon: plugin.logo,
|
||||
desc: fe.explain,
|
||||
type: plugin.pluginType,
|
||||
@ -96,7 +96,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
cmd,
|
||||
ext: {
|
||||
code: fe.code,
|
||||
type: cmd.type || "text",
|
||||
type: cmd.type || 'text',
|
||||
payload: fileList,
|
||||
},
|
||||
openPlugin,
|
||||
@ -115,7 +115,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
}
|
||||
const clipboardType = clipboard.availableFormats();
|
||||
if (!clipboardType.length) return;
|
||||
if ("text/plain" === clipboardType[0]) {
|
||||
if ('text/plain' === clipboardType[0]) {
|
||||
const contentText = clipboard.readText();
|
||||
if (contentText.trim()) {
|
||||
clearClipboardFile();
|
||||
@ -134,7 +134,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
// read image
|
||||
const img = clipboard.readImage();
|
||||
const dataUrl = img.toDataURL();
|
||||
if (!dataUrl.replace("data:image/png;base64,", "")) return;
|
||||
if (!dataUrl.replace('data:image/png;base64,', '')) return;
|
||||
clipboardFile.value = [
|
||||
{
|
||||
isFile: true,
|
||||
@ -143,7 +143,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
dataUrl,
|
||||
},
|
||||
];
|
||||
const localPlugins = remote.getGlobal("LOCAL_PLUGINS").getLocalPlugins();
|
||||
const localPlugins = remote.getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||
const options: any = [];
|
||||
// 再正则插件
|
||||
localPlugins.forEach((plugin) => {
|
||||
@ -152,10 +152,10 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
if (!feature) return;
|
||||
feature.forEach((fe) => {
|
||||
fe.cmds.forEach((cmd) => {
|
||||
if (cmd.type === "img") {
|
||||
if (cmd.type === 'img') {
|
||||
options.push({
|
||||
name: cmd.label,
|
||||
value: "plugin",
|
||||
value: 'plugin',
|
||||
icon: plugin.logo,
|
||||
desc: fe.explain,
|
||||
type: plugin.pluginType,
|
||||
@ -166,7 +166,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
cmd,
|
||||
ext: {
|
||||
code: fe.code,
|
||||
type: cmd.type || "text",
|
||||
type: cmd.type || 'text',
|
||||
payload: dataUrl,
|
||||
},
|
||||
openPlugin,
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { reactive, toRefs, ref } from "vue";
|
||||
import { nativeImage, remote, ipcRenderer } from "electron";
|
||||
import appSearch from "@/core/app-search";
|
||||
import { PluginHandler } from "@/core";
|
||||
import path from "path";
|
||||
import commonConst from "@/common/utils/commonConst";
|
||||
import { execSync } from "child_process";
|
||||
import searchManager from "./search";
|
||||
import optionsManager from "./options";
|
||||
import { PLUGIN_INSTALL_DIR as baseDir } from "@/common/constans/renderer";
|
||||
import { reactive, toRefs, ref } from 'vue';
|
||||
import { nativeImage, remote, ipcRenderer } from 'electron';
|
||||
import appSearch from '@/core/app-search';
|
||||
import { PluginHandler } from '@/core';
|
||||
import path from 'path';
|
||||
import commonConst from '@/common/utils/commonConst';
|
||||
import { execSync } from 'child_process';
|
||||
import searchManager from './search';
|
||||
import optionsManager from './options';
|
||||
import { PLUGIN_INSTALL_DIR as baseDir } from '@/common/constans/renderer';
|
||||
|
||||
const createPluginManager = (): any => {
|
||||
const pluginInstance = new PluginHandler({
|
||||
@ -34,27 +34,27 @@ const createPluginManager = (): any => {
|
||||
};
|
||||
|
||||
const openPlugin = (plugin) => {
|
||||
if (plugin.pluginType === "ui" || plugin.pluginType === "system") {
|
||||
if (plugin.pluginType === 'ui' || plugin.pluginType === 'system') {
|
||||
if (state.currentPlugin && state.currentPlugin.name === plugin.name) {
|
||||
return;
|
||||
}
|
||||
loadPlugin(plugin);
|
||||
ipcRenderer.sendSync("msg-trigger", {
|
||||
type: "openPlugin",
|
||||
ipcRenderer.sendSync('msg-trigger', {
|
||||
type: 'openPlugin',
|
||||
data: JSON.parse(
|
||||
JSON.stringify({
|
||||
...plugin,
|
||||
ext: plugin.ext || {
|
||||
code: plugin.feature.code,
|
||||
type: plugin.cmd.type || "text",
|
||||
type: plugin.cmd.type || 'text',
|
||||
payload: null,
|
||||
},
|
||||
})
|
||||
),
|
||||
});
|
||||
setSearchValue("");
|
||||
setSearchValue('');
|
||||
}
|
||||
if (plugin.pluginType === "app") {
|
||||
if (plugin.pluginType === 'app') {
|
||||
execSync(plugin.action);
|
||||
}
|
||||
};
|
||||
@ -83,8 +83,8 @@ const createPluginManager = (): any => {
|
||||
...pluginInfo,
|
||||
icon: pluginInfo.logo,
|
||||
indexPath: commonConst.dev()
|
||||
? "http://localhost:8081/#/"
|
||||
: `file://${path.join(pluginPath, "../", pluginInfo.main)}`,
|
||||
? 'http://localhost:8081/#/'
|
||||
: `file://${path.join(pluginPath, '../', pluginInfo.main)}`,
|
||||
};
|
||||
};
|
||||
|
||||
@ -104,18 +104,18 @@ const createPluginManager = (): any => {
|
||||
|
||||
window.updatePlugin = ({ currentPlugin }: any) => {
|
||||
state.currentPlugin = currentPlugin;
|
||||
remote.getGlobal("LOCAL_PLUGINS").updatePlugin(currentPlugin);
|
||||
remote.getGlobal('LOCAL_PLUGINS').updatePlugin(currentPlugin);
|
||||
};
|
||||
|
||||
window.setCurrentPlugin = ({ currentPlugin }) => {
|
||||
state.currentPlugin = currentPlugin;
|
||||
setSearchValue("");
|
||||
setSearchValue('');
|
||||
};
|
||||
|
||||
window.initRubick = () => {
|
||||
state.currentPlugin = {};
|
||||
setSearchValue("");
|
||||
window.setSubInput({ placeholder: "" });
|
||||
setSearchValue('');
|
||||
window.setSubInput({ placeholder: '' });
|
||||
};
|
||||
|
||||
window.pluginLoaded = () => {
|
||||
|
@ -1,21 +1,21 @@
|
||||
import { ref, watch } from "vue";
|
||||
import throttle from "lodash.throttle";
|
||||
import { remote, ipcRenderer } from "electron";
|
||||
import pluginClickEvent from "./pluginClickEvent";
|
||||
import useFocus from "./clipboardWatch";
|
||||
import { ref, watch } from 'vue';
|
||||
import throttle from 'lodash.throttle';
|
||||
import { remote, ipcRenderer } from 'electron';
|
||||
import pluginClickEvent from './pluginClickEvent';
|
||||
import useFocus from './clipboardWatch';
|
||||
|
||||
function formatReg(regStr) {
|
||||
const flags = regStr.replace(/.*\/([gimy]*)$/, "$1");
|
||||
const pattern = flags.replace(new RegExp("^/(.*?)/" + flags + "$"), "$1");
|
||||
const flags = regStr.replace(/.*\/([gimy]*)$/, '$1');
|
||||
const pattern = flags.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');
|
||||
return new RegExp(pattern, flags);
|
||||
}
|
||||
|
||||
function searchKeyValues(lists, value, strict = false) {
|
||||
return lists.filter((item) => {
|
||||
if (typeof item === "string") {
|
||||
if (typeof item === 'string') {
|
||||
return item.toLowerCase().indexOf(value.toLowerCase()) >= 0;
|
||||
}
|
||||
if (item.type === "regex" && !strict) {
|
||||
if (item.type === 'regex' && !strict) {
|
||||
return formatReg(item.match).test(value);
|
||||
}
|
||||
return false;
|
||||
@ -31,13 +31,13 @@ const optionsManager = ({
|
||||
const optionsRef = ref([]);
|
||||
|
||||
// 全局快捷键
|
||||
ipcRenderer.on("global-short-key", (e, msg) => {
|
||||
ipcRenderer.on('global-short-key', (e, msg) => {
|
||||
const options = getOptionsFromSearchValue(msg, true);
|
||||
options[0].click();
|
||||
});
|
||||
|
||||
const getOptionsFromSearchValue = (value, strict = false) => {
|
||||
const localPlugins = remote.getGlobal("LOCAL_PLUGINS").getLocalPlugins();
|
||||
const localPlugins = remote.getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||
let options: any = [];
|
||||
// todo 先搜索 plugin
|
||||
localPlugins.forEach((plugin) => {
|
||||
@ -50,7 +50,7 @@ const optionsManager = ({
|
||||
...options,
|
||||
...cmds.map((cmd) => ({
|
||||
name: cmd.label || cmd,
|
||||
value: "plugin",
|
||||
value: 'plugin',
|
||||
icon: plugin.logo,
|
||||
desc: fe.explain,
|
||||
type: plugin.pluginType,
|
||||
@ -63,7 +63,7 @@ const optionsManager = ({
|
||||
ext: cmd.type
|
||||
? {
|
||||
code: fe.code,
|
||||
type: cmd.type || "text",
|
||||
type: cmd.type || 'text',
|
||||
payload: searchValue.value,
|
||||
}
|
||||
: null,
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { PLUGIN_INSTALL_DIR as baseDir } from "@/common/constans/renderer";
|
||||
import path from "path";
|
||||
import { toRaw } from "vue";
|
||||
import commonConst from "@/common/utils/commonConst";
|
||||
import { PLUGIN_INSTALL_DIR as baseDir } from '@/common/constans/renderer';
|
||||
import path from 'path';
|
||||
import { toRaw } from 'vue';
|
||||
import commonConst from '@/common/utils/commonConst';
|
||||
|
||||
export default function pluginClickEvent({ plugin, fe, cmd, ext, openPlugin }) {
|
||||
const pluginPath = path.resolve(baseDir, "node_modules", plugin.name);
|
||||
const pluginPath = path.resolve(baseDir, 'node_modules', plugin.name);
|
||||
const pluginDist = {
|
||||
...toRaw(plugin),
|
||||
indexPath: `file://${path.join(pluginPath, "./", plugin.main || "")}`,
|
||||
indexPath: `file://${path.join(pluginPath, './', plugin.main || '')}`,
|
||||
cmd: cmd.label || cmd,
|
||||
feature: fe,
|
||||
ext,
|
||||
@ -15,13 +15,13 @@ export default function pluginClickEvent({ plugin, fe, cmd, ext, openPlugin }) {
|
||||
// 模板文件
|
||||
if (!plugin.main) {
|
||||
pluginDist.tplPath = commonConst.dev()
|
||||
? "http://localhost:8082/#/"
|
||||
? 'http://localhost:8082/#/'
|
||||
: `file://${__static}/tpl/index.html`;
|
||||
}
|
||||
// 插件市场
|
||||
if (plugin.name === "rubick-system-feature") {
|
||||
if (plugin.name === 'rubick-system-feature') {
|
||||
pluginDist.indexPath = commonConst.dev()
|
||||
? "http://localhost:8081/#/"
|
||||
? 'http://localhost:8081/#/'
|
||||
: `file://${__static}/feature/index.html`;
|
||||
}
|
||||
openPlugin(pluginDist);
|
||||
|
@ -1,10 +1,9 @@
|
||||
import { reactive, toRefs } from "vue";
|
||||
import { ipcRenderer, remote } from "electron";
|
||||
import { reactive, toRefs } from 'vue';
|
||||
|
||||
const searchManager = () => {
|
||||
const state = reactive({
|
||||
searchValue: "",
|
||||
placeholder: "",
|
||||
searchValue: '',
|
||||
placeholder: '',
|
||||
});
|
||||
|
||||
// search Input operation
|
||||
@ -21,7 +20,7 @@ const searchManager = () => {
|
||||
state.placeholder = placeholder;
|
||||
};
|
||||
window.removeSubInput = () => {
|
||||
state.placeholder = "";
|
||||
state.placeholder = '';
|
||||
};
|
||||
window.setSubInputValue = ({ value }: { value: string }) => {
|
||||
state.searchValue = value;
|
||||
|
8
src/renderer/shims-vue.d.ts
vendored
8
src/renderer/shims-vue.d.ts
vendored
@ -1,17 +1,17 @@
|
||||
/* eslint-disable */
|
||||
declare module "*.vue" {
|
||||
import type { DefineComponent } from "vue";
|
||||
declare module '*.vue' {
|
||||
import type { DefineComponent } from 'vue';
|
||||
const component: DefineComponent<{}, {}, any>;
|
||||
export default component;
|
||||
}
|
||||
|
||||
declare module "main" {
|
||||
declare module 'main' {
|
||||
export function main(): any;
|
||||
}
|
||||
|
||||
declare const __static: string;
|
||||
|
||||
declare module "lodash.throttle";
|
||||
declare module 'lodash.throttle';
|
||||
|
||||
interface Window {
|
||||
rubick: any;
|
||||
|
@ -51,7 +51,7 @@ module.exports = {
|
||||
},
|
||||
mac: {
|
||||
icon: "public/icons/icon.icns",
|
||||
target: ["dmg", "pkg"],
|
||||
target: ["pkg"],
|
||||
extendInfo: {
|
||||
LSUIElement: 1,
|
||||
},
|
||||
|
@ -9016,11 +9016,16 @@ prettier-linter-helpers@^1.0.0:
|
||||
dependencies:
|
||||
fast-diff "^1.1.2"
|
||||
|
||||
"prettier@^1.18.2 || ^2.0.0", prettier@^2.2.1:
|
||||
"prettier@^1.18.2 || ^2.0.0":
|
||||
version "2.7.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
|
||||
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==
|
||||
|
||||
prettier@^2.8.4:
|
||||
version "2.8.4"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.4.tgz#34dd2595629bfbb79d344ac4a91ff948694463c3"
|
||||
integrity sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==
|
||||
|
||||
pretty-error@^2.0.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.2.tgz#be89f82d81b1c86ec8fdfbc385045882727f93b6"
|
||||
|
Loading…
x
Reference in New Issue
Block a user