This commit is contained in:
iVampireSP.com 2023-03-18 22:06:02 +08:00
parent 23480b1478
commit cd9d716892
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 48 additions and 3 deletions

View File

@ -40,7 +40,7 @@
<td>0.000 Bytes</td>
<td>0.000 Bytes</td>
<td>Test</td>
<td>{{ tunnel.server.name }}</td>
<td>
<span class="text-danger">离线</span>
@ -55,7 +55,17 @@ import {ref} from "vue";
import http from "../../plugins/http";
const tunnels = ref([])
const tunnels = ref([
{
id: '0',
protocol: '',
server: {
server_address: '',
server_port: '',
name: '',
}
}
])
http.get('tunnels').then((res) => {
tunnels.value = res.data

View File

@ -1,4 +1,39 @@
<template>
<div>
<h2>隧道: {{ tunnel.name }}</h2>
</div>
</template>
<script setup>
import {onMounted, ref} from "vue";
import http from "../../plugins/http";
import router from "../../plugins/router";
let tunnel_id = router.currentRoute.value.params.id
const tunnel = ref({
name: '',
protocol: '',
local_address: '',
remote_port: '',
})
function getTunnel() {
http.get(`/tunnels/${tunnel_id}`).then(res => {
tunnel.value = res.data
})
}
function updateTunnel() {
http.put(`/tunnels/${tunnel_id}`, tunnel.value).then(res => {
tunnel.value = res.data
})
}
onMounted(getTunnel)
</script>