refactor: 列表统一为 setListPager 搜索+分页+排序(_lpSort 升序/降序/取消,中文数字感知,空值排后);监控设备表并入统一排序;STF设备管理/应用版本管理接入统一列表
This commit is contained in:
@@ -321,15 +321,15 @@ select.form-control{cursor:pointer}
|
||||
<table class="table">
|
||||
<thead><tr>
|
||||
<th class="col-cb"><input type="checkbox" id="cb-all" onclick="toggleAllDevices(this.checked)" title="全选/取消全选"></th>
|
||||
<th class="sortable" data-key="serial" onclick="sortBy('serial')">设备</th>
|
||||
<th class="sortable" data-key="model" onclick="sortBy('model')">型号</th>
|
||||
<th class="sortable" data-key="stf_occupied" onclick="sortBy('stf_occupied')">STF</th>
|
||||
<th class="sortable" data-key="worker_status" onclick="sortBy('worker_status')">任务状态</th>
|
||||
<th class="sortable" data-key="foreground_app" onclick="sortBy('foreground_app')">前台App</th>
|
||||
<th class="sortable" data-key="progress" onclick="sortBy('progress')">进度</th>
|
||||
<th class="sortable" data-key="task_job" onclick="sortBy('task_job')">当前任务</th>
|
||||
<th class="sortable" data-key="current_action" onclick="sortBy('current_action')">当前动作</th>
|
||||
<th class="sortable" data-key="last_error" onclick="sortBy('last_error')">最近错误</th>
|
||||
<th data-sort="serial" onclick="_lpSort('devices','serial')">设备</th>
|
||||
<th data-sort="model" onclick="_lpSort('devices','model')">型号</th>
|
||||
<th data-sort="stf_occupied" onclick="_lpSort('devices','stf_occupied')">STF</th>
|
||||
<th data-sort="worker_status" onclick="_lpSort('devices','worker_status')">任务状态</th>
|
||||
<th data-sort="foreground_app" onclick="_lpSort('devices','foreground_app')">前台App</th>
|
||||
<th data-sort="progress" onclick="_lpSort('devices','progress')">进度</th>
|
||||
<th data-sort="task_job" onclick="_lpSort('devices','task_job')">当前任务</th>
|
||||
<th data-sort="current_action" onclick="_lpSort('devices','current_action')">当前动作</th>
|
||||
<th data-sort="last_error" onclick="_lpSort('devices','last_error')">最近错误</th>
|
||||
<th>操作</th>
|
||||
</tr></thead>
|
||||
<tbody id="tb-devices"></tbody>
|
||||
@@ -369,7 +369,7 @@ select.form-control{cursor:pointer}
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead><tr>
|
||||
<th>ID</th><th>任务名</th><th>类型</th><th>启用</th><th>目标</th><th>调度</th><th>下次运行</th><th>重试</th><th>操作</th>
|
||||
<th data-sort="id" onclick="_lpSort('tasks','id')">ID</th><th data-sort="name" onclick="_lpSort('tasks','name')">任务名</th><th data-sort="task_type" onclick="_lpSort('tasks','task_type')">类型</th><th data-sort="enabled" onclick="_lpSort('tasks','enabled')">启用</th><th>目标</th><th>调度</th><th data-sort="next_run" onclick="_lpSort('tasks','next_run')">下次运行</th><th>重试</th><th>操作</th>
|
||||
</tr></thead>
|
||||
<tbody id="tb-tasks"></tbody>
|
||||
</table>
|
||||
@@ -385,7 +385,7 @@ select.form-control{cursor:pointer}
|
||||
</div>
|
||||
<div class="help">把常用步骤打包成可复用的动作,拖入任务步骤编辑器使用;也可在任务编辑器里"☑选中步骤→打包"生成</div>
|
||||
<table class="table">
|
||||
<thead><tr><th>图标</th><th>动作名</th><th>步骤数</th><th>创建时间</th><th>操作</th></tr></thead>
|
||||
<thead><tr><th>图标</th><th data-sort="name" onclick="_lpSort('actions','name')">动作名</th><th data-sort="steps" onclick="_lpSort('actions','steps')">步骤数</th><th data-sort="created_at" onclick="_lpSort('actions','created_at')">创建时间</th><th>操作</th></tr></thead>
|
||||
<tbody id="tb-actions"></tbody>
|
||||
</table>
|
||||
<div class="list-pager" id="pager-actions"></div>
|
||||
@@ -403,7 +403,7 @@ select.form-control{cursor:pointer}
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead><tr>
|
||||
<th>分组名</th><th>描述</th><th>设备数</th><th>设备列表</th><th>操作</th>
|
||||
<th data-sort="name" onclick="_lpSort('groups','name')">分组名</th><th>描述</th><th data-sort="count" onclick="_lpSort('groups','count')">设备数</th><th>设备列表</th><th>操作</th>
|
||||
</tr></thead>
|
||||
<tbody id="tb-groups"></tbody>
|
||||
</table>
|
||||
@@ -445,7 +445,7 @@ select.form-control{cursor:pointer}
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead><tr>
|
||||
<th>ID</th><th>用户名</th><th>管理员</th><th>权限</th><th>操作</th>
|
||||
<th data-sort="id" onclick="_lpSort('users','id')">ID</th><th data-sort="username" onclick="_lpSort('users','username')">用户名</th><th data-sort="is_admin" onclick="_lpSort('users','is_admin')">管理员</th><th>权限</th><th>操作</th>
|
||||
</tr></thead>
|
||||
<tbody id="tb-users"></tbody>
|
||||
</table>
|
||||
@@ -561,7 +561,7 @@ select.form-control{cursor:pointer}
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead><tr>
|
||||
<th>主机名</th><th>显示名</th><th>IP</th><th>系统</th><th>在线</th><th>授权</th><th>密钥过期</th><th>操作</th>
|
||||
<th data-sort="hostname" onclick="_lpSort('tailscale','hostname')">主机名</th><th data-sort="name" onclick="_lpSort('tailscale','name')">显示名</th><th data-sort="ip" onclick="_lpSort('tailscale','ip')">IP</th><th data-sort="os" onclick="_lpSort('tailscale','os')">系统</th><th data-sort="online" onclick="_lpSort('tailscale','online')">在线</th><th data-sort="authorized" onclick="_lpSort('tailscale','authorized')">授权</th><th data-sort="key_expiry" onclick="_lpSort('tailscale','key_expiry')">密钥过期</th><th>操作</th>
|
||||
</tr></thead>
|
||||
<tbody id="tb-tailscale"><tr><td colspan="8" class="empty">点击"刷新设备"加载</td></tr></tbody>
|
||||
</table>
|
||||
@@ -582,7 +582,7 @@ select.form-control{cursor:pointer}
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead><tr>
|
||||
<th>应用名</th><th>包名</th><th>版本</th><th>大小</th><th>上传时间</th><th>操作</th>
|
||||
<th data-sort="name" onclick="_lpSort('apks','name')">应用名</th><th data-sort="package_name" onclick="_lpSort('apks','package_name')">包名</th><th data-sort="version_name" onclick="_lpSort('apks','version_name')">版本</th><th data-sort="size" onclick="_lpSort('apks','size')">大小</th><th data-sort="upload_time" onclick="_lpSort('apks','upload_time')">上传时间</th><th>操作</th>
|
||||
</tr></thead>
|
||||
<tbody id="tb-apks"></tbody>
|
||||
</table>
|
||||
@@ -595,14 +595,19 @@ select.form-control{cursor:pointer}
|
||||
<input type="text" id="appver-pkg" class="form-control" style="width:340px;font-family:monospace"
|
||||
placeholder="包名,如 com.ss.android.ugc.aweme" onkeydown="if(event.key==='Enter')queryAppVers()">
|
||||
<button class="btn btn-primary" onclick="queryAppVers()">查询版本</button>
|
||||
<input class="form-control list-search" id="search-appver" placeholder="搜索设备/版本...">
|
||||
<span id="appver-status" class="text-muted"></span>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead><tr>
|
||||
<th>设备</th><th>状态</th><th>版本号</th><th>versionCode</th>
|
||||
<th data-sort="serial" onclick="_lpSort('appver','serial')">设备</th>
|
||||
<th data-sort="state" onclick="_lpSort('appver','state')">状态</th>
|
||||
<th data-sort="version" onclick="_lpSort('appver','version')">版本号</th>
|
||||
<th data-sort="code" onclick="_lpSort('appver','code')">versionCode</th>
|
||||
</tr></thead>
|
||||
<tbody id="tb-appver"><tr><td colspan="4" class="empty">输入包名后点击"查询版本"</td></tr></tbody>
|
||||
</table>
|
||||
<div class="list-pager" id="pager-appver"></div>
|
||||
<div class="help">查询所有设备(本地 adb 含 USB + STF 池)上该包名的安装情况与版本号,用于对比各设备 App 版本是否一致;未连接的 STF 设备会自动连接(绝不断开,不影响任务)。</div>
|
||||
</div>
|
||||
|
||||
@@ -619,7 +624,7 @@ select.form-control{cursor:pointer}
|
||||
<div style="max-height:420px;overflow:auto;border:1px solid var(--border);border-radius:8px">
|
||||
<table class="table" style="margin:0">
|
||||
<thead><tr>
|
||||
<th>应用</th><th>版本号</th><th>versionCode</th><th>APK 路径</th>
|
||||
<th data-sort="label" onclick="_lpSort('devapps','label')">应用</th><th data-sort="version_name" onclick="_lpSort('devapps','version_name')">版本号</th><th data-sort="version_code" onclick="_lpSort('devapps','version_code')">versionCode</th><th>APK 路径</th>
|
||||
</tr></thead>
|
||||
<tbody id="tb-device-apps">
|
||||
<tr><td colspan="4" class="empty">选择设备后点击"查看应用"</td></tr>
|
||||
@@ -636,14 +641,19 @@ select.form-control{cursor:pointer}
|
||||
placeholder="设备 IP,如 100.100.10.20" onkeydown="if(event.key==='Enter')addStfDev()">
|
||||
<button class="btn btn-primary" onclick="addStfDev()">添加设备并连接</button>
|
||||
<button class="btn" onclick="loadStfDevMgmt()">刷新</button>
|
||||
<input class="form-control list-search" id="search-stfdev" placeholder="搜索 IP...">
|
||||
<span id="stfdev-status" class="text-muted"></span>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead><tr>
|
||||
<th>设备</th><th>脚本配置</th><th>连接状态(220 adb)</th><th>操作</th>
|
||||
<th data-sort="ip" onclick="_lpSort('stfdev','ip')">设备</th>
|
||||
<th data-sort="cfg" onclick="_lpSort('stfdev','cfg')">脚本配置</th>
|
||||
<th data-sort="state" onclick="_lpSort('stfdev','state')">连接状态(220 adb)</th>
|
||||
<th>操作</th>
|
||||
</tr></thead>
|
||||
<tbody id="tb-stfdev"><tr><td colspan="4" class="empty">点击"刷新"加载</td></tr></tbody>
|
||||
</table>
|
||||
<div class="list-pager" id="pager-stfdev"></div>
|
||||
<div class="help">
|
||||
管理 220 上 OpenSTF 设备池:添加 = 写入 connect_devices.sh 的 DEVICES 列表并立即 adb connect;
|
||||
移除 = 从脚本删除并 adb disconnect(设备从 STF 池下线,任务将不再分配到它)。
|
||||
|
||||
Reference in New Issue
Block a user