mirror of
https://github.com/Dasemu/remote-mcp-manager.git
synced 2026-11-26 23:36:31 +00:00
feat: show the installed commit and how many newer commits the remote has
The Manager card now shows the commit SHA the image was built from (GIT_SHA build arg, passed by the panel's self-update and documented for compose) and counts the commits SELF_UPDATE_REF has beyond it, with their subjects and a "Check for updates" button. The check is a cached, background, history-only git fetch so GET /api/system never waits on it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4b3c8f213a
commit
9a85c3bca0
15 files changed
+400
-11
No files matched your search
@@ -0,0 +1,23 @@
|
||||
export interface CommitSummary {
|
||||
sha: string;
|
||||
subject: string;
|
||||
}
|
||||
|
||||
const SHA_RE = /^[0-9a-f]{7,40}$/;
|
||||
|
||||
/** Accepts a baked-in/inspected SHA only if it is plain hex; "unknown" and junk become undefined. */
|
||||
export function normalizeSha(raw: string | undefined): string | undefined {
|
||||
const sha = raw?.trim().toLowerCase();
|
||||
return sha && SHA_RE.test(sha) ? sha : undefined;
|
||||
}
|
||||
|
||||
/** Parses `git log --format=%h%x09%s` output. */
|
||||
export function parseCommitLog(output: string): CommitSummary[] {
|
||||
return output
|
||||
.split("\n")
|
||||
.filter((line) => line.includes("\t"))
|
||||
.map((line) => {
|
||||
const [sha, ...rest] = line.split("\t");
|
||||
return { sha: sha!.trim(), subject: rest.join("\t").trim() };
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user