-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from mr-wolf-gb/master
Fix missing translations Add french translation
Showing
21 changed files
with
1,751 additions
and
1,540 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
singleQuote: true | ||
semi: false | ||
printWidth: 100 | ||
printWidth: 180 | ||
trailingComma: none | ||
endOfLine: auto |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,90 @@ | ||
import App from '@/main/App' | ||
import Store from 'electron-store' | ||
import { SETTINGS_FILE_NAME } from '@/main/utils/constant' | ||
import Path from '@/main/utils/Path' | ||
import GetPath from '@/shared/utils/GetPath' | ||
import { isMacOS, isWindows } from '@/main/utils/utils' | ||
import GetAppPath from '@/main/utils/GetAppPath' | ||
|
||
export default class Settings { | ||
static #_instance; | ||
static #_fileName = SETTINGS_FILE_NAME; | ||
static #_fileExtension = 'json'; | ||
|
||
static get(key) { | ||
return this.getInstance().get(key); | ||
} | ||
|
||
static set(key, val) { | ||
return this.getInstance().set(key, val); | ||
} | ||
|
||
static getAll() { | ||
return this.getInstance().store | ||
} | ||
|
||
/** | ||
* | ||
* @returns {ElectronStore<T>} | ||
*/ | ||
static getInstance() { | ||
if (this.#_instance) { | ||
return this.#_instance; | ||
} | ||
this.init(); | ||
return this.#_instance; | ||
} | ||
|
||
static init() { | ||
if (this.#_instance) { | ||
return; | ||
} | ||
const options = { | ||
name: this.#_fileName, | ||
fileExtension: this.#_fileExtension, | ||
cwd: this.getDir(), | ||
}; | ||
options.defaults = this.#_getDefault(); | ||
this.#_instance = new Store(options); | ||
} | ||
|
||
/** | ||
* @returns {object} | ||
*/ | ||
static #_getDefault() { | ||
return { | ||
Language:'zh', | ||
ThemeMode:'system', | ||
ThemeColor:'#1890FF', | ||
EnableEnv: false, | ||
PhpCliVersion: '', | ||
EnableComposer: false, | ||
TextEditor: this.#_getDefaultTextEditorPath(), | ||
WebsiteDir: Path.Join(GetAppPath.getUserCoreDir(), 'www'), | ||
OneClickServerList: ['Nginx', 'PHP-FPM', 'MySQL-5.7'], | ||
AutoStartAndRestartServer: true, | ||
AfterOpenAppStartServer: false, | ||
}; | ||
} | ||
|
||
static #_getDefaultTextEditorPath() { | ||
let toolTypePath = GetPath.getToolTypeDir(); | ||
if (isMacOS) { | ||
return Path.Join(toolTypePath, 'Notepad--.app'); | ||
} else if (isWindows) { | ||
return Path.Join(toolTypePath, 'Notepad3/Notepad3.exe'); | ||
} | ||
} | ||
|
||
static getDir() { | ||
return GetAppPath.getSettingsDir() | ||
} | ||
|
||
/** | ||
* 获取设置文件完整的路径 | ||
* @returns {string} | ||
*/ | ||
static getFilePath(){ | ||
return Path.Join(this.getDir(), `${this.#_fileName}.${this.#_fileExtension}`); | ||
} | ||
} | ||
import App from '@/main/App' | ||
import Store from 'electron-store' | ||
import { SETTINGS_FILE_NAME } from '@/main/utils/constant' | ||
import Path from '@/main/utils/Path' | ||
import GetPath from '@/shared/utils/GetPath' | ||
import { isMacOS, isWindows } from '@/main/utils/utils' | ||
import GetAppPath from '@/main/utils/GetAppPath' | ||
|
||
export default class Settings { | ||
static #_instance | ||
static #_fileName = SETTINGS_FILE_NAME | ||
static #_fileExtension = 'json' | ||
|
||
static get(key) { | ||
return this.getInstance().get(key) | ||
} | ||
|
||
static set(key, val) { | ||
return this.getInstance().set(key, val) | ||
} | ||
|
||
static getAll() { | ||
return this.getInstance().store | ||
} | ||
|
||
/** | ||
* | ||
* @returns {ElectronStore<T>} | ||
*/ | ||
static getInstance() { | ||
if (this.#_instance) { | ||
return this.#_instance | ||
} | ||
this.init() | ||
return this.#_instance | ||
} | ||
|
||
static init() { | ||
if (this.#_instance) { | ||
return | ||
} | ||
const options = { | ||
name: this.#_fileName, | ||
fileExtension: this.#_fileExtension, | ||
cwd: this.getDir() | ||
} | ||
options.defaults = this.#_getDefault() | ||
this.#_instance = new Store(options) | ||
} | ||
|
||
/** | ||
* @returns {object} | ||
*/ | ||
static #_getDefault() { | ||
return { | ||
Language: 'zh', | ||
ThemeMode: 'system', | ||
ThemeColor: '#1890FF', | ||
EnableEnv: false, | ||
PhpCliVersion: '', | ||
EnableComposer: false, | ||
TextEditor: this.#_getDefaultTextEditorPath(), | ||
WebsiteDir: Path.Join(GetAppPath.getUserCoreDir(), 'www'), | ||
OneClickServerList: ['Nginx', 'PHP-FPM', 'MySQL-5.7'], | ||
AutoStartAndRestartServer: true, | ||
AfterOpenAppStartServer: false | ||
} | ||
} | ||
|
||
static #_getDefaultTextEditorPath() { | ||
let toolTypePath = GetPath.getToolTypeDir() | ||
if (isMacOS) { | ||
return Path.Join(toolTypePath, 'Notepad--.app') | ||
} else if (isWindows) { | ||
return Path.Join(toolTypePath, 'Notepad3/Notepad3.exe') | ||
} | ||
} | ||
|
||
static getDir() { | ||
return GetAppPath.getSettingsDir() | ||
} | ||
|
||
/** | ||
* 获取设置文件完整的路径 | ||
* @returns {string} | ||
*/ | ||
static getFilePath() { | ||
return Path.Join(this.getDir(), `${this.#_fileName}.${this.#_fileExtension}`) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,84 @@ | ||
<template> | ||
<a-card size="small" :title="t('Other')" class='settings-card'> | ||
<div class='settings-card-row flex-vertical-center'> | ||
<span>{{ mt('Text', 'ws', 'Editor') }}:</span> | ||
<a-input v-model:value='store.settings.TextEditor' readonly style='flex: 1'></a-input> | ||
<a-button @click='changeTextEditor' style='margin-left: 5px'>...</a-button> | ||
</div> | ||
|
||
<div class='settings-card-row flex-vertical-center'> | ||
<span>{{ mt('Website', 'ws', 'Directory') }}:</span> | ||
<a-input v-model:value='store.settings.WebsiteDir' readonly style='flex: 1'></a-input> | ||
<a-button @click='changeWebsiteDir' style='margin-left: 5px'>...</a-button> | ||
</div> | ||
|
||
<a-row type='flex' align='middle' class='settings-card-row'> | ||
<a-col :span='6' class='flex-vertical-center'> | ||
<a-button @click='exitApp' type='primary'>{{ t('Exit') }} {{APP_NAME}}</a-button> | ||
</a-col> | ||
<a-col :span='6' class='flex-vertical-center'> | ||
<a-button @click='init' type='primary'>{{ t('Initialize') }}</a-button> | ||
</a-col> | ||
</a-row> | ||
|
||
</a-card> | ||
</template> | ||
|
||
<script setup> | ||
import FileDialog from '@/main/utils/FileDialog' | ||
import MessageBox from '@/renderer/utils/MessageBox' | ||
import SoftwareInit from '@/main/core/software/SoftwareInit' | ||
import { message } from 'ant-design-vue' | ||
import { mt, t } from '@/renderer/utils/i18n' | ||
import {APP_NAME} from "@/shared/utils/constant"; | ||
import App from "@/main/App"; | ||
import { createAsyncComponent } from '@/renderer/utils/utils' | ||
import { useMainStore } from '@/renderer/store' | ||
const ACard = createAsyncComponent(import('ant-design-vue'), 'Card') | ||
const store = useMainStore() | ||
const changeTextEditor = () => { | ||
store.setSettings('TextEditor', async originVal => { | ||
let path = FileDialog.showOpenApp(originVal) | ||
if (!path) { | ||
return false | ||
} | ||
return path | ||
}) | ||
} | ||
const changeWebsiteDir = () => { | ||
store.setSettings('WebsiteDir', async originVal => { | ||
let path = FileDialog.showOpenDirectory(originVal) | ||
if (!path) { | ||
return false | ||
} | ||
if (path.includes(' ')) { | ||
throw new Error('网站目录不能有空格!') | ||
} | ||
return path | ||
}) | ||
} | ||
const exitApp = ()=>{ | ||
App.exit() | ||
} | ||
const init = async () => { | ||
try { | ||
const options = { | ||
content: t('initConfirmText'), | ||
okText: t('Confirm'), | ||
cancelText: t('Cancel') | ||
} | ||
if (await MessageBox.confirm(options)) { | ||
await SoftwareInit.initAll() | ||
message.success('初始化成功') | ||
} | ||
} catch (error) { | ||
MessageBox.error(error.message ?? error, '初始化失败!') | ||
} | ||
} | ||
</script> | ||
<style scoped> | ||
</style> | ||
<template> | ||
<a-card size="small" :title="t('Other')" class="settings-card"> | ||
<div class="settings-card-row flex-vertical-center"> | ||
<span>{{ mt('Text', 'ws', 'Editor') }}:</span> | ||
<a-input v-model:value="store.settings.TextEditor" readonly style="flex: 1"></a-input> | ||
<a-button @click="changeTextEditor" style="margin-left: 5px">...</a-button> | ||
</div> | ||
|
||
<div class="settings-card-row flex-vertical-center"> | ||
<span>{{ mt('Website', 'ws', 'Directory') }}:</span> | ||
<a-input v-model:value="store.settings.WebsiteDir" readonly style="flex: 1"></a-input> | ||
<a-button @click="changeWebsiteDir" style="margin-left: 5px">...</a-button> | ||
</div> | ||
|
||
<a-row type="flex" align="middle" class="settings-card-row"> | ||
<a-col :span="6" class="flex-vertical-center"> | ||
<a-button @click="exitApp" type="primary">{{ t('Exit') }} {{ APP_NAME }}</a-button> | ||
</a-col> | ||
<a-col :span="6" class="flex-vertical-center"> | ||
<a-button @click="init" type="primary">{{ t('Initialize') }}</a-button> | ||
</a-col> | ||
</a-row> | ||
</a-card> | ||
</template> | ||
|
||
<script setup> | ||
import FileDialog from '@/main/utils/FileDialog' | ||
import MessageBox from '@/renderer/utils/MessageBox' | ||
import SoftwareInit from '@/main/core/software/SoftwareInit' | ||
import { message } from 'ant-design-vue' | ||
import { mt, t } from '@/renderer/utils/i18n' | ||
import { APP_NAME } from '@/shared/utils/constant' | ||
import App from '@/main/App' | ||
import { createAsyncComponent } from '@/renderer/utils/utils' | ||
import { useMainStore } from '@/renderer/store' | ||
const ACard = createAsyncComponent(import('ant-design-vue'), 'Card') | ||
const store = useMainStore() | ||
const changeTextEditor = () => { | ||
store.setSettings('TextEditor', async (originVal) => { | ||
let path = FileDialog.showOpenApp(originVal) | ||
if (!path) { | ||
return false | ||
} | ||
return path | ||
}) | ||
} | ||
const changeWebsiteDir = () => { | ||
store.setSettings('WebsiteDir', async (originVal) => { | ||
let path = FileDialog.showOpenDirectory(originVal) | ||
if (!path) { | ||
return false | ||
} | ||
if (path.includes(' ')) { | ||
throw new Error(t('The website directory cannot have spaces!')) | ||
} | ||
return path | ||
}) | ||
} | ||
const exitApp = () => { | ||
App.exit() | ||
} | ||
const init = async () => { | ||
try { | ||
const options = { | ||
content: t('initConfirmText'), | ||
okText: t('Confirm'), | ||
cancelText: t('Cancel') | ||
} | ||
if (await MessageBox.confirm(options)) { | ||
await SoftwareInit.initAll() | ||
message.success(t('Initialization successful')) | ||
} | ||
} catch (error) { | ||
MessageBox.error(error.message ?? error, t('Initialization failed!')) | ||
} | ||
} | ||
</script> | ||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,35 @@ | ||
<template> | ||
<div class="content-container color-text"> | ||
<p style="text-align: center;font-size: 18px;margin-top: 50px">{{ APP_NAME }} 集成服务环境</p> | ||
<p style="text-align: center">{{$t("Version")}}:{{version}}</p> | ||
<p style="text-align: center"> | ||
{{t('OfficialSite')}}:<a @click="openUrl('http://www.eserver.app')">www.eserver.app</a> | ||
</p> | ||
<p style="text-align: center"> | ||
{{t('Doc')}}:<a @click="openUrl('http://www.eserver.app/doc')">www.eserver.app/doc</a> | ||
</p> | ||
<p style="text-align: center"> | ||
Github:<a @click="openUrl('http://github.com/xianyunleo/EServer')">github.com/xianyunleo/EServer</a> | ||
</p> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import App from "@/main/App"; | ||
import {APP_NAME} from "@/shared/utils/constant"; | ||
import Native from "@/main/utils/Native"; | ||
import { t } from '@/renderer/utils/i18n' | ||
const version = App.getVersion(); | ||
const openUrl = (url) => { | ||
Native.openUrl(url); | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
</style> | ||
<template> | ||
<div class="content-container color-text"> | ||
<p style="text-align: center; font-size: 18px; margin-top: 50px">{{ APP_NAME }}</p> | ||
<p style="text-align: center; font-size: 18px; font-weight: bold"> | ||
{{ t('integratedServiceEnvironment') }} | ||
</p> | ||
<p style="text-align: center">{{ $t('Version') }}:{{ version }}</p> | ||
<p style="text-align: center"> | ||
{{ t('OfficialSite') }}:<a @click="openUrl('http://www.eserver.app')">www.eserver.app</a> | ||
</p> | ||
<p style="text-align: center"> | ||
{{ t('Doc') }}:<a @click="openUrl('http://www.eserver.app/doc')">www.eserver.app/doc</a> | ||
</p> | ||
<p style="text-align: center"> | ||
Github:<a @click="openUrl('http://github.com/xianyunleo/EServer')" | ||
>github.com/xianyunleo/EServer</a | ||
> | ||
</p> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import App from '@/main/App' | ||
import { APP_NAME } from '@/shared/utils/constant' | ||
import Native from '@/main/utils/Native' | ||
import { t } from '@/renderer/utils/i18n' | ||
const version = App.getVersion() | ||
const openUrl = (url) => { | ||
Native.openUrl(url) | ||
} | ||
</script> | ||
|
||
<style scoped></style> |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,154 +1,147 @@ | ||
<template> | ||
<div class="content-container" style='padding:0'> | ||
<a-row> | ||
<a-col :span="12" v-for="item in toolItems" :key="item.key"> | ||
<div class="tool-item piece piece-hover" @click="item.func"> | ||
<div class="tool-item-avatar"> | ||
<template v-if="item.iconType"> | ||
<template v-if="item.iconType === iconTypes.textFile"> | ||
<file-text-two-tone /> | ||
</template> | ||
<template v-else-if="item.iconType === iconTypes.dir"> | ||
<folder-open-two-tone /> | ||
</template> | ||
<template v-else-if="item.iconType === iconTypes.list"> | ||
<database-two-tone /> | ||
</template> | ||
|
||
</template> | ||
<template v-else> | ||
<img :src="item.icon" alt="icon"> | ||
</template> | ||
|
||
</div> | ||
<div class="tool-item-content"> | ||
<h4 class="tool-item-title">{{ item.title }}</h4> | ||
<div class="tool-item-desc">{{ item.desc }}</div> | ||
</div> | ||
</div> | ||
</a-col> | ||
</a-row> | ||
</div> | ||
<!-- v-if防止不显示就执行modal里面的代码--> | ||
<mysql-reset-pwd-modal v-if="mysqlResetPwdModalShow" v-model:show="mysqlResetPwdModalShow"> | ||
</mysql-reset-pwd-modal> | ||
<tcp-process-list-modal v-if="tcpProcessListModalShow" v-model:show="tcpProcessListModalShow"> | ||
</tcp-process-list-modal> | ||
</template> | ||
|
||
<script setup> | ||
import { mt,t } from '@/renderer/utils/i18n' | ||
import {ref} from "vue"; | ||
import {message} from 'ant-design-vue'; | ||
import {FileTextTwoTone,FolderOpenTwoTone,DatabaseTwoTone} from "@ant-design/icons-vue"; | ||
import MysqlResetPwdModal from "@/renderer/components/ToolPage/MysqlResetPwdModal.vue" | ||
import MessageBox from "@/renderer/utils/MessageBox"; | ||
import GetPath from "@/shared/utils/GetPath"; | ||
import {sleep} from "@/shared/utils/utils"; | ||
import Native from "@/main/utils/Native"; | ||
import TcpProcessListModal from "@/renderer/components/ToolPage/TcpProcessListModal.vue"; | ||
import OS from "@/main/utils/OS"; | ||
import { isWindows } from '@/main/utils/utils' | ||
const iconTypes = { | ||
dir: 'dir', | ||
file: 'file', | ||
list: 'list', | ||
textFile: 'textFile', | ||
tool: 'tool', | ||
} | ||
const toolItems = [ | ||
{ | ||
key: 'editHosts', | ||
iconType: iconTypes.textFile, | ||
title: `${mt('Edit','ws')}hosts`, | ||
desc: '查看、编辑hosts文件', | ||
func: editHosts, | ||
}, | ||
{ | ||
key: 'mysqlResetPwd', | ||
icon: GetPath.getMysqlIconPath(), | ||
title: t('mysqlResetRootAccountPwd'), | ||
desc: '修改、重置MySQL的root账户的密码', | ||
func: mysqlResetPwd, | ||
}, | ||
{ | ||
key: 'tcpProcessList', | ||
iconType: iconTypes.list, | ||
title: `Tcp${mt('ws', 'Port', 'ws', 'Process', 'ws', 'List')}`, | ||
desc: '查看端口占用情况', | ||
func: tcpProcessList, | ||
}, | ||
]; | ||
async function editHosts() { | ||
message.info(t('pleaseWait')); | ||
await sleep(100); | ||
try { | ||
await Native.openHosts(); | ||
} catch (error) { | ||
MessageBox.error(error.message ?? error, '打开hosts文件出错!'); | ||
} | ||
} | ||
const mysqlResetPwdModalShow = ref(false); | ||
function mysqlResetPwd() { | ||
mysqlResetPwdModalShow.value = true; | ||
} | ||
const tcpProcessListModalShow = ref(false); | ||
function tcpProcessList() { | ||
if (isWindows && OS.getMajorVersion() <= 6.1) { | ||
MessageBox.error('你的系统版本过低,此功能不可用!', '此功能不可用!'); | ||
return; | ||
} | ||
tcpProcessListModalShow.value = true; | ||
} | ||
</script> | ||
<style scoped lang="less"> | ||
@import "@/renderer/assets/css/var"; | ||
.tool-item { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
margin: 10px 10px 0 10px; | ||
padding: 12px 0; | ||
cursor: pointer; | ||
} | ||
.tool-item-avatar { | ||
margin-left: 16px; | ||
margin-right: 16px; | ||
display: flex; | ||
> img { | ||
width: 50px; | ||
height: 50px; | ||
} | ||
> span { | ||
font-size: 50px; | ||
width: 50px; | ||
height: 50px; | ||
} | ||
} | ||
.tool-item-content { | ||
flex: 1 0; | ||
width: 0; | ||
color: @colorText; | ||
} | ||
.tool-item-desc { | ||
font-size: 14px; | ||
color: @colorTextSecondary; | ||
} | ||
</style> | ||
<template> | ||
<div class="content-container" style="padding: 0"> | ||
<a-row> | ||
<a-col :span="12" v-for="item in toolItems" :key="item.key"> | ||
<div class="tool-item piece piece-hover" @click="item.func"> | ||
<div class="tool-item-avatar"> | ||
<template v-if="item.iconType"> | ||
<template v-if="item.iconType === iconTypes.textFile"> | ||
<file-text-two-tone /> | ||
</template> | ||
<template v-else-if="item.iconType === iconTypes.dir"> | ||
<folder-open-two-tone /> | ||
</template> | ||
<template v-else-if="item.iconType === iconTypes.list"> | ||
<database-two-tone /> | ||
</template> | ||
</template> | ||
<template v-else> | ||
<img :src="item.icon" alt="icon" /> | ||
</template> | ||
</div> | ||
<div class="tool-item-content"> | ||
<h4 class="tool-item-title">{{ item.title }}</h4> | ||
<div class="tool-item-desc">{{ item.desc }}</div> | ||
</div> | ||
</div> | ||
</a-col> | ||
</a-row> | ||
</div> | ||
<!-- v-if防止不显示就执行modal里面的代码--> | ||
<mysql-reset-pwd-modal v-if="mysqlResetPwdModalShow" v-model:show="mysqlResetPwdModalShow"> </mysql-reset-pwd-modal> | ||
<tcp-process-list-modal v-if="tcpProcessListModalShow" v-model:show="tcpProcessListModalShow"> </tcp-process-list-modal> | ||
</template> | ||
|
||
<script setup> | ||
import { mt, t } from '@/renderer/utils/i18n' | ||
import { ref } from 'vue' | ||
import { message } from 'ant-design-vue' | ||
import { FileTextTwoTone, FolderOpenTwoTone, DatabaseTwoTone } from '@ant-design/icons-vue' | ||
import MysqlResetPwdModal from '@/renderer/components/ToolPage/MysqlResetPwdModal.vue' | ||
import MessageBox from '@/renderer/utils/MessageBox' | ||
import GetPath from '@/shared/utils/GetPath' | ||
import { sleep } from '@/shared/utils/utils' | ||
import Native from '@/main/utils/Native' | ||
import TcpProcessListModal from '@/renderer/components/ToolPage/TcpProcessListModal.vue' | ||
import OS from '@/main/utils/OS' | ||
import { isWindows } from '@/main/utils/utils' | ||
const iconTypes = { | ||
dir: 'dir', | ||
file: 'file', | ||
list: 'list', | ||
textFile: 'textFile', | ||
tool: 'tool' | ||
} | ||
const toolItems = [ | ||
{ | ||
key: 'editHosts', | ||
iconType: iconTypes.textFile, | ||
title: `${mt('Edit', 'ws')}hosts`, | ||
desc: t('View and edit hosts file'), | ||
func: editHosts | ||
}, | ||
{ | ||
key: 'mysqlResetPwd', | ||
icon: GetPath.getMysqlIconPath(), | ||
title: t('mysqlResetRootAccountPwd'), | ||
desc: t('Modify or reset the password of the MySQL root account'), | ||
func: mysqlResetPwd | ||
}, | ||
{ | ||
key: 'tcpProcessList', | ||
iconType: iconTypes.list, | ||
title: `Tcp${mt('ws', 'Port', 'ws', 'Process', 'ws', 'List')}`, | ||
desc: t('Check port usage'), | ||
func: tcpProcessList | ||
} | ||
] | ||
async function editHosts() { | ||
message.info(t('pleaseWait')) | ||
await sleep(100) | ||
try { | ||
await Native.openHosts() | ||
} catch (error) { | ||
MessageBox.error(error.message ?? error, t('Error opening hosts file!')) | ||
} | ||
} | ||
const mysqlResetPwdModalShow = ref(false) | ||
function mysqlResetPwd() { | ||
mysqlResetPwdModalShow.value = true | ||
} | ||
const tcpProcessListModalShow = ref(false) | ||
function tcpProcessList() { | ||
if (isWindows && OS.getMajorVersion() <= 6.1) { | ||
MessageBox.error(t('Your system version is too low, this function is not available!'), t('This feature is not available!')) | ||
return | ||
} | ||
tcpProcessListModalShow.value = true | ||
} | ||
</script> | ||
<style scoped lang="less"> | ||
@import '@/renderer/assets/css/var'; | ||
.tool-item { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
margin: 10px 10px 0 10px; | ||
padding: 12px 0; | ||
cursor: pointer; | ||
} | ||
.tool-item-avatar { | ||
margin-left: 16px; | ||
margin-right: 16px; | ||
display: flex; | ||
> img { | ||
width: 50px; | ||
height: 50px; | ||
} | ||
> span { | ||
font-size: 50px; | ||
width: 50px; | ||
height: 50px; | ||
} | ||
} | ||
.tool-item-content { | ||
flex: 1 0; | ||
width: 0; | ||
color: @colorText; | ||
} | ||
.tool-item-desc { | ||
font-size: 14px; | ||
color: @colorTextSecondary; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
export default { | ||
ws: ' ', // Word Separator | ||
// Uppercase | ||
Application: 'Application', | ||
Add: 'Ajouter', | ||
Delete: 'Supprimer', | ||
Modify: 'Modifier', | ||
Access: 'Accès', | ||
Log: 'Journal', | ||
Basic: 'Basque', | ||
Conf: 'Conf', | ||
Column: 'Colonne', | ||
File: 'Fichier', | ||
Name: 'Nom', | ||
Manage: 'Gérer', | ||
Manager: 'Gestionnaire', | ||
Input: 'Entrée', | ||
Initializing: 'Initialisation en cours', | ||
Installing: 'Installation en cours', | ||
Directory: 'Répertoire', | ||
Home: 'Accueil', | ||
Website: 'Site Web', | ||
Tools: 'Boîte à outils', | ||
AppStore: "Magasin d'applications", | ||
Settings: 'Paramètres', | ||
Auto: 'Auto', | ||
About: 'À propos', | ||
Start: 'Démarrer', | ||
Stop: 'Arrêter', | ||
Restart: 'Redémarrer', | ||
Installed: 'Installé', | ||
Server: 'Serveur', | ||
Tool: 'Outil', | ||
Port: 'Port', | ||
RootPath: 'Chemin racine', | ||
DomainName: 'Nom de domaine', | ||
Sync: 'Synchroniser', | ||
Icon: 'Icône', | ||
Path: 'Chemin', | ||
Status: 'Statut', | ||
Operation: 'Opération', | ||
OneClick: 'En un clic', | ||
ShortcutActions: 'Raccourcis', | ||
Version: 'Version', | ||
Open: 'Ouvrir', | ||
Exit: 'Quitter', | ||
Save: 'Enregistrer', | ||
Show: 'Afficher', | ||
Install: 'Installer', | ||
Extension: 'Extension', | ||
Uninstall: 'Désinstaller', | ||
Refresh: 'Actualiser', | ||
RefreshingServer: 'Actualisation du serveur en cours', | ||
Language: 'Langue', | ||
Local: 'Local', | ||
Confirm: 'Confirmer', | ||
Submit: 'Soumettre', | ||
Cancel: 'Annuler', | ||
UrlRewrite: "Réécriture d'URL", | ||
Second: 'Deuxième', | ||
Static: 'Statique', | ||
Current: 'Actuel', | ||
Reset: 'Réinitialiser', | ||
Pwd: 'Mot de passe', | ||
Edit: 'Modifier', | ||
New: 'Nouveau', | ||
Please: 'Veuillez', | ||
Select: 'Sélectionner', | ||
Kill: 'Tuer', | ||
Doc: 'Doc', | ||
OfficialSite: 'Site officiel', | ||
Desc: 'Description', | ||
List: 'Liste', | ||
Process: 'Processus', | ||
Mode: 'Mode', | ||
Theme: 'Thème', | ||
Color: 'Couleur', | ||
Enable: 'Activer', | ||
Not: 'Non', | ||
EnvironmentVariables: "Variables d'environnement", | ||
Other: 'Autre', | ||
Text: 'Texte', | ||
Editor: 'Éditeur', | ||
Initialize: 'Initialiser', | ||
User: 'Utilisateur', | ||
Set: 'Défini', | ||
Support: 'Support', | ||
Wrong: 'Errone', | ||
Network: 'Réseau', | ||
Info: 'Informations', | ||
Error: 'Erreur', | ||
Warning: 'Avertissement', | ||
Match: 'Correspondance', | ||
Script: 'Script', | ||
Note: 'Remarque', | ||
Close: 'Fermer', | ||
Force: 'Forcer', | ||
Certificate: 'Certificat', // Lowercase | ||
none: 'Aucun', | ||
auto: 'Automatique', | ||
dark: 'Sombre', | ||
light: 'Clair', | ||
blue: 'Bleu', | ||
green: 'Vert', | ||
red: 'Rouge', | ||
pink: 'Rose', | ||
cyan: 'Cyan', | ||
purple: 'Violet', | ||
notice: 'Avis', | ||
tool: 'Outil', | ||
root: 'Racine', | ||
name: 'Nom', | ||
desc: 'Description', // Changed "desc" to "Description" for better clarity | ||
sync: 'Synchroniser', | ||
set: 'Définir', | ||
uninstall: 'Désinstaller', | ||
initializing: 'Initialisation en cours', | ||
download: 'Télécharger', | ||
uncompress: 'Décompresser', | ||
update: 'Mettre à jour', | ||
configure: 'Configurer', | ||
operation: 'Opération', | ||
system: 'Système', | ||
version: 'Version', | ||
goToSettings: 'Aller aux paramètres', | ||
areYouSure: 'Êtes-vous sûr ?', | ||
pleaseWait: 'Veuillez patienter...', | ||
cannotBeEmpty: 'Ne peut pas être vide', | ||
mysqlResetPwdTip: "Arrêtez d'abord le service MySQL, puis réinitialisez le mot de passe.", | ||
defaultIsEmpty: 'Par défaut, il est vide.', | ||
oneClickStartAndStop: 'Démarrer et arrêter en un clic', | ||
successfulOperation: 'Opération réussie.', | ||
failedOperation: "Échec de l'opération.", | ||
errorOccurredDuring: "Une erreur s'est produite pendant {0}.", | ||
needRestartTerminal: 'Vous devez redémarrer le terminal.', | ||
websiteAutoRestartText: 'Après avoir enregistré le site Web, démarrez ou redémarrez automatiquement le service.', | ||
initConfirmText: 'Cette opération réinitialisera les fichiers de configuration PHP et Server. Confirmez-vous ?', | ||
theUserPwdForThisComputer: 'Le mot de passe utilisateur de cet ordinateur.', | ||
thisPwdIsUsedForSudoCommands: 'Ce mot de passe est utilisé pour les commandes sudo.', | ||
pathCannotContainSpaces: "Le chemin ne peut pas contenir d'espaces.", | ||
installPackageDownloadUrl: "URL de téléchargement du package d'installation.", | ||
softwareUninstallErrorTip: 'Veuillez ouvrir le gestionnaire de fichiers et supprimer manuellement le répertoire {0}.', | ||
mysqlResetRootAccountPwd: 'Réinitialiser le mot de passe du compte root MySQL.', | ||
afterOpenAppStartServer: "Démarrez le service après avoir ouvert l'application.", | ||
integratedServiceEnvironment: 'Environnement de services intégrés', | ||
pleaseChoose: "Choisissez s'il vous plaît", | ||
'MySQL Is a Relational Database': 'MySQL is a relational database', | ||
'Web Server': 'Serveur Web', | ||
'A high-performance Key-Value database': 'Une base de données clé-valeur performante', | ||
'PHP is the best programming language in the world': 'PHP est le meilleur langage de programmation au monde', | ||
'PHP dependency management tool': 'Outil de gestion des dépendances PHP (doit être activé dans les paramètres)', | ||
'cross-platform text and code editor': 'Éditeur de texte et de code multiplateformes', | ||
'Text and code editors': 'Éditeur de texte et de code', | ||
'MySQL management tool on the web': 'Outil de gestion MySQL sur le Web', | ||
'View and edit hosts file': 'Afficher et modifier les fichiers hôtes', | ||
'Modify or reset the password of the MySQL root account': 'Modifier et réinitialiser le mot de passe du compte root MySQL', | ||
'Check port usage': "Vérifier l'occupation du port", | ||
'Error opening hosts file!': "Erreur lors de l'ouverture du fichier hosts !", | ||
'Your system version is too low, this function is not available!': "La version de votre système est trop basse et cette fonction n'est pas disponible !", | ||
'This feature is not available!': "Cette fonctionnalité n'est pas disponible !", | ||
'Error starting service!': 'Erreur lors du démarrage du service !', | ||
'The service was not stopped successfully!': "Le service n'a pas été arrêté avec succès !", | ||
'Error stopping service!': "Une erreur s'est produite lors de l'arrêt du service !", | ||
Ready: 'Prêt', | ||
Downloading: 'Téléchargement', | ||
Unzipping: 'Décompression', | ||
Configuring: 'Configuration', | ||
'Error getting site list!': "Erreur lors de l'obtention de la liste des sites Web !", | ||
'Delete error!': "Supprimez l'erreur !", | ||
'The IIS service has been automatically stopped': 'Le service IIS a été automatiquement arrêté', | ||
'The setting is successful and has taken effect. There is no need to restart the terminal!': | ||
'Le paramétrage est réussi et a pris effet. Pas besoin de redémarrer le terminal !', | ||
'The website directory cannot have spaces!': "Le répertoire du site Web ne peut pas contenir d'espaces !", | ||
'Initialization successful': 'Initialisation réussie', | ||
'Initialization failed!': "L'initialisation a échoué !", | ||
'Error adding website!': "Erreur lors de l'ajout du site Web !", | ||
'file does not exist': 'fichier ne existe pas', | ||
'Error opening file!': "Erreur lors de l'ouverture du fichier !", | ||
'does not exist!': "n'existe pas!", | ||
'Please reset the text editor': 'Veuillez réinitialiser votre éditeur de texte' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters