UI review, stage 1: 401 on /auth/*, expiring certs, VPN netmask, formatBytes
401 from change-password/change-username no longer logs the user out; Analytics reads the plain /profiles array; VPN settings send vpn_netmask with vpn_network (the API reset it to 255.255.255.0); formatBytes guards null/NaN/negative; Certificates sorts 0 days correctly. Vitest added for formatters, CIDR parsing and the 401 interceptor. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3fac8d70d8
commit
b78de98f26
11 files changed
+672
-57
No files matched your search
@@ -201,17 +201,16 @@ const loadAnalytics = async () => {
|
||||
const loadCerts = async () => {
|
||||
loading.certs = true;
|
||||
try {
|
||||
const res = await fetchCertificates();
|
||||
if(res.success && Array.isArray(res.data)) {
|
||||
const list = res.data.filter(cert => {
|
||||
// Only active, non-revoked, and expiring soon (within 45 days)
|
||||
return !cert.is_revoked && !cert.is_expired &&
|
||||
cert.days_remaining !== null && cert.days_remaining <= 45;
|
||||
});
|
||||
|
||||
kpi.expiringCerts = list.length;
|
||||
expiringCertsList.value = list.sort((a,b) => (a.days_remaining || 0) - (b.days_remaining || 0));
|
||||
}
|
||||
// fetchCertificates returns the plain array of profiles
|
||||
const profiles = await fetchCertificates();
|
||||
const list = profiles.filter(cert => {
|
||||
// Only active, non-revoked, and expiring soon (within 45 days)
|
||||
return !cert.is_revoked && !cert.is_expired &&
|
||||
cert.days_remaining != null && cert.days_remaining <= 45;
|
||||
});
|
||||
|
||||
kpi.expiringCerts = list.length;
|
||||
expiringCertsList.value = list.sort((a, b) => a.days_remaining - b.days_remaining);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user