mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-26 23:19:54 +03:00
fix(riot-mui): creation date from tag list was not updating on page change
This commit is contained in:
parent
d13f81c9af
commit
696aa39012
1 changed files with 14 additions and 6 deletions
|
@ -20,13 +20,21 @@
|
||||||
import { dateFormat } from '../../scripts/utils';
|
import { dateFormat } from '../../scripts/utils';
|
||||||
export default {
|
export default {
|
||||||
onMounted(props) {
|
onMounted(props) {
|
||||||
props.image.one('creation-date', (date) => {
|
this.loadCreationDate(props);
|
||||||
this.update({
|
},
|
||||||
date: date,
|
onUpdated(props) {
|
||||||
localDate: date && date.toLocaleString(),
|
this.loadCreationDate(props);
|
||||||
|
},
|
||||||
|
loadCreationDate(props) {
|
||||||
|
if (!props.image.creationDate && !props.image.ociImage) {
|
||||||
|
props.image.one('creation-date', (date) => {
|
||||||
|
this.update({
|
||||||
|
date: date,
|
||||||
|
localDate: date && date.toLocaleString(),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
props.image.trigger('get-date');
|
||||||
props.image.trigger('get-date');
|
}
|
||||||
},
|
},
|
||||||
getDate(image) {
|
getDate(image) {
|
||||||
return !image.ociImage ? `${dateFormat(image.creationDate)} ago` : 'Not Available';
|
return !image.ociImage ? `${dateFormat(image.creationDate)} ago` : 'Not Available';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue