WebAdmin: add expired to the status in users page

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino 2024-02-05 19:03:05 +01:00
parent 6b07908084
commit d7975d8d76
No known key found for this signature in database
GPG key ID: 935D2952DEC4EECF
3 changed files with 14 additions and 4 deletions

View file

@ -259,7 +259,8 @@
"day_of_week": "Day of week", "day_of_week": "Day of week",
"day_of_month": "Day of month", "day_of_month": "Day of month",
"month": "Month", "month": "Month",
"options": "Options" "options": "Options",
"expired": "Expired"
}, },
"fs": { "fs": {
"view_file": "View file \"{{- path}}\"", "view_file": "View file \"{{- path}}\"",

View file

@ -259,7 +259,8 @@
"day_of_week": "Giorno settimana", "day_of_week": "Giorno settimana",
"day_of_month": "Giorno mese", "day_of_month": "Giorno mese",
"month": "Mese", "month": "Mese",
"options": "Opzioni" "options": "Opzioni",
"expired": "Scaduto"
}, },
"fs": { "fs": {
"view_file": "Visualizza file \"{{- path}}\"", "view_file": "Visualizza file \"{{- path}}\"",

View file

@ -267,15 +267,23 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
{ {
data: "status", data: "status",
render: function(data, type, row) { render: function(data, type, row) {
let result = data;
if (row.expiration_date){
if (row.expiration_date < Date.now()){
result = -1;
}
}
if (type === 'display') { if (type === 'display') {
switch (data){ switch (result){
case 1: case 1:
return $.t('general.active'); return $.t('general.active');
case -1:
return $.t('general.expired');
default: default:
return $.t('general.inactive'); return $.t('general.inactive');
} }
} }
return data; return result;
} }
}, },
{ {