Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"labelManual": "Manual",
"labelMissingExe": "Not Found",
"labelMatch": "Match",
"labelMatching": "Matching",
"labelMultiPatternMatching": "Multi-Pattern Matching",
"labelMultiRuleMatching": "Multi-Rule Matching",
"labelNA": "N/A",
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/zh_Hant_HK.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"labelManual": "手動輸入",
"labelMissingExe": "路徑無效",
"labelMatch": "配對",
"labelMatching": "配對中",
"labelMultiPatternMatching": "多匹配值配對",
"labelMultiRuleMatching": "多規則配對",
"labelNA": "N/A",
Expand Down
33 changes: 30 additions & 3 deletions frontend/src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ let timer: ReturnType<typeof setTimeout> | null = null
const selectedNetwork = ref<number>(0)
const selectedDisplay = ref<number>(0)
const selectedMiscellaneous = ref<number[]>([])
const matching = ref(false)

function loadSystemInfo() {
Promise.all([utils.getHardware(), utils.getOSInfo()]).then(([hw, os]) => {
Expand Down Expand Up @@ -92,6 +93,7 @@ onBeforeMount(() => {
})

function selectMatchedOptions() {
matching.value = true
matcher
.MatchedGroupIds()
.then(matchedIds => {
Expand All @@ -110,6 +112,9 @@ function selectMatchedOptions() {
})
})
.catch(err => toast.add({ title: decodeError(err, t), color: 'error' }))
.finally(() => {
matching.value = false
})
}

function resetSelection() {
Expand Down Expand Up @@ -258,7 +263,17 @@ onBeforeUnmount(() => {
</template>
</div>

<form ref="form" class="mt-3 flex h-28 gap-x-3">
<form ref="form" class="relative mt-3 flex h-28 gap-x-3">
<div
v-if="matching"
class="absolute -inset-2 z-10 flex flex-col items-center justify-center gap-y-1 rounded-lg bg-white/70 backdrop-blur-xs"
role="status"
>
<UIcon name="i-lucide-loader-circle" class="animate-spin text-xl text-apple-green-600" />

<span class="text-xs text-gray-500">{{ $t('labelMatching') }}</span>
</div>

<div class="flex flex-1 flex-col justify-between">
<div class="relative w-full">
<label
Expand Down Expand Up @@ -403,11 +418,23 @@ onBeforeUnmount(() => {
</div>

<div class="mt-2 flex h-8 flex-row items-center justify-end gap-x-3">
<UButton type="button" color="neutral" variant="outline" @click="selectMatchedOptions">
<UButton
type="button"
color="neutral"
variant="outline"
:disabled="matching || systemInfo.hw === null"
@click="selectMatchedOptions"
>
{{ $t('labelMatch') }}
</UButton>

<UButton type="button" color="secondary" variant="outline" @click="resetSelection">
<UButton
type="button"
color="secondary"
variant="outline"
:disabled="matching"
@click="resetSelection"
>
{{ $t('actionReset') }}
</UButton>

Expand Down
Loading