Update project documentation and improve frontend functionality

- Updated the backend documentation in CONTRIBUTING.md and README.md to reflect changes in application structure and API endpoints.
- Enhanced the frontend components in MapView.vue for better handling of context menu actions.
- Added new types and interfaces in TypeScript for improved type safety in the frontend.
- Introduced new utility classes for managing characters and markers in the map.
- Updated .gitignore to include .vscode directory for better development environment management.
This commit is contained in:
2026-02-24 23:32:50 +03:00
parent 605a31567e
commit 82cb8a13f5
39 changed files with 1788 additions and 2631 deletions

View File

@@ -1,22 +1,6 @@
export interface MeResponse {
username: string
auths: string[]
tokens?: string[]
prefix?: string
}
import type { ConfigResponse, MapInfo, MapInfoAdmin, MeResponse, SettingsResponse } from '~/types/api'
export interface MapInfoAdmin {
ID: number
Name: string
Hidden: boolean
Priority: boolean
}
export interface SettingsResponse {
prefix: string
defaultHide: boolean
title: string
}
export type { ConfigResponse, MapInfo, MapInfoAdmin, MeResponse, SettingsResponse }
// Singleton: shared by all useMapApi() callers so 401 triggers one global handler (e.g. app.vue)
const onApiErrorCallbacks: (() => void)[] = []
@@ -46,7 +30,7 @@ export function useMapApi() {
}
async function getConfig() {
return request<{ title?: string; auths?: string[] }>('config')
return request<ConfigResponse>('config')
}
async function getCharacters() {
@@ -58,7 +42,7 @@ export function useMapApi() {
}
async function getMaps() {
return request<Record<string, { ID: number; Name: string; size?: number }>>('maps')
return request<Record<string, MapInfo>>('maps')
}
// Auth