mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
improve ui
This commit is contained in:
@@ -90,9 +90,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "Skupina"
|
"header": "Skupina"
|
||||||
},
|
}
|
||||||
"prev_page": "Předchozí",
|
|
||||||
"next_page": "Další"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -305,9 +305,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "Group"
|
"header": "Group"
|
||||||
},
|
}
|
||||||
"prev_page": "Prev",
|
|
||||||
"next_page": "Next"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
@@ -1868,6 +1866,8 @@
|
|||||||
"col_world": "World",
|
"col_world": "World",
|
||||||
"col_players": "Players",
|
"col_players": "Players",
|
||||||
"col_resolution": "Resolution",
|
"col_resolution": "Resolution",
|
||||||
|
"col_match": "Match",
|
||||||
|
"col_author": "Author",
|
||||||
"back_to_results": "Back to {count} results",
|
"back_to_results": "Back to {count} results",
|
||||||
"result_count": "{count} results"
|
"result_count": "{count} results"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -113,9 +113,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "Grupo"
|
"header": "Grupo"
|
||||||
},
|
}
|
||||||
"prev_page": "Anterior",
|
|
||||||
"next_page": "Siguiente"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -109,9 +109,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "Groupe"
|
"header": "Groupe"
|
||||||
},
|
}
|
||||||
"prev_page": "Précédent",
|
|
||||||
"next_page": "Suivant"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -90,9 +90,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "Csoport"
|
"header": "Csoport"
|
||||||
},
|
}
|
||||||
"prev_page": "Előző",
|
|
||||||
"next_page": "Következő"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -178,9 +178,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "グループ"
|
"header": "グループ"
|
||||||
},
|
}
|
||||||
"prev_page": "前",
|
|
||||||
"next_page": "次"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -90,9 +90,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "그룹"
|
"header": "그룹"
|
||||||
},
|
}
|
||||||
"prev_page": "이전",
|
|
||||||
"next_page": "다음"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -153,9 +153,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "Grupa"
|
"header": "Grupa"
|
||||||
},
|
}
|
||||||
"prev_page": "Wstecz",
|
|
||||||
"next_page": "Dalej"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -90,9 +90,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "Grupo"
|
"header": "Grupo"
|
||||||
},
|
}
|
||||||
"prev_page": "Anterior",
|
|
||||||
"next_page": "Próximo"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -114,9 +114,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "Группа"
|
"header": "Группа"
|
||||||
},
|
}
|
||||||
"prev_page": "Назад",
|
|
||||||
"next_page": "Вперед"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -113,9 +113,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "กลุ่ม"
|
"header": "กลุ่ม"
|
||||||
},
|
}
|
||||||
"prev_page": "ก่อนหน้า",
|
|
||||||
"next_page": "ถัดไป"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -90,9 +90,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "Nhóm"
|
"header": "Nhóm"
|
||||||
},
|
}
|
||||||
"prev_page": "Trước",
|
|
||||||
"next_page": "Sau"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -178,9 +178,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "群组"
|
"header": "群组"
|
||||||
},
|
}
|
||||||
"prev_page": "上一页",
|
|
||||||
"next_page": "下一页"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -178,9 +178,7 @@
|
|||||||
},
|
},
|
||||||
"group": {
|
"group": {
|
||||||
"header": "群組"
|
"header": "群組"
|
||||||
},
|
}
|
||||||
"prev_page": "上一頁",
|
|
||||||
"next_page": "下一頁"
|
|
||||||
},
|
},
|
||||||
"favorite": {
|
"favorite": {
|
||||||
"worlds": {
|
"worlds": {
|
||||||
|
|||||||
@@ -3,12 +3,10 @@
|
|||||||
<ButtonGroup class="shadow-lg rounded-lg">
|
<ButtonGroup class="shadow-lg rounded-lg">
|
||||||
<Button variant="outline" size="sm" :disabled="prevDisabled" @click="$emit('prev')">
|
<Button variant="outline" size="sm" :disabled="prevDisabled" @click="$emit('prev')">
|
||||||
<ArrowLeft />
|
<ArrowLeft />
|
||||||
{{ t('view.search.prev_page') }}
|
|
||||||
<Kbd class="ml-1">{{ isMac ? '⌥' : 'Alt' }}</Kbd>
|
<Kbd class="ml-1">{{ isMac ? '⌥' : 'Alt' }}</Kbd>
|
||||||
<Kbd>←</Kbd>
|
<Kbd>←</Kbd>
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="outline" size="sm" :disabled="nextDisabled" @click="$emit('next')">
|
<Button variant="outline" size="sm" :disabled="nextDisabled" @click="$emit('next')">
|
||||||
{{ t('view.search.next_page') }}
|
|
||||||
<Kbd class="ml-1">{{ isMac ? '⌥' : 'Alt' }}</Kbd>
|
<Kbd class="ml-1">{{ isMac ? '⌥' : 'Alt' }}</Kbd>
|
||||||
<Kbd>→</Kbd>
|
<Kbd>→</Kbd>
|
||||||
<ArrowRight />
|
<ArrowRight />
|
||||||
@@ -22,9 +20,6 @@
|
|||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { ButtonGroup } from '@/components/ui/button-group';
|
import { ButtonGroup } from '@/components/ui/button-group';
|
||||||
import { Kbd } from '@/components/ui/kbd';
|
import { Kbd } from '@/components/ui/kbd';
|
||||||
import { useI18n } from 'vue-i18n';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
|
||||||
|
|
||||||
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,14 @@
|
|||||||
{{ t('dialog.screenshot_metadata.col_world') }}
|
{{ t('dialog.screenshot_metadata.col_world') }}
|
||||||
<span v-if="searchSort.key === 'world'" class="ml-1 text-[10px]">{{ searchSort.asc ? '↑' : '↓' }}</span>
|
<span v-if="searchSort.key === 'world'" class="ml-1 text-[10px]">{{ searchSort.asc ? '↑' : '↓' }}</span>
|
||||||
</th>
|
</th>
|
||||||
|
<th v-if="searchHasMatchColumn" class="text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground text-left px-3 py-2 border-b whitespace-nowrap select-none cursor-pointer hover:text-foreground" @click="toggleSearchSort('match')">
|
||||||
|
{{ t('dialog.screenshot_metadata.col_match') }}
|
||||||
|
<span v-if="searchSort.key === 'match'" class="ml-1 text-[10px]">{{ searchSort.asc ? '↑' : '↓' }}</span>
|
||||||
|
</th>
|
||||||
|
<th class="text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground text-left px-3 py-2 border-b whitespace-nowrap select-none cursor-pointer hover:text-foreground" @click="toggleSearchSort('author')">
|
||||||
|
{{ t('dialog.screenshot_metadata.col_author') }}
|
||||||
|
<span v-if="searchSort.key === 'author'" class="ml-1 text-[10px]">{{ searchSort.asc ? '↑' : '↓' }}</span>
|
||||||
|
</th>
|
||||||
<th class="text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground text-left px-3 py-2 border-b whitespace-nowrap select-none cursor-pointer hover:text-foreground w-20" @click="toggleSearchSort('players')">
|
<th class="text-[11px] font-medium uppercase tracking-[0.08em] text-muted-foreground text-left px-3 py-2 border-b whitespace-nowrap select-none cursor-pointer hover:text-foreground w-20" @click="toggleSearchSort('players')">
|
||||||
{{ t('dialog.screenshot_metadata.col_players') }}
|
{{ t('dialog.screenshot_metadata.col_players') }}
|
||||||
<span v-if="searchSort.key === 'players'" class="ml-1 text-[10px]">{{ searchSort.asc ? '↑' : '↓' }}</span>
|
<span v-if="searchSort.key === 'players'" class="ml-1 text-[10px]">{{ searchSort.asc ? '↑' : '↓' }}</span>
|
||||||
@@ -81,6 +89,8 @@
|
|||||||
@click="selectSearchResult(idx)">
|
@click="selectSearchResult(idx)">
|
||||||
<td class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis" :class="row.filePath === selectedSearchFilePath ? 'pl-[9px]' : ''">{{ row.dateFormatted }}</td>
|
<td class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis" :class="row.filePath === selectedSearchFilePath ? 'pl-[9px]' : ''">{{ row.dateFormatted }}</td>
|
||||||
<td class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis">{{ row.world || '—' }}</td>
|
<td class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis">{{ row.world || '—' }}</td>
|
||||||
|
<td v-if="searchHasMatchColumn" class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis text-primary">{{ row.match || '—' }}</td>
|
||||||
|
<td class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis text-muted-foreground">{{ row.author || '—' }}</td>
|
||||||
<td class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis">
|
<td class="text-sm px-3 py-2 border-b whitespace-nowrap overflow-hidden text-ellipsis">
|
||||||
<span class="inline-flex items-center gap-1">
|
<span class="inline-flex items-center gap-1">
|
||||||
<Users class="size-3 text-muted-foreground" />
|
<Users class="size-3 text-muted-foreground" />
|
||||||
@@ -300,6 +310,11 @@
|
|||||||
const selectedSearchFilePath = ref(null);
|
const selectedSearchFilePath = ref(null);
|
||||||
const searchSort = reactive({ key: 'dateTime', asc: false });
|
const searchSort = reactive({ key: 'dateTime', asc: false });
|
||||||
|
|
||||||
|
const searchHasMatchColumn = computed(() => {
|
||||||
|
const type = screenshotMetadataDialog.searchType;
|
||||||
|
return type === 'Player Name' || type === 'Player ID';
|
||||||
|
});
|
||||||
|
|
||||||
const sortedSearchResults = computed(() => {
|
const sortedSearchResults = computed(() => {
|
||||||
const data = [...searchResultsData.value];
|
const data = [...searchResultsData.value];
|
||||||
const { key, asc } = searchSort;
|
const { key, asc } = searchSort;
|
||||||
@@ -333,8 +348,9 @@
|
|||||||
getAndDisplayScreenshot(row.filePath, false);
|
getAndDisplayScreenshot(row.filePath, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadSearchResultsMetadata(filePaths) {
|
async function loadSearchResultsMetadata(filePaths, query, searchType) {
|
||||||
const results = [];
|
const results = [];
|
||||||
|
const lowerQuery = String(query).toLowerCase();
|
||||||
const promises = filePaths.map(async (filePath) => {
|
const promises = filePaths.map(async (filePath) => {
|
||||||
try {
|
try {
|
||||||
const metaJson = await AppApi.GetScreenshotMetadata(filePath);
|
const metaJson = await AppApi.GetScreenshotMetadata(filePath);
|
||||||
@@ -353,6 +369,15 @@
|
|||||||
dateFormatted = formatDateFilter(dateTime, 'short');
|
dateFormatted = formatDateFilter(dateTime, 'short');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let match = '';
|
||||||
|
if (searchType === 0) {
|
||||||
|
const matched = meta.players?.filter((p) => p.displayName?.toLowerCase().includes(lowerQuery)) || [];
|
||||||
|
match = matched.map((p) => p.displayName).join(', ');
|
||||||
|
} else if (searchType === 1) {
|
||||||
|
const matched = meta.players?.find((p) => p.id === query);
|
||||||
|
match = matched?.displayName || '';
|
||||||
|
}
|
||||||
|
|
||||||
results.push({
|
results.push({
|
||||||
filePath,
|
filePath,
|
||||||
dateTime,
|
dateTime,
|
||||||
@@ -360,7 +385,9 @@
|
|||||||
world: meta.world?.name || '',
|
world: meta.world?.name || '',
|
||||||
playerCount: meta.players?.length || 0,
|
playerCount: meta.players?.length || 0,
|
||||||
players: meta.players?.length || 0,
|
players: meta.players?.length || 0,
|
||||||
resolution: extra.fileResolution || ''
|
resolution: extra.fileResolution || '',
|
||||||
|
match,
|
||||||
|
author: meta.author?.displayName || ''
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Error loading metadata for', filePath, e);
|
console.error('Error loading metadata for', filePath, e);
|
||||||
@@ -622,7 +649,7 @@
|
|||||||
D.searchIndex = 0;
|
D.searchIndex = 0;
|
||||||
D.searchResults = results;
|
D.searchResults = results;
|
||||||
|
|
||||||
const enriched = await loadSearchResultsMetadata(results);
|
const enriched = await loadSearchResultsMetadata(results, D.search, searchType);
|
||||||
searchResultsData.value = enriched;
|
searchResultsData.value = enriched;
|
||||||
searchViewMode.value = 'table';
|
searchViewMode.value = 'table';
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user