Started to design the general chat-page
This commit is contained in:
@@ -1,17 +1,14 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { RouterView } from 'vue-router';
|
import { RouterView } from 'vue-router';
|
||||||
import ProtectedData from './components/ProtectedData.vue';
|
import ProtectedData from './components/ProtectedData.vue';
|
||||||
|
import IndexPage from 'pages/IndexPage.vue';
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'App'
|
name: 'App'
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<header>
|
<IndexPage></IndexPage>
|
||||||
<img alt="Quasar logo" src="./assets/quasar-logo-vertical.svg" width="200vw"/>
|
|
||||||
|
|
||||||
<ProtectedData />
|
|
||||||
</header>
|
|
||||||
<router-view />
|
<router-view />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
34
src/components/MessageComponent.vue
Normal file
34
src/components/MessageComponent.vue
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
const props = defineProps({
|
||||||
|
ownMessage: Boolean,
|
||||||
|
timestamp: String,
|
||||||
|
message: String,
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="message" :class="{'sent' : props.ownMessage, 'received' : !props.ownMessage}">
|
||||||
|
<p style="margin-bottom: 0;">{{props.message}}</p>
|
||||||
|
<div style="text-align: right;">
|
||||||
|
<small style="margin-top: 0;">{{props.timestamp}}</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.message {
|
||||||
|
border-radius: 10px;
|
||||||
|
max-width: 15rem;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sent {
|
||||||
|
background: blue;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.received {
|
||||||
|
background: red;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,47 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<q-layout view="lHh Lpr lFf">
|
|
||||||
<q-header elevated>
|
|
||||||
<q-toolbar>
|
|
||||||
<q-btn
|
|
||||||
flat
|
|
||||||
dense
|
|
||||||
round
|
|
||||||
icon="menu"
|
|
||||||
aria-label="Menu"
|
|
||||||
@click="toggleLeftDrawer"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<q-toolbar-title>
|
|
||||||
Quasar App
|
|
||||||
</q-toolbar-title>
|
|
||||||
|
|
||||||
<div>Quasar v{{ $q.version }}</div>
|
|
||||||
</q-toolbar>
|
|
||||||
</q-header>
|
|
||||||
|
|
||||||
<q-drawer
|
|
||||||
v-model="leftDrawerOpen"
|
|
||||||
bordered
|
|
||||||
>
|
|
||||||
<q-list>
|
|
||||||
<q-item-label
|
|
||||||
header
|
|
||||||
>
|
|
||||||
Essential Links
|
|
||||||
</q-item-label>
|
|
||||||
|
|
||||||
<EssentialLink
|
|
||||||
v-for="link in linksList"
|
|
||||||
:key="link.title"
|
|
||||||
v-bind="link"
|
|
||||||
/>
|
|
||||||
</q-list>
|
|
||||||
</q-drawer>
|
|
||||||
|
|
||||||
<q-page-container>
|
|
||||||
<router-view />
|
|
||||||
</q-page-container>
|
|
||||||
</q-layout>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@@ -51,55 +9,4 @@ import EssentialLink, { EssentialLinkProps } from 'components/EssentialLink.vue'
|
|||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'MainLayout'
|
name: 'MainLayout'
|
||||||
});
|
});
|
||||||
|
|
||||||
const linksList: EssentialLinkProps[] = [
|
|
||||||
{
|
|
||||||
title: 'Docs',
|
|
||||||
caption: 'quasar.dev',
|
|
||||||
icon: 'school',
|
|
||||||
link: 'https://quasar.dev'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Github',
|
|
||||||
caption: 'github.com/quasarframework',
|
|
||||||
icon: 'code',
|
|
||||||
link: 'https://github.com/quasarframework'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Discord Chat Channel',
|
|
||||||
caption: 'chat.quasar.dev',
|
|
||||||
icon: 'chat',
|
|
||||||
link: 'https://chat.quasar.dev'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Forum',
|
|
||||||
caption: 'forum.quasar.dev',
|
|
||||||
icon: 'record_voice_over',
|
|
||||||
link: 'https://forum.quasar.dev'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Twitter',
|
|
||||||
caption: '@quasarframework',
|
|
||||||
icon: 'rss_feed',
|
|
||||||
link: 'https://twitter.quasar.dev'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Facebook',
|
|
||||||
caption: '@QuasarFramework',
|
|
||||||
icon: 'public',
|
|
||||||
link: 'https://facebook.quasar.dev'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'Quasar Awesome',
|
|
||||||
caption: 'Community Quasar projects',
|
|
||||||
icon: 'favorite',
|
|
||||||
link: 'https://awesome.quasar.dev'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
const leftDrawerOpen = ref(false);
|
|
||||||
|
|
||||||
function toggleLeftDrawer () {
|
|
||||||
leftDrawerOpen.value = !leftDrawerOpen.value;
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ console.log("ICH WAR HIER");
|
|||||||
try {
|
try {
|
||||||
const authenticated = await keycloak.init({
|
const authenticated = await keycloak.init({
|
||||||
onLoad: 'login-required',
|
onLoad: 'login-required',
|
||||||
redirectUri: 'http://localhost:8080/test/'
|
redirectUri: 'http://localhost:8080/'
|
||||||
}).then( (auth) => {
|
}).then( (auth) => {
|
||||||
console.log("Authenticated :" + authenticated);
|
console.log("Authenticated :" + authenticated);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,47 +1,38 @@
|
|||||||
<template>
|
<template>
|
||||||
<q-page class="row items-center justify-evenly">
|
<div style="width:100%;display: flex; align-items: center; justify-content: space-between;height:100vh;">
|
||||||
<example-component
|
<div style="background: gray; width: 30%;height:100%;padding: 20px;">
|
||||||
title="Example component"
|
<div>
|
||||||
active
|
<q-input filled v-model="searchQuery">
|
||||||
:todos="todos"
|
<template v-slot:prepend>
|
||||||
:meta="meta"
|
<q-icon name="search"></q-icon>
|
||||||
></example-component>
|
</template>
|
||||||
</q-page>
|
</q-input>
|
||||||
|
<p>{{searchQuery}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="background: white; width: 70%;height: 100%;">
|
||||||
|
|
||||||
|
<div id="messageContainer">
|
||||||
|
<MessageComponent message="Halo" timestamp="13:03" own-message></MessageComponent>
|
||||||
|
<MessageComponent message="Hallo na" timestamp="13:04"></MessageComponent>
|
||||||
|
<MessageComponent message="Blubber" timestamp="13:06"></MessageComponent>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { Todo, Meta } from '../components/models';
|
import MessageComponent from 'components/MessageComponent.vue';
|
||||||
import ExampleComponent from 'components/ExampleComponent.vue';
|
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'IndexPage'
|
name: 'IndexPage'
|
||||||
});
|
});
|
||||||
|
|
||||||
const todos = ref<Todo[]>([
|
const searchQuery = ref("")
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
content: 'ct1'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
content: 'ct2'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
content: 'ct3'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
content: 'ct4'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
content: 'ct5'
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
const meta = ref<Meta>({
|
|
||||||
totalCount: 1200
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<h1>Hallloooooooooo</h1>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -6,10 +6,6 @@ const routes: RouteRecordRaw[] = [
|
|||||||
component: () => import('layouts/MainLayout.vue'),
|
component: () => import('layouts/MainLayout.vue'),
|
||||||
children: [{ path: '', component: () => import('pages/IndexPage.vue') }],
|
children: [{ path: '', component: () => import('pages/IndexPage.vue') }],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/test',
|
|
||||||
component: () => import('pages/TestPage.vue')
|
|
||||||
},
|
|
||||||
|
|
||||||
// Always leave this as last one,
|
// Always leave this as last one,
|
||||||
// but you can also remove it
|
// but you can also remove it
|
||||||
|
|||||||
Reference in New Issue
Block a user