PortIO/resources/js/views/Tunnels/Index.vue

77 lines
1.7 KiB
Vue
Raw Normal View History

2023-03-15 13:45:41 +00:00
<template>
<h3>隧道列表</h3>
<table class="table table-hover">
<thead>
2023-03-16 13:36:59 +00:00
<tr>
<th scope="col">ID</th>
<th scope="col">名称</th>
<th scope="col">协议</th>
<th scope="col">本地地址</th>
<th scope="col">远程端口/域名</th>
<th scope="col">连接数</th>
<th scope="col">下载流量</th>
<th scope="col">上载流量</th>
<th scope="col">服务器</th>
<th scope="col">状态</th>
</tr>
2023-03-15 13:45:41 +00:00
</thead>
<tbody>
2023-03-16 13:36:59 +00:00
<tr v-for="tunnel in tunnels">
<th>1</th>
<td>
<router-link :to="{name: 'tunnels.show', params: {id: tunnel.id}}">
{{ tunnel.name }}
</router-link>
</td>
2023-03-16 13:44:01 +00:00
<td>
{{ tunnel.protocol.toString().toUpperCase() }}
</td>
<td>
{{ tunnel.local_address }}
</td>
2023-03-16 13:36:59 +00:00
2023-03-16 13:44:01 +00:00
<td>
{{ tunnel.server.server_address }}{{ tunnel.remote_port }}
</td>
2023-03-16 13:36:59 +00:00
<td>0</td>
<td>0.000 Bytes</td>
<td>0.000 Bytes</td>
2023-03-18 14:06:02 +00:00
<td>{{ tunnel.server.name }}</td>
2023-03-16 13:36:59 +00:00
<td>
<span class="text-danger">离线</span>
</td>
</tr>
2023-03-15 13:45:41 +00:00
</tbody>
</table>
</template>
<script setup>
2023-03-16 13:36:59 +00:00
import {ref} from "vue";
2023-03-15 13:45:41 +00:00
import http from "../../plugins/http";
2023-03-18 14:06:02 +00:00
const tunnels = ref([
{
id: '0',
protocol: '',
server: {
server_address: '',
server_port: '',
name: '',
}
}
])
2023-03-15 13:45:41 +00:00
http.get('tunnels').then((res) => {
tunnels.value = res.data
console.log(tunnels.value)
})
</script>