改进
This commit is contained in:
parent
23480b1478
commit
cd9d716892
@ -40,7 +40,7 @@
|
|||||||
<td>0.000 Bytes</td>
|
<td>0.000 Bytes</td>
|
||||||
<td>0.000 Bytes</td>
|
<td>0.000 Bytes</td>
|
||||||
|
|
||||||
<td>Test</td>
|
<td>{{ tunnel.server.name }}</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<span class="text-danger">离线</span>
|
<span class="text-danger">离线</span>
|
||||||
@ -55,7 +55,17 @@ import {ref} from "vue";
|
|||||||
import http from "../../plugins/http";
|
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) => {
|
http.get('tunnels').then((res) => {
|
||||||
tunnels.value = res.data
|
tunnels.value = res.data
|
||||||
|
@ -1,4 +1,39 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<h2>隧道: {{ tunnel.name }}</h2>
|
||||||
|
</div>
|
||||||
</template>
|
</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>
|
||||||
|
Loading…
Reference in New Issue
Block a user