Second commit
This commit is contained in:
38
frontend/app/components/viewer/statusbar/FetchStatus.vue
Normal file
38
frontend/app/components/viewer/statusbar/FetchStatus.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<script setup>
|
||||
import { ref,onMounted } from 'vue';
|
||||
const emitter = useEmitter();
|
||||
|
||||
const statusIcon = ref(null);
|
||||
const statusMessage = ref(null);
|
||||
|
||||
emitter.on("status-bar-update", (state) => {
|
||||
var preloadImage = new Image();
|
||||
preloadImage.src = '/icons/Pixelarticons/black/' + state.icon + ".svg";
|
||||
preloadImage.onload = function() {
|
||||
statusIcon.value.src = this.src;
|
||||
};
|
||||
statusMessage.value.innerText = state.text;
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
emitter.emit("status-bar-update", {text: "Hola", icon: "check"})
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<span class="status-text">
|
||||
<img class="icon" ref="statusIcon" src=""/>
|
||||
<span class="status-message" ref="statusMessage"></span>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.status-text {
|
||||
margin-left: 10px;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.status-message {
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
46
frontend/app/components/viewer/statusbar/StatusBar.vue
Normal file
46
frontend/app/components/viewer/statusbar/StatusBar.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<script setup>
|
||||
import FetchStatus from './FetchStatus.vue';
|
||||
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<div class="status-bar">
|
||||
<div class="left">
|
||||
<FetchStatus></FetchStatus>
|
||||
</div>
|
||||
<div class="center">
|
||||
</div>
|
||||
<div class="right">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.status-bar {
|
||||
flex-grow: 0;
|
||||
flex-shrink: 0;
|
||||
min-height: 24px;
|
||||
max-height: 24px;
|
||||
width: 100%;
|
||||
background-color: var(--top-bar-background-color);
|
||||
display: flex;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.left, .right {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.top-bar-title {
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user