Last updated dropdown

This commit is contained in:
Natsumi
2026-02-05 16:41:33 +13:00
committed by pa
parent 33c8d97403
commit ecce12a9fc
7 changed files with 71 additions and 83 deletions

View File

@@ -54,9 +54,9 @@
>{{ avatarDialog.platformInfo.pc.performanceRating }}</span >{{ avatarDialog.platformInfo.pc.performanceRating }}</span
> >
<span <span
v-if="avatarDialog.bundleSizes['standalonewindows']" v-if="avatarDialog.fileAnalysis.standalonewindows?._fileSize"
:class="['x-grey', 'x-tag-platform-pc', 'x-tag-border-left']" :class="['x-grey', 'x-tag-platform-pc', 'x-tag-border-left']"
>{{ avatarDialog.bundleSizes['standalonewindows'].fileSize }}</span >{{ avatarDialog.fileAnalysis.standalonewindows._fileSize }}</span
> >
</Badge> </Badge>
</TooltipWrapper> </TooltipWrapper>
@@ -72,9 +72,9 @@
>{{ avatarDialog.platformInfo.android.performanceRating }}</span >{{ avatarDialog.platformInfo.android.performanceRating }}</span
> >
<span <span
v-if="avatarDialog.bundleSizes['android']" v-if="avatarDialog.fileAnalysis.android?._fileSize"
:class="['x-grey', 'x-tag-platform-quest', 'x-tag-border-left']" :class="['x-grey', 'x-tag-platform-quest', 'x-tag-border-left']"
>{{ avatarDialog.bundleSizes['android'].fileSize }}</span >{{ avatarDialog.fileAnalysis.android._fileSize }}</span
> >
</Badge> </Badge>
</TooltipWrapper> </TooltipWrapper>
@@ -90,9 +90,9 @@
>{{ avatarDialog.platformInfo.ios.performanceRating }}</span >{{ avatarDialog.platformInfo.ios.performanceRating }}</span
> >
<span <span
v-if="avatarDialog.bundleSizes['ios']" v-if="avatarDialog.fileAnalysis.ios?._fileSize"
:class="['x-grey', 'x-tag-border-left', 'text-[#8e8e93]', 'border-[#8e8e93]']" :class="['x-grey', 'x-tag-border-left', 'text-[#8e8e93]', 'border-[#8e8e93]']"
>{{ avatarDialog.bundleSizes['ios'].fileSize }}</span >{{ avatarDialog.fileAnalysis.ios._fileSize }}</span
> >
</Badge> </Badge>
</TooltipWrapper> </TooltipWrapper>
@@ -447,13 +447,24 @@
</div> </div>
<div class="x-friend-item" style="cursor: default"> <div class="x-friend-item" style="cursor: default">
<div class="detail"> <div class="detail">
<span class="name">{{ t('dialog.avatar.info.last_updated') }}</span> <span class="name" style="display: inline">{{
<span v-if="avatarDialog.lastUpdated" class="extra">{{ t('dialog.avatar.info.last_updated')
formatDateFilter(avatarDialog.lastUpdated, 'long')
}}</span>
<span v-else class="extra">{{
formatDateFilter(avatarDialog.ref.updated_at, 'long')
}}</span> }}</span>
<TooltipWrapper
v-if="Object.keys(avatarDialog.fileAnalysis).length"
side="top"
style="margin-left: 5px">
<template #content>
<template v-for="(data, platform) in avatarDialog.fileAnalysis" :key="platform">
<div class="flex justify-between w-full">
<span class="mr-1">{{ platform }}:</span>
<span>{{ formatDateFilter(data.created_at, 'long') }}</span>
</div>
</template>
</template>
<ChevronDown class="inline-block" />
</TooltipWrapper>
<span class="extra">{{ formatDateFilter(avatarDialog.ref.updated_at, 'long') }}</span>
</div> </div>
</div> </div>
<div class="x-friend-item" style="cursor: default"> <div class="x-friend-item" style="cursor: default">
@@ -506,7 +517,7 @@
show-icon /> show-icon />
<br /> <br />
<vue-json-pretty <vue-json-pretty
v-if="Object.keys(avatarDialog.fileAnalysis).length > 0" v-if="Object.keys(avatarDialog.fileAnalysis).length"
:data="avatarDialog.fileAnalysis" :data="avatarDialog.fileAnalysis"
:deep="2" :deep="2"
:theme="isDarkMode ? 'dark' : 'light'" :theme="isDarkMode ? 'dark' : 'light'"
@@ -529,6 +540,7 @@
Apple, Apple,
Check, Check,
CheckCircle, CheckCircle,
ChevronDown,
Copy, Copy,
Download, Download,
Ellipsis, Ellipsis,

