Skip to content

Commit defd79a

Browse files
committed
1. Optimize the version checking and update process
1 parent afe9faf commit defd79a

File tree

7 files changed

+34
-30
lines changed

7 files changed

+34
-30
lines changed

build/macos.build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 11
1+
version: 12

build/windows.build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 20
1+
version: 21

src/fork/module/Mongodb/index.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -303,24 +303,8 @@ class Manager extends Base {
303303
return new ForkPromise(async (resolve, reject) => {
304304
try {
305305
let all: Array<string> = []
306-
const command =
307-
'brew search -q --desc --eval-all --formula "High-performance, schema-free, document-oriented database"'
308-
all = await brewSearch(all, command, (content) => {
309-
content = content
310-
.replace('==> Formulae', '')
311-
.replace(
312-
new RegExp(
313-
': High-performance, schema-free, document-oriented database \\(Enterprise\\)',
314-
'g'
315-
),
316-
''
317-
)
318-
.replace(
319-
new RegExp(': High-performance, schema-free, document-oriented database', 'g'),
320-
''
321-
)
322-
return content
323-
})
306+
const command = 'brew search -q --formula "/mongodb-(community|enterprise)(@[\\d\\.]+)?$/"'
307+
all = await brewSearch(all, command)
324308
const info = await brewInfoJson(all)
325309
resolve(info)
326310
} catch (e) {

src/lang/en/setup.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@
4949

5050
"flyenvHelper": "Fix FlyEnv Helper",
5151
"flyenvHelperBtn": "Fix",
52-
"flyenvHelperFixSuccess": "FlyEnv Helper Fixed Successfully"
52+
"flyenvHelperFixSuccess": "FlyEnv Helper Fixed Successfully",
53+
"flyenvHelperInstallFailTips": "FlyEnv helper installation failed. Please try running FlyEnv with administrator privileges, or click the OK button and manually run the flyenv-helper.exe helper program in the opened folder."
5354
}

src/lang/zh/setup.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@
4949

5050
"flyenvHelper": "FlyEnv帮助程序修复",
5151
"flyenvHelperBtn": "修复",
52-
"flyenvHelperFixSuccess": "FlyEnv帮助程序修复成功"
52+
"flyenvHelperFixSuccess": "FlyEnv帮助程序修复成功",
53+
"flyenvHelperInstallFailTips": "FlyEnv帮助程序安装失败,请尝试使用管理员权限启动FlyEnv, 或者点击确定按钮, 在打开的文件夹中, 手动运行flyenv-helper.exe帮助程序"
5354
}

src/render/main.ts

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { reactive } from 'vue'
22
import { VueExtend } from './core/VueExtend'
3-
import { AppI18n } from '@lang/index'
3+
import { AppI18n, I18nT } from '@lang/index'
44
import App from './App.vue'
55
// import App from './APPTest.vue'
66
import './index.scss'
@@ -15,16 +15,17 @@ import { AppToolStore } from '@/components/Tools/store'
1515
import { SetupStore } from '@/components/Setup/store'
1616
import { AppLogStore } from '@/components/AppLog/store'
1717
import { AppCustomerModule } from '@/core/Module'
18-
import { lang, nativeTheme } from '@/util/NodeFn'
18+
import { dialog, lang, nativeTheme, shell, app } from '@/util/NodeFn'
1919
import { MessageError, MessageSuccess, MessageWarning } from '@/util/Element'
2020
import { AsyncComponentShow } from '@/util/AsyncComponent'
2121
import { FlyEnvHelperSetup } from '@/components/FlyEnvHelper/setup'
2222
import { isEqual } from 'lodash-es'
2323
import CapturerSetup from '@/components/Tools/Capturer/setup'
24+
import { join } from '@/util/path-browserify'
2425

2526
window.Server = reactive({}) as any
2627

27-
const app = VueExtend(App)
28+
const appRoot = VueExtend(App)
2829
lang.loadCustomerLang().then().catch()
2930

3031
let inited = false
@@ -42,7 +43,7 @@ IPC.on('APP-Ready-To-Show').then((key: string, res: any) => {
4243
ThemeInit()
4344
const config = store.config.setup
4445
AppI18n(config?.lang)
45-
app.mount('#app')
46+
appRoot.mount('#app')
4647
})
4748
.catch()
4849
SiteSuckerStore().init()
@@ -92,9 +93,25 @@ IPC.on('APP-FlyEnv-Helper-Notice').then((key: string, res: any) => {
9293
} else if (res.code === 1) {
9394
MessageError(res?.msg)
9495
if (res?.status === 'installFaild' && inited && !FlyEnvHelperSetup.show) {
95-
import('@/components/FlyEnvHelper/index.vue').then((m) => {
96-
AsyncComponentShow(m.default).then()
97-
})
96+
if (window.Server.isWindows) {
97+
dialog
98+
.showMessageBox({
99+
type: 'info',
100+
title: I18nT('host.warning'),
101+
message: I18nT('setup.flyenvHelperInstallFailTips'),
102+
buttons: [I18nT('base.confirm')]
103+
})
104+
.then(() => {
105+
app.getPath('exe').then((path: string) => {
106+
const item = join(path, 'resources/helper/flyenv-helper.exe')
107+
shell.showItemInFolder(item).catch()
108+
})
109+
})
110+
} else {
111+
import('@/components/FlyEnvHelper/index.vue').then((m) => {
112+
AsyncComponentShow(m.default).then()
113+
})
114+
}
98115
}
99116
} else if (res.code === 2) {
100117
MessageWarning(res?.msg)

src/render/store/app.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ export const AppStore = defineStore('app', {
316316
I18nT('update.view-update-log'),
317317
I18nT('update.download-new-version')
318318
],
319-
cancelId: 0
319+
cancelId: 0,
320+
defaultId: 1
320321
})
321322
.then(({ response }) => {
322323
if (response === 1) {

0 commit comments

Comments
 (0)