Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
feat:complete the build configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
hunter-ji committed Mar 8, 2022
1 parent 3a4e51f commit 1f321f9
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 4 deletions.
Binary file added build/icon.icns
Binary file not shown.
Binary file added build/icon.ico
Binary file not shown.
Binary file added build/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/mac/icon.icns
Binary file not shown.
Binary file added build/icons/png/1024x1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/png/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/png/16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/png/24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/png/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/png/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/png/48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/png/512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/png/64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build/icons/win/icon.ico
Binary file not shown.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"postinstall": "electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps"
},
"author": "Kuari",
"license": "GPL",
"main": "background.js",
"dependencies": {
"@element-plus/icons-vue": "^0.2.4",
Expand Down
7 changes: 7 additions & 0 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ async function createWindow () {
}
}

// 避免开启多个客户端窗口
const gotTheLock = app.requestSingleInstanceLock()

if (!gotTheLock) {
app.quit()
}

// Quit when all windows are closed.
app.on('window-all-closed', () => {
// On macOS it is common for applications and their menu bar
Expand Down
4 changes: 2 additions & 2 deletions src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
{
Expand All @@ -9,7 +9,7 @@ const routes: Array<RouteRecordRaw> = [
]

const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
history: createWebHashHistory(process.env.BASE_URL),
routes
})

Expand Down
2 changes: 1 addition & 1 deletion src/views/keyTab/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@tab-remove="removeTab"
editable
@edit="handleTabEdit"
style="width: calc(100vw - 680px);user-select: none;"
style="width: calc(100vw - 680px);"
>
<!-- console tab -->
<el-tab-pane label="Console" name="Console" :closable="false">
Expand Down
49 changes: 48 additions & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')

module.exports = {
productionSourceMap: false,
chainWebpack: config => {
config.module.rule('pug')
.test(/\.pug$/)
Expand All @@ -22,7 +23,53 @@ module.exports = {
electronBuilder: {
nodeIntegration: true,
disableMainProcessTypescript: false,
mainProcessTypeChecking: false
mainProcessTypeChecking: false,
build: {
productName: 'MyRedisDesktopManager',
appId: 'com.MyRedisDesktopManager.client',
copyright: '© Kuari 2022',
nsis: {
oneClick: false,
allowElevation: true,
allowToChangeInstallationDirectory: true,
installerIcon: 'build/icon.ico',
uninstallerIcon: 'build/icon.ico',
installerHeaderIcon: 'build/icon.ico',
createDesktopShortcut: true,
createStartMenuShortcut: true,
shortcutName: 'MyRedisDesktopManager'
},
win: {
icon: 'build/icon.ico',
requestedExecutionLevel: 'requireAdministrator',
target: [
{
target: 'nsis'
}
]
},
dmg: {
contents: [
{
x: 410,
y: 150,
type: 'link',
path: '/Applications'
},
{
x: 130,
y: 150,
type: 'file'
}
]
},
mac: {
icon: 'build/icon.icns'
},
linux: {
icon: 'build/icon.ico'
}
}
}
}
}

0 comments on commit 1f321f9

Please sign in to comment.