Skip to content

Commit 8c3186a

Browse files
author
wangwei1240
committed
Merge remote-tracking branch 'origin/master'
2 parents de0e9ed + ef85084 commit 8c3186a

File tree

10 files changed

+94
-72
lines changed

10 files changed

+94
-72
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
os: [macos-11, windows-2019, ubuntu-latest]
26+
os: [macos-latest, windows-2019, ubuntu-latest]
2727

2828
# create steps
2929
steps:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ Those who are interested in this project or want to exchange and learn can scan
109109

110110
![image](https://user-images.githubusercontent.com/21073039/127327603-9796f246-ee4b-4950-a69d-ce3205ec9569.png)
111111

112+
<a href="https://hellogithub.com/repository/0a3e2484b44e481e9dcf1850e45193cd" target="_blank"><img src="https://api.hellogithub.com/v1/widgets/recommend.svg?rid=0a3e2484b44e481e9dcf1850e45193cd&claim_uid=vXGwjpmYNsBex0C" alt="Featured|HelloGitHub" style="width: 250px; height: 54px;" width="250" height="54" /></a>
113+
112114
## Contribute
113115
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/rubickCenter/rubick/graphs/contributors)]. <a href="https://github.com/rubickCenter/rubick/graphs/contributors"><img src="https://opencollective.com/rubick/contributors.svg?width=890&button=false" /></a>
114116

