feat: improve reminders summarizer output and system metadata handling

This commit is contained in:
cesnimda
2026-03-22 14:58:56 +01:00
parent 2ae27433e8
commit f1c7c38a19
9 changed files with 177 additions and 110 deletions
@@ -0,0 +1,41 @@
using JobTrackerApi.Controllers;
using JobTrackerApi.Models;
using JobTrackerApi.Services;
using Microsoft.AspNetCore.Mvc;
using Moq;
using Xunit;
namespace JobTrackerApi.Tests;
public sealed class GmailControllerTests
{
[Fact]
public async Task Import_thread_rejects_missing_message_ids()
{
var controller = new GmailController(Mock.Of<IGmailOAuthService>(), null!, BuildConfig())
{
ControllerContext = new Microsoft.AspNetCore.Mvc.ControllerContext
{
HttpContext = new Microsoft.AspNetCore.Http.DefaultHttpContext
{
User = new System.Security.Claims.ClaimsPrincipal(new System.Security.Claims.ClaimsIdentity(new[]
{
new System.Security.Claims.Claim(System.Security.Claims.ClaimTypes.NameIdentifier, "user-1")
}, "test"))
}
}
};
var result = await controller.ImportThread(new GmailController.ImportGmailThreadRequest(1, "thread-1", Array.Empty<string>()), CancellationToken.None);
var badRequest = Assert.IsType<BadRequestObjectResult>(result.Result);
Assert.Equal("At least one messageId is required.", badRequest.Value);
}
private static Microsoft.Extensions.Configuration.IConfiguration BuildConfig()
{
return new Microsoft.Extensions.Configuration.ConfigurationBuilder()
.AddInMemoryCollection(new Dictionary<string, string?>())
.Build();
}
}
@@ -40,6 +40,21 @@ public sealed class AdminSystemController : ControllerBase
SummarizerMetrics Summarizer SummarizerMetrics Summarizer
); );
private static string? NormalizeBuildMetadata(string? value)
{
var trimmed = (value ?? string.Empty).Trim();
if (string.IsNullOrWhiteSpace(trimmed)) return null;
// Ignore unresolved shell/compose placeholders that would otherwise leak
// directly into the admin UI, e.g. $(git rev-parse --short HEAD) or ${APP_COMMIT_SHA}.
if ((trimmed.StartsWith("$(") && trimmed.EndsWith(")")) || (trimmed.StartsWith("${") && trimmed.EndsWith("}")))
{
return null;
}
return trimmed;
}
[HttpPost("summarizer/probe")] [HttpPost("summarizer/probe")]
public async Task<IActionResult> RunSummarizerProbe(CancellationToken cancellationToken) public async Task<IActionResult> RunSummarizerProbe(CancellationToken cancellationToken)
{ {
@@ -57,13 +72,14 @@ public sealed class AdminSystemController : ControllerBase
var companies = await _db.Companies.AsNoTracking().CountAsync(cancellationToken); var companies = await _db.Companies.AsNoTracking().CountAsync(cancellationToken);
var summarizer = await _summarizer.GetMetricsAsync(cancellationToken); var summarizer = await _summarizer.GetMetricsAsync(cancellationToken);
var version = (_cfg["App:Version"] ?? "").Trim(); var version = NormalizeBuildMetadata(_cfg["App:Version"]);
if (string.IsNullOrWhiteSpace(version)) if (string.IsNullOrWhiteSpace(version))
{ {
version = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "unknown"; version = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "unknown";
} }
var commitSha = (_cfg["App:CommitSha"] ?? "").Trim();
var buildStamp = (_cfg["App:BuildStamp"] ?? "").Trim(); var commitSha = NormalizeBuildMetadata(_cfg["App:CommitSha"]);
var buildStamp = NormalizeBuildMetadata(_cfg["App:BuildStamp"]);
return Ok(new SystemStatusDto( return Ok(new SystemStatusDto(
Environment: _env.EnvironmentName, Environment: _env.EnvironmentName,
@@ -82,11 +98,11 @@ public sealed class AdminSystemController : ControllerBase
), ),
Email: new EmailStatusDto( Email: new EmailStatusDto(
Enabled: _cfg.GetValue("Email:Enabled", false), Enabled: _cfg.GetValue("Email:Enabled", false),
Host: (_cfg["Email:SmtpHost"] ?? "").Trim(), Host: (_cfg["Email:SmtpHost"] ?? string.Empty).Trim(),
Port: _cfg.GetValue("Email:SmtpPort", 587), Port: _cfg.GetValue("Email:SmtpPort", 587),
EnableSsl: _cfg.GetValue("Email:SmtpEnableSsl", true), EnableSsl: _cfg.GetValue("Email:SmtpEnableSsl", true),
From: (_cfg["Email:From"] ?? "").Trim(), From: (_cfg["Email:From"] ?? string.Empty).Trim(),
FromName: (_cfg["Email:FromName"] ?? "").Trim() FromName: (_cfg["Email:FromName"] ?? string.Empty).Trim()
), ),
Summarizer: summarizer Summarizer: summarizer
)); ));
+5
View File
@@ -23,6 +23,11 @@ services:
- Google__GmailRedirectUri=${GOOGLE_GMAIL_REDIRECT_URI} - Google__GmailRedirectUri=${GOOGLE_GMAIL_REDIRECT_URI}
- Summarizer__BaseUrl=${SUMMARIZER_BASE_URL:-http://summarizer:8001} - Summarizer__BaseUrl=${SUMMARIZER_BASE_URL:-http://summarizer:8001}
# Email (SMTP) # Email (SMTP)
# Build metadata should be resolved before deployment. Examples:
# APP_VERSION=1.0.0
# APP_COMMIT_SHA=abc1234
# APP_BUILD_STAMP=2026-03-22 14:00 UTC
# Do not set literal placeholders like $(git rev-parse --short HEAD) in .env.
- App__PublicBaseUrl=${APP_PUBLIC_BASE_URL} - App__PublicBaseUrl=${APP_PUBLIC_BASE_URL}
- App__Version=${APP_VERSION} - App__Version=${APP_VERSION}
- App__CommitSha=${APP_COMMIT_SHA} - App__CommitSha=${APP_COMMIT_SHA}
+1 -1
View File
@@ -130,7 +130,7 @@ function Shell({ jobPageSize, setJobPageSize, jobColumns, setJobColumns, themeMo
const nav: NavItem[] = [ const nav: NavItem[] = [
{ to: "/dashboard", label: t("dashboard"), icon: <DashboardIcon fontSize="small" />, section: "Manage" }, { to: "/dashboard", label: t("dashboard"), icon: <DashboardIcon fontSize="small" />, section: "Manage" },
{ to: "/jobs", label: t("jobApplications"), icon: <WorkOutlineIcon fontSize="small" />, section: "Manage" }, { to: "/jobs", label: t("jobApplications"), icon: <WorkOutlineIcon fontSize="small" />, section: "Manage" },
{ to: "/reminders", label: t("reminders"), icon: <AlarmIcon fontSize="small" />, section: "Manage" }, { to: "/reminders", label: t("reminders"), icon: <AlarmIcon fontSize="small" />, badgeCount: notifCount, section: "Manage" },
{ to: "/kanban", label: t("kanbanBoard"), icon: <ViewKanbanIcon fontSize="small" />, section: "Manage" }, { to: "/kanban", label: t("kanbanBoard"), icon: <ViewKanbanIcon fontSize="small" />, section: "Manage" },
{ to: "/companies", label: t("companies"), icon: <BusinessIcon fontSize="small" />, section: "Manage" }, { to: "/companies", label: t("companies"), icon: <BusinessIcon fontSize="small" />, section: "Manage" },
{ to: "/trash", label: t("trash"), icon: <DeleteOutlineIcon fontSize="small" />, section: "Manage" }, { to: "/trash", label: t("trash"), icon: <DeleteOutlineIcon fontSize="small" />, section: "Manage" },
+57 -96
View File
@@ -14,6 +14,7 @@ import {
Paper, Paper,
TextField, TextField,
Typography, Typography,
Chip,
} from "@mui/material"; } from "@mui/material";
import { api } from "../api"; import { api } from "../api";
@@ -83,41 +84,36 @@ export default function EditJobDialog({ open, jobId, onClose, onSaved }: Props)
useEffect(() => { useEffect(() => {
if (!open || !jobId) return; if (!open || !jobId) return;
setLoading(true); setLoading(true);
api api.get<JobApplication>(`/jobapplications/${jobId}`).then((r) => {
.get<JobApplication>(`/jobapplications/${jobId}`) const j = r.data;
.then((r) => { setCompany(j.company ?? null);
const j = r.data; setJobTitle(j.jobTitle ?? "");
setCompany(j.company ?? null); setStatus(j.status ?? "Applied");
setJobTitle(j.jobTitle ?? ""); setInitialStatus(j.status ?? "Applied");
setStatus(j.status ?? "Applied"); setStatusChangedAt(new Date().toISOString().slice(0, 10));
setInitialStatus(j.status ?? "Applied"); setDateApplied(toDateInputValue(j.dateApplied));
setStatusChangedAt(new Date().toISOString().slice(0, 10)); setLocation(j.location ?? "");
setDateApplied(toDateInputValue(j.dateApplied)); setSalary(j.salary ?? "");
setLocation(j.location ?? ""); setNextAction((j as any).nextAction ?? "");
setSalary(j.salary ?? ""); setFollowUpAt((j as any).followUpAt ? toDateInputValue((j as any).followUpAt) : "");
setNextAction((j as any).nextAction ?? ""); setJobUrl(j.jobUrl ?? "");
setFollowUpAt((j as any).followUpAt ? toDateInputValue((j as any).followUpAt) : ""); setNotes(j.notes ?? "");
setJobUrl(j.jobUrl ?? ""); setDescription((j as any).description ?? "");
setNotes(j.notes ?? ""); setTranslatedDescription((j as any).translatedDescription ?? "");
setDescription((j as any).description ?? ""); setDescriptionLanguage((j as any).descriptionLanguage ?? "");
setTranslatedDescription((j as any).translatedDescription ?? ""); setTags(parseTags((j as any).tags));
setDescriptionLanguage((j as any).descriptionLanguage ?? ""); setDeadline((j as any).deadline ? toDateInputValue((j as any).deadline) : "");
setTags(parseTags((j as any).tags)); setCoverLetterText(j.coverLetterText ?? "");
setDeadline((j as any).deadline ? toDateInputValue((j as any).deadline) : ""); setResponseReceived(Boolean(j.responseReceived));
setCoverLetterText(j.coverLetterText ?? ""); setResponseDate(j.responseDate ? toDateInputValue(j.responseDate) : "");
setResponseReceived(Boolean(j.responseReceived)); setHasResume(Boolean((j as any).hasResume));
setResponseDate(j.responseDate ? toDateInputValue(j.responseDate) : ""); setHasCoverLetter(Boolean((j as any).hasCoverLetter));
setHasResume(Boolean((j as any).hasResume)); setHasPortfolio(Boolean((j as any).hasPortfolio));
setHasCoverLetter(Boolean((j as any).hasCoverLetter)); setHasOtherAttachment(Boolean((j as any).hasOtherAttachment));
setHasPortfolio(Boolean((j as any).hasPortfolio)); }).finally(() => setLoading(false));
setHasOtherAttachment(Boolean((j as any).hasOtherAttachment));
})
.finally(() => setLoading(false));
}, [open, jobId]); }, [open, jobId]);
const canSave = useMemo(() => { const canSave = useMemo(() => !!company?.id && jobTitle.trim().length > 0 && !loading, [company, jobTitle, loading]);
return !!company?.id && jobTitle.trim().length > 0 && !loading;
}, [company, jobTitle, loading]);
const save = async () => { const save = async () => {
if (!jobId || !company?.id) return; if (!jobId || !company?.id) return;
@@ -146,6 +142,7 @@ export default function EditJobDialog({ open, jobId, onClose, onSaved }: Props)
deadline: deadline || null, deadline: deadline || null,
coverLetterText: coverLetterText || null, coverLetterText: coverLetterText || null,
dateApplied: dateApplied || null, dateApplied: dateApplied || null,
jobUrl: jobUrl.trim() || null,
}); });
toast("Saved.", "success"); toast("Saved.", "success");
onSaved(); onSaved();
@@ -161,95 +158,59 @@ export default function EditJobDialog({ open, jobId, onClose, onSaved }: Props)
<Dialog open={open} onClose={onClose} fullWidth maxWidth="md"> <Dialog open={open} onClose={onClose} fullWidth maxWidth="md">
<DialogTitle>Edit job</DialogTitle> <DialogTitle>Edit job</DialogTitle>
<DialogContent> <DialogContent>
<Box sx={{ mt: 1, mb: 2, p: 1.5, borderRadius: 3, border: "1px solid", borderColor: "divider", backgroundColor: "background.paper" }}>
<Typography variant="body2" sx={{ color: "text.secondary" }}>
Update job details, timeline status, documents, and notes from one editing workspace.
</Typography>
</Box>
<Box sx={{ display: "flex", flexDirection: "column", gap: 2, mt: 1 }}> <Box sx={{ display: "flex", flexDirection: "column", gap: 2, mt: 1 }}>
<Paper variant="outlined" sx={{ p: 2 }}> <Paper variant="outlined" sx={{ p: 2 }}>
<Typography variant="overline" sx={{ color: "text.secondary" }}>Application details</Typography> <Typography variant="overline" sx={{ color: "text.secondary" }}>Application details</Typography>
<Box sx={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 2, mt: 1 }}> <Box sx={{ display: "grid", gridTemplateColumns: { xs: "1fr", md: "1fr 1fr" }, gap: 2, mt: 1 }}>
<Autocomplete <Autocomplete options={companies} getOptionLabel={(c) => c.name} value={company} onChange={(_, v) => setCompany(v)} renderInput={(params) => <TextField {...params} label="Company" />} />
options={companies}
getOptionLabel={(c) => c.name}
value={company}
onChange={(_, v) => setCompany(v)}
renderInput={(params) => <TextField {...params} label="Company" />}
/>
<TextField label="Job title" value={jobTitle} onChange={(e) => setJobTitle(e.target.value)} /> <TextField label="Job title" value={jobTitle} onChange={(e) => setJobTitle(e.target.value)} />
<TextField <TextField label="Applied on" type="date" value={dateApplied} onChange={(e) => setDateApplied(e.target.value)} InputLabelProps={{ shrink: true }} />
label="Applied on"
type="date"
value={dateApplied}
onChange={(e) => setDateApplied(e.target.value)}
InputLabelProps={{ shrink: true }}
/>
<TextField label="Job URL" value={jobUrl} onChange={(e) => setJobUrl(e.target.value)} /> <TextField label="Job URL" value={jobUrl} onChange={(e) => setJobUrl(e.target.value)} />
</Box> </Box>
</Paper> </Paper>
<Paper variant="outlined" sx={{ p: 2 }}> <Paper variant="outlined" sx={{ p: 2 }}>
<Typography variant="overline" sx={{ color: "text.secondary" }}>Status update</Typography> <Typography variant="overline" sx={{ color: "text.secondary" }}>Status update</Typography>
<Box sx={{ display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 2, mt: 1 }}> <Box sx={{ display: "grid", gridTemplateColumns: { xs: "1fr", md: "1fr 1fr 1fr" }, gap: 2, mt: 1 }}>
<TextField select label="Current status" value={status} onChange={(e) => setStatus(e.target.value)}> <TextField select label="Current status" value={status} onChange={(e) => setStatus(e.target.value)}>
{STATUS_OPTIONS.map((s) => ( {STATUS_OPTIONS.map((s) => <MenuItem key={s} value={s}>{s}</MenuItem>)}
<MenuItem key={s} value={s}>{s}</MenuItem>
))}
</TextField> </TextField>
<TextField <TextField label="Status changed on" type="date" value={statusChangedAt} onChange={(e) => setStatusChangedAt(e.target.value)} InputLabelProps={{ shrink: true }} helperText={status === initialStatus ? "Only used when you change the status." : "This date will be recorded in the timeline."} />
label="Status changed on" <Box sx={{ display: "flex", alignItems: "center" }}><FormControlLabel control={<Checkbox checked={responseReceived} onChange={(e) => setResponseReceived(e.target.checked)} />} label="Reply received" /></Box>
type="date" <TextField label="Reply received on" type="date" disabled={!responseReceived} value={responseDate} onChange={(e) => setResponseDate(e.target.value)} InputLabelProps={{ shrink: true }} />
value={statusChangedAt}
onChange={(e) => setStatusChangedAt(e.target.value)}
InputLabelProps={{ shrink: true }}
helperText={status === initialStatus ? "Only used when you change the status." : "This date will be recorded in the timeline."}
/>
<Box sx={{ display: "flex", alignItems: "center" }}>
<FormControlLabel
control={<Checkbox checked={responseReceived} onChange={(e) => setResponseReceived(e.target.checked)} />}
label="Reply received"
/>
</Box>
<TextField
label="Reply received on"
type="date"
disabled={!responseReceived}
value={responseDate}
onChange={(e) => setResponseDate(e.target.value)}
InputLabelProps={{ shrink: true }}
/>
<TextField label="Next action" value={nextAction} onChange={(e) => setNextAction(e.target.value)} /> <TextField label="Next action" value={nextAction} onChange={(e) => setNextAction(e.target.value)} />
<TextField <TextField label="Follow up on" type="date" value={followUpAt} onChange={(e) => setFollowUpAt(e.target.value)} InputLabelProps={{ shrink: true }} />
label="Follow up on"
type="date"
value={followUpAt}
onChange={(e) => setFollowUpAt(e.target.value)}
InputLabelProps={{ shrink: true }}
/>
</Box> </Box>
</Paper> </Paper>
<Paper variant="outlined" sx={{ p: 2 }}> <Paper variant="outlined" sx={{ p: 2 }}>
<Typography variant="overline" sx={{ color: "text.secondary" }}>Role details</Typography> <Typography variant="overline" sx={{ color: "text.secondary" }}>Role details</Typography>
<Box sx={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 2, mt: 1 }}> <Box sx={{ display: "grid", gridTemplateColumns: { xs: "1fr", md: "1fr 1fr" }, gap: 2, mt: 1 }}>
<TextField label="Location" value={location} onChange={(e) => setLocation(e.target.value)} /> <TextField label="Location" value={location} onChange={(e) => setLocation(e.target.value)} />
<TextField label="Salary" value={salary} onChange={(e) => setSalary(e.target.value)} /> <TextField label="Salary" value={salary} onChange={(e) => setSalary(e.target.value)} />
<TextField <TextField label="Deadline" type="date" value={deadline} onChange={(e) => setDeadline(e.target.value)} InputLabelProps={{ shrink: true }} />
label="Deadline"
type="date"
value={deadline}
onChange={(e) => setDeadline(e.target.value)}
InputLabelProps={{ shrink: true }}
/>
<TextField label="Description language" value={descriptionLanguage} onChange={(e) => setDescriptionLanguage(e.target.value)} /> <TextField label="Description language" value={descriptionLanguage} onChange={(e) => setDescriptionLanguage(e.target.value)} />
<Box sx={{ gridColumn: "1 / -1" }}> <Box sx={{ gridColumn: "1 / -1" }}><TagsInput value={tags} onChange={setTags} /></Box>
<TagsInput value={tags} onChange={setTags} /> <TextField label="Notes" value={notes} onChange={(e) => setNotes(e.target.value)} multiline rows={4} helperText={`${notes.length} characters`} sx={{ gridColumn: "1 / -1" }} />
</Box> <TextField label="Description (original)" value={description} onChange={(e) => setDescription(e.target.value)} multiline rows={6} helperText={`${description.length} characters`} sx={{ gridColumn: "1 / -1" }} />
<TextField label="Notes" value={notes} onChange={(e) => setNotes(e.target.value)} multiline rows={4} sx={{ gridColumn: "1 / -1" }} /> <TextField label="Translated description" value={translatedDescription} onChange={(e) => setTranslatedDescription(e.target.value)} multiline rows={6} helperText={`${translatedDescription.length} characters`} sx={{ gridColumn: "1 / -1" }} />
<TextField label="Description (original)" value={description} onChange={(e) => setDescription(e.target.value)} multiline rows={6} sx={{ gridColumn: "1 / -1" }} /> <TextField label="Cover letter" value={coverLetterText} onChange={(e) => setCoverLetterText(e.target.value)} multiline rows={6} helperText={`${coverLetterText.length} characters`} sx={{ gridColumn: "1 / -1" }} />
<TextField label="Translated description" value={translatedDescription} onChange={(e) => setTranslatedDescription(e.target.value)} multiline rows={6} sx={{ gridColumn: "1 / -1" }} />
<TextField label="Cover letter" value={coverLetterText} onChange={(e) => setCoverLetterText(e.target.value)} multiline rows={6} sx={{ gridColumn: "1 / -1" }} />
</Box> </Box>
</Paper> </Paper>
<Paper variant="outlined" sx={{ p: 2 }}> <Paper variant="outlined" sx={{ p: 2 }}>
<Typography variant="overline" sx={{ color: "text.secondary" }}>Attachments checklist</Typography> <Typography variant="overline" sx={{ color: "text.secondary" }}>Attachments checklist</Typography>
<Box sx={{ display: "flex", gap: 1, flexWrap: "wrap", mt: 1, mb: 1.5 }}>
<Chip size="small" label={hasResume ? "Resume ready" : "Resume missing"} color={hasResume ? "success" : "default"} variant={hasResume ? "filled" : "outlined"} />
<Chip size="small" label={hasCoverLetter ? "Cover letter ready" : "Cover letter missing"} color={hasCoverLetter ? "success" : "default"} variant={hasCoverLetter ? "filled" : "outlined"} />
<Chip size="small" label={hasPortfolio ? "Portfolio ready" : "Portfolio optional"} color={hasPortfolio ? "success" : "default"} variant={hasPortfolio ? "filled" : "outlined"} />
</Box>
<Box sx={{ display: "flex", gap: 2, flexWrap: "wrap", mt: 1 }}> <Box sx={{ display: "flex", gap: 2, flexWrap: "wrap", mt: 1 }}>
<FormControlLabel control={<Checkbox checked={hasResume} onChange={(e) => setHasResume(e.target.checked)} />} label="Resume" /> <FormControlLabel control={<Checkbox checked={hasResume} onChange={(e) => setHasResume(e.target.checked)} />} label="Resume" />
<FormControlLabel control={<Checkbox checked={hasCoverLetter} onChange={(e) => setHasCoverLetter(e.target.checked)} />} label="Cover letter" /> <FormControlLabel control={<Checkbox checked={hasCoverLetter} onChange={(e) => setHasCoverLetter(e.target.checked)} />} label="Cover letter" />
@@ -77,7 +77,7 @@ export default function RemindersView() {
</Typography> </Typography>
<Box sx={{ display: "flex", gap: 1, mt: 0.5, flexWrap: "wrap" }}> <Box sx={{ display: "flex", gap: 1, mt: 0.5, flexWrap: "wrap" }}>
{j.needsFollowUp ? ( {j.needsFollowUp ? (
<Chip size="small" label="Follow up" /> <Chip size="small" color="warning" label="Follow up" />
) : null} ) : null}
{j.followUpReason ? ( {j.followUpReason ? (
<Chip size="small" label={j.followUpReason} variant="outlined" /> <Chip size="small" label={j.followUpReason} variant="outlined" />
@@ -129,3 +129,18 @@ export default function RemindersView() {
); );
} }
lign: "center", py: 3 }}>
Nothing to follow up right now.
</Typography>
)}
</Box>
<JobDetailsDialog
open={openJobId !== null}
jobId={openJobId}
onClose={() => setOpenJobId(null)}
/>
</Paper>
);
}
+7 -1
View File
@@ -121,7 +121,13 @@ export default function AppShell({
}, },
})} })}
> >
<ListItemIcon sx={{ minWidth: 36 }}>{item.icon}</ListItemIcon> <ListItemIcon sx={{ minWidth: 36 }}>
{item.badgeCount && item.badgeCount > 0 ? (
<Badge color="error" badgeContent={item.badgeCount > 99 ? "99+" : item.badgeCount}>
{item.icon}
</Badge>
) : item.icon}
</ListItemIcon>
<ListItemText primary={item.label} primaryTypographyProps={{ fontWeight: 600 }} /> <ListItemText primary={item.label} primaryTypographyProps={{ fontWeight: 600 }} />
</ListItemButton> </ListItemButton>
); );
+13 -3
View File
@@ -115,9 +115,9 @@ export default function AdminSystemPage() {
<Paper sx={{ p: 2 }}> <Paper sx={{ p: 2 }}>
<Typography variant="overline" sx={{ color: "text.secondary" }}>Environment</Typography> <Typography variant="overline" sx={{ color: "text.secondary" }}>Environment</Typography>
<Typography variant="h5" sx={{ fontWeight: 950 }}>{status?.environment ?? "-"}</Typography> <Typography variant="h5" sx={{ fontWeight: 950 }}>{status?.environment ?? "-"}</Typography>
<Typography variant="body2" sx={{ color: "text.secondary", mt: 1 }}>Version {status?.version ?? "-"}</Typography> <Typography variant="body2" sx={{ color: "text.secondary", mt: 1 }}>Version {displayMetadata(status?.version)}</Typography>
{status?.commitSha ? <Typography variant="body2" sx={{ color: "text.secondary" }}>Commit {status.commitSha}</Typography> : null} <Typography variant="body2" sx={{ color: "text.secondary" }}>Commit {displayMetadata(status?.commitSha)}</Typography>
{status?.buildStamp ? <Typography variant="body2" sx={{ color: "text.secondary" }}>{status.buildStamp}</Typography> : null} <Typography variant="body2" sx={{ color: "text.secondary" }}>{displayMetadata(status?.buildStamp)}</Typography>
</Paper> </Paper>
<Paper sx={{ p: 2 }}> <Paper sx={{ p: 2 }}>
<Typography variant="overline" sx={{ color: "text.secondary" }}>Database</Typography> <Typography variant="overline" sx={{ color: "text.secondary" }}>Database</Typography>
@@ -193,3 +193,13 @@ export default function AdminSystemPage() {
</Box> </Box>
); );
} }
.summarizer.lastError}</Alert> : null}
</Paper>
</Box>
);
}
tus.summarizer.lastError}</Alert> : null}
</Paper>
</Box>
);
}
+15 -2
View File
@@ -237,11 +237,24 @@ async def summarize(req: SummarizeRequest):
if info["tech"]: if info["tech"]:
uniq = [] uniq = []
for t in info["tech"]: for t in _rank_tech_skills(info["tech"]):
if t not in uniq: if t not in uniq:
uniq.append(t) uniq.append(t)
lines.append("") lines.append("")
lines.append("Relevant hard skills: " + ", ".join(uniq[:14])) lines.append("Top hard skills: " + ", ".join(uniq[:10]))
if info["soft"]:
uniq_soft = []
for s in info["soft"]:
if s not in uniq_soft:
uniq_soft.append(s)
lines.append("")
lines.append("Relevant soft skills: " + ", ".join(uniq_soft[:8]))
out = "\n".join(lines).strip()
cache[key] = out
return {"summary": out, "cached": False}
skills: " + ", ".join(uniq[:14]))
if info["soft"]: if info["soft"]:
uniq_soft = [] uniq_soft = []