This commit is contained in:
sunyuqiang 2023-08-21 12:53:59 +08:00
commit 78ea2ac576
17 changed files with 83 additions and 52 deletions

View File

@ -54,6 +54,8 @@ Based on electron open source toolbox, free integration of rich plug-ins, to cre
## Docs ## Docs
[Rubick website](https://rubick.vip)
[Rubick Docs](https://rubickCenter.github.io/rubick/) [Rubick Docs](https://rubickCenter.github.io/rubick/)

View File

@ -54,6 +54,8 @@
## 使用文档 ## 使用文档
[Rubick 官网](https://rubick.vip)
[Rubick Docs](https://rubickCenter.github.io/rubick/) [Rubick Docs](https://rubickCenter.github.io/rubick/)

View File

@ -3,7 +3,7 @@
"pluginName": "rubick 系统菜单", "pluginName": "rubick 系统菜单",
"description": "rubick 系统菜单", "description": "rubick 系统菜单",
"main": "index.html", "main": "index.html",
"logo": "https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/acb761082f4a4b46847e7cd8b180f63c~tplv-k3u1fbpfcp-watermark.image", "logo": "https://pic1.zhimg.com/80/v2-c09780808301668a82e6646cb42f0806_720w.png",
"version": "0.0.0", "version": "0.0.0",
"preload":"preload.js", "preload":"preload.js",
"pluginType": "ui", "pluginType": "ui",

View File

@ -20,12 +20,12 @@
</template> </template>
{{ $t('feature.settings.global.title') }} {{ $t('feature.settings.global.title') }}
</a-menu-item> </a-menu-item>
<a-menu-item key="superpanel"> <!-- <a-menu-item key="superpanel">-->
<template #icon> <!-- <template #icon>-->
<FileAddOutlined /> <!-- <FileAddOutlined />-->
</template> <!-- </template>-->
{{ $t('feature.settings.superPanel.title') }} <!-- {{ $t('feature.settings.superPanel.title') }}-->
</a-menu-item> <!-- </a-menu-item>-->
<a-menu-item key="localhost"> <a-menu-item key="localhost">
<template #icon> <template #icon>
<DatabaseOutlined /> <DatabaseOutlined />

View File

@ -80,7 +80,7 @@ const layout = {
const resetForm = () => { const resetForm = () => {
formState.value = { formState.value = {
register: 'https://registry.npm.taobao.org', register: 'https://registry.npmmirror.com',
database: 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master', database: 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master',
access_token: '', access_token: '',
}; };

View File

@ -1,19 +1,19 @@
<template> <template>
<div class="user-info"> <div class="user-info">
<div class="info-container"> <!-- <div class="info-container">-->
<a-result <!-- <a-result-->
class="user-info-result" <!-- class="user-info-result"-->
:title="userInfo.name || $t('feature.settings.account.tips1')" <!-- :title="userInfo.name || $t('feature.settings.account.tips1')"-->
:sub-title="$t('feature.settings.account.tips2')" <!-- :sub-title="$t('feature.settings.account.tips2')"-->
> <!-- >-->
<template #icon> <!-- <template #icon>-->
<a-avatar :size="64" v-if="!userInfo.avatar"> <!-- <a-avatar :size="64" v-if="!userInfo.avatar">-->
<template #icon><UserOutlined /></template> <!-- <template #icon><UserOutlined /></template>-->
</a-avatar> <!-- </a-avatar>-->
<a-avatar :src="userInfo.avatar" :size="64" v-else /> <!-- <a-avatar :src="userInfo.avatar" :size="64" v-else />-->
</template> <!-- </template>-->
</a-result> <!-- </a-result>-->
</div> <!-- </div>-->
<div class="settings-container"> <div class="settings-container">
<div class="setting-item"> <div class="setting-item">
<div class="title"> <div class="title">
@ -151,9 +151,9 @@ state.custom = perf.custom || {};
const userInfo = ref(window.rubick.dbStorage.getItem('rubick-user-info')); const userInfo = ref(window.rubick.dbStorage.getItem('rubick-user-info'));
service.getUserInfo({ openId: userInfo.value.openId }).then((res) => { // service.getUserInfo({ openId: userInfo.value.openId }).then((res) => {
userInfo.value = res; // userInfo.value = res;
}); // });
const setConfig = debounce(() => { const setConfig = debounce(() => {
remote.getGlobal('OP_CONFIG').set( remote.getGlobal('OP_CONFIG').set(

View File

@ -1,17 +1,18 @@
<template> <template>
<div class="account"> <div class="account">
<a-result <!-- todo 暂时先去掉登录等小程序做好了再加回来吧 -->
v-if="!userInfo" <!-- <a-result-->
title="请先登录" <!-- v-if="!userInfo"-->
sub-title="登录后可开启用户个性化设置" <!-- title="请先登录"-->
> <!-- sub-title="登录后可开启用户个性化设置"-->
<template #extra> <!-- >-->
<a-button @click="showModal" type="primary"> <!-- <template #extra>-->
使用微信小程序登录 <!-- <a-button @click="showModal" type="primary">-->
</a-button> <!-- 使用微信小程序登录-->
</template> <!-- </a-button>-->
</a-result> <!-- </template>-->
<Index v-else /> <!-- </a-result>-->
<Index />
<a-modal :footer="null" v-model:visible="visible"> <a-modal :footer="null" v-model:visible="visible">
<a-result <a-result
title="请使用微信扫码登录!" title="请使用微信扫码登录!"

View File

@ -1,6 +1,6 @@
{ {
"name": "rubick", "name": "rubick",
"version": "2.4.1", "version": "2.4.5",
"author": "muwoo <2424880409@qq.com>", "author": "muwoo <2424880409@qq.com>",
"private": true, "private": true,
"scripts": { "scripts": {
@ -30,6 +30,7 @@
"get-mac-apps": "^1.0.2", "get-mac-apps": "^1.0.2",
"got": "^11.8.3", "got": "^11.8.3",
"lodash.throttle": "^4.1.1", "lodash.throttle": "^4.1.1",
"node-key-sender": "^1.0.11",
"pouchdb": "^7.2.2", "pouchdb": "^7.2.2",
"vue": "^3.0.0", "vue": "^3.0.0",
"vue-router": "^4.0.0-0", "vue-router": "^4.0.0-0",

Binary file not shown.

Binary file not shown.

BIN
public/ScreenCapture.exe Normal file

Binary file not shown.

View File

@ -3,7 +3,7 @@
"pluginName": "rubick 系统菜单", "pluginName": "rubick 系统菜单",
"description": "rubick 系统菜单", "description": "rubick 系统菜单",
"main": "index.html", "main": "index.html",
"logo": "https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/acb761082f4a4b46847e7cd8b180f63c~tplv-k3u1fbpfcp-watermark.image", "logo": "https://pic1.zhimg.com/80/v2-c09780808301668a82e6646cb42f0806_720w.png",
"version": "0.0.0", "version": "0.0.0",
"preload":"preload.js", "preload":"preload.js",
"pluginType": "ui", "pluginType": "ui",

View File

@ -166,4 +166,12 @@ window.rubick = {
getFileIcon: (path) => { getFileIcon: (path) => {
return ipcSendSync('getFileIcon', { path }); return ipcSendSync('getFileIcon', { path });
}, },
getCopyedFiles: () => {
return ipcSendSync('getCopyFiles');
},
simulateKeyboardTap: (key, ...modifier) => {
ipcSend('simulateKeyboardTap', { key, modifier });
},
}; };

View File

@ -52,7 +52,7 @@ class AdapterHandler {
} catch (e) { } catch (e) {
// ignore // ignore
} }
this.registry = register || 'https://registry.npm.taobao.org'; this.registry = register || 'https://registry.npmmirror.com/';
} }
async upgrade(name: string): Promise<void> { async upgrade(name: string): Promise<void> {
@ -150,27 +150,21 @@ class AdapterHandler {
} }
return adapters; return adapters;
} }
private cleanCache() {
spawn('npm', ['cache', 'clean', '-f'], {
cwd: this.baseDir,
});
}
/** /**
* *
* @memberof AdapterHandler * @memberof AdapterHandler
*/ */
private async execCommand(cmd: string, modules: string[]): Promise<string> { private async execCommand(cmd: string, modules: string[]): Promise<string> {
this.cleanCache();
return new Promise((resolve: any, reject: any) => { return new Promise((resolve: any, reject: any) => {
let args: string[] = [cmd] const args: string[] = [cmd]
.concat( .concat(
cmd !== 'uninstall' ? modules.map((m) => `${m}@latest`) : modules cmd !== 'uninstall' ? modules.map((m) => `${m}@latest`) : modules
) )
.concat('--color=always') .concat('--color=always')
.concat('--save'); .concat('--save')
if (cmd !== 'uninstall') .concat(`--registry=${this.registry}`);
args = args.concat(`--registry=${this.registry}`);
const npm = spawn('npm', args, { const npm = spawn('npm', args, {
cwd: this.baseDir, cwd: this.baseDir,
}); });

View File

@ -5,7 +5,7 @@ import path from 'path';
// 截图方法windows // 截图方法windows
export const screenWindow = (cb) => { export const screenWindow = (cb) => {
const url = path.resolve(__static, 'PrintScr.exe'); const url = path.resolve(__static, 'ScreenCapture.exe');
const screen_window = execFile(url); const screen_window = execFile(url);
screen_window.on('exit', (code) => { screen_window.on('exit', (code) => {
if (code) { if (code) {

View File

@ -13,7 +13,11 @@ import { runner, detach } from '../browsers';
import fs from 'fs'; import fs from 'fs';
import { LocalDb, screenCapture } from '@/core'; import { LocalDb, screenCapture } from '@/core';
import plist from 'plist'; import plist from 'plist';
import ks from 'node-key-sender';
import { DECODE_KEY } from '@/common/constans/main'; import { DECODE_KEY } from '@/common/constans/main';
import getCopyFiles from '@/common/utils/getCopyFiles';
import mainInstance from '../index'; import mainInstance from '../index';
const runnerInstance = runner(); const runnerInstance = runner();
const detachInstance = detach(); const detachInstance = detach();
@ -324,6 +328,20 @@ class API {
}); });
}); });
} }
public getCopyFiles() {
return getCopyFiles();
}
public simulateKeyboardTap({ data: { key, modifier } }) {
let keys = [key.toLowerCase()];
if (modifier && Array.isArray(modifier) && modifier.length > 0) {
keys = modifier.concat(keys);
ks.sendCombination(keys);
} else {
ks.sendKeys(keys);
}
}
} }
export default new API(); export default new API();

View File

@ -8070,6 +8070,11 @@ node-gyp-build@~4.1.0:
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.1.1.tgz#d7270b5d86717068d114cc57fff352f96d745feb" resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.1.1.tgz#d7270b5d86717068d114cc57fff352f96d745feb"
integrity sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ== integrity sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==
node-key-sender@^1.0.11:
version "1.0.11"
resolved "https://registry.npmmirror.com/node-key-sender/-/node-key-sender-1.0.11.tgz#93210f07163607d8daf2874f1a29567d0acdb94c"
integrity sha512-vv2IXd8QdZBFYXaIy02uy2rK6EKj+tOTEuoTxJKS9l8zw8Cz6DeLffR8ompj7N2A3h6XK7aiy+YAcTaeOqwp2Q==
node-libs-browser@^2.2.1: node-libs-browser@^2.2.1:
version "2.2.1" version "2.2.1"
resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425"