View File

@@ -60,9 +60,9 @@
style="margin-right: 5px; margin-top: 5px"> style="margin-right: 5px; margin-top: 5px">
<Monitor class="h-4 w-4 x-tag-platform-pc" /> <Monitor class="h-4 w-4 x-tag-platform-pc" />
<span <span
v-if="worldDialog.bundleSizes['standalonewindows']" v-if="worldDialog.fileAnalysis.standalonewindows?._fileSize"
:class="['x-grey', 'x-tag-platform-pc', 'x-tag-border-left']"> :class="['x-grey', 'x-tag-platform-pc', 'x-tag-border-left']">
{{ worldDialog.bundleSizes['standalonewindows'].fileSize }} {{ worldDialog.fileAnalysis.standalonewindows._fileSize }}
</span> </span>
</Badge> </Badge>
</TooltipWrapper> </TooltipWrapper>
@@ -74,9 +74,9 @@
style="margin-right: 5px; margin-top: 5px"> style="margin-right: 5px; margin-top: 5px">
<Smartphone class="h-4 w-4 x-tag-platform-quest" /> <Smartphone class="h-4 w-4 x-tag-platform-quest" />
<span <span
v-if="worldDialog.bundleSizes['android']" v-if="worldDialog.fileAnalysis.android?._fileSize"
:class="['x-grey', 'x-tag-platform-quest', 'x-tag-border-left']"> :class="['x-grey', 'x-tag-platform-quest', 'x-tag-border-left']">
{{ worldDialog.bundleSizes['android'].fileSize }} {{ worldDialog.fileAnalysis.android._fileSize }}
</span> </span>
</Badge> </Badge>
</TooltipWrapper> </TooltipWrapper>
@@ -88,9 +88,9 @@
style="margin-right: 5px; margin-top: 5px"> style="margin-right: 5px; margin-top: 5px">
<Apple class="h-4 w-4 text-[#8e8e93]" /> <Apple class="h-4 w-4 text-[#8e8e93]" />
<span <span
v-if="worldDialog.bundleSizes['ios']" v-if="worldDialog.fileAnalysis.ios?._fileSize"
:class="['x-grey', 'x-tag-border-left', 'text-[#8e8e93]', 'border-[#8e8e93]']"> :class="['x-grey', 'x-tag-border-left', 'text-[#8e8e93]', 'border-[#8e8e93]']">
{{ worldDialog.bundleSizes['ios'].fileSize }} {{ worldDialog.fileAnalysis.ios._fileSize }}
</span> </span>
</Badge> </Badge>
</TooltipWrapper> </TooltipWrapper>
@@ -566,13 +566,24 @@
</div> </div>
<div class="x-friend-item" style="cursor: default"> <div class="x-friend-item" style="cursor: default">
<div class="detail"> <div class="detail">
<span class="name"> <span class="name" style="display: inline">
{{ t('dialog.world.info.last_updated') }} {{ t('dialog.world.info.last_updated') }}
</span> </span>
<span v-if="worldDialog.lastUpdated" class="extra"> <TooltipWrapper
{{ formatDateFilter(worldDialog.lastUpdated, 'long') }} v-if="Object.keys(worldDialog.fileAnalysis).length"
</span> side="top"
<span v-else class="extra"> style="margin-left: 5px">
<template #content>
<template v-for="(data, platform) in worldDialog.fileAnalysis" :key="platform">
<div class="flex justify-between w-full">
<span class="mr-1">{{ platform }}:</span>
<span>{{ formatDateFilter(data.created_at, 'long') }}</span>
</div>
</template>
</template>
<ChevronDown class="inline-block" />
</TooltipWrapper>
<span class="extra">
{{ formatDateFilter(worldDialog.ref.updated_at, 'long') }} {{ formatDateFilter(worldDialog.ref.updated_at, 'long') }}
</span> </span>
</div> </div>
@@ -712,7 +723,7 @@
show-icon /> show-icon />
<br /> <br />
<vue-json-pretty <vue-json-pretty
v-if="Object.keys(worldDialog.fileAnalysis).length > 0" v-if="Object.keys(worldDialog.fileAnalysis).length"
:data="worldDialog.fileAnalysis" :data="worldDialog.fileAnalysis"
:deep="2" :deep="2"
:theme="isDarkMode ? 'dark' : 'light'" :theme="isDarkMode ? 'dark' : 'light'"

