Compare commits

..

5 Commits

Author SHA1 Message Date
871277882d imporoved readability of LOA reason 2025-12-18 22:08:34 -05:00
bb4d6a3a1a Fixed button sizing on the loa table 2025-12-18 22:05:51 -05:00
8f16d5190c fixed incorrect label for extended LOAs when past their original end data 2025-12-18 21:57:43 -05:00
f3e35f3f6a improved robustness of logout function
All checks were successful
Continuous Integration / Update Development (push) Successful in 2m29s
2025-12-17 19:46:30 -05:00
d7b099ac75 fixed for reals this time
All checks were successful
Continuous Integration / Update Development (push) Successful in 2m26s
Continuous Deployment / Update Deployment (push) Successful in 2m26s
2025-12-17 17:20:28 -05:00
3 changed files with 39 additions and 19 deletions

View File

@@ -12,7 +12,7 @@ const pool = mariadb.createPool({
connectionLimit: 5,
connectTimeout: 10000, // give it more breathing room
acquireTimeout: 15000,
database: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
ssl: false,
});

View File

@@ -115,11 +115,24 @@ router.get('/callback', (req, res, next) => {
router.get('/logout', [requireLogin], function (req, res, next) {
req.logout(function (err) {
if (err) { return next(err); }
req.session.destroy((err) => {
if (err) { return next(err); }
res.clearCookie('connect.sid', {
path: '/',
domain: process.env.CLIENT_DOMAIN,
httpOnly: true,
sameSite: 'lax'
});
var params = {
client_id: process.env.AUTH_CLIENT_ID,
returnTo: process.env.CLIENT_URL
};
res.redirect(process.env.AUTH_END_SESSION_URI + '?' + querystring.stringify(params));
})
});
});

View File

@@ -84,7 +84,7 @@ function loaStatus(loa: LOARequest): "Upcoming" | "Active" | "Overdue" | "Closed
if (now < start) return "Upcoming";
if (now >= start && now <= end) return "Active";
if (now > end) return "Overdue";
if (now > loa.extended_till || end) return "Overdue";
return "Overdue"; // fallback
}
@@ -197,7 +197,7 @@ function setPage(pagenum: number) {
<TableCell @click.stop="" class="text-right">
<DropdownMenu>
<DropdownMenuTrigger class="cursor-pointer">
<Button variant="ghost">
<Button variant="ghost" size="icon">
<Ellipsis class="size-6"></Ellipsis>
</Button>
</DropdownMenuTrigger>
@@ -220,10 +220,11 @@ function setPage(pagenum: number) {
</DropdownMenu>
</TableCell>
<TableCell>
<Button v-if="expanded === post.id" @click.stop="expanded = null" variant="ghost">
<Button v-if="expanded === post.id" @click.stop="expanded = null" size="icon"
variant="ghost">
<ChevronUp class="size-6" />
</Button>
<Button v-else @click.stop="expanded = post.id" variant="ghost">
<Button v-else @click.stop="expanded = post.id" size="icon" variant="ghost">
<ChevronDown class="size-6" />
</Button>
</TableCell>
@@ -233,18 +234,24 @@ function setPage(pagenum: number) {
<TableCell :colspan="8" class="p-0">
<div class="w-full p-3 mb-6 space-y-3">
<div class="flex justify-between items-start gap-4">
<div class="flex-1">
<!-- Title -->
<p class="text-md font-semibold text-foreground">
<div class="space-y-3 w-full">
<!-- Header -->
<div class="flex items-center gap-2">
<h4 class="text-sm font-semibold text-foreground">
Reason
</p>
</h4>
<Separator class="flex-1" />
</div>
<!-- Content -->
<p
class="mt-1 text-md whitespace-pre-wrap leading-relaxed text-muted-foreground">
{{ post.reason }}
</p>
<div
class="rounded-lg border bg-muted/40 px-4 py-3 text-sm leading-relaxed whitespace-pre-wrap text-muted-foreground w-full">
{{ post.reason || 'No reason provided.' }}
</div>
</div>
</div>
</div>
</TableCell>