1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

feat: 全屏按钮样式统一调整 (#2366)

This commit is contained in:
ssongliu 2023-09-20 22:16:20 +08:00 committed by GitHub
parent 12d6c2c3df
commit a5b3067cc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 2 deletions

View File

@ -49,6 +49,8 @@ const message = {
copy: 'Copy', copy: 'Copy',
random: 'Random', random: 'Random',
uninstall: 'Uninstall', uninstall: 'Uninstall',
fullscreen: 'Fullscreen',
quitFullscreen: 'Quit Fullscreen',
}, },
search: { search: {
timeStart: 'Time start', timeStart: 'Time start',

View File

@ -49,6 +49,8 @@ const message = {
copy: '復製', copy: '復製',
random: '隨機密碼', random: '隨機密碼',
uninstall: '卸載', uninstall: '卸載',
fullscreen: '全屏',
quitFullscreen: '退出全屏',
}, },
search: { search: {
timeStart: '開始時間', timeStart: '開始時間',

View File

@ -49,6 +49,8 @@ const message = {
copy: '复制', copy: '复制',
random: '随机密码', random: '随机密码',
uninstall: '卸载', uninstall: '卸载',
fullscreen: '全屏',
quitFullscreen: '退出全屏',
}, },
search: { search: {
timeStart: '开始时间', timeStart: '开始时间',

View File

@ -9,7 +9,9 @@
<template #header> <template #header>
<DrawerHeader :header="$t('commons.button.log')" :resource="logSearch.container" :back="handleClose"> <DrawerHeader :header="$t('commons.button.log')" :resource="logSearch.container" :back="handleClose">
<template #extra v-if="!mobile"> <template #extra v-if="!mobile">
<el-button @click="toggleFullscreen" class="fullScreen" icon="FullScreen" plain></el-button> <el-tooltip :content="loadTooltip()" placement="top">
<el-button @click="toggleFullscreen" class="fullScreen" icon="FullScreen" plain></el-button>
</el-tooltip>
</template> </template>
</DrawerHeader> </DrawerHeader>
</template> </template>
@ -124,6 +126,10 @@ function toggleFullscreen() {
screenfull.toggle(); screenfull.toggle();
} }
} }
const loadTooltip = () => {
return i18n.global.t('commons.button.' + (screenfull.isFullscreen ? 'quitFullscreen' : 'fullscreen'));
};
const handleClose = async () => { const handleClose = async () => {
logVisiable.value = false; logVisiable.value = false;
terminalSocket.value.close(); terminalSocket.value.close();

View File

@ -119,7 +119,9 @@
></el-empty> ></el-empty>
</div> </div>
</el-tabs> </el-tabs>
<el-button @click="toggleFullscreen" v-if="!mobile" class="fullScreen" icon="FullScreen"></el-button> <el-tooltip :content="loadTooltip()" placement="top">
<el-button @click="toggleFullscreen" v-if="!mobile" class="fullScreen" icon="FullScreen"></el-button>
</el-tooltip>
<HostDialog ref="dialogRef" @on-conn-terminal="onConnTerminal" @load-host-tree="loadHostTree" /> <HostDialog ref="dialogRef" @on-conn-terminal="onConnTerminal" @load-host-tree="loadHostTree" />
</div> </div>
@ -149,7 +151,11 @@ function toggleFullscreen() {
if (screenfull.isEnabled) { if (screenfull.isEnabled) {
screenfull.toggle(); screenfull.toggle();
} }
globalStore.isFullScreen = !screenfull.isFullscreen;
} }
const loadTooltip = () => {
return i18n.global.t('commons.button.' + (globalStore.isFullScreen ? 'quitFullscreen' : 'fullscreen'));
};
const localHostID = ref(); const localHostID = ref();
@ -409,6 +415,8 @@ defineExpose({
font-weight: 600; font-weight: 600;
} }
.fullScreen { .fullScreen {
background-color: #efefef;
border: none;
position: absolute; position: absolute;
right: 50px; right: 50px;
top: 90px; top: 90px;