minor ui tweaks

This commit is contained in:
iamBadgers
2025-07-13 11:14:33 -07:00
parent b21e763d65
commit b5f0e8afbb
2 changed files with 45 additions and 12 deletions

View File

@@ -48,7 +48,7 @@ const butts = () => {
</template> </template>
<style scoped> <style scoped>
/*header { header {
line-height: 1.5; line-height: 1.5;
} }
@@ -73,5 +73,5 @@ const butts = () => {
place-items: flex-start; place-items: flex-start;
flex-wrap: wrap; flex-wrap: wrap;
} }
}*/ }
</style> </style>

View File

@@ -2,27 +2,60 @@
<v-expansion-panel> <v-expansion-panel>
<v-expansion-panel-title> <v-expansion-panel-title>
<div class="d-flex flex-row"> <div class="d-flex flex-row">
<div class="charactername">{{ character.characterName || "Unkown Character"}}</div> <div class="charactername">{{ characterName }}</div>
<div class="playername"> ( {{ character.playerName || "Unkown Player"}} )</div> <div class="playername">( {{ playerName }} )</div>
</div> </div>
</v-expansion-panel-title> </v-expansion-panel-title>
<v-expansion-panel-text> <v-expansion-panel-text>
<div>Alias: {{ character.characterAlias }}</div> <div>Alias: {{ alias }}</div>
<slot></slot> <JsonEditorVue v-model="json" v-bind="editorConfig" />
</v-expansion-panel-text> </v-expansion-panel-text>
</v-expansion-panel> </v-expansion-panel>
</template> </template>
<style> <style>
.charactername { .charactername {
font-weight: bold; font-weight: bold;
margin-right: 10px; margin-right: 10px;
} }
</style> </style>
<script setup lang="ts"> <script setup lang="ts">
import { defineProps } from 'vue' import JsonEditorVue from 'json-editor-vue'
import { computed } from 'vue'
import { Character, ListCharacterRequest } from '../proto/character' import { Character, ListCharacterRequest } from '../proto/character'
const props = defineProps<{ character?: Character }>() const editorConfig = {
mainMenuBar: false,
navigationBar: false,
readOnly: true,
}
const {
character = {
playerName: 'Unkown Player',
characterName: 'Player Character',
characterAlias: ['No Alias'],
json: "",
},
} = defineProps<{ character?: Character }>()
const playerName = computed(() => {
return character.playerName || 'Unnamed Player'
})
const characterName = computed(() => {
return character.characterName || 'Unnamed Character'
})
const alias = computed(() => {
return (character.characterAlias || [])
.map((entry) => '"' + entry + '"')
.join(', ')
})
const json = computed(() => {
return character.json || '{}'
})
</script> </script>