feat(页面布局): 调整头部菜单的路由控制,删除dist目录
This commit is contained in:
parent
0c0bd0fd20
commit
ac3bb6b4fd
Binary file not shown.
Before Width: | Height: | Size: 27 KiB |
|
@ -1,229 +0,0 @@
|
|||
x64:
|
||||
firstOrDefaultFilePatterns:
|
||||
- '**/*'
|
||||
- '!**/node_modules'
|
||||
- '!build{,/**/*}'
|
||||
- '!dist{,/**/*}'
|
||||
- '!**/.vscode/*'
|
||||
- '!src/*'
|
||||
- '!electron.vite.config.{js,ts,mjs,cjs}'
|
||||
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
|
||||
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
|
||||
- '!**/*.{iml,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,suo,xproj,cc,d.ts,mk,a,o,forge-meta,pdb}'
|
||||
- '!**/._*'
|
||||
- '!**/electron-builder.{yaml,yml,json,json5,toml,ts}'
|
||||
- '!**/{.git,.hg,.svn,CVS,RCS,SCCS,__pycache__,.DS_Store,thumbs.db,.gitignore,.gitkeep,.gitattributes,.npmignore,.idea,.vs,.flowconfig,.jshintrc,.eslintrc,.circleci,.yarn-integrity,.yarn-metadata.json,yarn-error.log,yarn.lock,package-lock.json,npm-debug.log,appveyor.yml,.travis.yml,circle.yml,.nyc_output,.husky,.github,electron-builder.env}'
|
||||
- '!.yarn{,/**/*}'
|
||||
- '!.editorconfig'
|
||||
- '!.yarnrc.yml'
|
||||
nodeModuleFilePatterns:
|
||||
- '**/*'
|
||||
- '!**/.vscode/*'
|
||||
- '!src/*'
|
||||
- '!electron.vite.config.{js,ts,mjs,cjs}'
|
||||
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
|
||||
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
|
||||
nsis:
|
||||
script: |-
|
||||
!include "F:\pc\gateway-ui\node_modules\app-builder-lib\templates\nsis\include\StdUtils.nsh"
|
||||
!addincludedir "F:\pc\gateway-ui\node_modules\app-builder-lib\templates\nsis\include"
|
||||
!macro _isUpdated _a _b _t _f
|
||||
${StdUtils.TestParameter} $R9 "updated"
|
||||
StrCmp "$R9" "true" `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define isUpdated `"" isUpdated ""`
|
||||
|
||||
!macro _isForceRun _a _b _t _f
|
||||
${StdUtils.TestParameter} $R9 "force-run"
|
||||
StrCmp "$R9" "true" `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define isForceRun `"" isForceRun ""`
|
||||
|
||||
!macro _isKeepShortcuts _a _b _t _f
|
||||
${StdUtils.TestParameter} $R9 "keep-shortcuts"
|
||||
StrCmp "$R9" "true" `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define isKeepShortcuts `"" isKeepShortcuts ""`
|
||||
|
||||
!macro _isNoDesktopShortcut _a _b _t _f
|
||||
${StdUtils.TestParameter} $R9 "no-desktop-shortcut"
|
||||
StrCmp "$R9" "true" `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define isNoDesktopShortcut `"" isNoDesktopShortcut ""`
|
||||
|
||||
!macro _isDeleteAppData _a _b _t _f
|
||||
${StdUtils.TestParameter} $R9 "delete-app-data"
|
||||
StrCmp "$R9" "true" `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define isDeleteAppData `"" isDeleteAppData ""`
|
||||
|
||||
!macro _isForAllUsers _a _b _t _f
|
||||
${StdUtils.TestParameter} $R9 "allusers"
|
||||
StrCmp "$R9" "true" `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define isForAllUsers `"" isForAllUsers ""`
|
||||
|
||||
!macro _isForCurrentUser _a _b _t _f
|
||||
${StdUtils.TestParameter} $R9 "currentuser"
|
||||
StrCmp "$R9" "true" `${_t}` `${_f}`
|
||||
!macroend
|
||||
!define isForCurrentUser `"" isForCurrentUser ""`
|
||||
|
||||
!macro addLangs
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
!insertmacro MUI_LANGUAGE "German"
|
||||
!insertmacro MUI_LANGUAGE "French"
|
||||
!insertmacro MUI_LANGUAGE "SpanishInternational"
|
||||
!insertmacro MUI_LANGUAGE "SimpChinese"
|
||||
!insertmacro MUI_LANGUAGE "TradChinese"
|
||||
!insertmacro MUI_LANGUAGE "Japanese"
|
||||
!insertmacro MUI_LANGUAGE "Korean"
|
||||
!insertmacro MUI_LANGUAGE "Italian"
|
||||
!insertmacro MUI_LANGUAGE "Dutch"
|
||||
!insertmacro MUI_LANGUAGE "Danish"
|
||||
!insertmacro MUI_LANGUAGE "Swedish"
|
||||
!insertmacro MUI_LANGUAGE "Norwegian"
|
||||
!insertmacro MUI_LANGUAGE "Finnish"
|
||||
!insertmacro MUI_LANGUAGE "Russian"
|
||||
!insertmacro MUI_LANGUAGE "Portuguese"
|
||||
!insertmacro MUI_LANGUAGE "PortugueseBR"
|
||||
!insertmacro MUI_LANGUAGE "Polish"
|
||||
!insertmacro MUI_LANGUAGE "Ukrainian"
|
||||
!insertmacro MUI_LANGUAGE "Czech"
|
||||
!insertmacro MUI_LANGUAGE "Slovak"
|
||||
!insertmacro MUI_LANGUAGE "Hungarian"
|
||||
!insertmacro MUI_LANGUAGE "Arabic"
|
||||
!insertmacro MUI_LANGUAGE "Turkish"
|
||||
!insertmacro MUI_LANGUAGE "Thai"
|
||||
!insertmacro MUI_LANGUAGE "Vietnamese"
|
||||
!macroend
|
||||
|
||||
!include "C:\Users\Administrator\AppData\Local\Temp\t-0Y9MVm\1-messages.nsh"
|
||||
!include "C:\Users\Administrator\AppData\Local\Temp\t-0Y9MVm\0-messages.nsh"
|
||||
!addplugindir /x86-unicode "C:\Users\Administrator\AppData\Local\electron-builder\Cache\nsis\nsis-resources-3.4.1\plugins\x86-unicode"
|
||||
|
||||
Var newStartMenuLink
|
||||
Var oldStartMenuLink
|
||||
Var newDesktopLink
|
||||
Var oldDesktopLink
|
||||
Var oldShortcutName
|
||||
Var oldMenuDirectory
|
||||
|
||||
!include "common.nsh"
|
||||
!include "MUI2.nsh"
|
||||
!include "multiUser.nsh"
|
||||
!include "allowOnlyOneInstallerInstance.nsh"
|
||||
|
||||
!ifdef INSTALL_MODE_PER_ALL_USERS
|
||||
!ifdef BUILD_UNINSTALLER
|
||||
RequestExecutionLevel user
|
||||
!else
|
||||
RequestExecutionLevel admin
|
||||
!endif
|
||||
!else
|
||||
RequestExecutionLevel user
|
||||
!endif
|
||||
|
||||
!ifdef BUILD_UNINSTALLER
|
||||
SilentInstall silent
|
||||
!else
|
||||
Var appExe
|
||||
Var launchLink
|
||||
!endif
|
||||
|
||||
!ifdef ONE_CLICK
|
||||
!include "oneClick.nsh"
|
||||
!else
|
||||
!include "assistedInstaller.nsh"
|
||||
!endif
|
||||
|
||||
!insertmacro addLangs
|
||||
|
||||
!ifmacrodef customHeader
|
||||
!insertmacro customHeader
|
||||
!endif
|
||||
|
||||
Function .onInit
|
||||
Call setInstallSectionSpaceRequired
|
||||
|
||||
SetOutPath $INSTDIR
|
||||
${LogSet} on
|
||||
|
||||
!ifmacrodef preInit
|
||||
!insertmacro preInit
|
||||
!endif
|
||||
|
||||
!ifdef DISPLAY_LANG_SELECTOR
|
||||
!insertmacro MUI_LANGDLL_DISPLAY
|
||||
!endif
|
||||
|
||||
!ifdef BUILD_UNINSTALLER
|
||||
WriteUninstaller "${UNINSTALLER_OUT_FILE}"
|
||||
!insertmacro quitSuccess
|
||||
!else
|
||||
!insertmacro check64BitAndSetRegView
|
||||
|
||||
!ifdef ONE_CLICK
|
||||
!insertmacro ALLOW_ONLY_ONE_INSTALLER_INSTANCE
|
||||
!else
|
||||
${IfNot} ${UAC_IsInnerInstance}
|
||||
!insertmacro ALLOW_ONLY_ONE_INSTALLER_INSTANCE
|
||||
${EndIf}
|
||||
!endif
|
||||
|
||||
!insertmacro initMultiUser
|
||||
|
||||
!ifmacrodef customInit
|
||||
!insertmacro customInit
|
||||
!endif
|
||||
|
||||
!ifmacrodef addLicenseFiles
|
||||
InitPluginsDir
|
||||
!insertmacro addLicenseFiles
|
||||
!endif
|
||||
!endif
|
||||
FunctionEnd
|
||||
|
||||
!ifndef BUILD_UNINSTALLER
|
||||
!include "installUtil.nsh"
|
||||
!endif
|
||||
|
||||
Section "install" INSTALL_SECTION_ID
|
||||
!ifndef BUILD_UNINSTALLER
|
||||
# If we're running a silent upgrade of a per-machine installation, elevate so extracting the new app will succeed.
|
||||
# For a non-silent install, the elevation will be triggered when the install mode is selected in the UI,
|
||||
# but that won't be executed when silent.
|
||||
!ifndef INSTALL_MODE_PER_ALL_USERS
|
||||
!ifndef ONE_CLICK
|
||||
${if} $hasPerMachineInstallation == "1" # set in onInit by initMultiUser
|
||||
${andIf} ${Silent}
|
||||
${ifNot} ${UAC_IsAdmin}
|
||||
ShowWindow $HWNDPARENT ${SW_HIDE}
|
||||
!insertmacro UAC_RunElevated
|
||||
${Switch} $0
|
||||
${Case} 0
|
||||
${Break}
|
||||
${Case} 1223 ;user aborted
|
||||
${Break}
|
||||
${Default}
|
||||
MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Unable to elevate, error $0"
|
||||
${Break}
|
||||
${EndSwitch}
|
||||
Quit
|
||||
${else}
|
||||
!insertmacro setInstallModePerAllUsers
|
||||
${endIf}
|
||||
${endIf}
|
||||
!endif
|
||||
!endif
|
||||
!include "installSection.nsh"
|
||||
!endif
|
||||
SectionEnd
|
||||
|
||||
Function setInstallSectionSpaceRequired
|
||||
!insertmacro setSpaceRequired ${INSTALL_SECTION_ID}
|
||||
FunctionEnd
|
||||
|
||||
!ifdef BUILD_UNINSTALLER
|
||||
!include "uninstaller.nsh"
|
||||
!endif
|
|
@ -1,56 +0,0 @@
|
|||
directories:
|
||||
output: dist
|
||||
buildResources: build
|
||||
appId: com.electron.app
|
||||
productName: 谷云工具
|
||||
files:
|
||||
- filter:
|
||||
- '!**/.vscode/*'
|
||||
- '!src/*'
|
||||
- '!electron.vite.config.{js,ts,mjs,cjs}'
|
||||
- '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}'
|
||||
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml}'
|
||||
asarUnpack:
|
||||
- resources/**
|
||||
win:
|
||||
icon: resources/icon.png
|
||||
nsis:
|
||||
artifactName: ${productName}-${version}-setup.${ext}
|
||||
shortcutName: ${productName}
|
||||
uninstallDisplayName: ${productName}
|
||||
createDesktopShortcut: always
|
||||
allowToChangeInstallationDirectory: true
|
||||
oneClick: false
|
||||
installerIcon: resources/icon.ico
|
||||
uninstallerIcon: resources/icon.ico
|
||||
installerHeader: resources/icon.png
|
||||
installerHeaderIcon: resources/icon.png
|
||||
mac:
|
||||
entitlementsInherit: build/entitlements.mac.plist
|
||||
extendInfo:
|
||||
- NSCameraUsageDescription: Application requests access to the device's camera.
|
||||
- NSMicrophoneUsageDescription: Application requests access to the device's microphone.
|
||||
- NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder.
|
||||
- NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder.
|
||||
notarize: false
|
||||
icon: resources/icon.png
|
||||
identity: null
|
||||
dmg:
|
||||
artifactName: ${name}-${version}.${ext}
|
||||
linux:
|
||||
target:
|
||||
- AppImage
|
||||
- snap
|
||||
- deb
|
||||
maintainer: electronjs.org
|
||||
category: Utility
|
||||
icon: resources/icon.png
|
||||
appImage:
|
||||
artifactName: ${name}-${version}.${ext}
|
||||
npmRebuild: false
|
||||
publish:
|
||||
provider: generic
|
||||
url: https://example.com/auto-updates
|
||||
electronDownload:
|
||||
mirror: https://npmmirror.com/mirrors/electron/
|
||||
electronVersion: 31.1.0
|
|
@ -1,8 +0,0 @@
|
|||
version: 1.0.0
|
||||
files:
|
||||
- url: 谷云工具-1.0.0-setup.exe
|
||||
sha512: aemDZR0UQP7yDRYYhhRLZKJcS9wPyeKzx9s72EeNg6UNxpisIhqdZsOFteQnb4v6ZLtrkGDHKUfycv8E+VwC5A==
|
||||
size: 109171792
|
||||
path: 谷云工具-1.0.0-setup.exe
|
||||
sha512: aemDZR0UQP7yDRYYhhRLZKJcS9wPyeKzx9s72EeNg6UNxpisIhqdZsOFteQnb4v6ZLtrkGDHKUfycv8E+VwC5A==
|
||||
releaseDate: '2024-07-19T09:35:20.628Z'
|
|
@ -1,21 +0,0 @@
|
|||
Copyright (c) Electron contributors
|
||||
Copyright (c) 2013-2020 GitHub Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,3 +0,0 @@
|
|||
provider: generic
|
||||
url: https://example.com/auto-updates
|
||||
updaterCacheDirName: gateway-app-updater
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 27 KiB |
Binary file not shown.
Before Width: | Height: | Size: 45 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
{"file_format_version": "1.0.0", "ICD": {"library_path": ".\\vk_swiftshader.dll", "api_version": "1.0.5"}}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,182 +1,182 @@
|
|||
import { app, shell, BrowserWindow, ipcMain, globalShortcut, dialog } from 'electron'
|
||||
import { join } from 'path'
|
||||
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
||||
import icon from '../../resources/icon.png?asset'
|
||||
import { app, shell, BrowserWindow, ipcMain, globalShortcut, dialog } from 'electron';
|
||||
import { join } from 'path';
|
||||
import { electronApp, optimizer, is } from '@electron-toolkit/utils';
|
||||
import icon from '../../resources/icon.png?asset';
|
||||
|
||||
//关闭exe命令
|
||||
function killProcessByName(processName) {
|
||||
const command = `taskkill /IM ${processName} /F`
|
||||
const { exec } = require('child_process')
|
||||
const command = `taskkill /IM ${processName} /F`;
|
||||
const { exec } = require('child_process');
|
||||
|
||||
exec(command, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.error(`执行的错误: ${error}`)
|
||||
return
|
||||
}
|
||||
console.log(`stdout: ${stdout}`)
|
||||
console.error(`stderr: ${stderr}`)
|
||||
})
|
||||
exec(command, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
console.error(`执行的错误: ${error}`);
|
||||
return;
|
||||
}
|
||||
console.log(`stdout: ${stdout}`);
|
||||
console.error(`stderr: ${stderr}`);
|
||||
});
|
||||
}
|
||||
|
||||
app.commandLine.appendSwitch('disable-web-security')
|
||||
app.commandLine.appendSwitch('disable-web-security');
|
||||
function createWindow() {
|
||||
// Create the browser window.
|
||||
const mainWindow = new BrowserWindow({
|
||||
width: 1100,
|
||||
height: 700,
|
||||
show: false,
|
||||
autoHideMenuBar: true,
|
||||
icon,
|
||||
webPreferences: {
|
||||
preload: join(__dirname, '../preload/index.js'),
|
||||
sandbox: false,
|
||||
nodeIntegration: true,
|
||||
// 禁用同源策略,允许跨域请求
|
||||
webSecurity: false,
|
||||
contextIsolation: false,
|
||||
csp: "default-src 'self'; connect-src 'self' *",
|
||||
// 禁止build环境使用DevTool
|
||||
// devTools: is.dev ? true : false
|
||||
devTools: true
|
||||
}
|
||||
})
|
||||
//开启调试
|
||||
// mainWindow.webContents.openDevTools()
|
||||
mainWindow.on('ready-to-show', () => {
|
||||
mainWindow.show()
|
||||
})
|
||||
// Create the browser window.
|
||||
const mainWindow = new BrowserWindow({
|
||||
width: 1100,
|
||||
height: 700,
|
||||
show: false,
|
||||
autoHideMenuBar: true,
|
||||
icon,
|
||||
webPreferences: {
|
||||
preload: join(__dirname, '../preload/index.js'),
|
||||
sandbox: false,
|
||||
nodeIntegration: true,
|
||||
// 禁用同源策略,允许跨域请求
|
||||
webSecurity: false,
|
||||
contextIsolation: false,
|
||||
csp: "default-src 'self'; connect-src 'self' *",
|
||||
// 禁止build环境使用DevTool
|
||||
// devTools: is.dev ? true : false
|
||||
devTools: true
|
||||
}
|
||||
});
|
||||
//开启调试
|
||||
// mainWindow.webContents.openDevTools()
|
||||
mainWindow.on('ready-to-show', () => {
|
||||
mainWindow.show();
|
||||
});
|
||||
|
||||
mainWindow.webContents.setWindowOpenHandler((details) => {
|
||||
shell.openExternal(details.url)
|
||||
return { action: 'deny' }
|
||||
})
|
||||
// HMR for renderer base on electron-vite cli.
|
||||
// Load the remote URL for development or the local html file for production.
|
||||
if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
|
||||
mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL'])
|
||||
} else {
|
||||
mainWindow.loadFile(join(__dirname, '../renderer/index.html'))
|
||||
}
|
||||
mainWindow.webContents.setWindowOpenHandler(details => {
|
||||
shell.openExternal(details.url);
|
||||
return { action: 'deny' };
|
||||
});
|
||||
// HMR for renderer base on electron-vite cli.
|
||||
// Load the remote URL for development or the local html file for production.
|
||||
if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
|
||||
mainWindow.loadURL(process.env['ELECTRON_RENDERER_URL']);
|
||||
} else {
|
||||
mainWindow.loadFile(join(__dirname, '../renderer/index.html'));
|
||||
}
|
||||
|
||||
// 设置DevTools快捷键
|
||||
// 设置DevTools快捷键
|
||||
globalShortcut.register('CommandOrControl+Shift+i', function () {
|
||||
mainWindow.webContents.openDevTools()
|
||||
})
|
||||
return mainWindow
|
||||
// 设置DevTools快捷键
|
||||
// 设置DevTools快捷键
|
||||
globalShortcut.register('CommandOrControl+Shift+i', function () {
|
||||
mainWindow.webContents.openDevTools();
|
||||
});
|
||||
return mainWindow;
|
||||
}
|
||||
|
||||
// 程序单例模式
|
||||
let myWindow = null
|
||||
const gotTheLock = app.requestSingleInstanceLock()
|
||||
let myWindow = null;
|
||||
const gotTheLock = app.requestSingleInstanceLock();
|
||||
if (!gotTheLock) {
|
||||
// 如果已经有同样的该程序正在运行,则不启动
|
||||
app.quit()
|
||||
// 如果已经有同样的该程序正在运行,则不启动
|
||||
app.quit();
|
||||
} else {
|
||||
// 如果检测到有同样的该程序正在试图启动...
|
||||
app.on('second-instance', () => {
|
||||
if (myWindow) {
|
||||
// 弹出系统提示对话框
|
||||
dialog.showMessageBox({
|
||||
message: '此程序已经正在运行'
|
||||
})
|
||||
// 如果该程序窗口处于最小化状态,则恢复窗口
|
||||
if (myWindow.isMinimized()) myWindow.restore()
|
||||
// 将该程序窗口置为当前聚焦态
|
||||
myWindow.focus()
|
||||
}
|
||||
})
|
||||
// 如果检测到有同样的该程序正在试图启动...
|
||||
app.on('second-instance', () => {
|
||||
if (myWindow) {
|
||||
// 弹出系统提示对话框
|
||||
dialog.showMessageBox({
|
||||
message: '此程序已经正在运行'
|
||||
});
|
||||
// 如果该程序窗口处于最小化状态,则恢复窗口
|
||||
if (myWindow.isMinimized()) myWindow.restore();
|
||||
// 将该程序窗口置为当前聚焦态
|
||||
myWindow.focus();
|
||||
}
|
||||
});
|
||||
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
const { spawn } = require('child_process')
|
||||
let child = null
|
||||
let exePluginsExeList = []
|
||||
app.whenReady().then(() => {
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
// This method will be called when Electron has finished
|
||||
// initialization and is ready to create browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
const { spawn } = require('child_process');
|
||||
let child = null;
|
||||
let exePluginsExeList = [];
|
||||
app.whenReady().then(() => {
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const logStream = fs.createWriteStream('app.log', { flags: 'a' }) // 日志文件
|
||||
let exePath = path.resolve('./resources/app.asar.unpacked/resources/service')
|
||||
let exePluginsPath = path.resolve('./resources/app.asar.unpacked/resources/service/plugins')
|
||||
//单独配置测试环境
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
exePath = path.resolve('./resources/service')
|
||||
exePluginsPath = path.resolve('./resources/service/plugins')
|
||||
}
|
||||
const logStream = fs.createWriteStream('app.log', { flags: 'a' }); // 日志文件
|
||||
let exePath = path.resolve('./resources/app.asar.unpacked/resources/service');
|
||||
let exePluginsPath = path.resolve('./resources/app.asar.unpacked/resources/service/plugins');
|
||||
//单独配置测试环境
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
exePath = path.resolve('./resources/service');
|
||||
exePluginsPath = path.resolve('./resources/service/plugins');
|
||||
}
|
||||
|
||||
//查询所有插件目录下的exe文件
|
||||
fs.readdir(exePluginsPath, (err, files) => {
|
||||
if (err) {
|
||||
return console.log('Unable to scan directory: ' + err)
|
||||
}
|
||||
// 筛选出以.exe结尾的文件
|
||||
exePluginsExeList = files.filter((file) => path.extname(file).toLowerCase() === '.exe')
|
||||
})
|
||||
//查询所有插件目录下的exe文件
|
||||
fs.readdir(exePluginsPath, (err, files) => {
|
||||
if (err) {
|
||||
return console.log('Unable to scan directory: ' + err);
|
||||
}
|
||||
// 筛选出以.exe结尾的文件
|
||||
exePluginsExeList = files.filter(file => path.extname(file).toLowerCase() === '.exe');
|
||||
});
|
||||
|
||||
child = spawn('./main.exe', [], { cwd: exePath, stdio: ['ignore', 'pipe', 'pipe'] })
|
||||
child = spawn('./main.exe', [], { cwd: exePath, stdio: ['ignore', 'pipe', 'pipe'] });
|
||||
|
||||
//监听进程的输出
|
||||
child.stdout.on('data', (data) => {
|
||||
console.log('stdout:', data.toString())
|
||||
logStream.write(data)
|
||||
})
|
||||
//监听进程的输出
|
||||
child.stdout.on('data', data => {
|
||||
console.log('stdout:', data.toString());
|
||||
logStream.write(data);
|
||||
});
|
||||
|
||||
child.stderr.on('data', (data) => {
|
||||
console.error('stderr:', data.toString())
|
||||
logStream.write(data)
|
||||
})
|
||||
child.stderr.on('data', data => {
|
||||
console.error('stderr:', data.toString());
|
||||
logStream.write(data);
|
||||
});
|
||||
|
||||
child.on('close', (code) => {
|
||||
console.log(`子进程已退出,退出码 ${code}`)
|
||||
logStream.end()
|
||||
})
|
||||
child.on('close', code => {
|
||||
console.log(`子进程已退出,退出码 ${code}`);
|
||||
logStream.end();
|
||||
});
|
||||
|
||||
child.on('exit', (code, signal) => {
|
||||
console.log(`子进程已退出,退出码 ${code},信号: ${signal}`)
|
||||
logStream.write(`子进程已退出,退出码 ${code},信号: ${signal}`)
|
||||
logStream.end()
|
||||
})
|
||||
child.on('exit', (code, signal) => {
|
||||
console.log(`子进程已退出,退出码 ${code},信号: ${signal}`);
|
||||
logStream.write(`子进程已退出,退出码 ${code},信号: ${signal}`);
|
||||
logStream.end();
|
||||
});
|
||||
|
||||
// Set app user model id for windows
|
||||
electronApp.setAppUserModelId('com.electron')
|
||||
// Set app user model id for windows
|
||||
electronApp.setAppUserModelId('com.electron');
|
||||
|
||||
// Default open or close DevTools by F12 in development
|
||||
// and ignore CommandOrControl + R in production.
|
||||
// see https://github.com/alex8088/electron-toolkit/tree/master/packages/utils
|
||||
app.on('browser-window-created', (_, window) => {
|
||||
optimizer.watchWindowShortcuts(window)
|
||||
})
|
||||
// Default open or close DevTools by F12 in development
|
||||
// and ignore CommandOrControl + R in production.
|
||||
// see https://github.com/alex8088/electron-toolkit/tree/master/packages/utils
|
||||
app.on('browser-window-created', (_, window) => {
|
||||
optimizer.watchWindowShortcuts(window);
|
||||
});
|
||||
|
||||
// IPC test
|
||||
ipcMain.on('ping', () => console.log('pong'))
|
||||
// IPC test
|
||||
ipcMain.on('ping', () => console.log('pong'));
|
||||
|
||||
myWindow = createWindow()
|
||||
myWindow = createWindow();
|
||||
|
||||
app.on('activate', function () {
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (BrowserWindow.getAllWindows().length === 0) createWindow()
|
||||
})
|
||||
})
|
||||
app.on('activate', function () {
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (BrowserWindow.getAllWindows().length === 0) createWindow();
|
||||
});
|
||||
});
|
||||
|
||||
// Quit when all windows are closed, except on macOS. There, it's common
|
||||
// for applications and their menu bar to stay active until the user quits
|
||||
// explicitly with Cmd + Q.
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
// 循环关闭插件 EXE 列表
|
||||
exePluginsExeList.forEach((exe) => {
|
||||
killProcessByName(exe)
|
||||
})
|
||||
// child.kill('SIGTERM'); // 或者使用 'SIGKILL' 来强制关闭
|
||||
// killProcessByName('gateway.exe');
|
||||
// 循环关闭后端服务
|
||||
killProcessByName('main.exe')
|
||||
app.quit()
|
||||
}
|
||||
})
|
||||
// Quit when all windows are closed, except on macOS. There, it's common
|
||||
// for applications and their menu bar to stay active until the user quits
|
||||
// explicitly with Cmd + Q.
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') {
|
||||
// 循环关闭插件 EXE 列表
|
||||
exePluginsExeList.forEach(exe => {
|
||||
killProcessByName(exe);
|
||||
});
|
||||
// child.kill('SIGTERM'); // 或者使用 'SIGKILL' 来强制关闭
|
||||
// killProcessByName('gateway.exe');
|
||||
// 循环关闭后端服务
|
||||
killProcessByName('main.exe');
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
}
|
||||
// In this file you can include the rest of your app"s specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
|
|
@ -1,71 +1,63 @@
|
|||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const settings = defineProps({
|
||||
collapse: Boolean,
|
||||
width: String
|
||||
})
|
||||
|
||||
|
||||
collapse: Boolean,
|
||||
width: String
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-aside :width="settings.width">
|
||||
<el-scrollbar>
|
||||
<el-menu
|
||||
default-active="/system/switch"
|
||||
:collapse="settings.collapse"
|
||||
:router="true"
|
||||
>
|
||||
<el-menu-item index="/system/switch"> <span class="iconfont icon-icon_duanluqi"></span> 断路器调试</el-menu-item>
|
||||
<!-- <el-menu-item index="/system/about"><span class="iconfont icon-icon_jiankong"></span> 视频监控</el-menu-item>-->
|
||||
<!-- <el-menu-item index="/test"><el-icon> <Menu /> </el-icon>测试</el-menu-item>-->
|
||||
</el-menu>
|
||||
</el-scrollbar>
|
||||
</el-aside>
|
||||
<el-aside :width="settings.width">
|
||||
<el-scrollbar>
|
||||
<el-menu default-active="/system/switch" :collapse="settings.collapse" :router="true">
|
||||
<el-menu-item index="/system/switch"> <span class="iconfont icon-icon_duanluqi"></span> 断路器调试</el-menu-item>
|
||||
<!-- <el-menu-item index="/system/about"><span class="iconfont icon-icon_jiankong"></span> 视频监控</el-menu-item>-->
|
||||
<!-- <el-menu-item index="/system/test"><el-icon> <Menu /> </el-icon>测试</el-menu-item>-->
|
||||
</el-menu>
|
||||
</el-scrollbar>
|
||||
</el-aside>
|
||||
</template>
|
||||
|
||||
<style scoped lang="less">
|
||||
.el-aside {
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
.el-menu{
|
||||
padding: 0 10px;
|
||||
background: #fff;
|
||||
.el-menu {
|
||||
padding: 0 10px;
|
||||
background: #fff;
|
||||
}
|
||||
.el-menu-item{
|
||||
border-radius: 10px;
|
||||
background: #f2f2f2;
|
||||
margin-bottom: 12px;
|
||||
align-items: center;
|
||||
padding: 0;
|
||||
padding-left: 26px !important;
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
.iconfont{
|
||||
margin-right: 10px;
|
||||
color: #999;
|
||||
font-size: 22px;
|
||||
}
|
||||
.el-menu-item {
|
||||
border-radius: 10px;
|
||||
background: #f2f2f2;
|
||||
margin-bottom: 12px;
|
||||
align-items: center;
|
||||
padding: 0;
|
||||
padding-left: 26px !important;
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
.iconfont {
|
||||
margin-right: 10px;
|
||||
color: #999;
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
.el-menu-item.is-active{
|
||||
background: #4c94db;
|
||||
border-radius: 10px;
|
||||
/*margin: 0 10px;*/
|
||||
color: #fff;
|
||||
.iconfont{
|
||||
color: #fff;
|
||||
}
|
||||
.el-menu-item.is-active {
|
||||
background: #4c94db;
|
||||
border-radius: 10px;
|
||||
/*margin: 0 10px;*/
|
||||
color: #fff;
|
||||
.iconfont {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.el-scrollbar {
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
/*background-color: #1a1c1e;*/
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
/*background-color: #1a1c1e;*/
|
||||
}
|
||||
|
||||
.el-menu {
|
||||
border-right: none;
|
||||
border-right: none;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
router="true"
|
||||
>
|
||||
<el-menu-item index="/system">系统模板</el-menu-item>
|
||||
<!-- <el-menu-item index="/test">测试</el-menu-item>-->
|
||||
</el-menu>
|
||||
</div>
|
||||
<div class="haeder-right">
|
||||
|
|
|
@ -1,41 +1,35 @@
|
|||
|
||||
<template>
|
||||
<el-container direction="vertical" style="min-height: 100vh;min-width: 100vw;overflow: hidden;">
|
||||
<Header></Header>
|
||||
<el-container style="padding: 10px 0">
|
||||
<Aside width="180px"></Aside>
|
||||
<el-main>
|
||||
<router-view v-slot="{ Component }">
|
||||
<keep-alive>
|
||||
<component :is="Component" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
<el-container direction="vertical" style="min-height: 100vh; min-width: 100vw; overflow: hidden">
|
||||
<Header></Header>
|
||||
<el-main>
|
||||
<router-view v-slot="{ Component }">
|
||||
<keep-alive>
|
||||
<component :is="Component" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// 组件注册
|
||||
import Header from '@renderer/layout/Header.vue'
|
||||
import Aside from '@renderer/layout/Aside.vue'
|
||||
import Header from '@renderer/layout/Header.vue';
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
body{
|
||||
background-color: #eee;
|
||||
max-width: 100vw;
|
||||
}
|
||||
.el-container{
|
||||
/*padding: 10px 0;*/
|
||||
}
|
||||
.el-main {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
overflow-x: hidden;
|
||||
background: #fff;
|
||||
padding-right: 10px;
|
||||
}
|
||||
body {
|
||||
background-color: #eee;
|
||||
max-width: 100vw;
|
||||
}
|
||||
.el-container {
|
||||
/*padding: 10px 0;*/
|
||||
}
|
||||
.el-main {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
overflow-x: hidden;
|
||||
background: #fff;
|
||||
padding-right: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,51 +1,59 @@
|
|||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import Layout from '@renderer/layout/index.vue'
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import Layout from '@renderer/layout/index.vue';
|
||||
import systenLayout from '@renderer/views/system/index.vue';
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: [
|
||||
{
|
||||
path: '/system',
|
||||
name: 'system',
|
||||
component: Layout,
|
||||
redirect: {name: 'switch'},
|
||||
children:[
|
||||
{
|
||||
path: 'switch',
|
||||
name: 'switch',
|
||||
component: () => import("@renderer/views/switch/index.vue"),
|
||||
meta: {
|
||||
menu: 'switch',
|
||||
keepAlive: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'about',
|
||||
name: 'about',
|
||||
component: () => import("@renderer/views/AboutView.vue"),
|
||||
meta: {
|
||||
menu: 'about',
|
||||
keepAlive: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'test',
|
||||
name: 'test',
|
||||
component: () => import("@renderer/views/test.vue"),
|
||||
meta: {
|
||||
menu: 'test',
|
||||
keepAlive: true,
|
||||
}
|
||||
},
|
||||
history: createWebHistory(),
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
component: Layout,
|
||||
meta: { title: '整体页面布局' },
|
||||
redirect: '/system',
|
||||
children: [
|
||||
{
|
||||
path: '/system',
|
||||
name: 'system',
|
||||
component: systenLayout,
|
||||
redirect: { name: 'switch' },
|
||||
children: [
|
||||
{
|
||||
path: 'switch',
|
||||
name: 'switch',
|
||||
component: () => import('@renderer/views/system/switch/index.vue'),
|
||||
meta: {
|
||||
menu: 'switch',
|
||||
keepAlive: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'about',
|
||||
name: 'about',
|
||||
component: () => import('@renderer/views/AboutView.vue'),
|
||||
meta: {
|
||||
menu: 'about',
|
||||
keepAlive: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'test',
|
||||
name: 'test',
|
||||
component: () => import('@renderer/views/test.vue'),
|
||||
meta: {
|
||||
menu: 'test',
|
||||
keepAlive: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/', // 这个是根路由,现在我们让它重定向到 /system
|
||||
redirect: '/system'
|
||||
},
|
||||
{ path: '/:pathMatch(.*)', redirect: '/' }
|
||||
]
|
||||
});
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/', // 这个是根路由,现在我们让它重定向到 /system
|
||||
redirect: '/system',
|
||||
},
|
||||
{ path: '/:pathMatch(.*)', redirect: '/' },
|
||||
]
|
||||
})
|
||||
|
||||
export default router
|
||||
export default router;
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
<script setup>
|
||||
// 组件注册
|
||||
import Header from '@renderer/components/Header.vue'
|
||||
import Aside from '@renderer/components/Aside.vue'
|
||||
</script>
|
||||
<template>
|
||||
<el-container direction="vertical" style="min-height: 100vh;min-width: 100vw;overflow: hidden;">
|
||||
<Header></Header>
|
||||
<el-container >
|
||||
<Aside width="160px"></Aside>
|
||||
<el-main>
|
||||
<router-view v-slot="{ Component }">
|
||||
<keep-alive>
|
||||
<component :is="Component" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</template>
|
||||
<style scoped>
|
||||
|
||||
body{
|
||||
background-color: #eee;
|
||||
max-width: 100vw;
|
||||
}
|
||||
|
||||
.el-main {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
overflow-x: hidden;
|
||||
background: #f6f6f6;
|
||||
}
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,35 @@
|
|||
<template>
|
||||
<el-container style="padding: 10px 0">
|
||||
<Aside width="180px"></Aside>
|
||||
<el-main>
|
||||
<router-view v-slot="{ Component }">
|
||||
<keep-alive>
|
||||
<component :is="Component" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// 组件注册
|
||||
import Aside from '@renderer/layout/Aside.vue';
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
body {
|
||||
background-color: #eee;
|
||||
max-width: 100vw;
|
||||
}
|
||||
.el-container {
|
||||
/*padding: 10px 0;*/
|
||||
}
|
||||
.el-main {
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
overflow-x: hidden;
|
||||
background: #fff;
|
||||
padding-right: 10px;
|
||||
}
|
||||
</style>
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue