关于页运行状态、代理关联租户与步进框修复
This commit is contained in:
@@ -22,6 +22,8 @@ import {
|
||||
import AppInputNumber from '@/components/AppInputNumber.vue'
|
||||
import FootNote from '@/components/FootNote.vue'
|
||||
import FormField from '@/components/FormField.vue'
|
||||
import ProxyTenantsModal from '@/components/proxy/ProxyTenantsModal.vue'
|
||||
import StatusBadge from '@/components/StatusBadge.vue'
|
||||
import { useAsync } from '@/composables/useAsync'
|
||||
import type { ProxyImportResult, ProxyInfo } from '@/types/api'
|
||||
import { useToast } from '@/composables/useToast'
|
||||
@@ -120,6 +122,15 @@ async function remove(row: ProxyInfo) {
|
||||
}
|
||||
}
|
||||
|
||||
// ---- 关联租户管理 ----
|
||||
const showTenants = ref(false)
|
||||
const tenantsFor = ref<ProxyInfo | null>(null)
|
||||
|
||||
function openTenants(row: ProxyInfo) {
|
||||
tenantsFor.value = row
|
||||
showTenants.value = true
|
||||
}
|
||||
|
||||
// ---- 手动重测出口地区 ----
|
||||
const probingIds = ref(new Set<number>())
|
||||
|
||||
@@ -207,13 +218,15 @@ const columns: DataTableColumns<ProxyInfo> = [
|
||||
{
|
||||
title: '认证',
|
||||
key: 'username',
|
||||
width: 110,
|
||||
render: (row) =>
|
||||
h(
|
||||
'span',
|
||||
{ class: 'text-[12.5px] text-ink-2' },
|
||||
row.username ? `${row.username}${row.passwordSet ? ' / ●●●' : ''}` : row.passwordSet ? '●●●' : '无',
|
||||
),
|
||||
width: 76,
|
||||
render: (row) => {
|
||||
const has = !!row.username || row.passwordSet
|
||||
// 悬停「是」可见用户名(无用户名则提示仅密码)
|
||||
const title = has ? (row.username ? `用户名 ${row.username}` : '仅密码认证') : undefined
|
||||
return h('span', { title }, [
|
||||
h(StatusBadge, { kind: has ? 'run' : 'check', label: has ? '是' : '否', dot: false }),
|
||||
])
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '关联租户',
|
||||
@@ -225,7 +238,7 @@ const columns: DataTableColumns<ProxyInfo> = [
|
||||
{
|
||||
title: '操作',
|
||||
key: 'actions',
|
||||
width: 168,
|
||||
width: 236,
|
||||
render: (row) =>
|
||||
h('div', { class: 'flex items-center gap-1' }, [
|
||||
h(
|
||||
@@ -233,6 +246,7 @@ const columns: DataTableColumns<ProxyInfo> = [
|
||||
{ size: 'tiny', quaternary: true, loading: probingIds.value.has(row.id), onClick: () => probe(row) },
|
||||
() => '重测',
|
||||
),
|
||||
h(NButton, { size: 'tiny', quaternary: true, onClick: () => openTenants(row) }, () => '关联租户'),
|
||||
h(NButton, { size: 'tiny', quaternary: true, onClick: () => openEdit(row) }, () => '编辑'),
|
||||
h(
|
||||
NPopconfirm,
|
||||
@@ -261,6 +275,12 @@ const columns: DataTableColumns<ProxyInfo> = [
|
||||
支持 SOCKS5 / HTTP / HTTPS;密码 AES 加密存储、不回显明文;地区为经代理实测的出口位置(ip-api.com),创建后自动检测;被租户关联的代理不可删除,请先解除关联
|
||||
</FootNote>
|
||||
|
||||
<ProxyTenantsModal
|
||||
v-model:show="showTenants"
|
||||
:proxy="tenantsFor"
|
||||
@saved="void proxies.run({ silent: true })"
|
||||
/>
|
||||
|
||||
<NModal
|
||||
v-model:show="showForm"
|
||||
preset="card"
|
||||
|
||||
Reference in New Issue
Block a user