feat(qoder): 账号行新增「导入设备身份」——把桌面客户端那台机器的 machineToken/Code/Type 粘进来复用其设备身份
This commit is contained in:
@@ -210,7 +210,8 @@
|
||||
'<td class="actions">' +
|
||||
'<button class="btn btn-sm" data-a2="run" data-id="' + esc(a.id) + '">签到</button>' +
|
||||
(a.platform === "qoder" ? '<button class="btn btn-sm" data-a2="fixdomain" data-id="' + esc(a.id) + '" title="自动探测 Token 所属站点并切换">修复站点</button>' +
|
||||
'<button class="btn btn-sm" data-a2="risk" data-id="' + esc(a.id) + '" title="重新生成设备风控身份(活动列表为空时使用)">刷新风控</button>' : "") +
|
||||
'<button class="btn btn-sm" data-a2="risk" data-id="' + esc(a.id) + '" title="重新生成设备风控身份(活动列表为空时使用)">刷新风控</button>' +
|
||||
'<button class="btn btn-sm" data-a2="importdev" data-id="' + esc(a.id) + '" title="把桌面客户端那台机器的设备身份导入进来(活动列表为空时可试)">导入设备身份</button>' : "") +
|
||||
'<button class="btn btn-sm" data-a2="toggle" data-id="' + esc(a.id) + '">' + (a.enabled ? "禁用" : "启用") + "</button>" +
|
||||
'<button class="btn btn-sm btn-danger" data-a2="del" data-id="' + esc(a.id) + '">删除</button>' +
|
||||
"</td></tr>";
|
||||
@@ -240,6 +241,25 @@
|
||||
.catch(function (e) { toast(e.message, "err"); })
|
||||
.finally(function () { btn.disabled = false; btn.textContent = "修复站点"; });
|
||||
}
|
||||
else if (act === "importdev") {
|
||||
var raw = prompt("把 Qoder 桌面客户端机器上 runtime-info 输出的那一行 JSON 粘进来\n(需含 machineToken / machineCode / machineType):");
|
||||
if (!raw) return;
|
||||
var obj = null;
|
||||
try { obj = JSON.parse(raw.trim()); } catch (e) {
|
||||
var m = raw.match(/\{[\s\S]*\}/);
|
||||
if (m) { try { obj = JSON.parse(m[0]); } catch (e2) { obj = null; } }
|
||||
}
|
||||
if (!obj || !obj.machineToken || !obj.machineCode || !obj.machineType) {
|
||||
toast("解析失败:需要包含 machineToken / machineCode / machineType", "err");
|
||||
return;
|
||||
}
|
||||
btn.disabled = true; btn.textContent = "导入中…";
|
||||
api("POST", "/qoder/import_device", { id: id, machineToken: obj.machineToken,
|
||||
machineCode: obj.machineCode, machineType: obj.machineType })
|
||||
.then(function (d) { toast(d.message || "已导入设备身份", "ok"); })
|
||||
.catch(function (e) { toast(e.message, "err"); })
|
||||
.finally(function () { btn.disabled = false; btn.textContent = "导入设备身份"; });
|
||||
}
|
||||
else if (act === "toggle") {
|
||||
var acc = state.accounts.find(function (x) { return x.id === id; });
|
||||
api("POST", "/accounts/update", { id: id, enabled: !acc.enabled })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
appname = AgentCheckin
|
||||
version = 1.4.1
|
||||
version = 1.4.2
|
||||
display_name = Agent 签到助手
|
||||
desc = AI 编程工具每日积分自动签到:TRAE(字节跳动)、WorkBuddy / CodeBuddy(腾讯)、Qoder(国内版 + 国际版每日 100 Credits)。多账号管理、多时段自动补签、积分看板、签到日志、Webhook 通知,数据全部保存在 NAS 本地。
|
||||
platform = all
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ const BASE = `https://${HOST}:${PORT}`;
|
||||
const USER = process.env.FNOS_USER;
|
||||
const PASS = process.env.FNOS_PASS;
|
||||
const APPNAME = "AgentCheckin";
|
||||
const VERSION = "1.4.1";
|
||||
const VERSION = "1.4.2";
|
||||
const FPK = process.argv[2] ||
|
||||
path.join(__dirname, "AgentCheckin", "AgentCheckin.fpk");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user