新增全屏&UI调整

This commit is contained in:
chaoszhu 2024-07-25 20:46:58 +08:00
parent 98dbf26ea3
commit afbfc98e68
2 changed files with 32 additions and 79 deletions

View File

@ -1,11 +1,15 @@
# EasyNode # EasyNode v2.0
> 一个简易的个人Linux服务器管理面板(基于Node.js). > 一个功能完善的Linux服务器SSH终端面板.
> 前端仓库地址https://github.com/chaos-zhu/easynode_web > [!WARNING]
> 初次部署EasyNode登录系统后务必记得修改默认账户密码 `admin/admin`
<!-- - [EasyNode](#easynode) --> > [!WARNING]
- [功能简介](#功能简介) > 强烈建议使用 **iptables****fail2ban** 等安全服务限制IP访问谨慎暴露面板服务到公网。
<!-- - [功能简介](#功能简介)
- [安装指南](#安装指南) - [安装指南](#安装指南)
- [服务端安装](#服务端安装) - [服务端安装](#服务端安装)
- [Docker镜像](#docker镜像) - [Docker镜像](#docker镜像)
@ -135,11 +139,7 @@ wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubuserconte
## 升级指南 ## 升级指南
- **v1.2 to v1.3** 2.0版本无论前后端均作了大量的重构工作1.0版本**不支持**无感升级到2.0版本
因储存方式变更,需重新安装服务
- **v1.1 to v1.2**
### 服务端 ### 服务端
@ -182,4 +182,4 @@ wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubuserconte
## License ## License
[MIT](LICENSE). Copyright (c). [MIT](LICENSE). Copyright (c). -->

View File

@ -2,10 +2,11 @@
<div class="terminal_wrap"> <div class="terminal_wrap">
<div class="info_box"> <div class="info_box">
<div class="top"> <div class="top">
<el-icon>
<FullScreen class="full_icon" @click="handleFullScreen" />
</el-icon>
<el-dropdown trigger="click"> <el-dropdown trigger="click">
<div class="action_wrap"> <div class="action_wrap">
<!-- 全屏 -->
<el-icon><FullScreen /></el-icon>
<span class="link_host">连接<el-icon class="el-icon--right"><arrow-down /></el-icon></span> <span class="link_host">连接<el-icon class="el-icon--right"><arrow-down /></el-icon></span>
</div> </div>
<template #dropdown> <template #dropdown>
@ -17,35 +18,13 @@
</template> </template>
</el-dropdown> </el-dropdown>
</div> </div>
<InfoSide <InfoSide ref="infoSideRef" v-model:show-input-command="showInputCommand" :host-info="curHost" :visible="visible"
ref="infoSideRef" @click-input-command="clickInputCommand" />
v-model:show-input-command="showInputCommand"
:host-info="curHost"
:visible="visible"
@click-input-command="clickInputCommand"
/>
</div> </div>
<div class="terminals_sftp_wrap"> <div class="terminals_sftp_wrap">
<!-- <el-button class="full-screen-button" type="success" @click="handleFullScreen"> <el-tabs v-model="activeTabIndex" type="border-card" tab-position="top" @tab-remove="removeTab"
{{ isFullScreen ? '退出全屏' : '全屏' }} @tab-change="tabChange">
</el-button> --> <el-tab-pane v-for="(item, index) in terminalTabs" :key="index" :label="item.name" :name="index" :closable="true">
<!-- <div class="visible" @click="handleVisibleSidebar">
<svg-icon name="icon-jiantou_zuoyouqiehuan" class="svg-icon" />
</div> -->
<el-tabs
v-model="activeTabIndex"
type="border-card"
tab-position="top"
@tab-remove="removeTab"
@tab-change="tabChange"
>
<el-tab-pane
v-for="(item, index) in terminalTabs"
:key="index"
:label="item.name"
:name="index"
:closable="true"
>
<div class="tab_content_wrap" :style="{ height: mainHeight + 'px' }"> <div class="tab_content_wrap" :style="{ height: mainHeight + 'px' }">
<TerminalTab ref="terminalTabRefs" :host="item.host" /> <TerminalTab ref="terminalTabRefs" :host="item.host" />
<Sftp :host="item.host" @resize="resizeTerminal" /> <Sftp :host="item.host" @resize="resizeTerminal" />
@ -148,7 +127,7 @@ const removeTab = (index) => {
const handleFullScreen = () => { const handleFullScreen = () => {
if (isFullScreen.value) document.exitFullscreen() if (isFullScreen.value) document.exitFullscreen()
else document.getElementsByClassName('tab_content_wrap')[0].requestFullscreen() else document.getElementsByClassName('terminals_sftp_wrap')[0].requestFullscreen()
isFullScreen.value = !isFullScreen.value isFullScreen.value = !isFullScreen.value
} }
@ -183,7 +162,7 @@ const handleInputCommand = async (command) => {
const curTabTerminal = terminalTabRefs.value[activeTabIndex.value] const curTabTerminal = terminalTabRefs.value[activeTabIndex.value]
await $nextTick() await $nextTick()
curTabTerminal?.focusTab() curTabTerminal?.focusTab()
curTabTerminal.handleInputCommand(`${ command }\n`) curTabTerminal.handleInputCommand(`${command}\n`)
showInputCommand.value = false showInputCommand.value = false
} }
</script> </script>
@ -213,20 +192,24 @@ const handleInputCommand = async (command) => {
overflow: auto; overflow: auto;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.top { .top {
height: 39px;
flex-shrink: 0;
position: sticky; position: sticky;
top: 0px; top: 0px;
z-index: 1; z-index: 1;
background-color: rgb(255, 255, 255); background-color: rgb(255, 255, 255);
padding-right: 15px; padding: 0 15px;
display: flex; display: flex;
:deep(.el-dropdown) { align-items: center;
margin-left: auto; justify-content: space-between;
.full_icon {
font-size: 15px;
color: var(--el-color-primary);
cursor: pointer;
} }
.action_wrap { .action_wrap {
height: 39px;
display: flex;
align-items: center;
.link_host { .link_host {
font-size: var(--el-font-size-base); font-size: var(--el-font-size-base);
color: var(--el-color-primary); color: var(--el-color-primary);
@ -235,6 +218,7 @@ const handleInputCommand = async (command) => {
} }
} }
} }
.terminals_sftp_wrap { .terminals_sftp_wrap {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
@ -279,34 +263,3 @@ const handleInputCommand = async (command) => {
} }
} }
</style> </style>
<style lang="scss">
// .el-tabs__header {
// position: sticky;
// top: 0;
// z-index: 1;
// user-select: none;
// }
// .el-tabs__new-tab {
// position: absolute;
// left: 18px;
// font-size: 50px;
// z-index: 98;
// }
// .el-tabs--border-card {
// height: 100%;
// overflow: hidden;
// display: flex;
// flex-direction: column;
// }
// .el-icon.is-icon-close {
// font-size: 13px;
// position: absolute;
// right: 0px;
// top: 2px;
// }
</style>