feat(admin): 新增短信平台管理功能 #21

Merged
shiran merged 3 commits from master into deploy 2026-06-16 17:17:33 +08:00
2 changed files with 20 additions and 0 deletions
Showing only changes of commit 3227a50f9a - Show all commits
+10
View File
@@ -36,6 +36,7 @@
</div>
<div class="overview-actions">
<el-button v-if="isVmGoods" size="small" type="primary" @click="handleVnc">VNC</el-button>
<el-button v-if="isVmGoods" size="small" type="success" @click="handleSshConnect" :disabled="!vmPublicIpList.length || isWindows">SSH连接</el-button>
<el-button v-if="isVmGoods" size="small" type="success" @click="handlePower('start')" :disabled="vm?.status === 'running'">启动</el-button>
<el-button v-if="isVmGoods" size="small" type="warning" @click="handlePower('reboot')">重启</el-button>
<el-button v-if="isVmGoods" size="small" type="danger" @click="handlePower('stop')" :disabled="vm?.status === 'stopped' || vm?.status === 'stop'">关机</el-button>
@@ -1407,6 +1408,15 @@ const loadSgLockInfo = async () => {
const vncVisible = ref(false)
const vncLoading = ref(false)
const vncResult = ref(null)
const handleSshConnect = () => {
const host = vmPublicIpList.value[0]
if (!host) return ElMessage.warning('无可用公网 IP')
const username = isWindows.value ? 'Administrator' : 'root'
const password = vm.value?.root_password || ''
const encodedPwd = btoa(password)
window.open(`https://webssh1.007yjs.com/?hostname=${encodeURIComponent(host)}&username=${encodeURIComponent(username)}&password=${encodedPwd}`, '_blank')
}
const handleVnc = async () => {
vncVisible.value = true; vncLoading.value = true; vncResult.value = null
try {
+10
View File
@@ -18,6 +18,7 @@
</div>
<div class="overview-actions">
<el-button type="primary" @click="handleGetVnc">远程连接</el-button>
<el-button type="success" @click="handleSshConnect" :disabled="!publicIpList.length || isWindows">SSH连接</el-button>
<el-button type="danger" @click="handlePower('stop')" :disabled="detail.status === 'stopped' || detail.status === 'stop' || isMigrating">关机</el-button>
<el-dropdown trigger="click" @command="handleMoreCommand">
<el-button>更多 <el-icon class="el-icon--right"><ArrowDown /></el-icon></el-button>
@@ -2783,6 +2784,15 @@ const loadVncNodes = async () => {
} catch { /* */ }
}
const handleSshConnect = () => {
const host = publicIpList.value[0]
if (!host) return ElMessage.warning('无可用公网 IP')
const username = isWindows.value ? 'Administrator' : 'root'
const password = detail.value?.root_password || ''
const encodedPwd = btoa(password)
window.open(`https://webssh1.007yjs.com/?hostname=${encodeURIComponent(host)}&username=${encodeURIComponent(username)}&password=${encodedPwd}`, '_blank')
}
const handleGetVnc = async () => {
vncNodeId.value = null
vncResult.value = null