mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-18 00:34:19 +08:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c00963fabb | ||
|
|
4b8f0e4657 | ||
|
|
28e7d2aa46 | ||
|
|
404cb4fcb5 | ||
|
|
5553170c5a | ||
|
|
d8fabc6b4c | ||
|
|
88e4e325f3 | ||
|
|
c0aaae08ee | ||
|
|
35598159a6 | ||
|
|
2a1a332fbb | ||
|
|
6d105e0f56 | ||
|
|
d2acdeaad6 | ||
|
|
54ad4ef7b2 | ||
|
|
7fb299d270 | ||
|
|
606cb8bb22 |
@@ -15,6 +15,8 @@
|
|||||||
--color-input-hover: #fff;
|
--color-input-hover: #fff;
|
||||||
// 边框
|
// 边框
|
||||||
--color-border-light: #f0f0f0;
|
--color-border-light: #f0f0f0;
|
||||||
|
// 输入框附带icon
|
||||||
|
--color-action-color: rgba(0, 0, 0, 0.25);;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark {
|
.dark {
|
||||||
@@ -29,4 +31,6 @@
|
|||||||
--color-input-hover: #444d;
|
--color-input-hover: #444d;
|
||||||
// 边框
|
// 边框
|
||||||
--color-border-light: #444d;
|
--color-border-light: #444d;
|
||||||
|
// 输入框附带icon
|
||||||
|
--color-action-color: #ffffff4d;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ const wrapperCol = { span: 14 };
|
|||||||
color: var(--color-text-content);
|
color: var(--color-text-content);
|
||||||
}
|
}
|
||||||
:deep(.ant-input) {
|
:deep(.ant-input) {
|
||||||
background: var(--color-input-hover);
|
background: var(--color-input-hover) !important;
|
||||||
color: var(--color-text-content);
|
color: var(--color-text-content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<ExportOutlined />
|
<ExportOutlined />
|
||||||
</template>
|
</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button @click="importData" danger size="small" style="margin-right: 10px;">
|
<a-button @click="importData" danger size="small" style="margin-right: 10px; background-color: var(--color-input-hover)">
|
||||||
导入数据
|
导入数据
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<ImportOutlined />
|
<ImportOutlined />
|
||||||
@@ -33,15 +33,20 @@
|
|||||||
<DatabaseOutlined style="font-size: 18px;"/>
|
<DatabaseOutlined style="font-size: 18px;"/>
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
<a-list-item-meta :description="`${item.keys.length} 份文档`">
|
<a-list-item-meta>
|
||||||
<template #title>
|
<template #title>
|
||||||
<div>
|
<div style="color: var(--color-text-content)">
|
||||||
<span>{{ item.plugin?.pluginName }}</span>
|
<span>{{ item.plugin?.pluginName }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #avatar>
|
<template #avatar>
|
||||||
<a-avatar shape="square" :src="item.plugin?.logo"/>
|
<a-avatar shape="square" :src="item.plugin?.logo"/>
|
||||||
</template>
|
</template>
|
||||||
|
<template #description>
|
||||||
|
<div style="color: var(--color-text-desc)">
|
||||||
|
<span>{{ item.keys.length }} 份文档</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</a-list-item-meta>
|
</a-list-item-meta>
|
||||||
</a-list-item>
|
</a-list-item>
|
||||||
</template>
|
</template>
|
||||||
@@ -52,6 +57,7 @@
|
|||||||
:closable="false"
|
:closable="false"
|
||||||
:title="currentSelect.plugin.pluginName"
|
:title="currentSelect.plugin.pluginName"
|
||||||
placement="right"
|
placement="right"
|
||||||
|
class="exportDrawer"
|
||||||
>
|
>
|
||||||
<p
|
<p
|
||||||
class="key-item"
|
class="key-item"
|
||||||
@@ -64,7 +70,12 @@
|
|||||||
</a-drawer>
|
</a-drawer>
|
||||||
<a-modal
|
<a-modal
|
||||||
centered
|
centered
|
||||||
bodyStyle="max-height: 500px; overflow: auto"
|
:bodyStyle="{
|
||||||
|
maxHeight: '500px',
|
||||||
|
overflow: 'auto',
|
||||||
|
backgroundColor: 'var(--color-body-bg)',
|
||||||
|
color: 'var(--color-text-primary)'
|
||||||
|
}"
|
||||||
:footer="null"
|
:footer="null"
|
||||||
:closable="false"
|
:closable="false"
|
||||||
v-model:visible="show"
|
v-model:visible="show"
|
||||||
@@ -75,6 +86,7 @@
|
|||||||
v-model:visible="showSetting"
|
v-model:visible="showSetting"
|
||||||
title="webdav 账户配置"
|
title="webdav 账户配置"
|
||||||
:footer="null"
|
:footer="null"
|
||||||
|
class="webdavModel"
|
||||||
>
|
>
|
||||||
<a-alert v-if="formState.suport === 'jianguo'" style="margin-bottom: 20px;" type="info" show-icon>
|
<a-alert v-if="formState.suport === 'jianguo'" style="margin-bottom: 20px;" type="info" show-icon>
|
||||||
<template #message>
|
<template #message>
|
||||||
@@ -255,7 +267,7 @@ const downloadPlugin = async (plugin) => {
|
|||||||
.export-header {
|
.export-header {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid var(--color-border-light);
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.key-item {
|
.key-item {
|
||||||
@@ -265,4 +277,44 @@ const downloadPlugin = async (plugin) => {
|
|||||||
color: var(--ant-primary-color);
|
color: var(--ant-primary-color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.exportDrawer{
|
||||||
|
.ant-drawer-header{
|
||||||
|
background-color: var(--color-body-bg);
|
||||||
|
border-bottom: 1px solid var(--color-border-light);
|
||||||
|
.ant-drawer-title{
|
||||||
|
color: var(--color-text-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ant-drawer-body{
|
||||||
|
background-color: var(--color-body-bg);
|
||||||
|
color: var(--color-text-content)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.webdavModel{
|
||||||
|
.ant-modal-close-x{
|
||||||
|
color: var(--color-text-content);
|
||||||
|
}
|
||||||
|
.ant-modal-header{
|
||||||
|
background-color: var(--color-body-bg);
|
||||||
|
border-bottom: 1px solid var(--color-border-light);
|
||||||
|
.ant-modal-title{
|
||||||
|
color: var(--color-text-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ant-form-item-label>label {
|
||||||
|
color: var(--color-text-content);
|
||||||
|
}
|
||||||
|
.ant-modal-body {
|
||||||
|
background-color: var(--color-body-bg);
|
||||||
|
.ant-input,
|
||||||
|
.ant-input-password,
|
||||||
|
.ant-select-selector {
|
||||||
|
background: var(--color-input-hover) !important;
|
||||||
|
color: var(--color-text-content);
|
||||||
|
}
|
||||||
|
.ant-input-password-icon, .ant-select-arrow {
|
||||||
|
color: var(--color-action-color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -512,6 +512,13 @@ const changeLanguage = (value) => {
|
|||||||
background: var(--color-list-hover);
|
background: var(--color-list-hover);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.ant-select-selector {
|
||||||
|
background: var(--color-input-hover) !important;
|
||||||
|
color: var(--color-text-content);
|
||||||
|
}
|
||||||
|
.ant-input-password-icon, .ant-select-arrow {
|
||||||
|
color: var(--color-action-color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rubick",
|
"name": "rubick",
|
||||||
"version": "4.0.5",
|
"version": "4.0.9",
|
||||||
"author": "muwoo <2424880409@qq.com>",
|
"author": "muwoo <2424880409@qq.com>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -17,10 +17,13 @@ export default function getCopyFiles(): Array<any> | null {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else if (process.platform === 'win32') {
|
} else if (process.platform === 'win32') {
|
||||||
/* eslint-disable */
|
try {
|
||||||
const clipboardEx = require('electron-clipboard-ex');
|
/* eslint-disable */
|
||||||
fileInfo = clipboardEx.readFilePaths();
|
const clipboardEx = require('electron-clipboard-ex');
|
||||||
// todo
|
fileInfo = clipboardEx.readFilePaths();
|
||||||
|
} catch (e) {
|
||||||
|
// todo
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!commonConst.linux()) return null;
|
if (!commonConst.linux()) return null;
|
||||||
if (!clipboard.has('text/uri-list')) return null;
|
if (!clipboard.has('text/uri-list')) return null;
|
||||||
|
|||||||
@@ -5,18 +5,18 @@ import { WINDOW_MIN_HEIGHT } from '@/common/constans/common';
|
|||||||
export default () => {
|
export default () => {
|
||||||
let win: any;
|
let win: any;
|
||||||
|
|
||||||
const init = (pluginInfo, viewInfo, view) => {
|
const init = async (pluginInfo, viewInfo, view) => {
|
||||||
ipcMain.on('detach:service', async (event, arg: { type: string }) => {
|
ipcMain.on('detach:service', async (event, arg: { type: string }) => {
|
||||||
const data = await operation[arg.type]();
|
const data = await operation[arg.type]();
|
||||||
event.returnValue = data;
|
event.returnValue = data;
|
||||||
});
|
});
|
||||||
createWindow(pluginInfo, viewInfo, view);
|
const createWin = await createWindow(pluginInfo, viewInfo, view);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||||
require('@electron/remote/main').enable(win.webContents);
|
require('@electron/remote/main').enable(createWin.webContents);
|
||||||
};
|
};
|
||||||
|
|
||||||
const createWindow = async (pluginInfo, viewInfo, view) => {
|
const createWindow = async (pluginInfo, viewInfo, view) => {
|
||||||
win = new BrowserWindow({
|
const createWin = new BrowserWindow({
|
||||||
height: viewInfo.height,
|
height: viewInfo.height,
|
||||||
minHeight: WINDOW_MIN_HEIGHT,
|
minHeight: WINDOW_MIN_HEIGHT,
|
||||||
width: viewInfo.width,
|
width: viewInfo.width,
|
||||||
@@ -43,29 +43,32 @@ export default () => {
|
|||||||
});
|
});
|
||||||
if (process.env.WEBPACK_DEV_SERVER_URL) {
|
if (process.env.WEBPACK_DEV_SERVER_URL) {
|
||||||
// Load the url of the dev server if in development mode
|
// Load the url of the dev server if in development mode
|
||||||
win.loadURL('http://localhost:8082');
|
createWin.loadURL('http://localhost:8082');
|
||||||
} else {
|
} else {
|
||||||
win.loadURL(`file://${path.join(__static, './detach/index.html')}`);
|
createWin.loadURL(`file://${path.join(__static, './detach/index.html')}`);
|
||||||
}
|
}
|
||||||
win.on('close', () => {
|
createWin.on('close', () => {
|
||||||
executeHooks('PluginOut', null);
|
executeHooks('PluginOut', null);
|
||||||
});
|
});
|
||||||
win.on('closed', () => {
|
createWin.on('closed', () => {
|
||||||
win = undefined;
|
win = undefined;
|
||||||
});
|
});
|
||||||
|
createWin.on('focus', () => {
|
||||||
|
win = createWin;
|
||||||
|
});
|
||||||
|
|
||||||
win.once('ready-to-show', async () => {
|
createWin.once('ready-to-show', async () => {
|
||||||
const config = await localConfig.getConfig();
|
const config = await localConfig.getConfig();
|
||||||
const darkMode = config.perf.common.darkMode;
|
const darkMode = config.perf.common.darkMode;
|
||||||
darkMode &&
|
darkMode &&
|
||||||
win.webContents.executeJavaScript(
|
createWin.webContents.executeJavaScript(
|
||||||
`document.body.classList.add("dark");window.rubick.theme="dark"`
|
`document.body.classList.add("dark");window.rubick.theme="dark"`
|
||||||
);
|
);
|
||||||
win.setBrowserView(view);
|
createWin.setBrowserView(view);
|
||||||
win.webContents.executeJavaScript(
|
createWin.webContents.executeJavaScript(
|
||||||
`window.initDetach(${JSON.stringify(pluginInfo)})`
|
`window.initDetach(${JSON.stringify(pluginInfo)})`
|
||||||
);
|
);
|
||||||
win.show();
|
createWin.show();
|
||||||
});
|
});
|
||||||
const executeHooks = (hook, data) => {
|
const executeHooks = (hook, data) => {
|
||||||
if (!view) return;
|
if (!view) return;
|
||||||
@@ -77,6 +80,7 @@ export default () => {
|
|||||||
`;
|
`;
|
||||||
view.webContents.executeJavaScript(evalJs);
|
view.webContents.executeJavaScript(evalJs);
|
||||||
};
|
};
|
||||||
|
return createWin;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getWindow = () => win;
|
const getWindow = () => win;
|
||||||
|
|||||||
@@ -175,14 +175,16 @@ export default () => {
|
|||||||
const getView = () => view;
|
const getView = () => view;
|
||||||
|
|
||||||
const executeHooks = (hook, data) => {
|
const executeHooks = (hook, data) => {
|
||||||
if (!view) return;
|
setTimeout(() => {
|
||||||
const evalJs = `if(window.rubick && window.rubick.hooks && typeof window.rubick.hooks.on${hook} === 'function' ) {
|
if (!view) return;
|
||||||
|
const evalJs = `if(window.rubick && window.rubick.hooks && typeof window.rubick.hooks.on${hook} === 'function' ) {
|
||||||
try {
|
try {
|
||||||
window.rubick.hooks.on${hook}(${data ? JSON.stringify(data) : ''});
|
window.rubick.hooks.on${hook}(${data ? JSON.stringify(data) : ''});
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
view.webContents?.executeJavaScript(evalJs);
|
view.webContents?.executeJavaScript(evalJs);
|
||||||
|
}, 300);
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ class API extends DBInstance {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getFeatures() {
|
public getFeatures() {
|
||||||
return this.currentPlugin.features;
|
return this.currentPlugin?.features;
|
||||||
}
|
}
|
||||||
|
|
||||||
public setFeature({ data }, window) {
|
public setFeature({ data }, window) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<a-avatar style="width: 28px; height: 28px;" :src="item.icon" />
|
<a-avatar style="width: 28px; height: 28px;" :src="item.icon" />
|
||||||
<div class="name ellpise">{{item.pluginName || item._name || item.name}}</div>
|
<div class="name ellpise">{{item.cmd || item.pluginName || item._name || item.name}}</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -70,6 +70,9 @@ const createPluginManager = (): any => {
|
|||||||
const openPlugin = async (plugin, option) => {
|
const openPlugin = async (plugin, option) => {
|
||||||
if (plugin.pluginType === 'ui' || plugin.pluginType === 'system') {
|
if (plugin.pluginType === 'ui' || plugin.pluginType === 'system') {
|
||||||
if (state.currentPlugin && state.currentPlugin.name === plugin.name) {
|
if (state.currentPlugin && state.currentPlugin.name === plugin.name) {
|
||||||
|
ipcRenderer.sendSync('msg-trigger', {
|
||||||
|
type: 'showMainWindow',
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await loadPlugin(plugin);
|
await loadPlugin(plugin);
|
||||||
|
|||||||
Reference in New Issue
Block a user