-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsysinfo.aspx
More file actions
206 lines (202 loc) · 16.9 KB
/
sysinfo.aspx
File metadata and controls
206 lines (202 loc) · 16.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<%@ Page Title="系统信息中心" Language="C#" AutoEventWireup="true" CodeFile="sysinfo.aspx.cs" Inherits="Sysinfo" ResponseEncoding="utf-8" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>系统信息中心</title>
<style>
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: #f1f5f9; color: #0f172a; }
.sys-page { padding: 24px; }
.sys-shell { display: flex; flex-direction: column; gap: 24px; }
.sys-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 28px 32px; background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 52%, #38bdf8 100%); color: #eff6ff; box-shadow: 0 20px 45px rgba(15,23,42,.18); }
.sys-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 999px; background: rgba(255,255,255,.08); }
.sys-hero__content { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.sys-hero__title { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: .04em; }
.sys-hero__subtitle { margin: 10px 0 0; max-width: 720px; color: rgba(239,246,255,.88); line-height: 1.7; font-size: 15px; }
.sys-platform { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: rgba(15,23,42,.22); border: 1px solid rgba(255,255,255,.16); font-weight: 700; white-space: nowrap; }
.sys-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.sys-card { grid-column: span 12; background: #fff; border: 1px solid #e2e8f0; border-radius: 22px; box-shadow: 0 14px 35px rgba(15,23,42,.06); overflow: hidden; }
.sys-card__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 24px 0; }
.sys-card__title { margin: 0; font-size: 20px; font-weight: 800; color: #0f172a; }
.sys-card__desc { margin: 6px 0 0; color: #64748b; font-size: 14px; }
.sys-card__body { padding: 22px 24px 24px; }
.sys-card--span-4 { grid-column: span 4; }
.sys-card--span-8 { grid-column: span 8; }
.sys-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sys-stat-item { padding: 16px 18px; border-radius: 18px; background: linear-gradient(180deg,#f8fbff 0%,#eef6ff 100%); border: 1px solid #dbeafe; }
.sys-stat-item__label { display: block; color: #64748b; font-size: 13px; margin-bottom: 6px; }
.sys-stat-item__value { display: block; color: #1d4ed8; font-size: 26px; font-weight: 800; line-height: 1.2; }
.sys-table { display: grid; gap: 12px; }
.sys-table__row { display: grid; grid-template-columns: 160px 1fr 180px 1fr; gap: 12px 16px; align-items: stretch; }
.sys-table__cell { padding: 14px 16px; border-radius: 16px; background: #f8fafc; border: 1px solid #e2e8f0; min-height: 54px; display: flex; align-items: center; }
.sys-table__cell--label { color: #475569; font-weight: 700; background: #f1f5f9; }
.sys-table__value { display: flex; align-items: center; gap: 10px; color: #0f172a; font-weight: 600; word-break: break-word; }
.sys-wide-value { white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
@media (max-width: 1100px) { .sys-card--span-4, .sys-card--span-8 { grid-column: span 12; } .sys-table__row { grid-template-columns: 150px 1fr; } }
@media (max-width: 720px) { .sys-page { padding: 16px; } .sys-hero { padding: 22px 20px; border-radius: 20px; } .sys-hero__title { font-size: 26px; } .sys-card__head, .sys-card__body { padding-left: 18px; padding-right: 18px; } .sys-stat-grid { grid-template-columns: 1fr; } .sys-table__row { grid-template-columns: 1fr; } }
</style>
</head>
<body>
<form runat="server">
<div class="sys-page">
<div class="sys-shell">
<section class="sys-hero">
<div class="sys-hero__content">
<div>
<h1 class="sys-hero__title">系统信息中心</h1>
<p class="sys-hero__subtitle">集中查看平台运行状态、服务器环境、数据规模与系统资源占用,便于日常巡检和问题定位。</p>
</div>
<div class="sys-platform">
<span>运行平台</span>
<strong><asp:Label ID="Labelcomputer" runat="server"></asp:Label></strong>
</div>
</div>
</section>
<div class="sys-grid">
<section class="sys-card sys-card--span-8">
<div class="sys-card__head"><div><h2 class="sys-card__title">网站分析统计</h2><p class="sys-card__desc">当前教学平台内核心数据总量一览。</p></div></div>
<div class="sys-card__body">
<div class="sys-stat-grid">
<div class="sys-stat-item"><span class="sys-stat-item__label">学案总数</span><span class="sys-stat-item__value"><asp:Label ID="Label15" runat="server"></asp:Label></span></div>
<div class="sys-stat-item"><span class="sys-stat-item__label">作品总数</span><span class="sys-stat-item__value"><asp:Label ID="Label16" runat="server"></asp:Label></span></div>
<div class="sys-stat-item"><span class="sys-stat-item__label">学生总数</span><span class="sys-stat-item__value"><asp:Label ID="Label17" runat="server"></asp:Label></span></div>
<div class="sys-stat-item"><span class="sys-stat-item__label">签到次数</span><span class="sys-stat-item__value"><asp:Label ID="Label18" runat="server"></asp:Label></span></div>
<div class="sys-stat-item"><span class="sys-stat-item__label">打字次数</span><span class="sys-stat-item__value"><asp:Label ID="Label19" runat="server"></asp:Label></span></div>
<div class="sys-stat-item"><span class="sys-stat-item__label">资源总数</span><span class="sys-stat-item__value"><asp:Label ID="Label20" runat="server"></asp:Label></span></div>
</div>
</div>
</section>
<section class="sys-card sys-card--span-4">
<div class="sys-card__head"><div><h2 class="sys-card__title">版本信息</h2><p class="sys-card__desc">当前实例版本与远端发布线对比。</p></div></div>
<div class="sys-card__body">
<div class="sys-table">
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">本地版本</div>
<div class="sys-table__cell"><div class="sys-table__value" id="ver-local"><asp:Label ID="LabelVerLocal" runat="server" /></div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">远端最新</div>
<div class="sys-table__cell"><div class="sys-table__value" id="ver-remote">检测中…</div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">更新状态</div>
<div class="sys-table__cell"><div class="sys-table__value" id="ver-status">—</div></div>
</div>
</div>
</div>
</section>
<section class="sys-card">
<div class="sys-card__head"><div><h2 class="sys-card__title">服务器状态</h2><p class="sys-card__desc">当前主机环境、Asp.Net 进程资源占用与运行时指标。</p></div></div>
<div class="sys-card__body">
<div class="sys-table">
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">服务器 IP</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label1" runat="server"></asp:Label></div></div>
<div class="sys-table__cell sys-table__cell--label">.NET 引擎版本</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label8" runat="server"></asp:Label></div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">服务器名称</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label2" runat="server"></asp:Label></div></div>
<div class="sys-table__cell sys-table__cell--label">脚本超时时间</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label9" runat="server"></asp:Label></div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">操作系统</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label3" runat="server"></asp:Label></div></div>
<div class="sys-table__cell sys-table__cell--label">开机运行时长</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label10" runat="server"></asp:Label></div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">CPU 数</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label4" runat="server"></asp:Label></div></div>
<div class="sys-table__cell sys-table__cell--label">进程开始时间</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label11" runat="server"></asp:Label></div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">CPU 类型</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label5" runat="server"></asp:Label></div></div>
<div class="sys-table__cell sys-table__cell--label">AspNet 内存占用</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label12" runat="server"></asp:Label></div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">信息服务软件</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label7" runat="server"></asp:Label></div></div>
<div class="sys-table__cell sys-table__cell--label">AspNet CPU 时间</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label13" runat="server"></asp:Label></div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">服务器区域语言</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label21" runat="server"></asp:Label></div></div>
<div class="sys-table__cell sys-table__cell--label">AspNet 当前线程数</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label14" runat="server"></asp:Label></div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">网站平台版本</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label6" runat="server"></asp:Label></div></div>
<div class="sys-table__cell sys-table__cell--label">Session 总数</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label22" runat="server"></asp:Label></div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">全局变量数</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label23" runat="server"></asp:Label></div></div>
<div class="sys-table__cell sys-table__cell--label">当前实例来源</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label30" runat="server"></asp:Label></div></div>
</div>
</div>
</div>
</section>
<section class="sys-card">
<div class="sys-card__head"><div><h2 class="sys-card__title">系统详细信息</h2><p class="sys-card__desc">系统内核、资源占用、负载与进程概览。</p></div></div>
<div class="sys-card__body">
<div class="sys-table">
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">系统版本</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label24" runat="server"></asp:Label></div></div>
<div class="sys-table__cell sys-table__cell--label">内存使用率</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label25" runat="server"></asp:Label></div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">磁盘占用</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label26" runat="server"></asp:Label></div></div>
<div class="sys-table__cell sys-table__cell--label">系统负载</div>
<div class="sys-table__cell"><div class="sys-table__value"><asp:Label ID="Label27" runat="server"></asp:Label></div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">网络使用率</div>
<div class="sys-table__cell" style="grid-column:span 3"><div class="sys-table__value sys-wide-value"><asp:Label ID="Label28" runat="server"></asp:Label></div></div>
</div>
<div class="sys-table__row">
<div class="sys-table__cell sys-table__cell--label">进程 TOP10</div>
<div class="sys-table__cell" style="grid-column:span 3"><div class="sys-table__value sys-wide-value"><asp:Label ID="Label29" runat="server"></asp:Label></div></div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</form>
<script>
(function () {
var releaseLogUrl = '<%= ResolveUrl("~/api/VersionCheckProxy.ashx?type=log") %>';
function normalizeVer(v) { var m = String(v||'').trim().match(/v?\d+(?:\.\d+)*/i); if (!m) return ''; var s = m[0]; return (s[0].toLowerCase()!=='v'?'v':'')+s.toLowerCase(); }
function compareVer(a, b) { var ap=normalizeVer(a).replace(/^v/i,'').split('.').map(Number), bp=normalizeVer(b).replace(/^v/i,'').split('.').map(Number); for(var i=0;i<Math.max(ap.length,bp.length);i++){var d=(ap[i]||0)-(bp[i]||0);if(d!==0)return d>0?1:-1;} return 0; }
function el(id) { return document.getElementById(id); }
fetch(releaseLogUrl).then(function(r){return r.ok?r.text():null;}).catch(function(){return null;}).then(function(logText){
var remoteVer = normalizeVer(logText);
el('ver-remote').textContent = remoteVer || '检测失败';
if (!remoteVer) { el('ver-status').textContent = '无法连接远端'; return; }
var localVer = normalizeVer(el('ver-local').textContent.trim());
var cmp = localVer ? compareVer(localVer, remoteVer) : null;
var statusEl = el('ver-status');
if (cmp === null) statusEl.textContent = '无法比较';
else if (cmp >= 0) statusEl.innerHTML = '<span style="color:#16a34a;font-weight:700">✓ 已是最新版本</span>';
else statusEl.innerHTML = '<span style="color:#dc2626;font-weight:700">⚠ 有新版本可用 </span><a href="https://gitee.com/nylon26/openlearnsite/releases" target="_blank" style="color:#2563eb;font-weight:700">前往下载 '+remoteVer+'</a>';
});
}());
</script>
</body>
</html>