Files
mayfly-go/mayfly_go_web/src/views/ops/machine/SshTerminalPage.vue

40 lines
885 B
Vue
Raw Normal View History

<template>
<div>
<ssh-terminal ref="terminal" :machineId="machineId" :height="height + 'px'" />
</div>
</template>
<script lang="ts">
import SshTerminal from './SshTerminal.vue';
2022-02-14 14:58:25 +08:00
import { reactive, toRefs, defineComponent, onMounted } from 'vue';
import { useRoute } from 'vue-router';
export default defineComponent({
name: 'SshTerminalPage',
components: {
SshTerminal,
},
props: {
machineId: { type: Number },
},
setup() {
const route = useRoute();
const state = reactive({
machineId: 0,
height: 700,
});
onMounted(() => {
2022-03-09 17:07:35 +08:00
state.height = window.innerHeight + 5;
state.machineId = Number.parseInt(route.query.id as string);
});
return {
...toRefs(state),
};
},
});
</script>
<style lang="scss">
</style>