add url protocol &
add web client on/off by api server
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
import { shareByWebClient } from '@/api/address_book'
|
||||
import { CopyDocument } from '@element-plus/icons'
|
||||
import { handleClipboard } from '@/utils/clipboard'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
|
||||
const props = defineProps({
|
||||
id: String,
|
||||
@@ -71,7 +72,7 @@
|
||||
formData.id = props.id
|
||||
formData.hash = props.hash
|
||||
formData.password = ''
|
||||
formData.expire = 300
|
||||
formData.expire = 1800
|
||||
formData.password_type = 'once'
|
||||
link.value = ''
|
||||
}
|
||||
@@ -106,7 +107,10 @@
|
||||
loading.value = true
|
||||
const _formData = { ...formData }
|
||||
if (formData.password !== formData.hash) {
|
||||
const res = await getPeerSlat(formData.id).catch(_ => false)
|
||||
const res = await getPeerSlat(formData.id).catch(e => {
|
||||
ElMessageBox.alert(T('Timeout'), T('Error'))
|
||||
return false
|
||||
})
|
||||
if (!res) {
|
||||
loading.value = false
|
||||
return
|
||||
|
||||
@@ -30,22 +30,23 @@
|
||||
<el-card class="list-body" shadow="hover">
|
||||
<!-- <el-tag type="danger" style="margin-bottom: 10px">不建议在此操作地址簿,可能会造成数据不同步</el-tag>-->
|
||||
<el-table :data="listRes.list" v-loading="listRes.loading" border>
|
||||
<el-table-column prop="id" label="id" align="center"/>
|
||||
<el-table-column :label="T('Owner')" align="center">
|
||||
<el-table-column prop="id" label="id" align="center" width="200"/>
|
||||
<el-table-column :label="T('Owner')" align="center" width="200">
|
||||
<template #default="{row}">
|
||||
<span v-if="row.user_id"> <el-tag>{{ allUsers?.find(u => u.id === row.user_id)?.username }}</el-tag> </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="username" :label="T('Username')" align="center"/>
|
||||
<el-table-column prop="hostname" :label="T('Hostname')" align="center"/>
|
||||
<el-table-column prop="alias" :label="T('Alias')" align="center"/>
|
||||
<el-table-column prop="platform" :label="T('Platform')" align="center"/>
|
||||
<el-table-column prop="hash" :label="T('Hash')" align="center"/>
|
||||
<el-table-column prop="tags" :label="T('Tags')" align="center"/>
|
||||
<el-table-column prop="username" :label="T('Username')" align="center" width="150"/>
|
||||
<el-table-column prop="hostname" :label="T('Hostname')" align="center" width="150"/>
|
||||
<el-table-column prop="alias" :label="T('Alias')" align="center" width="150"/>
|
||||
<el-table-column prop="platform" :label="T('Platform')" align="center" width="120"/>
|
||||
<el-table-column prop="hash" :label="T('Hash')" align="center" width="250"/>
|
||||
<el-table-column prop="tags" :label="T('Tags')" align="center" width="250"/>
|
||||
<!-- <el-table-column prop="created_at" label="创建时间" align="center"/>-->
|
||||
<!-- <el-table-column prop="updated_at" label="更新时间" align="center"/>-->
|
||||
<el-table-column label="操作" align="center" width="500">
|
||||
<el-table-column :label="T('Actions')" align="center" class-name="table-actions">
|
||||
<template #default="{row}">
|
||||
<el-button type="success" @click="connectByClient(row.id)">{{ T('Link') }}</el-button>
|
||||
<el-button type="success" @click="toWebClientLink(row)">Web Client</el-button>
|
||||
<!-- <el-button type="primary" @click="toShowShare(row)">{{ T('ShareByWebClient') }}</el-button>-->
|
||||
<el-button @click="toEdit(row)">{{ T('Edit') }}</el-button>
|
||||
@@ -158,6 +159,7 @@
|
||||
import { T } from '@/utils/i18n'
|
||||
import { useRoute } from 'vue-router'
|
||||
import shareByWebClient from '@/views/address_book/components/shareByWebClient.vue'
|
||||
import { connectByClient } from '@/utils/peer'
|
||||
|
||||
const route = useRoute()
|
||||
const { allUsers, getAllUsers } = loadAllUsers()
|
||||
|
||||
Reference in New Issue
Block a user