feature/src/App.vue

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,37 @@
88
>
99
<a-menu-item key="finder">
1010
<template #icon>
11-
<StarOutlined style="font-size: 18px;" />
11+
<StarOutlined style="font-size: 16px" />
1212
</template>
1313
{{ $t('feature.market.explore') }}
1414
</a-menu-item>
1515
<a-menu-item key="worker">
1616
<template #icon>
17-
<SendOutlined style="transform: rotate(-45deg); font-size: 18px;" />
17+
<SendOutlined style="transform: rotate(-45deg); font-size: 16px" />
1818
</template>
1919
{{ $t('feature.market.efficiency') }}
2020
</a-menu-item>
2121
<a-menu-item key="tools">
2222
<template #icon>
23-
<SearchOutlined style="font-size: 18px;" />
23+
<SearchOutlined style="font-size: 16px" />
2424
</template>
2525
{{ $t('feature.market.searchTool') }}
2626
</a-menu-item>
2727
<a-menu-item key="image">
2828
<template #icon>
29-
<FileImageOutlined style="font-size: 18px;" />
29+
<FileImageOutlined style="font-size: 16px" />
3030
</template>
3131
{{ $t('feature.market.imageTool') }}
3232
</a-menu-item>
3333
<a-menu-item key="devPlugin">
3434
<template #icon>
35-
<CodeOutlined style="font-size: 18px;" />
35+
<CodeOutlined style="font-size: 16px" />
3636
</template>
3737
{{ $t('feature.market.developTool') }}
3838
</a-menu-item>
3939
<a-menu-item key="system">
4040
<template #icon>
41-
<DatabaseOutlined style="font-size: 18px;" />
41+
<DatabaseOutlined style="font-size: 16px" />
4242
</template>
4343
{{ $t('feature.market.systemTool') }}
4444
</a-menu-item>
@@ -72,7 +72,21 @@
7272
</a-sub-menu>
7373
</a-menu>
7474
</div>
75-
<div :class="['finder', 'result', 'devPlugin', 'image', 'tools', 'worker', 'system'].includes(active[0]) ? 'container' : 'more'">
75+
<div
76+
:class="
77+
[
78+
'finder',
79+
'result',
80+
'devPlugin',
81+
'image',
82+
'tools',
83+
'worker',
84+
'system',
85+
].includes(active[0])
86+
? 'container'
87+
: 'more'
88+
"
89+
>
7690
<keep-alive>
7791
<router-view />
7892
</keep-alive>
@@ -103,14 +117,14 @@ const active = computed(() => store.state.active);
103117
const { perf } = localConfig.getConfig();
104118
105119
const changeMenu = (key: any) => {
106-
store.commit('commonUpdate', {active: [key]})
120+
store.commit('commonUpdate', { active: [key] });
107121
router.push(key);
108122
};
109123
110124
window.rubick.onPluginEnter(({ code }: { code: string }) => {
111125
code = code === '已安装插件' ? 'installed' : code;
112126
changeMenu(code);
113-
store.commit('commonUpdate', {active: [code]})
127+
store.commit('commonUpdate', { active: [code] });
114128
});
115129
116130
window.rubick.setSubInput((e: any) => {
@@ -129,7 +143,7 @@ window.rubick.setSubInput((e: any) => {
129143
store.commit('setSearchValue', e.text);
130144
router.push('result');
131145
} else {
132-
store.commit('commonUpdate', {active: ['finder']})
146+
store.commit('commonUpdate', { active: ['finder'] });
133147
router.push('finder');
134148
}
135149
}
@@ -144,13 +158,16 @@ init();
144158
background: var(--color-body-bg2) !important;
145159
height: 100%;
146160
border-right: none;
147-
.ant-menu-item, .ant-menu-submenu, .ant-menu-submenu-arrow {
161+
.ant-menu-item,
162+
.ant-menu-submenu,
163+
.ant-menu-submenu-arrow {
148164
color: var(--color-text-content);
149165
&:active {
150166
background: none;
151167
}
152168
}
153-
.ant-menu-item-selected, .ant-menu-submenu-selected {
169+
.ant-menu-item-selected,
170+
.ant-menu-submenu-selected {
154171
background-color: var(--color-list-hover);
155172
color: var(--ant-primary-color);
156173
.ant-menu-submenu-arrow {
@@ -203,9 +220,12 @@ init();
203220
background: var(--color-body-bg2);
204221
}
205222
.left-menu {
206-
padding: 24px 16px;
223+
padding: 16px;
207224
position: relative;
208225
height: 100vh;
226+
:deep(.ant-menu) {
227+
width: 100%;
228+
}
209229
:deep(.ant-menu-item) {
210230
padding-left: 12px !important;
211231
display: flex;
@@ -219,7 +239,14 @@ init();
219239
}
220240
:deep(.user-info) {
221241
position: absolute;
222-
bottom: 32px;
242+
bottom: 16px;
243+
width: calc(100% - 32px);
244+
.ant-menu-submenu-title {
245+
padding: 0 32px 0 8px;
246+
.ant-menu-title-content {
247+
margin-left: 8px;
248+
}
249+
}
223250
}
224251
:deep(.ant-avatar) {
225252
background: transparent;

feature/src/assets/request/index.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import axios from 'axios';
22

3-
let baseURL = 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master';
3+
let baseURL = 'https://gitee.com/monkeyWang/rubickdatabase/raw/master';
44
let access_token = '';
55

66
try {
@@ -14,7 +14,7 @@ try {
1414
const instance = axios.create({
1515
timeout: 4000,
1616
baseURL:
17-
baseURL || 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master',
17+
baseURL || 'https://gitee.com/monkeyWang/rubickdatabase/raw/master',
1818
});
1919

2020
export default {
@@ -23,9 +23,10 @@ export default {
2323
if (access_token) {
2424
targetPath = `${encodeURIComponent(
2525
targetPath
26-
)}/raw?access_token=${access_token}&ref=master`;
26+
)}?access_token=${access_token}&ref=master`;
2727
}
2828
const res = await instance.get(targetPath);
29+
console.log('total plugsin', res);
2930
return res.data;
3031
},
3132

@@ -34,7 +35,7 @@ export default {
3435
if (access_token) {
3536
targetPath = `${encodeURIComponent(
3637
targetPath
37-
)}/raw?access_token=${access_token}&ref=master`;
38+
)}?access_token=${access_token}&ref=master`;
3839
}
3940
const res = await instance.get(targetPath);
4041
return res.data;
@@ -45,7 +46,7 @@ export default {
4546
if (access_token) {
4647
targetPath = `${encodeURIComponent(
4748
targetPath
48-
)}/raw?access_token=${access_token}&ref=master`;
49+
)}?access_token=${access_token}&ref=master`;
4950
}
5051
const res = await instance.get(targetPath);
5152
return res.data;
@@ -55,7 +56,7 @@ export default {
5556
if (access_token) {
5657
targetPath = `${encodeURIComponent(
5758
targetPath
58-
)}/raw?access_token=${access_token}&ref=master`;
59+
)}?access_token=${access_token}&ref=master`;
5960
}
6061
const res = await instance.get(targetPath);
6162
return res.data;
@@ -71,7 +72,7 @@ export default {
7172
if (access_token) {
7273
targetPath = `${encodeURIComponent(
7374
targetPath
74-
)}/raw?access_token=${access_token}&ref=master`;
75+
)}?access_token=${access_token}&ref=master`;
7576
}
7677
const res = await instance.get(targetPath);
7778
return res.data;
@@ -81,7 +82,7 @@ export default {
8182
if (access_token) {
8283
targetPath = `${encodeURIComponent(
8384
targetPath
84-
)}/raw?access_token=${access_token}&ref=master`;
85+
)}?access_token=${access_token}&ref=master`;
8586
}
8687
const res = await instance.get(targetPath);
8788
return res.data;
@@ -91,7 +92,7 @@ export default {
9192
if (access_token) {
9293
targetPath = `${encodeURIComponent(
9394
targetPath
94-
)}/raw?access_token=${access_token}&ref=master`;
95+
)}?access_token=${access_token}&ref=master`;
9596
}
9697
const res = await instance.get(targetPath);
9798
return res.data;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rubick",
3-
"version": "4.2.3",
3+
"version": "4.2.9",
44
"author": "muwoo <2424880409@qq.com>",
55
"private": true,
66
"scripts": {

src/main/browsers/runner.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -175,31 +175,29 @@ export default () => {
175175

176176
const removeView = (window: BrowserWindow) => {
177177
if (!view) return;
178-
window.removeBrowserView(view);
179-
if (!view.inDetach) {
180-
window.setBrowserView(null);
181-
view.webContents?.destroy();
182-
}
183-
184-
// window.setSize(800, 60);
185178
executeHooks('PluginOut', null);
186-
window.webContents?.executeJavaScript(`window.initRubick()`);
187-
view = undefined;
179+
setTimeout(() => {
180+
window.removeBrowserView(view);
181+
if (!view.inDetach) {
182+
window.setBrowserView(null);
183+
view.webContents?.destroy();
184+
}
185+
window.webContents?.executeJavaScript(`window.initRubick()`);
186+
view = undefined;
187+
}, 0);
188188
};
189189

190190
const getView = () => view;
191191

192192
const executeHooks = (hook, data) => {
193-
setTimeout(() => {
194-
if (!view) return;
195-
const evalJs = `if(window.rubick && window.rubick.hooks && typeof window.rubick.hooks.on${hook} === 'function' ) {
193+
if (!view) return;
194+
const evalJs = `if(window.rubick && window.rubick.hooks && typeof window.rubick.hooks.on${hook} === 'function' ) {
196195
try {
197196
window.rubick.hooks.on${hook}(${data ? JSON.stringify(data) : ''});
198197
} catch(e) {}
199198
}
200199
`;
201-
view.webContents?.executeJavaScript(evalJs);
202-
}, 300);
200+
view.webContents?.executeJavaScript(evalJs);
203201
};
204202

205203
return {

src/main/common/api.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ class API extends DBInstance {
128128
}
129129

130130
public removePlugin(e, window) {
131-
this.currentPlugin = null;
132131
runnerInstance.removeView(window);
132+
this.currentPlugin = null;
133133
}
134134

135135
public openPluginDevTools() {
@@ -211,11 +211,10 @@ class API extends DBInstance {
211211
if (!Notification.isSupported()) return;
212212
'string' != typeof body && (body = String(body));
213213
const plugin = this.currentPlugin;
214-
if (!plugin) return;
215214
const notify = new Notification({
216-
title: plugin.pluginName,
215+
title: plugin ? plugin.pluginName : null,
217216
body,
218-
icon: plugin.logo,
217+
icon: plugin ? plugin.logo : null,
219218
});
220219
notify.show();
221220
}

src/renderer/App.vue

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<template>
2-
<div
3-
id="components-layout"
4-
@mousedown="onMouseDown"
5-
>
2+
<div id="components-layout" @mousedown="onMouseDown">
63
<Search
74
:currentPlugin="currentPlugin"
85
@changeCurrent="changeIndex"
@@ -94,7 +91,9 @@ watch(
9491
window.rubick.setExpendHeight(
9592
getWindowHeight(
9693
options.value,
97-
(pluginLoading.value || !config.value.perf.common.history) ? [] : pluginHistory.value
94+
pluginLoading.value || !config.value.perf.common.history
95+
? []
96+
: pluginHistory.value
9897
)
9998
);
10099
},
@@ -104,26 +103,15 @@ watch(
104103
);
105104
106105
const changeIndex = (index) => {
107-
if (!options.value.length) {
108-
if (!pluginHistory.value.length) return;
109-
if (
110-
currentSelect.value + index > pluginHistory.value.length - 1 ||
111-
currentSelect.value + index < 0
112-
) {
113-
currentSelect.value = 0;
114-
return;
115-
}
116-
currentSelect.value = currentSelect.value + index;
117-
return;
118-
}
119-
if (
120-
currentSelect.value + index > options.value.length - 1 ||
121-
currentSelect.value + index < 0
122-
) {
106+
const len = options.value.length || pluginHistory.value.length;
107+
if (!len) return;
108+
if (currentSelect.value + index > len - 1) {
123109
currentSelect.value = 0;
124-
return;
110+
} else if (currentSelect.value + index < 0) {
111+
currentSelect.value = len - 1;
112+
} else {
113+
currentSelect.value = currentSelect.value + index;
125114
}
126-
currentSelect.value = currentSelect.value + index;
127115
};
128116
129117
const openMenu = (ext) => {
@@ -161,7 +149,9 @@ const choosePlugin = (plugin) => {
161149
});
162150
if (hasRemove) {
163151
const result = window.rubick.db.get(PLUGIN_HISTORY) || {};
164-
const history = result.data.filter(item => item.originName !== currentChoose.originName);
152+
const history = result.data.filter(
153+
(item) => item.originName !== currentChoose.originName
154+
);
165155
setPluginHistory(history);
166156
return message.warning('插件已被卸载!');
167157
}

0 commit comments

Comments
 (0)