Skip to content

Commit

Permalink
fix: 解决重复访问容器内部时,终端显示宽度异常的问题 (1Panel-dev#3996)
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinHsu authored Feb 27, 2024
1 parent 50d55d5 commit 54bbb93
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/src/views/container/container/terminal/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,17 @@
{{ $t('commons.button.conn') }}
</el-button>
<el-button v-else @click="onClose()">{{ $t('commons.button.disconn') }}</el-button>
<Terminal style="height: calc(100vh - 302px)" ref="terminalRef"></Terminal>
<Terminal
style="height: calc(100vh - 302px); margin-top: 18px"
ref="terminalRef"
v-if="terminalOpen"
></Terminal>
</el-form>
</el-drawer>
</template>

<script lang="ts" setup>
import { reactive, ref } from 'vue';
import { reactive, ref, nextTick } from 'vue';
import { ElForm, FormInstance } from 'element-plus';
import { Rules } from '@/global/form-rules';
import Terminal from '@/components/terminal/index.vue';
Expand Down Expand Up @@ -91,6 +95,7 @@ const initTerm = (formEl: FormInstance | undefined) => {
formEl.validate(async (valid) => {
if (!valid) return;
terminalOpen.value = true;
await nextTick();
terminalRef.value!.acceptParams({
endpoint: '/api/v1/containers/exec',
args: `containerid=${form.containerID}&user=${form.user}&command=${form.command}`,
Expand Down

0 comments on commit 54bbb93

Please sign in to comment.