Ok next the backend refactor ig2
This commit is contained in:
parent
2fd1e82889
commit
8627b1ccb9
BIN
backend/uploads/image-1727718908224
Normal file
BIN
backend/uploads/image-1727718908224
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 MiB |
BIN
backend/uploads/image-1727718925076
Normal file
BIN
backend/uploads/image-1727718925076
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 MiB |
@ -57,10 +57,8 @@ function OpenDatabaseWindow(){
|
|||||||
CreateWindow('database');
|
CreateWindow('database');
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(game, () => {
|
watch(in_game, () => {
|
||||||
if(game.value && in_game.value){
|
if(in_game.value){
|
||||||
AddSound(game.value);
|
|
||||||
|
|
||||||
// Check if we are dm
|
// Check if we are dm
|
||||||
is_dm.value = GetClient().is_dm;
|
is_dm.value = GetClient().is_dm;
|
||||||
}
|
}
|
||||||
|
29
client/src/views/partials/FixedBottomButtons.vue
Normal file
29
client/src/views/partials/FixedBottomButtons.vue
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<script setup>
|
||||||
|
import IconButton from '@/views/partials/game/IconButton.vue'
|
||||||
|
|
||||||
|
const props = defineProps(['plus', 'edit', 'view', 'remove']);
|
||||||
|
|
||||||
|
let plus = props.plus;
|
||||||
|
let edit = props.edit;
|
||||||
|
let view = props.view;
|
||||||
|
let remove = props.remove;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="fixed-bottom-buttons">
|
||||||
|
<IconButton v-show="plus" icon="/icons/iconoir/regular/plus.svg" :action="plus"></IconButton>
|
||||||
|
<IconButton v-show="edit" icon="/icons/iconoir/regular/edit-pencil.svg" :action="edit"></IconButton>
|
||||||
|
<IconButton v-show="view" icon="/icons/iconoir/solid/eye.svg" :action="view"></IconButton>
|
||||||
|
<IconButton v-show="remove" icon="/icons/iconoir/solid/trash.svg" :action="remove"></IconButton>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.fixed-bottom-buttons {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10px;
|
||||||
|
right: 10px;
|
||||||
|
z-index: 2;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
</style>
|
@ -3,8 +3,7 @@ import { onMounted, ref, watch } from 'vue';
|
|||||||
import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
|
import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
|
||||||
|
|
||||||
const props = defineProps(['done', 'editable']);
|
const props = defineProps(['done', 'editable']);
|
||||||
|
import FixedBottomButtons from './FixedBottomButtons.vue';
|
||||||
import IconButton from '../partials/game/IconButton.vue';
|
|
||||||
|
|
||||||
const editing = ref(false);
|
const editing = ref(false);
|
||||||
const isEditable = ref(true);
|
const isEditable = ref(true);
|
||||||
@ -62,17 +61,11 @@ defineExpose({
|
|||||||
<div v-show="!editing" class="preview">
|
<div v-show="!editing" class="preview">
|
||||||
<div class="document" ref="preview">
|
<div class="document" ref="preview">
|
||||||
</div>
|
</div>
|
||||||
|
<FixedBottomButtons v-show="isEditable" :edit="EditContent"></FixedBottomButtons>
|
||||||
<div class="fixed-bottom-buttons">
|
|
||||||
<IconButton v-show="isEditable" icon="/icons/iconoir/regular/edit-pencil.svg" :action="EditContent"></IconButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-show="editing" class="editor">
|
<div v-show="editing" class="editor">
|
||||||
<textarea class="editing" ref="editor"></textarea>
|
<textarea class="editing" ref="editor"></textarea>
|
||||||
|
<FixedBottomButtons v-show="isEditable" :view="PreviewContent"></FixedBottomButtons>
|
||||||
<div class="fixed-bottom-buttons">
|
|
||||||
<IconButton v-show="isEditable" icon="/icons/iconoir/solid/eye.svg" :action="PreviewContent"></IconButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -116,11 +109,4 @@ defineExpose({
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background-color: var(--color-background);
|
background-color: var(--color-background);
|
||||||
}
|
}
|
||||||
.fixed-bottom-buttons {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 10px;
|
|
||||||
right: 10px;
|
|
||||||
z-index: 2;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
@ -9,6 +9,7 @@ import BigIconTemplate from '@/views/partials/BigIconTemplate.vue';
|
|||||||
import { SetMinSize, SetResizable } from '@/services/Windows';
|
import { SetMinSize, SetResizable } from '@/services/Windows';
|
||||||
import { backendUrl } from '@/services/BackendURL';
|
import { backendUrl } from '@/services/BackendURL';
|
||||||
import { GetUser } from '@/services/User';
|
import { GetUser } from '@/services/User';
|
||||||
|
import FixedBottomButtons from '../partials/FixedBottomButtons.vue';
|
||||||
|
|
||||||
const props = defineProps(['data']);
|
const props = defineProps(['data']);
|
||||||
const data = props.data;
|
const data = props.data;
|
||||||
@ -35,6 +36,10 @@ onMounted(() => {
|
|||||||
else userIcon.value = "public/img/def-avatar.jpg";
|
else userIcon.value = "public/img/def-avatar.jpg";
|
||||||
}).catch((err) => console.log("Internal error"));
|
}).catch((err) => console.log("Internal error"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function RemoveUser(){
|
||||||
|
alert("Remove")
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -43,10 +48,15 @@ onMounted(() => {
|
|||||||
<WindowHandle :window="id" ref="handle"></WindowHandle>
|
<WindowHandle :window="id" ref="handle"></WindowHandle>
|
||||||
|
|
||||||
<BigIconTemplate :title="data.user.username" :img="userIcon">
|
<BigIconTemplate :title="data.user.username" :img="userIcon">
|
||||||
<div v-show="isAdmin">
|
<div v-if="props.data.editable || isAdmin">
|
||||||
Admin
|
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
|
||||||
|
</div>
|
||||||
</BigIconTemplate>
|
</BigIconTemplate>
|
||||||
|
|
||||||
|
<FixedBottomButtons v-if="isAdmin" :remove="RemoveUser"></FixedBottomButtons>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -3,11 +3,11 @@ import WindowHandle from '@/views/partials/WindowHandle.vue';
|
|||||||
|
|
||||||
import { onMounted, ref, shallowRef, watch } from 'vue';
|
import { onMounted, ref, shallowRef, watch } from 'vue';
|
||||||
import { ClearWindow, CreateWindow, ResetPosition, SetMinSize, SetResizable, SetSize, SetupHandle } from '@/services/Windows';
|
import { ClearWindow, CreateWindow, ResetPosition, SetMinSize, SetResizable, SetSize, SetupHandle } from '@/services/Windows';
|
||||||
import IconButton from '@/views/partials/game/IconButton.vue'
|
|
||||||
import ConceptList from '@/views/partials/ConceptList.vue';
|
import ConceptList from '@/views/partials/ConceptList.vue';
|
||||||
import { FetchConcepts, GetConcepts } from '@/services/Data';
|
import { FetchConcepts, GetConcepts } from '@/services/Data';
|
||||||
import Tabs from '@/views/partials/Tabs.vue';
|
import Tabs from '@/views/partials/Tabs.vue';
|
||||||
import { GetCampaignModuleName } from '@/services/Campaign';
|
import { GetCampaignModuleName } from '@/services/Campaign';
|
||||||
|
import FixedBottomButtons from '@/views/partials/FixedBottomButtons.vue';
|
||||||
|
|
||||||
const handle = ref(null);
|
const handle = ref(null);
|
||||||
|
|
||||||
@ -90,10 +90,7 @@ function ElementIcon(element){
|
|||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<FixedBottomButtons :plus="OpenCreateItemPrompt"></FixedBottomButtons>
|
||||||
<div class="fixed-bottom-buttons">
|
|
||||||
<IconButton icon="/icons/iconoir/regular/plus.svg" :action="OpenCreateItemPrompt"></IconButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -7,12 +7,11 @@ import { onMounted, ref, shallowRef, toRaw } from 'vue';
|
|||||||
import { SetupHandle, SetSize, ResetPosition } from '@/services/Windows';
|
import { SetupHandle, SetSize, ResetPosition } from '@/services/Windows';
|
||||||
import Api from '@/services/Api'
|
import Api from '@/services/Api'
|
||||||
|
|
||||||
import IconButton from '@/views/partials/game/IconButton.vue'
|
|
||||||
|
|
||||||
import WindowHandle from '@/views/partials/WindowHandle.vue';
|
import WindowHandle from '@/views/partials/WindowHandle.vue';
|
||||||
import ConceptList from '../../partials/ConceptList.vue';
|
import ConceptList from '@/views/partials/ConceptList.vue';
|
||||||
import { backendUrl } from '../../../services/BackendURL';
|
import { backendUrl } from '@/services/BackendURL';
|
||||||
import { ClearWindow, CreateChildWindow, CreateWindow } from '../../../services/Windows';
|
import { ClearWindow, CreateChildWindow } from '@/services/Windows';
|
||||||
|
import FixedBottomButtons from '@/views/partials/FixedBottomButtons.vue';
|
||||||
|
|
||||||
const handle = ref(null);
|
const handle = ref(null);
|
||||||
|
|
||||||
@ -104,9 +103,7 @@ function OpenCreateAccount(){
|
|||||||
:open="OpenAccount"
|
:open="OpenAccount"
|
||||||
></ConceptList>
|
></ConceptList>
|
||||||
|
|
||||||
<div class="fixed-bottom-buttons">
|
<FixedBottomButtons :plus="OpenCreateAccount"></FixedBottomButtons>
|
||||||
<IconButton icon="/icons/iconoir/regular/plus.svg" :action="OpenCreateAccount"></IconButton>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -116,14 +113,6 @@ function OpenCreateAccount(){
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fixed-bottom-buttons {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 10px;
|
|
||||||
right: 10px;
|
|
||||||
z-index: 2;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user