fix vue-tsc

This commit is contained in:
Loïc Gremaud 2025-10-29 03:44:57 +01:00
parent 007bb4a0eb
commit 72d5fbb803
8 changed files with 13 additions and 98 deletions

View File

@ -166,7 +166,7 @@ LOGIN_REDIRECT_URL = "/"
LOGOUT_REDIRECT_URL = "/"
DJANGO_VITE = {
"default": {
"dev_mode": True,
"dev_mode": False,
}
}
STATIC_URL = "/static/"

View File

@ -15,84 +15,7 @@ const isLoading = ref(true)
const showSubmissionModal = ref(false)
const error = ref<string>('')
// Mock data for development
const mockCollections: SteamCollection[] = [
{
id: 1,
steam_id: '3479142989',
title: 'PolyLAN 41',
description: 'Puzzle for PolyLAN 41 fil rouge',
author_name: 'Flame Legrems',
total_items: 10,
unique_visitors: 31,
current_favorites: 1,
created_at: '2025-05-29T11:19:24Z',
updated_at: '2025-05-30T22:15:09Z'
}
]
const mockPuzzles: SteamCollectionItem[] = [
{
id: 1,
steam_item_id: '3479143948',
title: 'P41-FLOC',
author_name: 'Flame Legrems',
description: 'A challenging puzzle involving complex molecular arrangements',
tags: ['puzzle', 'chemistry', 'advanced'],
order_index: 0,
collection: 1,
created_at: '2025-05-29T11:19:24Z',
updated_at: '2025-05-30T22:15:09Z'
},
{
id: 2,
steam_item_id: '3479143084',
title: 'P41-40',
author_name: 'Flame Legrems',
description: 'Test your optimization skills with this intricate design challenge',
tags: ['optimization', 'design'],
order_index: 1,
collection: 1,
created_at: '2025-05-29T11:19:24Z',
updated_at: '2025-05-30T22:15:09Z'
},
{
id: 3,
steam_item_id: '3479143304',
title: 'P41-39',
author_name: 'Flame Legrems',
description: 'A puzzle focusing on efficient resource management',
tags: ['efficiency', 'resources'],
order_index: 2,
collection: 1,
created_at: '2025-05-29T11:19:24Z',
updated_at: '2025-05-30T22:15:09Z'
},
{
id: 4,
steam_item_id: '3479143433',
title: 'P41-38',
author_name: 'Flame Legrems',
description: 'Master the art of precise timing in this temporal challenge',
tags: ['timing', 'precision'],
order_index: 3,
collection: 1,
created_at: '2025-05-29T11:19:24Z',
updated_at: '2025-05-30T22:15:09Z'
},
{
id: 5,
steam_item_id: '3479143537',
title: 'P41-37',
author_name: 'Flame Legrems',
description: 'Explore innovative solutions in this creative puzzle',
tags: ['creative', 'innovation'],
order_index: 4,
collection: 1,
created_at: '2025-05-29T11:19:24Z',
updated_at: '2025-05-30T22:15:09Z'
}
]
// Mock data removed - using API data only
// Computed properties
const isSuperuser = computed(() => {
@ -227,6 +150,10 @@ const closeSubmissionModal = () => {
const findPuzzleByName = (ocrPuzzleName: string): SteamCollectionItem | null => {
return puzzleHelpers.findPuzzleByName(puzzles.value, ocrPuzzleName)
}
const reloadPage = () => {
window.location.reload()
}
</script>
<template>
@ -268,7 +195,7 @@ const findPuzzleByName = (ocrPuzzleName: string): SteamCollectionItem | null =>
<h3 class="font-bold">Error Loading Data</h3>
<div class="text-sm">{{ error }}</div>
</div>
<button @click="window.location.reload()" class="btn btn-sm btn-outline">
<button @click="reloadPage" class="btn btn-sm btn-outline">
<i class="mdi mdi-refresh mr-1"></i>
Retry
</button>

View File

@ -142,7 +142,7 @@
<script setup lang="ts">
import { ref, watch, nextTick } from 'vue'
import { ocrService, type OpusMagnumData } from '../services/ocrService'
import { ocrService } from '../services/ocrService'
import type { SubmissionFile, SteamCollectionItem } from '@/types'
interface Props {

View File

@ -115,19 +115,7 @@ interface Props {
defineProps<Props>()
const formatFileSize = (bytes: number): string => {
if (bytes === 0) return '0 Bytes'
const k = 1024
const sizes = ['Bytes', 'KB', 'MB', 'GB']
const i = Math.floor(Math.log(bytes) / Math.log(k))
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]
}
const formatDate = (dateString: string): string => {
return new Date(dateString).toLocaleDateString()
}
// Utility functions removed - not used in template
</script>
<style scoped>

View File

@ -133,7 +133,7 @@ export class ApiService {
formData.append('data', JSON.stringify(submissionData))
// Add files
files.forEach((file, index) => {
files.forEach((file) => {
formData.append('files', file)
})

View File

@ -32,7 +32,7 @@ export class OpusMagnumOCRService {
this.worker = await createWorker('eng');
await this.worker.setParameters({
tessedit_ocr_engine_mode: '3',
tessedit_pageseg_mode: '7'
tessedit_pageseg_mode: 7 as any
});
}
@ -85,7 +85,6 @@ export class OpusMagnumOCRService {
regionCtx.putImageData(imageData, 0, 0);
// Configure OCR based on content type
let config: any = {};
if (key === 'cost') {
// Cost field has digits + 'G' for gold (content type: 'digits_with_6')
await this.worker!.setParameters({

View File

@ -38,6 +38,7 @@ export interface SubmissionFile {
ocrData?: OpusMagnumData
ocrProcessing?: boolean
ocrError?: string
original_filename?: string
}
export interface PuzzleResponse {

View File

@ -1 +1 @@
{"root":["./src/main.ts","./src/App.vue","./src/components/HelloWorld.vue"],"version":"5.9.3"}
{"root":["./src/main.ts","./src/services/apiService.ts","./src/services/ocrService.ts","./src/types/index.ts","./src/App.vue","./src/components/AdminPanel.vue","./src/components/FileUpload.vue","./src/components/PuzzleCard.vue","./src/components/SubmissionForm.vue"],"version":"5.9.3"}