Fix account dashboard sync rendering
This commit is contained in:
+37
-12
@@ -1055,8 +1055,16 @@ def local_syncer_save_summary(account_id):
|
|||||||
applied_dir = root / "state" / "applied"
|
applied_dir = root / "state" / "applied"
|
||||||
|
|
||||||
paths = {
|
paths = {
|
||||||
"us": applied_dir / f"psopeeps_us.site.{account}.json",
|
"us": [
|
||||||
"eu": applied_dir / f"psopeeps_eu.site.{account}.json",
|
applied_dir / f"psopeeps_us.us-live.site.{account}.json",
|
||||||
|
applied_dir / f"psopeeps_us.us-test.site.{account}.json",
|
||||||
|
applied_dir / f"psopeeps_us.us-hardcore.site.{account}.json",
|
||||||
|
],
|
||||||
|
"eu": [
|
||||||
|
applied_dir / f"psopeeps_eu.eu-live.site.{account}.json",
|
||||||
|
applied_dir / f"psopeeps_eu.eu-test.site.{account}.json",
|
||||||
|
applied_dir / f"psopeeps_eu.eu-hardcore.site.{account}.json",
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
def parse_time(value):
|
def parse_time(value):
|
||||||
@@ -1079,19 +1087,36 @@ def local_syncer_save_summary(account_id):
|
|||||||
"manifest_sha256": None,
|
"manifest_sha256": None,
|
||||||
}
|
}
|
||||||
|
|
||||||
if path.exists():
|
states = []
|
||||||
|
errors = []
|
||||||
|
|
||||||
|
for path in paths[region]:
|
||||||
|
if not path.exists():
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
data = json.loads(path.read_text())
|
data = json.loads(path.read_text())
|
||||||
info.update({
|
data["_path"] = str(path)
|
||||||
"status": "seen",
|
states.append(data)
|
||||||
"label": "Seen",
|
|
||||||
"style": "warn",
|
|
||||||
"host": data.get("host"),
|
|
||||||
"applied_at": data.get("applied_at"),
|
|
||||||
"manifest_sha256": data.get("manifest_sha256"),
|
|
||||||
})
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
info["error"] = str(e)
|
errors.append(f"{path.name}: {e}")
|
||||||
|
|
||||||
|
if states:
|
||||||
|
latest_state = max(states, key=lambda x: str(x.get("applied_at") or ""))
|
||||||
|
hashes = {x.get("manifest_sha256") for x in states if x.get("manifest_sha256")}
|
||||||
|
info.update({
|
||||||
|
"status": "seen",
|
||||||
|
"label": "Seen",
|
||||||
|
"style": "warn",
|
||||||
|
"host": latest_state.get("host"),
|
||||||
|
"applied_at": latest_state.get("applied_at"),
|
||||||
|
"manifest_sha256": latest_state.get("manifest_sha256"),
|
||||||
|
"targets_seen": len(states),
|
||||||
|
"targets_expected": len(paths[region]),
|
||||||
|
"all_targets_same_hash": len(hashes) == 1,
|
||||||
|
})
|
||||||
|
|
||||||
|
if errors:
|
||||||
|
info["errors"] = errors
|
||||||
|
|
||||||
regions[region] = info
|
regions[region] = info
|
||||||
|
|
||||||
|
|||||||
+25
-10
@@ -32,13 +32,15 @@
|
|||||||
<div>
|
<div>
|
||||||
<p class="eyebrow">Account Dashboard</p>
|
<p class="eyebrow">Account Dashboard</p>
|
||||||
<h1 id="account-title">chuudoku</h1>
|
<h1 id="account-title">chuudoku</h1>
|
||||||
<p>
|
<p class="account-email-line">
|
||||||
Manage your Blue Burst login and the serial/access keys you use for DC V2, PC V2, and GC V3.
|
Email <strong>chuudoku@pm.me</strong>
|
||||||
Linked saves are mirrored between US and EU automatically.
|
<span class="verified-pill">Verified</span>
|
||||||
|
<a href="#" data-account-action="update-email">update email address</a>
|
||||||
|
<a href="#" data-account-action="change-password">change password</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="status-badges" aria-label="Account setup status">
|
<div class="status-badges" aria-label="Account setup status">
|
||||||
<span class="badge badge--ok">BB account ready</span>
|
<span class="badge badge--ok">Account ready</span>
|
||||||
<span class="badge badge--ok">Saves synced</span>
|
<span class="badge badge--ok">Saves synced</span>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@@ -54,12 +56,25 @@
|
|||||||
|
|
||||||
<section class="dashboard-grid dashboard-grid--setup">
|
<section class="dashboard-grid dashboard-grid--setup">
|
||||||
<section class="card setup-card setup-card--bb" aria-labelledby="bb-heading">
|
<section class="card setup-card setup-card--bb" aria-labelledby="bb-heading">
|
||||||
<h2 id="bb-heading" class="section-title">Blue Burst Account</h2>
|
<h2 id="bb-heading" class="section-title">Blue Burst</h2>
|
||||||
<dl class="account-summary account-summary--large">
|
<p>BB username <strong>chuudoku</strong><br>BB account ID <strong>0126326509</strong></p>
|
||||||
<div><dt>BB username</dt><dd>chuudoku</dd></div>
|
|
||||||
<div><dt>BB account ID</dt><dd>0126326509</dd></div>
|
<form class="bb-account-form" data-bb-action="change-password">
|
||||||
</dl>
|
<p class="muted">Change your Blue Burst login password. This updates the account file, then it needs to sync to the ships.</p>
|
||||||
<p class="fine-print">Blue Burst is limited to one account per website account. Password reset can come later.</p>
|
|
||||||
|
<label>
|
||||||
|
New BB password
|
||||||
|
<input name="password" type="password" autocomplete="new-password" maxlength="16" required>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
Confirm new BB password
|
||||||
|
<input name="confirm_password" type="password" autocomplete="new-password" maxlength="16" required>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<button class="button" type="submit">Change Blue Burst Password</button>
|
||||||
|
<div class="bb-message" role="status"></div>
|
||||||
|
</form>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="card setup-card setup-card--key-sync" aria-labelledby="key-sync-heading">
|
<section class="card setup-card setup-card--key-sync" aria-labelledby="key-sync-heading">
|
||||||
|
|||||||
+7
-4
@@ -388,7 +388,10 @@
|
|||||||
if (!hero || !title) return;
|
if (!hero || !title) return;
|
||||||
|
|
||||||
for (const p of Array.from(hero.querySelectorAll("p"))) {
|
for (const p of Array.from(hero.querySelectorAll("p"))) {
|
||||||
if (p.textContent.includes("Manage your Blue Burst login")) {
|
if (
|
||||||
|
p.textContent.includes("Manage your Blue Burst login") ||
|
||||||
|
p.classList.contains("account-email-line")
|
||||||
|
) {
|
||||||
p.remove();
|
p.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -573,9 +576,9 @@
|
|||||||
const title = document.querySelector("#account-title");
|
const title = document.querySelector("#account-title");
|
||||||
if (title) title.textContent = user.username;
|
if (title) title.textContent = user.username;
|
||||||
|
|
||||||
renderAccountEmail(accountData);
|
// Account dashboard cards are server-rendered and have dedicated account JS.
|
||||||
updateAccountStatusBadges(accountData);
|
// Do not let the generic app bootstrap rewrite BB/status cards into stale layouts.
|
||||||
renderBBCard(accountData);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function boot() {
|
async function boot() {
|
||||||
|
|||||||
Reference in New Issue
Block a user