mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-26 04:19:27 +08:00
✨ 增加用户体系
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
import commonConst from '@/common/utils/commonConst';
|
||||
|
||||
export default {
|
||||
version: 5,
|
||||
version: 9,
|
||||
perf: {
|
||||
custom: {
|
||||
primaryColor: '#106898',
|
||||
errorColor: '#ed6d46',
|
||||
warningColor: '#e5a84b',
|
||||
successColor: '#c0d695',
|
||||
infoColor: '#007175',
|
||||
logo: `file://${__static}/logo.png`,
|
||||
placeholder: '你好 rubick',
|
||||
},
|
||||
shortCut: {
|
||||
showAndHidden: 'Option+R',
|
||||
separate: 'Ctrl+D',
|
||||
@@ -12,8 +19,7 @@ export default {
|
||||
common: {
|
||||
start: true,
|
||||
space: true,
|
||||
// 是否失焦隐藏。默认在dev环境不隐藏,在打包后隐藏。
|
||||
hideOnBlur: commonConst.production(),
|
||||
hideOnBlur: true,
|
||||
autoPast: false,
|
||||
darkMode: false,
|
||||
},
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
import getLocalDataFile from "./getLocalDataFile";
|
||||
import defaultConfigForAnyPlatform from "../constans/defaultConfig";
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import getLocalDataFile from './getLocalDataFile';
|
||||
import defaultConfigForAnyPlatform from '../constans/defaultConfig';
|
||||
|
||||
const configPath = path.join(getLocalDataFile(), "./rubick-config.json");
|
||||
const configPath = path.join(getLocalDataFile(), './rubick-config.json');
|
||||
|
||||
global.OP_CONFIG = {
|
||||
config: null,
|
||||
getDefaultConfig() {
|
||||
return defaultConfigForAnyPlatform;
|
||||
},
|
||||
get() {
|
||||
try {
|
||||
if (!global.OP_CONFIG.config) {
|
||||
global.OP_CONFIG.config = JSON.parse(
|
||||
fs.readFileSync(configPath, "utf8") ||
|
||||
fs.readFileSync(configPath, 'utf8') ||
|
||||
JSON.stringify(defaultConfigForAnyPlatform)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class VersionHandler {
|
||||
if (releaseName === 'major') {
|
||||
autoUpdater.quitAndInstall(true, true);
|
||||
}
|
||||
const mainWindow = main().getWindow()
|
||||
const mainWindow = main().getWindow();
|
||||
dialog
|
||||
.showMessageBox(mainWindow, {
|
||||
title: '版本更新',
|
||||
|
||||
@@ -60,7 +60,7 @@ const renderTitle = (title) => {
|
||||
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: var(--ant-error-color)'>${props.searchValue}</span>${result[1]}</div>`;
|
||||
} else {
|
||||
return `<div>${result[0]}</div>`;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
@keydown.up="e => keydownEvent(e, 'up')"
|
||||
@keydown="e => checkNeedInit(e)"
|
||||
:value="searchValue"
|
||||
:placeholder="placeholder || 'Hi, Rubick2'"
|
||||
:placeholder="placeholder || config.perf.custom.placeholder"
|
||||
@keypress.enter="e => keydownEvent(e, 'enter')"
|
||||
@keypress.space="e => keydownEvent(e, 'space')"
|
||||
@focus="emit('focus')"
|
||||
@@ -43,7 +43,7 @@
|
||||
<img class="icon-tool" :src="currentPlugin.logo" />
|
||||
</div>
|
||||
<div @click="() => emit('openMenu')" v-else class="rubick-logo">
|
||||
<img src="../assets/logo.png" />
|
||||
<img :src="config.perf.custom.logo" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -249,7 +249,7 @@ window.rubick.hooks.onHide = () => {
|
||||
height: 32px;
|
||||
position: relative;
|
||||
color: #fff;
|
||||
background-color: rgba(255, 78, 164, 0.8);
|
||||
background-color: var(--ant-primary-color);
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
margin-right: 1px;
|
||||
@@ -305,7 +305,7 @@ window.rubick.hooks.onHide = () => {
|
||||
color: var(--color-text-content);
|
||||
}
|
||||
.loading {
|
||||
color: #ff4ea4;
|
||||
color: var(--ant-primary-color);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
import { createApp } from 'vue';
|
||||
import { Button, List, Spin, Input, Avatar, Tag } from 'ant-design-vue';
|
||||
import {
|
||||
Button,
|
||||
List,
|
||||
Spin,
|
||||
Input,
|
||||
Avatar,
|
||||
Tag,
|
||||
ConfigProvider,
|
||||
} from 'ant-design-vue';
|
||||
import App from './App.vue';
|
||||
|
||||
import 'ant-design-vue/dist/antd.variable.min.css';
|
||||
|
||||
const { remote } = window.require('electron');
|
||||
|
||||
const { perf } = remote.getGlobal('OP_CONFIG').get();
|
||||
|
||||
ConfigProvider.config({
|
||||
theme: perf.custom || {},
|
||||
});
|
||||
|
||||
createApp(App)
|
||||
.use(Button)
|
||||
.use(List)
|
||||
|
||||
Reference in New Issue
Block a user