Compare commits
9 Commits
Group/role
...
LOA-Fix
| Author | SHA1 | Date | |
|---|---|---|---|
| 871277882d | |||
| bb4d6a3a1a | |||
| 8f16d5190c | |||
| f3e35f3f6a | |||
| d7b099ac75 | |||
| a6b521a89c | |||
| ad4d28b5dd | |||
| ac22e36202 | |||
| 3180097aa7 |
@@ -12,7 +12,7 @@ const pool = mariadb.createPool({
|
||||
connectionLimit: 5,
|
||||
connectTimeout: 10000, // give it more breathing room
|
||||
acquireTimeout: 15000,
|
||||
database: 'ranger_unit_tracker',
|
||||
database: process.env.DB_DATABASE,
|
||||
ssl: false,
|
||||
});
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export async function getUserRoles(userID: number): Promise<Role[]> {
|
||||
const sql = `SELECT r.id, r.name
|
||||
FROM members_roles mr
|
||||
INNER JOIN roles r ON mr.role_id = r.id
|
||||
WHERE mr.member_id = 190;`;
|
||||
WHERE mr.member_id = ?;`;
|
||||
|
||||
return await pool.query(sql, [userID]);
|
||||
}
|
||||
@@ -197,7 +197,7 @@ defineExpose({ forceReload })
|
||||
<DropdownMenuItem v-if="activeEvent.cancelled" @click="setCancel(false)">
|
||||
Un-Cancel
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem v-else @click="setCancel(true)">
|
||||
<DropdownMenuItem v-else @click="setCancel(true)" class="text-destructive">
|
||||
Cancel
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user