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()
|
||||
|
||||
@@ -20,19 +20,20 @@
|
||||
<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 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="id" label="id" align="center" width="200"/>
|
||||
<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="T('Actions')" align="center" width="500">
|
||||
<el-table-column :label="T('Actions')" align="center" class-name="table-actions">
|
||||
<template #default="{row}">
|
||||
<el-button type="success" @click="toWebClientLink(row)">Web Client</el-button>
|
||||
<el-button type="primary" @click="toShowShare(row)">{{ T('ShareByWebClient') }}</el-button>
|
||||
<el-button type="success" @click="connectByClient(row.id)">{{ T('Link') }}</el-button>
|
||||
<el-button v-if="appStore.setting.appConfig.web_client" type="success" @click="toWebClientLink(row)">Web Client</el-button>
|
||||
<el-button v-if="appStore.setting.appConfig.web_client" type="primary" @click="toShowShare(row)">{{ T('ShareByWebClient') }}</el-button>
|
||||
<el-button @click="toEdit(row)">{{ T('Edit') }}</el-button>
|
||||
<el-button type="danger" @click="del(row)">{{ T('Delete') }}</el-button>
|
||||
</template>
|
||||
@@ -131,7 +132,10 @@
|
||||
import { toWebClientLink } from '@/utils/webclient'
|
||||
import { T } from '@/utils/i18n'
|
||||
import shareByWebClient from '@/views/address_book/components/shareByWebClient.vue'
|
||||
import { useAppStore } from '@/store/app'
|
||||
import { connectByClient } from '@/utils/peer'
|
||||
|
||||
const appStore = useAppStore()
|
||||
const tagList = ref([])
|
||||
const fetchTagListData = async () => {
|
||||
const res = await fetchTagList({ is_my: 1 }).catch(_ => false)
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
<div>
|
||||
<el-card class="list-query" shadow="hover">
|
||||
<el-form inline label-width="150px">
|
||||
<el-form-item label="ID">
|
||||
<el-input v-model="listQuery.id" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="T('Hostname')">
|
||||
<el-input v-model="listQuery.hostname" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="T('LastOnlineTime')">
|
||||
<el-select v-model="listQuery.time_ago" clearable>
|
||||
<el-option
|
||||
@@ -42,9 +48,10 @@
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="T('Actions')" align="center" width="500">
|
||||
<el-table-column :label="T('Actions')" align="center" width="500" class-name="table-actions">
|
||||
<template #default="{row}">
|
||||
<el-button type="success" @click="toWebClientLink(row)">Web-Client</el-button>
|
||||
<el-button type="success" @click="connectByClient(row.id)">{{ T('Link') }}</el-button>
|
||||
<el-button v-if="appStore.setting.appConfig.web_client" type="success" @click="toWebClientLink(row)">Web Client</el-button>
|
||||
<el-button type="primary" @click="toAddressBook(row)">{{ T('AddToAddressBook') }}</el-button>
|
||||
<el-button @click="toEdit(row)">{{ T('Edit') }}</el-button>
|
||||
<el-button type="danger" @click="del(row)">{{ T('Delete') }}</el-button>
|
||||
@@ -161,7 +168,10 @@
|
||||
import { loadAllUsers } from '@/global'
|
||||
import { list as fetchTagList } from '@/api/tag'
|
||||
import { batchCreate } from '@/api/address_book'
|
||||
import { useAppStore } from '@/store/app'
|
||||
import { connectByClient } from '@/utils/peer'
|
||||
|
||||
const appStore = useAppStore()
|
||||
const listRes = reactive({
|
||||
list: [], total: 0, loading: false,
|
||||
})
|
||||
@@ -169,6 +179,8 @@
|
||||
page: 1,
|
||||
page_size: 10,
|
||||
time_ago: null,
|
||||
id: '',
|
||||
hostname: '',
|
||||
})
|
||||
|
||||
const getList = async () => {
|
||||
|
||||
Reference in New Issue
Block a user