373 lines
16 KiB
HTML
373 lines
16 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>版本信息 - Master-Detail Inset Station (全自动 OTA 升级流)</title>
|
|
<style>
|
|
/* =========================================================================
|
|
全局统一色彩与 Design Tokens (严格对齐 #2563EB 体系)
|
|
========================================================================= */
|
|
:root {
|
|
--color-primary: #2563EB;
|
|
--color-primary-dark: #1D4ED8;
|
|
--color-on-primary-container: #1E40AF;
|
|
--color-primary-light: #EFF6FF;
|
|
--color-primary-container: #EFF6FF;
|
|
--color-primary-border: #DBEAFE;
|
|
--color-primary-glow: rgba(37, 99, 235, 0.22);
|
|
--color-primary-gradient: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
|
|
|
|
--bg: #EEF2F6;
|
|
--surface: #FFFFFF;
|
|
--surface-sub: #F8FAFC;
|
|
--text-main: #0F172A;
|
|
--text-sub: #64748B;
|
|
--text-dim: #94A3B8;
|
|
--divider: #E2E8F0;
|
|
--border-card: #E2E8F0;
|
|
|
|
--color-success: #059669;
|
|
--color-success-bg: #ECFDF5;
|
|
--color-success-border: #A7F3D0;
|
|
--color-success-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
|
|
|
|
--color-warning: #D97706;
|
|
--color-warning-bg: #FFFBEB;
|
|
--color-warning-border: #FDE68A;
|
|
|
|
--color-danger: #E11D48;
|
|
--color-danger-bg: #FFF1F2;
|
|
--color-danger-border: #FFE4E6;
|
|
|
|
--corner-card: 16px;
|
|
--corner-item: 10px;
|
|
--content-max-width: 1160px;
|
|
--content-gutter: clamp(16px, 2.5vw, 32px);
|
|
--appbar-height: 60px;
|
|
}
|
|
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Segoe UI", Roboto, sans-serif;
|
|
background: var(--bg); color: var(--text-main); min-height: 100vh;
|
|
padding: var(--content-gutter); display: flex; flex-direction: column; -webkit-font-smoothing: antialiased;
|
|
}
|
|
|
|
.device-wrapper {
|
|
width: 100%; max-width: var(--content-max-width); margin: 0 auto; background: var(--surface);
|
|
border-radius: 20px; border: 1px solid var(--divider); box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.08);
|
|
overflow: hidden; position: relative; min-height: 660px; display: flex; flex-direction: column;
|
|
}
|
|
|
|
/* 1. AppBar */
|
|
.appbar {
|
|
height: var(--appbar-height); display: flex; align-items: center; justify-content: space-between;
|
|
padding: 0 20px; border-bottom: 1px solid var(--divider); background: var(--surface); flex-shrink: 0;
|
|
}
|
|
.appbar-left { display: flex; align-items: center; }
|
|
.appbar-nav, .appbar-more {
|
|
width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
|
|
cursor: pointer; background: transparent; border: none; transition: all 0.15s ease;
|
|
}
|
|
.appbar-nav:hover, .appbar-more:hover { background: rgba(15, 23, 42, 0.06); transform: scale(0.96); }
|
|
.appbar-nav svg, .appbar-more svg { width: 22px; height: 22px; fill: var(--text-main); }
|
|
.appbar-title { font-size: 19px; font-weight: 700; margin-left: 10px; }
|
|
|
|
/* 2. 经典 360px 1fr 双栏布局 */
|
|
.split-body {
|
|
padding: clamp(20px, 2.5vw, 30px); background: #F8FAFC; flex: 1; overflow-y: auto;
|
|
display: grid; grid-template-columns: 360px 1fr; gap: 20px; max-height: calc(100vh - 120px);
|
|
}
|
|
|
|
/* 左侧 360px Hero 与 OTA 更新大盘 */
|
|
.left-version-hero {
|
|
background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 24px;
|
|
display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
|
|
box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
|
|
}
|
|
|
|
.hero-header-box {
|
|
display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
|
|
padding-bottom: 18px; border-bottom: 1px solid var(--divider);
|
|
}
|
|
.app-logo-box {
|
|
width: 72px; height: 72px; border-radius: 18px; background: linear-gradient(135deg, #FF6B6B 0%, #EE5253 100%);
|
|
display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(238, 82, 83, 0.25);
|
|
}
|
|
.app-logo-box svg { width: 38px; height: 38px; fill: white; }
|
|
.app-title-name { font-size: 18px; font-weight: 800; color: var(--text-main); letter-spacing: -0.01em; }
|
|
.app-version-badge {
|
|
font-size: 13px; font-weight: 700; color: var(--color-primary); background: var(--color-primary-light);
|
|
border: 1px solid var(--color-primary-border); padding: 4px 12px; border-radius: 20px;
|
|
font-family: ui-monospace, monospace;
|
|
}
|
|
|
|
/* OTA 系统更新卡片 (内嵌全自动进度展开) */
|
|
.ota-update-card {
|
|
background: var(--color-primary-light); border: 1.5px solid var(--color-primary-border); border-radius: 12px;
|
|
padding: 16px; display: flex; flex-direction: column; gap: 12px; transition: all 0.3s ease;
|
|
}
|
|
.ota-card-title {
|
|
font-size: 13px; font-weight: 700; color: var(--color-on-primary-container); display: flex; align-items: center; justify-content: space-between;
|
|
}
|
|
.ota-badge-status {
|
|
font-size: 11px; background: #DBEAFE; color: var(--color-primary); padding: 2px 8px; border-radius: 4px; font-weight: 700;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.ota-new-version {
|
|
display: flex; align-items: baseline; justify-content: space-between;
|
|
}
|
|
.ota-version-code { font-size: 16px; font-weight: 800; color: var(--color-primary); font-family: ui-monospace, monospace; }
|
|
|
|
/* 动态全自动进度条区域 */
|
|
.download-progress-block {
|
|
display: none; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--color-primary-border);
|
|
}
|
|
.progress-meta-row {
|
|
display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-sub);
|
|
}
|
|
.progress-percent-val {
|
|
font-family: ui-monospace, monospace; font-weight: 800; color: var(--color-primary); font-size: 13px;
|
|
}
|
|
|
|
.progress-track-bg {
|
|
width: 100%; height: 8px; background: #DBEAFE; border-radius: 10px; overflow: hidden; position: relative;
|
|
}
|
|
.progress-fill-bar {
|
|
height: 100%; width: 0%; background: var(--color-primary-gradient); border-radius: 10px;
|
|
transition: width 0.2s linear; box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
|
|
}
|
|
|
|
.progress-stats-row {
|
|
display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-dim); font-family: ui-monospace, monospace;
|
|
}
|
|
|
|
/* 底部贯穿式按钮 (全自动运行态) */
|
|
.btn-dynamic-full {
|
|
width: 100%; height: 46px; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer;
|
|
display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s ease;
|
|
border: 1.5px solid transparent;
|
|
}
|
|
.btn-primary-gradient {
|
|
background: var(--color-primary-gradient); color: white;
|
|
box-shadow: 0 4px 12px var(--color-primary-glow);
|
|
}
|
|
.btn-primary-gradient:hover { transform: translateY(-1px); box-shadow: 0 6px 16px var(--color-primary-glow); }
|
|
|
|
.btn-running-state, .btn-reboot-state {
|
|
background: #F1F5F9; color: var(--text-sub); border: 1.5px solid #CBD5E1; cursor: not-allowed;
|
|
box-shadow: none; pointer-events: none;
|
|
}
|
|
|
|
/* 右侧 1fr 设备与底层系统信息矩阵 */
|
|
.right-details-panel {
|
|
display: flex; flex-direction: column; gap: 16px;
|
|
}
|
|
|
|
.info-card-block {
|
|
background: white; border: 1.5px solid var(--divider); border-radius: 16px; padding: 20px 24px;
|
|
display: flex; flex-direction: column; gap: 14px; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
|
|
}
|
|
.card-section-header {
|
|
font-size: 15px; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 8px;
|
|
padding-bottom: 10px; border-bottom: 1px solid var(--divider);
|
|
}
|
|
|
|
.kv-table { display: flex; flex-direction: column; gap: 12px; }
|
|
.kv-row-item {
|
|
display: flex; align-items: center; justify-content: space-between;
|
|
}
|
|
.kv-label { font-size: 13.5px; color: var(--text-sub); font-weight: 500; }
|
|
.kv-value { font-size: 14px; font-weight: 700; color: var(--text-main); font-family: ui-monospace, monospace; }
|
|
|
|
/* 状态标签 */
|
|
.tag-badge {
|
|
padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center;
|
|
}
|
|
.tag-debug {
|
|
background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid var(--color-danger-border);
|
|
}
|
|
|
|
/* 版权页脚 */
|
|
.footer-copyright {
|
|
text-align: center; font-size: 12px; color: var(--text-dim); margin-top: auto; padding-top: 10px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="device-wrapper">
|
|
<header class="appbar">
|
|
<div class="appbar-left">
|
|
<button class="appbar-nav" title="返回"><svg viewBox="0 0 24 24"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg></button>
|
|
<h1 class="appbar-title">版本信息</h1>
|
|
</div>
|
|
<button class="appbar-more"><svg viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg></button>
|
|
</header>
|
|
|
|
<main class="split-body">
|
|
<!-- 左侧 360px 应用标头与 OTA 升级控制中心 -->
|
|
<div class="left-version-hero">
|
|
<div style="display: flex; flex-direction: column; gap: 18px;">
|
|
<div class="hero-header-box">
|
|
<div class="app-logo-box">
|
|
<svg viewBox="0 0 24 24"><path d="M5 9.2h3V19H5V9.2zM10.6 5h2.8v14h-2.8V5zm5.6 8H19v6h-2.8v-6z"/></svg>
|
|
</div>
|
|
<div class="app-title-name">EAP Manage Team</div>
|
|
<div class="app-version-badge">版本号 1.00.0000</div>
|
|
</div>
|
|
|
|
<!-- 系统更新卡片 (全自动下载与安装重启流) -->
|
|
<div class="ota-update-card" id="otaCard">
|
|
<div class="ota-card-title">
|
|
<span>系统更新</span>
|
|
<span class="ota-badge-status" id="otaBadge">OTA 就绪</span>
|
|
</div>
|
|
<div class="ota-new-version">
|
|
<span style="font-size: 12.5px; color: var(--text-sub);" id="otaLabelText">有新版本可用:</span>
|
|
<span class="ota-version-code" id="otaVersionCode">1.00.0001</span>
|
|
</div>
|
|
|
|
<!-- 动态下载进度容器 -->
|
|
<div class="download-progress-block" id="progressBlock">
|
|
<div class="progress-meta-row">
|
|
<span style="font-weight: 600; color: var(--text-main);" id="progressStateText">正在下载 EAP 应用安装包...</span>
|
|
<span class="progress-percent-val" id="progressPercent">0%</span>
|
|
</div>
|
|
<div class="progress-track-bg">
|
|
<div class="progress-fill-bar" id="progressFill"></div>
|
|
</div>
|
|
<div class="progress-stats-row">
|
|
<span id="progressMbStats">0.0 MB / 38.4 MB</span>
|
|
<span id="progressSpeedStats">2.8 MB/s</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 底部贯穿式升级操作按钮 -->
|
|
<div>
|
|
<button class="btn-dynamic-full btn-primary-gradient" id="btnUpdateAction" onclick="handleStartAutoOTA()">
|
|
<svg style="width: 17px; height: 17px; fill: currentColor;" id="btnActionIcon" viewBox="0 0 24 24"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM17 13l-5 5-5-5h3V9h4v4h3z"/></svg>
|
|
<span id="btnActionText">下载更新 (1.00.0001)</span>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 右侧 1fr 设备信息与构建信息卡片矩阵 -->
|
|
<div class="right-details-panel">
|
|
<!-- 卡 1:设备信息 -->
|
|
<div class="info-card-block">
|
|
<div class="card-section-header">
|
|
<span>📱 设备信息</span>
|
|
</div>
|
|
<div class="kv-table">
|
|
<div class="kv-row-item">
|
|
<span class="kv-label">硬件 ID</span>
|
|
<span class="kv-value">15EA5B1C22D14D97</span>
|
|
</div>
|
|
<div class="kv-row-item">
|
|
<span class="kv-label">设备型号</span>
|
|
<span class="kv-value">TB375FC</span>
|
|
</div>
|
|
<div class="kv-row-item">
|
|
<span class="kv-label">Android 版本</span>
|
|
<span class="kv-value">16 (API 36)</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 卡 2:构建信息 -->
|
|
<div class="info-card-block">
|
|
<div class="card-section-header">
|
|
<span>🛠️ 构建信息</span>
|
|
</div>
|
|
<div class="kv-table">
|
|
<div class="kv-row-item">
|
|
<span class="kv-label">构建类型</span>
|
|
<span class="tag-badge tag-debug">Debug</span>
|
|
</div>
|
|
<div class="kv-row-item">
|
|
<span class="kv-label">编译环境</span>
|
|
<span class="kv-value" style="font-size: 13px;">UmiLab CI/CD Pipeline</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="footer-copyright">
|
|
© 2026 UmiLab. All rights reserved.
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<script>
|
|
let isRunning = false;
|
|
let progress = 0;
|
|
const totalSize = 38.4; // MB
|
|
|
|
function handleStartAutoOTA() {
|
|
if (isRunning) return;
|
|
isRunning = true;
|
|
|
|
const btn = document.getElementById('btnUpdateAction');
|
|
const btnText = document.getElementById('btnActionText');
|
|
const badge = document.getElementById('otaBadge');
|
|
const progressBlock = document.getElementById('progressBlock');
|
|
const fill = document.getElementById('progressFill');
|
|
const percentText = document.getElementById('progressPercent');
|
|
const stateText = document.getElementById('progressStateText');
|
|
const mbStats = document.getElementById('progressMbStats');
|
|
const speedStats = document.getElementById('progressSpeedStats');
|
|
|
|
// 1. 触发下载
|
|
progressBlock.style.display = 'flex';
|
|
badge.innerText = '正在自动下载';
|
|
badge.style.background = '#FFFBEB';
|
|
badge.style.color = '#D97706';
|
|
btn.className = 'btn-dynamic-full btn-running-state';
|
|
btnText.innerText = '⚡ 正在自动升级 EAP 应用...';
|
|
|
|
const timer = setInterval(() => {
|
|
if (progress < 100) {
|
|
progress += Math.floor(Math.random() * 8) + 4;
|
|
if (progress > 100) progress = 100;
|
|
fill.style.width = `${progress}%`;
|
|
percentText.innerText = `${progress}%`;
|
|
const currentMb = ((progress / 100) * totalSize).toFixed(1);
|
|
mbStats.innerText = `${currentMb} MB / ${totalSize} MB`;
|
|
speedStats.innerText = `${(Math.random() * 0.8 + 2.2).toFixed(1)} MB/s`;
|
|
|
|
// 2. 达到 100% 后自动无缝进入校验与安装重启倒计时
|
|
if (progress === 100) {
|
|
clearInterval(timer);
|
|
stateText.innerText = '安装包下载完成,正在自动校验并安装更新...';
|
|
badge.innerText = '安装中';
|
|
badge.style.background = '#ECFDF5';
|
|
badge.style.color = '#059669';
|
|
|
|
setTimeout(() => {
|
|
stateText.innerText = '✅ EAP 软件更新就绪!应用将在 3 秒后自动重启生效...';
|
|
btn.className = 'btn-dynamic-full btn-reboot-state';
|
|
btnText.innerText = '🔄 正在重启 EAP 应用...';
|
|
|
|
let countdown = 3;
|
|
const cdTimer = setInterval(() => {
|
|
countdown--;
|
|
if (countdown > 0) {
|
|
stateText.innerText = `✅ EAP 软件更新就绪!应用将在 ${countdown} 秒后自动重启生效...`;
|
|
} else {
|
|
clearInterval(cdTimer);
|
|
stateText.innerText = '🔄 EAP 应用重启中...';
|
|
}
|
|
}, 1000);
|
|
}, 1200);
|
|
}
|
|
}
|
|
}, 300);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|