fix vue-tsc
This commit is contained in:
parent
007bb4a0eb
commit
72d5fbb803
@ -166,7 +166,7 @@ LOGIN_REDIRECT_URL = "/"
|
|||||||
LOGOUT_REDIRECT_URL = "/"
|
LOGOUT_REDIRECT_URL = "/"
|
||||||
DJANGO_VITE = {
|
DJANGO_VITE = {
|
||||||
"default": {
|
"default": {
|
||||||
"dev_mode": True,
|
"dev_mode": False,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
STATIC_URL = "/static/"
|
STATIC_URL = "/static/"
|
||||||
|
|||||||
@ -15,84 +15,7 @@ const isLoading = ref(true)
|
|||||||
const showSubmissionModal = ref(false)
|
const showSubmissionModal = ref(false)
|
||||||
const error = ref<string>('')
|
const error = ref<string>('')
|
||||||
|
|
||||||
// Mock data for development
|
// Mock data removed - using API data only
|
||||||
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'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
// Computed properties
|
// Computed properties
|
||||||
const isSuperuser = computed(() => {
|
const isSuperuser = computed(() => {
|
||||||
@ -227,6 +150,10 @@ const closeSubmissionModal = () => {
|
|||||||
const findPuzzleByName = (ocrPuzzleName: string): SteamCollectionItem | null => {
|
const findPuzzleByName = (ocrPuzzleName: string): SteamCollectionItem | null => {
|
||||||
return puzzleHelpers.findPuzzleByName(puzzles.value, ocrPuzzleName)
|
return puzzleHelpers.findPuzzleByName(puzzles.value, ocrPuzzleName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const reloadPage = () => {
|
||||||
|
window.location.reload()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -268,7 +195,7 @@ const findPuzzleByName = (ocrPuzzleName: string): SteamCollectionItem | null =>
|
|||||||
<h3 class="font-bold">Error Loading Data</h3>
|
<h3 class="font-bold">Error Loading Data</h3>
|
||||||
<div class="text-sm">{{ error }}</div>
|
<div class="text-sm">{{ error }}</div>
|
||||||
</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>
|
<i class="mdi mdi-refresh mr-1"></i>
|
||||||
Retry
|
Retry
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -142,7 +142,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch, nextTick } from 'vue'
|
import { ref, watch, nextTick } from 'vue'
|
||||||
import { ocrService, type OpusMagnumData } from '../services/ocrService'
|
import { ocrService } from '../services/ocrService'
|
||||||
import type { SubmissionFile, SteamCollectionItem } from '@/types'
|
import type { SubmissionFile, SteamCollectionItem } from '@/types'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|||||||
@ -115,19 +115,7 @@ interface Props {
|
|||||||
|
|
||||||
defineProps<Props>()
|
defineProps<Props>()
|
||||||
|
|
||||||
const formatFileSize = (bytes: number): string => {
|
// Utility functions removed - not used in template
|
||||||
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()
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -133,7 +133,7 @@ export class ApiService {
|
|||||||
formData.append('data', JSON.stringify(submissionData))
|
formData.append('data', JSON.stringify(submissionData))
|
||||||
|
|
||||||
// Add files
|
// Add files
|
||||||
files.forEach((file, index) => {
|
files.forEach((file) => {
|
||||||
formData.append('files', file)
|
formData.append('files', file)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export class OpusMagnumOCRService {
|
|||||||
this.worker = await createWorker('eng');
|
this.worker = await createWorker('eng');
|
||||||
await this.worker.setParameters({
|
await this.worker.setParameters({
|
||||||
tessedit_ocr_engine_mode: '3',
|
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);
|
regionCtx.putImageData(imageData, 0, 0);
|
||||||
|
|
||||||
// Configure OCR based on content type
|
// Configure OCR based on content type
|
||||||
let config: any = {};
|
|
||||||
if (key === 'cost') {
|
if (key === 'cost') {
|
||||||
// Cost field has digits + 'G' for gold (content type: 'digits_with_6')
|
// Cost field has digits + 'G' for gold (content type: 'digits_with_6')
|
||||||
await this.worker!.setParameters({
|
await this.worker!.setParameters({
|
||||||
|
|||||||
@ -38,6 +38,7 @@ export interface SubmissionFile {
|
|||||||
ocrData?: OpusMagnumData
|
ocrData?: OpusMagnumData
|
||||||
ocrProcessing?: boolean
|
ocrProcessing?: boolean
|
||||||
ocrError?: string
|
ocrError?: string
|
||||||
|
original_filename?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PuzzleResponse {
|
export interface PuzzleResponse {
|
||||||
|
|||||||
@ -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"}
|
||||||
Loading…
Reference in New Issue
Block a user