2021-06-07 17:22:07 +08:00
|
|
|
<template>
|
2022-01-21 16:39:38 +08:00
|
|
|
<div>
|
2021-06-07 17:22:07 +08:00
|
|
|
<ssh-terminal ref="terminal" :machineId="machineId" :height="height + 'px'" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
2022-10-29 20:08:15 +08:00
|
|
|
<script lang="ts" setup>
|
2021-06-07 17:22:07 +08:00
|
|
|
import SshTerminal from './SshTerminal.vue';
|
2022-10-29 20:08:15 +08:00
|
|
|
import { reactive, toRefs, onMounted } from 'vue';
|
2021-06-07 17:22:07 +08:00
|
|
|
import { useRoute } from 'vue-router';
|
|
|
|
|
|
2022-10-29 20:08:15 +08:00
|
|
|
const route = useRoute();
|
|
|
|
|
const state = reactive({
|
|
|
|
|
machineId: 0,
|
2023-02-20 18:41:45 +08:00
|
|
|
height: 0,
|
2022-10-29 20:08:15 +08:00
|
|
|
});
|
2021-06-07 17:22:07 +08:00
|
|
|
|
2022-10-29 20:08:15 +08:00
|
|
|
const {
|
|
|
|
|
machineId,
|
|
|
|
|
height,
|
|
|
|
|
} = toRefs(state)
|
2021-06-07 17:22:07 +08:00
|
|
|
|
2022-10-29 20:08:15 +08:00
|
|
|
onMounted(() => {
|
|
|
|
|
state.height = window.innerHeight + 5;
|
|
|
|
|
state.machineId = Number.parseInt(route.query.id as string);
|
2021-06-07 17:22:07 +08:00
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss">
|
2022-10-29 20:08:15 +08:00
|
|
|
|
2021-06-07 17:22:07 +08:00
|
|
|
</style>
|