Ux improves (#1103)

* ux-improves

* ui improvements
This commit is contained in:
pa
2025-01-27 07:39:30 +09:00
committed by GitHub
parent 212934f08c
commit d3bcaf130a
13 changed files with 2790 additions and 1216 deletions

View File

@@ -3199,6 +3199,7 @@ console.log(`isLinux: ${LINUX}`);
console.error(err);
}
this.expireFavorites();
this.cachedFavoriteGroupsByTypeName.clear();
this.bulk({
fn: 'getFavorites',
N: -1,
@@ -7168,9 +7169,16 @@ console.log(`isLinux: ${LINUX}`);
if (!objectId) {
return;
}
this.favoriteDialog.visible = true;
API.deleteFavorite({
objectId
});
})
.then(() => {
this.favoriteDialog.visible = false;
})
.finally(() => {
this.favoriteDialog.loading = false;
});
};
$app.methods.clearFavoriteGroup = function (ctx) {
@@ -12627,11 +12635,15 @@ console.log(`isLinux: ${LINUX}`);
favoriteId: D.objectId,
tags: group.name
})
.then(() => {
D.visible = false;
new Noty({
type: 'success',
text: 'Favorite added'
}).show();
})
.finally(() => {
D.loading = false;
})
.then((args) => {
return args;
});
};
@@ -19653,9 +19665,22 @@ console.log(`isLinux: ${LINUX}`);
if (!date) {
return '-';
}
var dt = new Date(date);
const dt = new Date(date);
if (format === 'long') {
return dt.toISOString();
const formatDate = (date) => {
const padZero = (num) => String(num).padStart(2, '0');
const year = date.getFullYear();
const month = padZero(date.getMonth() + 1);
const day = padZero(date.getDate());
const hours = padZero(date.getHours());
const minutes = padZero(date.getMinutes());
const seconds = padZero(date.getSeconds());
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
};
return formatDate(dt);
} else if (format === 'short') {
return dt
.toLocaleDateString('en-nz', {