improve activity tab ui

This commit is contained in:
pa
2026-03-20 17:50:22 +09:00
parent ad5b9ab48d
commit ae212dca17
2 changed files with 7 additions and 12 deletions
@@ -12,9 +12,6 @@
<Spinner v-if="isLoading" /> <Spinner v-if="isLoading" />
<RefreshCw v-else /> <RefreshCw v-else />
</Button> </Button>
<span v-if="hasAnyData && !isLoading" class="ml-2 text-xs text-muted-foreground">
{{ t('dialog.user.activity.refresh_hint') }}
</span>
<span v-if="filteredEventCount > 0" class="text-accent-foreground ml-1"> <span v-if="filteredEventCount > 0" class="text-accent-foreground ml-1">
{{ t('dialog.user.activity.total_events', { count: filteredEventCount }) }} {{ t('dialog.user.activity.total_events', { count: filteredEventCount }) }}
</span> </span>
@@ -50,9 +47,7 @@
<span class="text-sm text-muted-foreground">{{ t('dialog.user.activity.preparing_data') }}</span> <span class="text-sm text-muted-foreground">{{ t('dialog.user.activity.preparing_data') }}</span>
<span class="text-xs text-muted-foreground">{{ t('dialog.user.activity.preparing_data_hint') }}</span> <span class="text-xs text-muted-foreground">{{ t('dialog.user.activity.preparing_data_hint') }}</span>
</div> </div>
<div <div v-else-if="!isLoading && !hasAnyData" class="flex items-center justify-center flex-1 mt-8">
v-else-if="!isLoading && !hasAnyData"
class="flex items-center justify-center flex-1 mt-8">
<DataTableEmpty type="nodata" /> <DataTableEmpty type="nodata" />
</div> </div>
<div <div
@@ -510,6 +505,7 @@
yAxis: { yAxis: {
type: 'category', type: 'category',
data: displayDayLabels.value, data: displayDayLabels.value,
inverse: true,
splitArea: { show: false }, splitArea: { show: false },
axisLabel: { axisLabel: {
fontSize: 11 fontSize: 11
@@ -698,10 +694,10 @@
if (!userId) { if (!userId) {
return; return;
} }
if (isSelf.value) {
if (lastLoadedUserId === userId && (hasAnyData.value || isLoading.value)) { if (lastLoadedUserId === userId && (hasAnyData.value || isLoading.value)) {
return; return;
} }
if (isSelf.value) {
void loadData(); void loadData();
return; return;
} }
@@ -822,8 +818,7 @@
const currentMs = getIncludedSessionDurationMs(currentSessions, start, end); const currentMs = getIncludedSessionDurationMs(currentSessions, start, end);
const targetMs = getIncludedSessionDurationMs(targetSessions, start, end); const targetMs = getIncludedSessionDurationMs(targetSessions, start, end);
const minOnlineMs = Math.min(currentMs, targetMs); const minOnlineMs = Math.min(currentMs, targetMs);
result.overlapPercent = result.overlapPercent = minOnlineMs > 0 ? Math.round((overlapMs / minOnlineMs) * 100) : 0;
minOnlineMs > 0 ? Math.round((overlapMs / minOnlineMs) * 100) : 0;
if (overlapMs === 0) { if (overlapMs === 0) {
overlapPercent.value = 0; overlapPercent.value = 0;
bestOverlapTime.value = ''; bestOverlapTime.value = '';
@@ -970,6 +965,7 @@
yAxis: { yAxis: {
type: 'category', type: 'category',
data: displayDayLabels.value, data: displayDayLabels.value,
inverse: true,
splitArea: { show: false }, splitArea: { show: false },
axisLabel: { axisLabel: {
fontSize: 11 fontSize: 11
-1
View File
@@ -1429,7 +1429,6 @@
"header": "Activity", "header": "Activity",
"load": "Load Activity", "load": "Load Activity",
"load_hint": "Load activity data from the local database when needed.", "load_hint": "Load activity data from the local database when needed.",
"refresh_hint": "Rebuild activity cache",
"total_events": "{count} online events", "total_events": "{count} online events",
"times_online": "times online", "times_online": "times online",
"most_active_day": "Most active day:", "most_active_day": "Most active day:",