Character display

added FeChar (FrontEndCharacter)
added marker for innate skills (angeborene Fertigkeiten) and category
added selector for innate skills at import
added marker for improvable skills
TestGetCharacters against real database
changed favicon
server frontend on '192.168.0.48', 'localhost','terrra.local'
added view DeleteCharView
fixed errors on rendering datasheetview
serve backend on 192.168.0.48
This commit is contained in:
2025-01-18 20:59:35 +01:00
parent dfe3602d20
commit 30a990b0cf
16 changed files with 209 additions and 26 deletions
+2 -1
View File
@@ -2,7 +2,8 @@
<html lang="">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<!-- <link rel="icon" href="/favicon.ico">-->
<link rel="icon" href="/favicon.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

+10 -4
View File
@@ -35,6 +35,7 @@ import WeaponView from "./WeaponView.vue"; // Component for character history
import SpellView from "./SpellView.vue"; // Component for character history
import EquipmentView from "./EquipmentView.vue"; // Component for character equipment
import ExperianceView from "./ExperianceView.vue"; // Component for character history
import DeleteCharView from "./DeleteCharView.vue"; // Component for character history
export default {
@@ -47,18 +48,22 @@ export default {
SpellView,
EquipmentView,
ExperianceView,
DeleteCharView,
},
data() {
return {
character: {},
currentView: "DatasheetView", // Default view
lastView: "DatasheetView",
menus: [
{ id: 1, name: "Datasheet", component: "DatasheetView" },
{ id: 2, name: "Skill", component: "SkillView" },
{ id: 2, name: "Weapon", component: "WeaponView" },
{ id: 2, name: "Spell", component: "SpellView" },
{ id: 2, name: "Equipment", component: "EquipmentView" },
{ id: 2, name: "Experiance", component: "ExperianceView" },
{ id: 3, name: "Weapon", component: "WeaponView" },
{ id: 4, name: "Spell", component: "SpellView" },
{ id: 5, name: "Equipment", component: "EquipmentView" },
{ id: 6, name: "Experiance", component: "ExperianceView" },
{ id: 6, name: "DeleteChar", component: "DeleteCharView" },
//{ id: 3, name: "History", component: "HistoryView" },
//{ id: 2, name: "Notes", component: "NotesView" },
//{ id: 2, name: "Campagne", component: "CampagneView" },
@@ -74,6 +79,7 @@ export default {
},
methods: {
changeView(view) {
this.lastView = this.currentView;
this.currentView = view;
},
},
+4 -4
View File
@@ -25,16 +25,16 @@
Heimat: {{ character.heimat || 'x' }}Alba,
Stand: {{ character.heimat || 'x' }}Mittelschicht.
</p>
<p>
Hort für Grad 3: 125 GS, für nächsten Grad: 250 GS.
<p v-if="character.rasse==='Zwerg'">
Hort für Grad {{ character.grad || 'x' }}: 125 GS, für nächsten Grad: 250 GS.
</p>
<p>
<strong>Spezialisierung:</strong> {{ character.spezialisierung || '-'}}.
</p>
<p>
Alter: {{ character.alter || 'xx' }},
<strong v-if="character.hand='rechts'"> Rechtshänder</strong>
<strong v-else-if="character.hand='links'"> Linkshänder</strong>
<strong v-if="character.hand=='rechts'"> Rechtshänder</strong>
<strong v-else-if="character.hand=='links'"> Linkshänder</strong>
<strong v-else> Beidhändig</strong>,
Größe: {{ character.groesse }}cm,
Gewicht: {{ character.gewicht }}kg,
@@ -0,0 +1,61 @@
<template>
<div class="cd-view">
<DeleteCharView
v-if="showDeleteDialog"
:character="character"
@deleted="handleDeleted"
@cancel="handleCancel"
/>
<p>Are you sure you want to delete {{ character.name }}?</p>
<button @click="deleteCharacter">Yes</button>
<button @click="$emit('cancel')">No</button>
</div>
</template>
<script>
export default {
name: "DeleteCharView",
props: {
character: {
type: Object,
required: true
}
},
methods: {
async deleteCharacter() {
try {
const response = await fetch(`/api/characters/${this.character.id}`, {
method: 'DELETE'
});
if (response.ok) {
this.$emit('deleted');
} else {
console.error('Failed to delete character');
}
} catch (error) {
console.error('Error:', error);
}
},
handleCancel() {
this.showDeleteDialog = false;
// Optional: Go back in router history
this.$router.go(-1);
},
handleDeleted() {
this.$router.push('/characters');
}
}
};
</script>
<style>
/*
.cd-view {
text-align: center;
}
button {
margin: 5px;
}*/
</style>
+1 -1
View File
@@ -1,6 +1,6 @@
<template>
<div class="cd-view">
Experiance and Level information
</div> <!--- end character -datasheet-->
</template>
+2 -1
View File
@@ -28,6 +28,7 @@ export default {
History:'Logbuch',
Notes:'Notizen',
Campagne:'Kampagne',
DeleteChar:'Figur löschen',
//Character:'Charakter',
},
equipment:{
@@ -43,7 +44,7 @@ export default {
skill:{
name:'Name',
description:'Beschreibung',
value:'Fertigkeitswert',
value:'EW',
note:'Bemerkung',
bonus:'Bonus',
pp:'PP',
+4
View File
@@ -15,4 +15,8 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
server: {
//port: 8080,
host: ['192.168.0.48', 'localhost','terrra.local'],
},
})