mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-07 17:10:07 +08:00
fix: 解决重复访问容器内部时,终端显示宽度异常的问题 (#3996)
This commit is contained in:
parent
121a1ff5da
commit
c510a028db
@ -44,13 +44,17 @@
|
|||||||
{{ $t('commons.button.conn') }}
|
{{ $t('commons.button.conn') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-else @click="onClose()">{{ $t('commons.button.disconn') }}</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-form>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref, nextTick } from 'vue';
|
||||||
import { ElForm, FormInstance } from 'element-plus';
|
import { ElForm, FormInstance } from 'element-plus';
|
||||||
import { Rules } from '@/global/form-rules';
|
import { Rules } from '@/global/form-rules';
|
||||||
import Terminal from '@/components/terminal/index.vue';
|
import Terminal from '@/components/terminal/index.vue';
|
||||||
@ -91,6 +95,7 @@ const initTerm = (formEl: FormInstance | undefined) => {
|
|||||||
formEl.validate(async (valid) => {
|
formEl.validate(async (valid) => {
|
||||||
if (!valid) return;
|
if (!valid) return;
|
||||||
terminalOpen.value = true;
|
terminalOpen.value = true;
|
||||||
|
await nextTick();
|
||||||
terminalRef.value!.acceptParams({
|
terminalRef.value!.acceptParams({
|
||||||
endpoint: '/api/v1/containers/exec',
|
endpoint: '/api/v1/containers/exec',
|
||||||
args: `containerid=${form.containerID}&user=${form.user}&command=${form.command}`,
|
args: `containerid=${form.containerID}&user=${form.user}&command=${form.command}`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user