|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+<template>
|
|
|
2
|
+ <div>
|
|
|
3
|
+ <el-card class="list-query" shadow="hover">
|
|
|
4
|
+ <el-form inline label-width="80px">
|
|
|
5
|
+ <el-form-item :label="T('Peer')">
|
|
|
6
|
+ <el-input v-model="listQuery.peer_id" clearable></el-input>
|
|
|
7
|
+ </el-form-item>
|
|
|
8
|
+ <el-form-item :label="T('FromPeer')">
|
|
|
9
|
+ <el-input v-model="listQuery.from_peer" clearable></el-input>
|
|
|
10
|
+ </el-form-item>
|
|
|
11
|
+ <el-form-item>
|
|
|
12
|
+ <el-button type="primary" @click="handlerQuery">筛选</el-button>
|
|
|
13
|
+ </el-form-item>
|
|
|
14
|
+ </el-form>
|
|
|
15
|
+ </el-card>
|
|
|
16
|
+ <el-card class="list-body" shadow="hover">
|
|
|
17
|
+ <el-table :data="listRes.list" v-loading="listRes.loading" border max-height="750">
|
|
|
18
|
+ <el-table-column prop="id" label="id" align="center" width="100"/>
|
|
|
19
|
+ <el-table-column :label="T('Peer')" prop="peer_id" align="center" width="120"/>
|
|
|
20
|
+ <el-table-column :label="T('FromPeer')" prop="from_peer" align="center" width="120"/>
|
|
|
21
|
+ <el-table-column :label="T('FromName')" prop="from_name" align="center" width="120"/>
|
|
|
22
|
+ <el-table-column :label="T('Ip')" prop="ip" align="center" width="120"/>
|
|
|
23
|
+ <el-table-column prop="type" :label="T('Type')" align="center" width="200">
|
|
|
24
|
+ <template #default="{row}">
|
|
|
25
|
+ <el-tag v-if="row.type === 1" type="warning"> {{T('ToRemote')}}: <el-icon><Right/></el-icon> {{row.peer_id}}</el-tag>
|
|
|
26
|
+ <el-tag v-else>{{T('ToLocal')}}: <el-icon><Right/></el-icon> {{row.from_peer}}</el-tag>
|
|
|
27
|
+ </template>
|
|
|
28
|
+ </el-table-column>
|
|
|
29
|
+ <el-table-column prop="num" :label="T('Num')" align="center" width="100"/>
|
|
|
30
|
+ <el-table-column :label="T('FileInfo')" align="center" width="300">
|
|
|
31
|
+ <template #default="{row}">
|
|
|
32
|
+ <template v-if="!row.is_file">
|
|
|
33
|
+ <el-table size="small" :data="row.info?.files?.filter((v,k) => k<showDirFileNum)" fit>
|
|
|
34
|
+ <el-table-column prop="0" :label="T('FileName')" align="center" width="150" show-overflow-tooltip></el-table-column>
|
|
|
35
|
+ <el-table-column prop="1" :label="T('Size')" align="center">
|
|
|
36
|
+ <template #default="{row:_row}">
|
|
|
37
|
+ {{ sizeFormat(_row[1]) }}
|
|
|
38
|
+ </template>
|
|
|
39
|
+ </el-table-column>
|
|
|
40
|
+ </el-table>
|
|
|
41
|
+ <el-button size="small" v-if="row.info.files.length>showDirFileNum" style="width: 100%;margin-top: 5px" type="primary" @click="showAllFile(row.info.files)">
|
|
|
42
|
+ {{ T('More') }}({{ row.info.files.length - showDirFileNum }})
|
|
|
43
|
+ </el-button>
|
|
|
44
|
+ </template>
|
|
|
45
|
+ <div v-else>
|
|
|
46
|
+ {{ sizeFormat(row.info.files[0][1]) }}
|
|
|
47
|
+ </div>
|
|
|
48
|
+
|
|
|
49
|
+ </template>
|
|
|
50
|
+ </el-table-column>
|
|
|
51
|
+ <el-table-column prop="path" :label="T('Path')" align="center" width="150" show-overflow-tooltip/>
|
|
|
52
|
+ <el-table-column prop="uuid" label="uuid" align="center" width="120" show-overflow-tooltip/>
|
|
|
53
|
+ <el-table-column prop="created_at" :label="T('CreatedAt')" align="center" min-width="120"/>
|
|
|
54
|
+ <el-table-column :label="T('Actions')" align="center" width="150" fixed="right">
|
|
|
55
|
+ <template #default="{row}">
|
|
|
56
|
+ <el-button type="danger" @click="del(row)">{{ T('Delete') }}</el-button>
|
|
|
57
|
+ </template>
|
|
|
58
|
+ </el-table-column>
|
|
|
59
|
+ </el-table>
|
|
|
60
|
+ </el-card>
|
|
|
61
|
+ <el-card class="list-page" shadow="hover">
|
|
|
62
|
+ <el-pagination background
|
|
|
63
|
+ layout="prev, pager, next, sizes, jumper"
|
|
|
64
|
+ :page-sizes="[10,20,50,100]"
|
|
|
65
|
+ v-model:page-size="listQuery.page_size"
|
|
|
66
|
+ v-model:current-page="listQuery.page"
|
|
|
67
|
+ :total="listRes.total">
|
|
|
68
|
+ </el-pagination>
|
|
|
69
|
+ </el-card>
|
|
|
70
|
+ <el-dialog v-model="allFilesVisible" :title="T('File')">
|
|
|
71
|
+ <el-table :data="showFiles" max-height="800px">
|
|
|
72
|
+ <el-table-column type="index" :label="T('IndexNum')" width="120" align="center"></el-table-column>
|
|
|
73
|
+ <el-table-column prop="0" :label="T('FileName')" align="center"></el-table-column>
|
|
|
74
|
+ <el-table-column prop="1" :label="T('Size')" align="center">
|
|
|
75
|
+ <template #default="{row:_row}">
|
|
|
76
|
+ {{ sizeFormat(_row[1]) }}
|
|
|
77
|
+ </template>
|
|
|
78
|
+ </el-table-column>
|
|
|
79
|
+ </el-table>
|
|
|
80
|
+ <el-button @click="allFilesVisible=false" style="margin-top: 20px;width: 100%" type="primary">{{ T('Close') }}</el-button>
|
|
|
81
|
+ </el-dialog>
|
|
|
82
|
+ </div>
|
|
|
83
|
+</template>
|
|
|
84
|
+
|
|
|
85
|
+<script setup>
|
|
|
86
|
+ import { onActivated, onMounted, ref, watch } from 'vue'
|
|
|
87
|
+ import { useFileRepositories } from '@/views/audit/reponsitories'
|
|
|
88
|
+ import { T } from '@/utils/i18n'
|
|
|
89
|
+ import { sizeFormat } from '@/utils/file'
|
|
|
90
|
+ import { Right } from '@element-plus/icons'
|
|
|
91
|
+
|
|
|
92
|
+ const showDirFileNum = 3
|
|
|
93
|
+ const {
|
|
|
94
|
+ listRes,
|
|
|
95
|
+ listQuery,
|
|
|
96
|
+ getList,
|
|
|
97
|
+ handlerQuery,
|
|
|
98
|
+ del,
|
|
|
99
|
+ } = useFileRepositories()
|
|
|
100
|
+
|
|
|
101
|
+ onMounted(getList)
|
|
|
102
|
+ onActivated(getList)
|
|
|
103
|
+
|
|
|
104
|
+ watch(() => listQuery.page, getList)
|
|
|
105
|
+
|
|
|
106
|
+ watch(() => listQuery.page_size, handlerQuery)
|
|
|
107
|
+
|
|
|
108
|
+ const allFilesVisible = ref(false)
|
|
|
109
|
+ const showFiles = ref([])
|
|
|
110
|
+ const showAllFile = (files) => {
|
|
|
111
|
+ showFiles.value = files
|
|
|
112
|
+ allFilesVisible.value = true
|
|
|
113
|
+ }
|
|
|
114
|
+</script>
|
|
|
115
|
+
|
|
|
116
|
+<style scoped lang="scss">
|
|
|
117
|
+
|
|
|
118
|
+</style>
|