Update version to 1.0.7 in package.json and version.json, and add refresh functionality in HostsManager.vue for improved host management experience.

This commit is contained in:
Ethanfly 2025-12-31 15:09:11 +08:00
parent 2e06bc5277
commit 965bc618ee
3 changed files with 23 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "phper-dev-manager", "name": "phper-dev-manager",
"version": "1.0.6", "version": "1.0.7",
"description": "PHP开发环境管理器 - 管理PHP、MySQL、Nginx、Redis服务", "description": "PHP开发环境管理器 - 管理PHP、MySQL、Nginx、Redis服务",
"main": "dist-electron/main.js", "main": "dist-electron/main.js",
"scripts": { "scripts": {

View File

@ -1,5 +1,5 @@
{ {
"version": "1.0.6", "version": "1.0.7",
"buildTime": "2025-12-26T08:01:20.649Z", "buildTime": "2025-12-31T07:09:02.287Z",
"buildDate": "2025/12/26" "buildDate": "2025/12/31"
} }

View File

@ -16,6 +16,10 @@
Hosts 条目 Hosts 条目
</span> </span>
<div class="card-actions"> <div class="card-actions">
<el-button @click="refreshHosts" :loading="refreshing">
<el-icon v-if="!refreshing"><RefreshRight /></el-icon>
刷新 Hosts
</el-button>
<el-button @click="flushDns"> <el-button @click="flushDns">
<el-icon><Refresh /></el-icon> <el-icon><Refresh /></el-icon>
刷新 DNS 刷新 DNS
@ -101,6 +105,7 @@ interface HostEntry {
} }
const loading = ref(false) const loading = ref(false)
const refreshing = ref(false)
const hosts = ref<HostEntry[]>([]) const hosts = ref<HostEntry[]>([])
const showAddDialog = ref(false) const showAddDialog = ref(false)
const adding = ref(false) const adding = ref(false)
@ -118,6 +123,19 @@ const loadHosts = async () => {
} }
} }
const refreshHosts = async () => {
refreshing.value = true
try {
hosts.value = await window.electronAPI?.hosts.get() || []
ElMessage.success('Hosts 列表已刷新')
} catch (error: any) {
console.error('刷新 hosts 失败:', error)
ElMessage.error('刷新失败: ' + error.message)
} finally {
refreshing.value = false
}
}
const addHost = async () => { const addHost = async () => {
if (!hostForm.ip || !hostForm.domain) { if (!hostForm.ip || !hostForm.domain) {
ElMessage.warning('请填写 IP 地址和域名') ElMessage.warning('请填写 IP 地址和域名')