💄 修改滚动条样式.

This commit is contained in:
lijiahang
2024-07-26 10:18:39 +08:00
parent 305312cc26
commit 3851ead8bb
13 changed files with 91 additions and 89 deletions

View File

@@ -320,6 +320,18 @@
height: calc(100% - 56px);
overflow: auto;
padding-bottom: 4px;
&::-webkit-scrollbar-track {
display: none;
}
&::-webkit-scrollbar-thumb {
background: transparent;
}
&:hover::-webkit-scrollbar-thumb {
background: var(--color-fill-4);
}
}
.loading-skeleton {

View File

@@ -75,9 +75,8 @@
import type { HostQueryResponse } from '@/api/asset/host';
import { onMounted, ref } from 'vue';
import { useTerminalStore } from '@/store';
import { PanelSessionType, TerminalTabs } from '../../types/const';
import { PanelSessionType, TerminalTabs, emptyRecommendCount } from '../../types/const';
const totalCount = 7;
const { tabManager, hosts, openSession } = useTerminalStore();
const combinedHandlers = ref<Array<CombinedHandlerItem>>([{
@@ -103,7 +102,7 @@
...hosts.hostList.filter(s => s.favorite).map(s => s.id),
...hosts.hostList.map(s => s.id)
])
].slice(0, totalCount - 1)
].slice(0, emptyRecommendCount - 1)
.map(s => hosts.hostList.find(t => t.id === s) as HostQueryResponse)
.filter(Boolean)
.map(s => {
@@ -116,10 +115,10 @@
// 插入主机列表
combinedHandlers.value.push(...combinedHosts);
// 不足显示的行数用设置补充
if (totalCount - 1 - combinedHosts.length > 0) {
if (emptyRecommendCount - 1 - combinedHosts.length > 0) {
const fillTabs = Object.values(TerminalTabs)
.filter(s => s.key !== TerminalTabs.NEW_CONNECTION.key)
.slice(0, totalCount - 1 - combinedHosts.length)
.slice(0, emptyRecommendCount - 1 - combinedHosts.length)
.map(s => {
return {
title: s.title,
@@ -147,23 +146,19 @@
.combined-container {
padding: 12px;
margin: 64px auto 0 auto;
margin: 32px auto 0 auto;
width: @container-width;
height: @container-height;
max-height: @container-height;
display: flex;
flex-direction: column;
align-items: center;
box-sizing: content-box;
overflow: hidden;
&:hover {
overflow: auto;
}
}
.combined-handler {
width: @container-width - @transform-x;
height: @handler-height;
max-height: @handler-height;
border-radius: 4px;
margin-bottom: 6px;
color: var(--color-content-text-1);

View File

@@ -134,10 +134,4 @@
</script>
<style lang="less" scoped>
.list-view-container {
max-height: 100%;
width: 100%;
overflow: auto;
position: relative;
}
</style>

View File

@@ -320,6 +320,18 @@
height: calc(100% - 56px);
overflow: auto;
padding-bottom: 4px;
&::-webkit-scrollbar-track {
display: none;
}
&::-webkit-scrollbar-thumb {
background: transparent;
}
&:hover::-webkit-scrollbar-thumb {
background: var(--color-fill-4);
}
}
.loading-skeleton {

View File

@@ -242,7 +242,7 @@
width: 100%;
height: calc(100% - @ssh-header-height);
position: relative;
padding: 6px 0 0 6px;
padding: 8px;
.ssh-inst {
width: 100%;

View File

@@ -1,5 +1,8 @@
import type { ShortcutKeyItem } from './define';
// 首页推荐数量
export const emptyRecommendCount = 7;
// 终端 tab
export const TerminalTabs = {
NEW_CONNECTION: {