Compare commits

..

2 Commits

Author SHA1 Message Date
533d856c5b fix front build 2025-10-29 03:47:35 +01:00
72d5fbb803 fix vue-tsc 2025-10-29 03:44:57 +01:00
19 changed files with 89 additions and 100 deletions

View File

@ -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/"

View File

@ -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>

View File

@ -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 {

View File

@ -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>

View File

@ -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)
}) })

View 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({

View File

@ -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 {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,33 @@
{
"node_modules/.pnpm/@mdi+font@7.4.47/node_modules/@mdi/font/fonts/materialdesignicons-webfont.eot": {
"file": "assets/materialdesignicons-webfont-CSr8KVlo.eot",
"src": "node_modules/.pnpm/@mdi+font@7.4.47/node_modules/@mdi/font/fonts/materialdesignicons-webfont.eot"
},
"node_modules/.pnpm/@mdi+font@7.4.47/node_modules/@mdi/font/fonts/materialdesignicons-webfont.ttf": {
"file": "assets/materialdesignicons-webfont-B7mPwVP_.ttf",
"src": "node_modules/.pnpm/@mdi+font@7.4.47/node_modules/@mdi/font/fonts/materialdesignicons-webfont.ttf"
},
"node_modules/.pnpm/@mdi+font@7.4.47/node_modules/@mdi/font/fonts/materialdesignicons-webfont.woff": {
"file": "assets/materialdesignicons-webfont-PXm3-2wK.woff",
"src": "node_modules/.pnpm/@mdi+font@7.4.47/node_modules/@mdi/font/fonts/materialdesignicons-webfont.woff"
},
"node_modules/.pnpm/@mdi+font@7.4.47/node_modules/@mdi/font/fonts/materialdesignicons-webfont.woff2": {
"file": "assets/materialdesignicons-webfont-Dp5v-WZN.woff2",
"src": "node_modules/.pnpm/@mdi+font@7.4.47/node_modules/@mdi/font/fonts/materialdesignicons-webfont.woff2"
},
"src/main.ts": {
"file": "assets/main-XyhNv7AL.js",
"name": "main",
"src": "src/main.ts",
"isEntry": true,
"css": [
"assets/main-ClCUrjHA.css"
],
"assets": [
"assets/materialdesignicons-webfont-CSr8KVlo.eot",
"assets/materialdesignicons-webfont-Dp5v-WZN.woff2",
"assets/materialdesignicons-webfont-PXm3-2wK.woff",
"assets/materialdesignicons-webfont-B7mPwVP_.ttf"
]
}
}

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because one or more lines are too long

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"}

View File

@ -0,0 +1,22 @@
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { resolve } from 'path';
import { fileURLToPath } from 'node:url';
import tailwindcss from '@tailwindcss/vite';
// https://vitejs.dev/config/
export default defineConfig({
base: '/static/',
plugins: [vue(), tailwindcss()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
build: {
manifest: 'manifest.json',
outDir: resolve("./static/vite"),
rollupOptions: {
input: { main: resolve('./src/main.ts') }
}
}
});

View File

@ -15,7 +15,7 @@ export default defineConfig({
}, },
build: { build: {
manifest: 'manifest.json', manifest: 'manifest.json',
outDir: resolve("./static/dist"), outDir: resolve("./static/vite"),
rollupOptions: { rollupOptions: {
input: input:
{ main: resolve('./src/main.ts') } { main: resolve('./src/main.ts') }