mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-25 11:59:27 +08:00
feat: 支持文本模板,系统命令
This commit is contained in:
@@ -2,8 +2,36 @@ const WINDOW_MAX_HEIGHT = 600;
|
||||
const WINDOW_MIN_HEIGHT = 60;
|
||||
const PRE_ITEM_HEIGHT = 60;
|
||||
|
||||
const SYSTEM_PLUGINS = [
|
||||
{
|
||||
"pluginName": "rubick 帮助文档",
|
||||
"logo": "logo.png",
|
||||
"features": [
|
||||
{
|
||||
"code": "help",
|
||||
"explain": "rubick 帮助文档",
|
||||
"cmds": [ "Help", "帮助" ]
|
||||
},
|
||||
],
|
||||
"tag": 'rubick-help',
|
||||
},
|
||||
{
|
||||
"pluginName": "屏幕颜色拾取",
|
||||
"logo": "logo.png",
|
||||
"features": [
|
||||
{
|
||||
"code": "pick",
|
||||
"explain": "rubick 帮助文档",
|
||||
"cmds": [ "取色", "拾色", 'Pick color' ]
|
||||
},
|
||||
],
|
||||
"tag": 'rubick-color',
|
||||
}
|
||||
]
|
||||
|
||||
export {
|
||||
WINDOW_MAX_HEIGHT,
|
||||
WINDOW_MIN_HEIGHT,
|
||||
PRE_ITEM_HEIGHT,
|
||||
SYSTEM_PLUGINS,
|
||||
}
|
||||
|
||||
13
src/renderer/assets/common/system.js
Normal file
13
src/renderer/assets/common/system.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import {shell, ipcRenderer} from 'electron';
|
||||
export default {
|
||||
'rubick-help': {
|
||||
help() {
|
||||
shell.openExternal('https://u.tools/docs/guide/about-uTools.html')
|
||||
}
|
||||
},
|
||||
'rubick-color': {
|
||||
pick() {
|
||||
ipcRenderer.send('start-picker')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import {WINDOW_MAX_HEIGHT, WINDOW_MIN_HEIGHT, PRE_ITEM_HEIGHT} from './constans';
|
||||
import {WINDOW_MAX_HEIGHT, WINDOW_MIN_HEIGHT, PRE_ITEM_HEIGHT, SYSTEM_PLUGINS} from './constans';
|
||||
import download from 'download-git-repo';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
@@ -14,7 +14,6 @@ function getWindowHeight(searchList) {
|
||||
}
|
||||
|
||||
function searchKeyValues(lists, value){
|
||||
console.log(lists);
|
||||
return lists.filter(item => item.indexOf(value) >= 0)
|
||||
}
|
||||
|
||||
@@ -90,9 +89,24 @@ const sysFile = {
|
||||
}
|
||||
}
|
||||
|
||||
function mergePlugins(plugins) {
|
||||
return [
|
||||
...plugins,
|
||||
...SYSTEM_PLUGINS.map(plugin => {
|
||||
return {
|
||||
...plugin,
|
||||
status: true,
|
||||
sourceFile: '',
|
||||
type: 'system',
|
||||
}
|
||||
}),
|
||||
]
|
||||
}
|
||||
|
||||
export {
|
||||
getWindowHeight,
|
||||
searchKeyValues,
|
||||
downloadFunc,
|
||||
sysFile,
|
||||
mergePlugins,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user