View File

@@ -434,7 +434,6 @@ async function getBundleDateSize(ref) {
const instanceStore = useInstanceStore(); const instanceStore = useInstanceStore();
const { currentInstanceWorld, currentInstanceLocation } = const { currentInstanceWorld, currentInstanceLocation } =
storeToRefs(instanceStore); storeToRefs(instanceStore);
const bundleSizes = {};
const bundleJson = {}; const bundleJson = {};
for (let i = ref.unityPackages.length - 1; i > -1; i--) { for (let i = ref.unityPackages.length - 1; i > -1; i--) {
const unityPackage = ref.unityPackages[i]; const unityPackage = ref.unityPackages[i];
@@ -453,7 +452,7 @@ async function getBundleDateSize(ref) {
} }
const platform = unityPackage.platform; const platform = unityPackage.platform;
if (bundleSizes[platform]) { if (bundleJson[platform]) {
continue; continue;
} }
const assetUrl = unityPackage.assetUrl; const assetUrl = unityPackage.assetUrl;
@@ -488,34 +487,22 @@ async function getBundleDateSize(ref) {
json._totalTextureUsage = `${(json.avatarStats.totalTextureUsage / 1048576).toFixed(2)} MB`; json._totalTextureUsage = `${(json.avatarStats.totalTextureUsage / 1048576).toFixed(2)} MB`;
} }
bundleJson[platform] = json; bundleJson[platform] = json;
const createdAt = json.created_at;
const fileSize = `${(json.fileSize / 1048576).toFixed(2)} MB`;
bundleSizes[platform] = {
createdAt,
fileSize
};
if (avatarDialog.value.id === ref.id) { if (avatarDialog.value.id === ref.id) {
// update avatar dialog // update avatar dialog
avatarDialog.value.bundleSizes[platform] = bundleSizes[platform]; avatarDialog.value.fileAnalysis[platform] = json;
avatarDialog.value.lastUpdated = createdAt;
avatarDialog.value.fileAnalysis = bundleJson;
} }
// update world dialog // update world dialog
if (worldDialog.value.id === ref.id) { if (worldDialog.value.id === ref.id) {
worldDialog.value.bundleSizes[platform] = bundleSizes[platform]; worldDialog.value.fileAnalysis[platform] = json;
worldDialog.value.lastUpdated = createdAt;
worldDialog.value.fileAnalysis = bundleJson;
} }
// update player list // update player list
if (currentInstanceLocation.value.worldId === ref.id) { if (currentInstanceLocation.value.worldId === ref.id) {
currentInstanceWorld.value.bundleSizes[platform] = currentInstanceWorld.value.fileAnalysis[platform] = json;
bundleSizes[platform];
currentInstanceWorld.value.lastUpdated = createdAt;
} }
} }
return bundleSizes; return bundleJson;
} }
// #region | App: Random unsorted app methods, data structs, API functions, and an API feedback/file analysis event // #region | App: Random unsorted app methods, data structs, API functions, and an API feedback/file analysis event

View File

