mirror of
https://gitcode.com/JianFeeeee/webui4frpc.git
synced 2026-10-15 12:14:37 +00:00
feat(web): 窄屏适配 — 侧栏转底部 tab bar + 各页响应式重排
此前只有一个 max-width:900px 断点(仅缩窄侧栏),手机上 210px 侧栏吃掉 半屏、卡片网格横向溢出、按钮被挤成细条。新增 720px / 380px 两档断点: App.vue(关键) - ≤720px:shell 转竖向,导航从侧栏抽出固定到屏幕底部(图标上/文字下), 品牌+身份+主题折进顶部窄条;tab 最小 44px 触控高度 - 内容区预留 env(safe-area-inset-bottom),避开 iOS 手势条 - ≤380px 再压一档:隐藏权限徽标、缩小字号 StatusView - card-grid 的 minmax(320px) 在 375px 屏溢出 → 单列 - KPI 由 auto-fit 改固定两列(auto-fit 窄屏退化单列使四卡拉长),≤380px 单列 - 转发卡 fwd-head 原一行塞 7~8 元素 → 路由占整行、按钮另起一行平分 - 分组标题按钮不再被 margin-left:auto 压扁 ClusterView - 环拓扑改竖向,节点卡占满宽,箭头旋转 90° 指下 - nodeKey(32 位 hex)允许 break-all,不再撑宽容器 - 日志 lg-detail 由 max-width:60%+nowrap 改整行完整显示 SettingsView / UsersView / CanvasView - binary-row、setting-row 竖排;表格卡标题行竖排、操作按钮平分 - 画布 toolbar 按钮换行平铺;vue-flow handle 12px→16px(触控可达) index.html - viewport 加 viewport-fit=cover,这是 env(safe-area-inset-*) 生效前提 验证:tsc --noEmit 通过、npm run build 通过、dist 已重新 embed, 三节点部署后环正常(pending=0,5 条转发 frpc 进程与 topology 归属一致)。
This commit is contained in:
@ -560,4 +560,78 @@ onBeforeUnmount(() => {
|
||||
/* dialog form */
|
||||
.form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; label { width: 72px; font-size: 13px; color: $color-text-secondary; flex-shrink: 0; } }
|
||||
.form-hint { font-size: 12px; color: $color-text-muted; }
|
||||
|
||||
/* ---------- narrow screens ----------
|
||||
窄屏下的主要问题:
|
||||
- ring-node 的 min-width:168px 与环形箭头在 375px 下会横向溢出,且节点横排无意义
|
||||
- nodeKey 是 32 位 hex,单行放不下会撑宽容器
|
||||
- log-row 的 lg-detail max-width:60% + 不换行,窄屏几乎全被省略号吃掉
|
||||
- toolbar / 对话框表单同 StatusView 的问题 */
|
||||
@media (max-width: 720px) {
|
||||
.cluster-page { gap: 10px; }
|
||||
.section { padding: 14px 14px; }
|
||||
|
||||
.hero { padding: 14px 15px; gap: 12px; }
|
||||
.page-title { font-size: 16.5px; }
|
||||
|
||||
/* nodeKey 允许折行,不再撑宽容器 */
|
||||
.nk-value {
|
||||
font-size: 11px;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
max-width: 100%;
|
||||
}
|
||||
.nk-label { white-space: normal; }
|
||||
|
||||
.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
|
||||
|
||||
/* 工具栏按钮平分整行 */
|
||||
.toolbar { padding: 11px 13px; gap: 8px; }
|
||||
.toolbar > .w4f-btn { flex: 1 1 auto; min-height: 40px; }
|
||||
.act-hint { width: 100%; }
|
||||
|
||||
/* 环拓扑改竖向:节点卡占整宽,箭头旋转 90° 指下 */
|
||||
.ring-line { flex-direction: column; align-items: stretch; gap: 6px; }
|
||||
.ring-node { min-width: 0; width: 100%; padding: 11px 12px; }
|
||||
.rn-id { font-size: 12.5px; word-break: break-all; }
|
||||
.ring-arrow {
|
||||
align-self: center;
|
||||
transform: rotate(90deg);
|
||||
font-size: 15px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* 日志:详情另起一行完整显示,不再被省略号截掉 */
|
||||
.log-row { row-gap: 3px; font-size: 11.5px; }
|
||||
.lg-detail {
|
||||
margin-left: 0;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
text-align: left;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
.log-list { max-height: 260px; }
|
||||
|
||||
/* 任务/拓扑行:允许折行,归属另起一行 */
|
||||
.task-row, .topo-row { flex-wrap: wrap; row-gap: 4px; font-size: 12.5px; }
|
||||
.tp-owner { margin-left: 0; width: 100%; }
|
||||
|
||||
.title-actions { margin-left: 0; width: 100%; }
|
||||
.title-actions > .w4f-btn { flex: 1 1 0; min-height: 36px; }
|
||||
.section-title { flex-wrap: wrap; row-gap: 8px; }
|
||||
|
||||
/* 对话框表单:标签在上、输入在下 */
|
||||
.form-row {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 5px;
|
||||
label { width: auto; }
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 380px) {
|
||||
.kpis { grid-template-columns: minmax(0, 1fr); }
|
||||
.page-title { font-size: 15.5px; }
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user