mirror of
https://github.com/Pandipipas/scoreko-dev.git
synced 2026-06-06 03:32:06 +00:00
feat: add new translations for settings and graphics; implement shortcut conflict detection and reset functionality
This commit is contained in:
@@ -91,6 +91,12 @@ type Translations = {
|
|||||||
commentaryClear: string;
|
commentaryClear: string;
|
||||||
aboutChangelog : string;
|
aboutChangelog : string;
|
||||||
aboutTechStackTitle : string;
|
aboutTechStackTitle : string;
|
||||||
|
settingsShortcutConflictWarning : string;
|
||||||
|
settingsShortcutStartRecording: string;
|
||||||
|
settingsShortcutStopRecording: string;
|
||||||
|
settingsShortcutResetSingle: string;
|
||||||
|
graphicsCopied : string;
|
||||||
|
graphicsOpenBrowser : string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const STORAGE_KEY = 'scoreko-dev.language';
|
const STORAGE_KEY = 'scoreko-dev.language';
|
||||||
@@ -185,6 +191,12 @@ const messages: Record<Locale, Translations> = {
|
|||||||
commentaryClear: 'Clear commentary',
|
commentaryClear: 'Clear commentary',
|
||||||
aboutChangelog: 'Changelog',
|
aboutChangelog: 'Changelog',
|
||||||
aboutTechStackTitle: 'Tech stack',
|
aboutTechStackTitle: 'Tech stack',
|
||||||
|
settingsShortcutConflictWarning: 'This shortcut is already assigned to',
|
||||||
|
settingsShortcutStartRecording: 'Start recording shortcut',
|
||||||
|
settingsShortcutStopRecording: 'Stop recording shortcut',
|
||||||
|
settingsShortcutResetSingle: 'Reset single player score shortcut',
|
||||||
|
graphicsCopied: 'URL copied to clipboard',
|
||||||
|
graphicsOpenBrowser: 'Open in browser',
|
||||||
},
|
},
|
||||||
es: {
|
es: {
|
||||||
menuDashboard: 'Panel',
|
menuDashboard: 'Panel',
|
||||||
@@ -275,6 +287,12 @@ const messages: Record<Locale, Translations> = {
|
|||||||
commentaryClear: 'Limpiar comentario',
|
commentaryClear: 'Limpiar comentario',
|
||||||
aboutChangelog: 'Changelog',
|
aboutChangelog: 'Changelog',
|
||||||
aboutTechStackTitle: 'Tech stack',
|
aboutTechStackTitle: 'Tech stack',
|
||||||
|
settingsShortcutConflictWarning: 'This shortcut is already assigned to',
|
||||||
|
settingsShortcutStartRecording: 'Start recording shortcut',
|
||||||
|
settingsShortcutStopRecording: 'Stop recording shortcut',
|
||||||
|
settingsShortcutResetSingle: 'Reset single player score shortcut',
|
||||||
|
graphicsCopied: 'URL copiada al portapapeles',
|
||||||
|
graphicsOpenBrowser: 'Abrir en el navegador',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -175,9 +175,15 @@ export const useShortcutSettingsStore = defineStore('shortcut-settings', () => {
|
|||||||
persistSettings(shortcuts);
|
persistSettings(shortcuts);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const resetShortcut = (action: ShortcutAction) => {
|
||||||
|
shortcuts[action] = defaultShortcuts[action];
|
||||||
|
persistSettings(shortcuts);
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
shortcuts,
|
shortcuts,
|
||||||
setShortcut,
|
setShortcut,
|
||||||
resetShortcuts,
|
resetShortcuts,
|
||||||
|
resetShortcut,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref, watch } from 'vue';
|
|
||||||
import { useHead } from '@unhead/vue';
|
import { useHead } from '@unhead/vue';
|
||||||
|
import { computed, ref, watch } from 'vue';
|
||||||
import bundlePackage from '../../../../package.json';
|
import bundlePackage from '../../../../package.json';
|
||||||
import { graphicsSettingsReplicant } from '../../../browser_shared/replicants';
|
import { graphicsSettingsReplicant } from '../../../browser_shared/replicants';
|
||||||
import { t } from '../i18n';
|
import { t } from '../i18n';
|
||||||
|
|
||||||
defineOptions({ name: 'GraphicsView' });
|
defineOptions({ name: 'GraphicsView' });
|
||||||
|
|
||||||
useHead(() => ({ title: t('graphicsTitle') }));type GraphicConfig = {
|
type GraphicConfig = {
|
||||||
name?: string;
|
name?: string;
|
||||||
title?: string;
|
title?: string;
|
||||||
file: string;
|
file: string;
|
||||||
@@ -129,19 +129,29 @@ const cards = computed<GraphicCard[]>(() => {
|
|||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
|
|
||||||
const copyUrl = async (graphic: GraphicConfig) => {
|
const copiedCardId = ref<string | null>(null);
|
||||||
|
|
||||||
|
const copyUrl = async (graphic: GraphicConfig, cardId: string) => {
|
||||||
const url = buildGraphicUrl(graphic);
|
const url = buildGraphicUrl(graphic);
|
||||||
if (navigator.clipboard?.writeText) {
|
if (navigator.clipboard?.writeText) {
|
||||||
await navigator.clipboard.writeText(url);
|
await navigator.clipboard.writeText(url);
|
||||||
return;
|
} else {
|
||||||
|
const input = document.createElement('input');
|
||||||
|
input.value = url;
|
||||||
|
document.body.appendChild(input);
|
||||||
|
input.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
document.body.removeChild(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
const input = document.createElement('input');
|
copiedCardId.value = cardId;
|
||||||
input.value = url;
|
setTimeout(() => {
|
||||||
document.body.appendChild(input);
|
copiedCardId.value = null;
|
||||||
input.select();
|
}, 2000);
|
||||||
document.execCommand('copy');
|
};
|
||||||
document.body.removeChild(input);
|
|
||||||
|
const openUrl = (graphic: GraphicConfig) => {
|
||||||
|
window.open(buildGraphicUrl(graphic), '_blank');
|
||||||
};
|
};
|
||||||
|
|
||||||
const onDragStart = (event: DragEvent, graphic: GraphicConfig) => {
|
const onDragStart = (event: DragEvent, graphic: GraphicConfig) => {
|
||||||
@@ -225,11 +235,11 @@ const onDragStart = (event: DragEvent, graphic: GraphicConfig) => {
|
|||||||
|
|
||||||
<div class="row items-center q-gutter-sm">
|
<div class="row items-center q-gutter-sm">
|
||||||
<QBtn
|
<QBtn
|
||||||
color="primary"
|
:color="copiedCardId === card.id ? 'positive' : 'primary'"
|
||||||
icon="content_copy"
|
:icon="copiedCardId === card.id ? 'check' : 'content_copy'"
|
||||||
no-caps
|
no-caps
|
||||||
:label="t('graphicsCopyUrl')"
|
:label="copiedCardId === card.id ? t('graphicsCopied') : t('graphicsCopyUrl')"
|
||||||
@click="copyUrl(card.graphic)"
|
@click="copyUrl(card.graphic, card.id)"
|
||||||
/>
|
/>
|
||||||
<QBtn
|
<QBtn
|
||||||
color="secondary"
|
color="secondary"
|
||||||
@@ -239,6 +249,13 @@ const onDragStart = (event: DragEvent, graphic: GraphicConfig) => {
|
|||||||
:label="t('graphicsDragObs')"
|
:label="t('graphicsDragObs')"
|
||||||
@dragstart="onDragStart($event, card.graphic)"
|
@dragstart="onDragStart($event, card.graphic)"
|
||||||
/>
|
/>
|
||||||
|
<QBtn
|
||||||
|
color="grey-7"
|
||||||
|
icon="open_in_new"
|
||||||
|
no-caps
|
||||||
|
:label="t('graphicsOpenBrowser')"
|
||||||
|
@click="openUrl(card.graphic)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
</QCard>
|
</QCard>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue';
|
|
||||||
import { useHead } from '@unhead/vue';
|
import { useHead } from '@unhead/vue';
|
||||||
import type { QTableColumn } from 'quasar';
|
import type { QTableColumn } from 'quasar';
|
||||||
|
import { computed, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue';
|
||||||
import { getCountryLabel, getCountryOptions } from '../../../shared/countries';
|
import { getCountryLabel, getCountryOptions } from '../../../shared/countries';
|
||||||
import type { Schemas } from '../../../types';
|
import type { Schemas } from '../../../types';
|
||||||
import { locale, t } from '../i18n';
|
import { locale, t } from '../i18n';
|
||||||
@@ -524,6 +524,20 @@ const hasChallongeTokenConfigured = computed(() => Boolean(challongeToken.value.
|
|||||||
|
|
||||||
const challongeConnectionLabel = computed(() => (hasValidatedChallongeToken.value ? t('playersConnected') : 'Token set'));
|
const challongeConnectionLabel = computed(() => (hasValidatedChallongeToken.value ? t('playersConnected') : 'Token set'));
|
||||||
|
|
||||||
|
const playerSource = (id: string): 'startgg' | 'challonge' | null => {
|
||||||
|
if (id in temporaryStartGGPlayers.value) return 'startgg';
|
||||||
|
if (id in temporaryChallongePlayers.value) return 'challonge';
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const playerExpiresAt = (id: string): number | null => {
|
||||||
|
const meta = temporaryStartGGPlayers.value[id] ?? temporaryChallongePlayers.value[id] ?? null;
|
||||||
|
return meta ? meta.expiresAt : null;
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatExpiresAt = (ts: number): string =>
|
||||||
|
new Date(ts * 1000).toLocaleDateString(locale.value, { month: 'short', day: 'numeric', year: 'numeric' });
|
||||||
|
|
||||||
const filterChallongeTournaments = (value: string, update: (callback: () => void) => void) => {
|
const filterChallongeTournaments = (value: string, update: (callback: () => void) => void) => {
|
||||||
update(() => {
|
update(() => {
|
||||||
const needle = value.toLowerCase().trim();
|
const needle = value.toLowerCase().trim();
|
||||||
@@ -684,6 +698,22 @@ const openSelectedTournamentImportDialog = () => {
|
|||||||
void openStartGGImportDialog(selectedTournamentOption.value);
|
void openStartGGImportDialog(selectedTournamentOption.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const toggleAllStartGGPlayers = () => {
|
||||||
|
if (selectedStartGGPlayerIds.value.length === startGGPlayers.value.length) {
|
||||||
|
selectedStartGGPlayerIds.value = [];
|
||||||
|
} else {
|
||||||
|
selectedStartGGPlayerIds.value = startGGPlayers.value.map((p) => p.id);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const toggleAllChallongePlayers = () => {
|
||||||
|
if (selectedChallongePlayerIds.value.length === challongePlayers.value.length) {
|
||||||
|
selectedChallongePlayerIds.value = [];
|
||||||
|
} else {
|
||||||
|
selectedChallongePlayerIds.value = challongePlayers.value.map((p) => p.id);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const importSelectedStartGGPlayers = () => {
|
const importSelectedStartGGPlayers = () => {
|
||||||
const selectedPlayers = startGGPlayers.value.filter((player) =>
|
const selectedPlayers = startGGPlayers.value.filter((player) =>
|
||||||
selectedStartGGPlayerIds.value.includes(player.id),
|
selectedStartGGPlayerIds.value.includes(player.id),
|
||||||
@@ -837,6 +867,7 @@ onBeforeUnmount(() => {
|
|||||||
<QIcon name="search" />
|
<QIcon name="search" />
|
||||||
</template>
|
</template>
|
||||||
</QInput>
|
</QInput>
|
||||||
|
<span class="text-caption text-grey-6">{{ rows.length }} players</span>
|
||||||
<QBtn
|
<QBtn
|
||||||
color="secondary"
|
color="secondary"
|
||||||
outline
|
outline
|
||||||
@@ -873,6 +904,45 @@ onBeforeUnmount(() => {
|
|||||||
:filter="filter"
|
:filter="filter"
|
||||||
:rows-per-page-options="[10, 20, 50]"
|
:rows-per-page-options="[10, 20, 50]"
|
||||||
>
|
>
|
||||||
|
<template #body-cell-gamertag="{ row }">
|
||||||
|
<QTd>
|
||||||
|
<div class="row items-center q-gutter-x-sm">
|
||||||
|
<span class="text-weight-medium">{{ row.gamertag }}</span>
|
||||||
|
<QChip
|
||||||
|
v-if="playerSource(row.id) === 'startgg'"
|
||||||
|
dense
|
||||||
|
outline
|
||||||
|
color="blue-4"
|
||||||
|
class="q-ma-none"
|
||||||
|
style="font-size: 10px; height: 18px;"
|
||||||
|
>
|
||||||
|
start.gg
|
||||||
|
<QTooltip v-if="playerExpiresAt(row.id)">
|
||||||
|
Temporary · expires {{ formatExpiresAt(playerExpiresAt(row.id)!) }}
|
||||||
|
</QTooltip>
|
||||||
|
</QChip>
|
||||||
|
<QChip
|
||||||
|
v-else-if="playerSource(row.id) === 'challonge'"
|
||||||
|
dense
|
||||||
|
outline
|
||||||
|
color="orange-4"
|
||||||
|
class="q-ma-none"
|
||||||
|
style="font-size: 10px; height: 18px;"
|
||||||
|
>
|
||||||
|
Challonge
|
||||||
|
<QTooltip v-if="playerExpiresAt(row.id)">
|
||||||
|
Temporary · expires {{ formatExpiresAt(playerExpiresAt(row.id)!) }}
|
||||||
|
</QTooltip>
|
||||||
|
</QChip>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="row.name"
|
||||||
|
class="text-caption text-grey-6"
|
||||||
|
>
|
||||||
|
{{ row.name }}
|
||||||
|
</div>
|
||||||
|
</QTd>
|
||||||
|
</template>
|
||||||
<template #body-cell-actions="{ row }">
|
<template #body-cell-actions="{ row }">
|
||||||
<QTd align="right">
|
<QTd align="right">
|
||||||
<QBtn
|
<QBtn
|
||||||
@@ -1199,6 +1269,20 @@ onBeforeUnmount(() => {
|
|||||||
<span>Loading participants...</span>
|
<span>Loading participants...</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
<div class="row q-gutter-sm q-mb-sm">
|
||||||
|
<QBtn
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
no-caps
|
||||||
|
size="sm"
|
||||||
|
color="primary"
|
||||||
|
:label="selectedStartGGPlayerIds.length === startGGPlayers.length ? 'Deselect all' : 'Select all'"
|
||||||
|
@click="toggleAllStartGGPlayers"
|
||||||
|
/>
|
||||||
|
<span class="text-caption text-grey-6 self-center">
|
||||||
|
{{ selectedStartGGPlayerIds.length }} / {{ startGGPlayers.length }} selected
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
<QOptionGroup
|
<QOptionGroup
|
||||||
v-model="selectedStartGGPlayerIds"
|
v-model="selectedStartGGPlayerIds"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@@ -1246,6 +1330,20 @@ onBeforeUnmount(() => {
|
|||||||
<span>Loading participants...</span>
|
<span>Loading participants...</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
<div class="row q-gutter-sm q-mb-sm">
|
||||||
|
<QBtn
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
no-caps
|
||||||
|
size="sm"
|
||||||
|
color="primary"
|
||||||
|
:label="selectedChallongePlayerIds.length === challongePlayers.length ? 'Deselect all' : 'Select all'"
|
||||||
|
@click="toggleAllChallongePlayers"
|
||||||
|
/>
|
||||||
|
<span class="text-caption text-grey-6 self-center">
|
||||||
|
{{ selectedChallongePlayerIds.length }} / {{ challongePlayers.length }} selected
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
<QOptionGroup
|
<QOptionGroup
|
||||||
v-model="selectedChallongePlayerIds"
|
v-model="selectedChallongePlayerIds"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@@ -1340,6 +1438,8 @@ onBeforeUnmount(() => {
|
|||||||
dense
|
dense
|
||||||
class="players-underlined-field"
|
class="players-underlined-field"
|
||||||
autofocus
|
autofocus
|
||||||
|
:rules="[(v) => !!v?.trim() || 'Gamertag is required']"
|
||||||
|
lazy-rules
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onBeforeUnmount, ref } from 'vue';
|
|
||||||
import { useHead } from '@unhead/vue';
|
import { useHead } from '@unhead/vue';
|
||||||
|
import { computed, onBeforeUnmount, ref } from 'vue';
|
||||||
import type { Locale } from '../i18n';
|
import type { Locale } from '../i18n';
|
||||||
import { locale, setLocale, t } from '../i18n';
|
import { locale, setLocale, t } from '../i18n';
|
||||||
import {
|
import {
|
||||||
@@ -28,6 +28,9 @@ const selectedLanguage = computed<Locale>({
|
|||||||
const shortcutSettingsStore = useShortcutSettingsStore();
|
const shortcutSettingsStore = useShortcutSettingsStore();
|
||||||
const recordingAction = ref<ShortcutAction | null>(null);
|
const recordingAction = ref<ShortcutAction | null>(null);
|
||||||
|
|
||||||
|
// Ref para detectar clicks fuera del contenedor de atajos
|
||||||
|
const shortcutsContainerRef = ref<HTMLElement | null>(null);
|
||||||
|
|
||||||
const shortcutFields = computed<{ action: ShortcutAction; label: string; hint: string }[]>(() => [
|
const shortcutFields = computed<{ action: ShortcutAction; label: string; hint: string }[]>(() => [
|
||||||
{ action: 'leftIncrement', label: t('settingsShortcutLeftIncrementLabel'), hint: t('settingsShortcutLeftIncrementHint') },
|
{ action: 'leftIncrement', label: t('settingsShortcutLeftIncrementLabel'), hint: t('settingsShortcutLeftIncrementHint') },
|
||||||
{ action: 'leftDecrement', label: t('settingsShortcutLeftDecrementLabel'), hint: t('settingsShortcutLeftDecrementHint') },
|
{ action: 'leftDecrement', label: t('settingsShortcutLeftDecrementLabel'), hint: t('settingsShortcutLeftDecrementHint') },
|
||||||
@@ -35,6 +38,21 @@ const shortcutFields = computed<{ action: ShortcutAction; label: string; hint: s
|
|||||||
{ action: 'rightDecrement', label: t('settingsShortcutRightDecrementLabel'), hint: t('settingsShortcutRightDecrementHint') },
|
{ action: 'rightDecrement', label: t('settingsShortcutRightDecrementLabel'), hint: t('settingsShortcutRightDecrementHint') },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// Detecta atajos duplicados entre acciones
|
||||||
|
const conflictingActions = computed(() => {
|
||||||
|
const seen = new Map<string, ShortcutAction>();
|
||||||
|
const conflicts = new Set<ShortcutAction>();
|
||||||
|
for (const [action, shortcut] of Object.entries(shortcutSettingsStore.shortcuts) as [ShortcutAction, string][]) {
|
||||||
|
if (seen.has(shortcut)) {
|
||||||
|
conflicts.add(action);
|
||||||
|
conflicts.add(seen.get(shortcut)!);
|
||||||
|
} else {
|
||||||
|
seen.set(shortcut, action);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return conflicts;
|
||||||
|
});
|
||||||
|
|
||||||
const stopRecording = () => {
|
const stopRecording = () => {
|
||||||
recordingAction.value = null;
|
recordingAction.value = null;
|
||||||
if (typeof document !== 'undefined') {
|
if (typeof document !== 'undefined') {
|
||||||
@@ -43,20 +61,34 @@ const stopRecording = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onRecordKeydown = (event: KeyboardEvent) => {
|
const onRecordKeydown = (event: KeyboardEvent) => {
|
||||||
if (!recordingAction.value) {
|
if (!recordingAction.value) return;
|
||||||
|
|
||||||
|
// Escape cancela la grabación sin asignar ningún atajo
|
||||||
|
if (event.key === 'Escape') {
|
||||||
|
event.preventDefault();
|
||||||
|
stopRecording();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const shortcut = eventToShortcut(event);
|
const shortcut = eventToShortcut(event);
|
||||||
if (!shortcut) {
|
if (!shortcut) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
shortcutSettingsStore.setShortcut(recordingAction.value, shortcut);
|
shortcutSettingsStore.setShortcut(recordingAction.value, shortcut);
|
||||||
stopRecording();
|
stopRecording();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Click fuera del área de atajos también cancela la grabación
|
||||||
|
const onDocumentMousedown = (event: MouseEvent) => {
|
||||||
|
if (
|
||||||
|
recordingAction.value &&
|
||||||
|
shortcutsContainerRef.value &&
|
||||||
|
!shortcutsContainerRef.value.contains(event.target as Node)
|
||||||
|
) {
|
||||||
|
stopRecording();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const startRecording = (action: ShortcutAction) => {
|
const startRecording = (action: ShortcutAction) => {
|
||||||
if (recordingAction.value === action) {
|
if (recordingAction.value === action) {
|
||||||
stopRecording();
|
stopRecording();
|
||||||
@@ -71,11 +103,13 @@ const startRecording = (action: ShortcutAction) => {
|
|||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
window.addEventListener('keydown', onRecordKeydown);
|
window.addEventListener('keydown', onRecordKeydown);
|
||||||
|
document.addEventListener('mousedown', onDocumentMousedown);
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
window.removeEventListener('keydown', onRecordKeydown);
|
window.removeEventListener('keydown', onRecordKeydown);
|
||||||
|
document.removeEventListener('mousedown', onDocumentMousedown);
|
||||||
}
|
}
|
||||||
stopRecording();
|
stopRecording();
|
||||||
});
|
});
|
||||||
@@ -99,15 +133,16 @@ onBeforeUnmount(() => {
|
|||||||
>
|
>
|
||||||
<!-- Language -->
|
<!-- Language -->
|
||||||
<QCardSection class="q-pa-lg">
|
<QCardSection class="q-pa-lg">
|
||||||
<div class="text-overline text-grey-6 q-mb-md">
|
<!--
|
||||||
{{ t('settingsLanguageLabel') }}
|
Label movido al propio QSelect (más idiomático en Quasar con outlined).
|
||||||
</div>
|
Se elimina el text-overline redundante de encima.
|
||||||
|
-->
|
||||||
<QSelect
|
<QSelect
|
||||||
v-model="selectedLanguage"
|
v-model="selectedLanguage"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
:options="languageOptions"
|
:options="languageOptions"
|
||||||
|
:label="t('settingsLanguageLabel')"
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
/>
|
/>
|
||||||
@@ -142,12 +177,39 @@ onBeforeUnmount(() => {
|
|||||||
{{ t('settingsShortcutDescription') }}
|
{{ t('settingsShortcutDescription') }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column q-gutter-md">
|
<!-- Aviso de conflicto: se muestra si dos acciones comparten el mismo atajo -->
|
||||||
|
<QBanner
|
||||||
|
v-if="conflictingActions.size > 0"
|
||||||
|
class="bg-warning text-white q-mb-md"
|
||||||
|
rounded
|
||||||
|
dense
|
||||||
|
>
|
||||||
|
<template #avatar>
|
||||||
|
<QIcon name="warning" color="white" />
|
||||||
|
</template>
|
||||||
|
{{ t('settingsShortcutConflictWarning') }}
|
||||||
|
</QBanner>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
ref="shortcutsContainerRef" permite detectar clicks fuera
|
||||||
|
de esta área para cancelar la grabación automáticamente.
|
||||||
|
-->
|
||||||
|
<div
|
||||||
|
ref="shortcutsContainerRef"
|
||||||
|
class="column q-gutter-md"
|
||||||
|
>
|
||||||
<QInput
|
<QInput
|
||||||
v-for="field in shortcutFields"
|
v-for="field in shortcutFields"
|
||||||
:key="field.action"
|
:key="field.action"
|
||||||
:model-value="shortcutSettingsStore.shortcuts[field.action]"
|
:model-value="shortcutSettingsStore.shortcuts[field.action]"
|
||||||
:hint="recordingAction === field.action ? t('settingsShortcutRecordingHint') : field.hint"
|
:hint="recordingAction === field.action ? t('settingsShortcutRecordingHint') : field.hint"
|
||||||
|
:color="
|
||||||
|
recordingAction === field.action
|
||||||
|
? 'negative'
|
||||||
|
: conflictingActions.has(field.action)
|
||||||
|
? 'warning'
|
||||||
|
: 'primary'
|
||||||
|
"
|
||||||
readonly
|
readonly
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
@@ -155,14 +217,33 @@ onBeforeUnmount(() => {
|
|||||||
:label="field.label"
|
:label="field.label"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
|
<!-- Botón grabar / detener -->
|
||||||
<QBtn
|
<QBtn
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
dense
|
dense
|
||||||
:icon="recordingAction === field.action ? 'stop_circle' : 'keyboard'"
|
:icon="recordingAction === field.action ? 'stop_circle' : 'keyboard'"
|
||||||
:color="recordingAction === field.action ? 'negative' : 'primary'"
|
:color="recordingAction === field.action ? 'negative' : 'primary'"
|
||||||
|
:aria-label="
|
||||||
|
recordingAction === field.action
|
||||||
|
? t('settingsShortcutStopRecording')
|
||||||
|
: t('settingsShortcutStartRecording')
|
||||||
|
"
|
||||||
@click="startRecording(field.action)"
|
@click="startRecording(field.action)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<!-- Botón reset individual por atajo -->
|
||||||
|
<QBtn
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
icon="restart_alt"
|
||||||
|
color="grey-5"
|
||||||
|
:aria-label="t('settingsShortcutResetSingle')"
|
||||||
|
@click="shortcutSettingsStore.resetShortcut(field.action)"
|
||||||
|
>
|
||||||
|
<QTooltip>{{ t('settingsShortcutResetSingle') }}</QTooltip>
|
||||||
|
</QBtn>
|
||||||
</template>
|
</template>
|
||||||
</QInput>
|
</QInput>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user