@@ -56,11 +56,9 @@ export const useAvatarStore = defineStore('Avatar', () => {
isPC: false, isPC: false,
isQuest: false, isQuest: false,
isIos: false, isIos: false,
bundleSizes: {},
platformInfo: {}, platformInfo: {},
galleryImages: [], galleryImages: [],
galleryLoading: false, galleryLoading: false,
lastUpdated: '',
inCache: false, inCache: false,
cacheSize: '', cacheSize: '',
cacheLocked: false, cacheLocked: false,
@@ -202,8 +200,6 @@ export const useAvatarStore = defineStore('Avatar', () => {
D.isIos = false; D.isIos = false;
D.hasImposter = false; D.hasImposter = false;
D.imposterVersion = ''; D.imposterVersion = '';
D.lastUpdated = '';
D.bundleSizes = {};
D.platformInfo = {}; D.platformInfo = {};
D.galleryImages = []; D.galleryImages = [];
D.galleryLoading = true; D.galleryLoading = true;
@@ -247,10 +243,8 @@ export const useAvatarStore = defineStore('Avatar', () => {
break; break;
} }
} }
if (Object.keys(D.bundleSizes).length === 0) { if (Object.keys(D.fileAnalysis).length === 0) {
getBundleDateSize(ref).then((bundleSizes) => { getBundleDateSize(ref);
D.bundleSizes = bundleSizes;
});
} }
}) })
.catch((err) => { .catch((err) => {

View File

@@ -101,8 +101,7 @@ export const useInstanceStore = defineStore('Instance', () => {
focusViewDisabled: false, focusViewDisabled: false,
inCache: false, inCache: false,
cacheSize: '', cacheSize: '',
bundleSizes: {}, fileAnalysis: {}
lastUpdated: ''
}); });
/** @type {import('vue').Ref<any>} */ /** @type {import('vue').Ref<any>} */
@@ -386,8 +385,7 @@ export const useInstanceStore = defineStore('Instance', () => {
focusViewDisabled: false, focusViewDisabled: false,
inCache: false, inCache: false,
cacheSize: '', cacheSize: '',
bundleSizes: {}, fileAnalysis: {}
lastUpdated: ''
}; };
currentInstanceLocation.value = {}; currentInstanceLocation.value = {};
} else if (instanceId !== currentInstanceLocation.value.tag) { } else if (instanceId !== currentInstanceLocation.value.tag) {
@@ -401,8 +399,7 @@ export const useInstanceStore = defineStore('Instance', () => {
focusViewDisabled: false, focusViewDisabled: false,
inCache: false, inCache: false,
cacheSize: '', cacheSize: '',
bundleSizes: {}, fileAnalysis: {}
lastUpdated: ''
}; };
L = parseLocation(instanceId); L = parseLocation(instanceId);
currentInstanceLocation.value = L; currentInstanceLocation.value = L;
@@ -439,17 +436,7 @@ export const useInstanceStore = defineStore('Instance', () => {
error error
); );
}); });
getBundleDateSize(args.ref) getBundleDateSize(args.ref);
.then((bundleSizes) => {
currentInstanceWorld.value.bundleSizes =
bundleSizes;
})
.catch((error) => {
console.error(
'Error fetching bundle sizes:',
error
);
});
return args; return args;
}) })
.catch((error) => { .catch((error) => {

View File

@@ -46,8 +46,6 @@ export const useWorldStore = defineStore('World', () => {
avatarScalingDisabled: false, avatarScalingDisabled: false,
focusViewDisabled: false, focusViewDisabled: false,
rooms: [], rooms: [],
bundleSizes: {},
lastUpdated: '',
inCache: false, inCache: false,
cacheSize: '', cacheSize: '',
cacheLocked: false, cacheLocked: false,
@@ -96,8 +94,6 @@ export const useWorldStore = defineStore('World', () => {
L.shortName = shortName; L.shortName = shortName;
D.id = L.worldId; D.id = L.worldId;
D.$location = L; D.$location = L;
D.bundleSizes = {};
D.lastUpdated = '';
D.loading = true; D.loading = true;
D.inCache = false; D.inCache = false;
D.cacheSize = ''; D.cacheSize = '';
@@ -331,10 +327,8 @@ export const useWorldStore = defineStore('World', () => {
}); });
} }
} }
if (Object.keys(worldDialog.bundleSizes).length === 0) { if (Object.keys(worldDialog.fileAnalysis).length === 0) {
getBundleDateSize(ref).then((bundleSizes) => { getBundleDateSize(ref);
worldDialog.bundleSizes = bundleSizes;
});
} }
} }
if (favoriteStore.localWorldFavoritesList.includes(ref.id)) { if (favoriteStore.localWorldFavoritesList.includes(ref.id)) {

View File

@@ -61,9 +61,9 @@
<Badge class="x-tag-platform-pc" variant="outline" style="margin-right: 5px" <Badge class="x-tag-platform-pc" variant="outline" style="margin-right: 5px"
><Monitor class="h-4 w-4" /> ><Monitor class="h-4 w-4" />
<span <span
v-if="currentInstanceWorld.bundleSizes['standalonewindows']" v-if="currentInstanceWorld.fileAnalysis.standalonewindows?._fileSize"
:class="['x-grey', 'x-tag-platform-pc', 'x-tag-border-left']" :class="['x-grey', 'x-tag-platform-pc', 'x-tag-border-left']"
>{{ currentInstanceWorld.bundleSizes['standalonewindows'].fileSize }}</span >{{ currentInstanceWorld.fileAnalysis.standalonewindows._fileSize }}</span
> >
</Badge> </Badge>
</TooltipWrapper> </TooltipWrapper>
@@ -71,9 +71,9 @@
<Badge class="x-tag-platform-quest" variant="outline" style="margin-right: 5px" <Badge class="x-tag-platform-quest" variant="outline" style="margin-right: 5px"
><Smartphone class="h-4 w-4" /> ><Smartphone class="h-4 w-4" />
<span <span
v-if="currentInstanceWorld.bundleSizes['android']" v-if="currentInstanceWorld.fileAnalysis.android?._fileSize"
:class="['x-grey', 'x-tag-platform-quest', 'x-tag-border-left']" :class="['x-grey', 'x-tag-platform-quest', 'x-tag-border-left']"
>{{ currentInstanceWorld.bundleSizes['android'].fileSize }}</span >{{ currentInstanceWorld.fileAnalysis.android._fileSize }}</span
> >
</Badge> </Badge>
</TooltipWrapper> </TooltipWrapper>
@@ -81,9 +81,9 @@
<Badge class="text-[#8e8e93] border-[#8e8e93]" variant="outline" style="margin-right: 5px" <Badge class="text-[#8e8e93] border-[#8e8e93]" variant="outline" style="margin-right: 5px"
><Apple class="h-4 w-4 text-[#8e8e93]" /> ><Apple class="h-4 w-4 text-[#8e8e93]" />
<span <span
v-if="currentInstanceWorld.bundleSizes['ios']" v-if="currentInstanceWorld.fileAnalysis.ios?._fileSize"
:class="['x-grey', 'x-tag-border-left', 'text-[#8e8e93]', 'border-[#8e8e93]']" :class="['x-grey', 'x-tag-border-left', 'text-[#8e8e93]', 'border-[#8e8e93]']"
>{{ currentInstanceWorld.bundleSizes['ios'].fileSize }}</span >{{ currentInstanceWorld.fileAnalysis.ios._fileSize }}</span
> >
</Badge> </Badge>
</TooltipWrapper> </TooltipWrapper>
@@ -129,7 +129,10 @@
<div class="detail"> <div class="detail">
<span class="name">{{ t('dialog.world.info.last_updated') }}</span> <span class="name">{{ t('dialog.world.info.last_updated') }}</span>
<span class="block truncate text-xs">{{ <span class="block truncate text-xs">{{
formatDateFilter(currentInstanceWorld.lastUpdated, 'long') formatDateFilter(
currentInstanceWorld.fileAnalysis.standalonewindows?.created_at,
'long'
)
}}</span> }}</span>
</div> </div>
</div> </div>