Compare commits
4 commits
fe87593b9b
...
9a693821ce
Author | SHA1 | Date | |
---|---|---|---|
9a693821ce | |||
f81590ff24 | |||
9bad76dcd6 | |||
6b4dd96d83 |
7 changed files with 4414 additions and 98 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -6,7 +6,7 @@ target/
|
||||||
|
|
||||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||||
Cargo.lock
|
# Cargo.lock
|
||||||
|
|
||||||
# These are backup files generated by rustfmt
|
# These are backup files generated by rustfmt
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
|
4314
Cargo.lock
generated
Normal file
4314
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -16,4 +16,8 @@ impl Database {
|
||||||
conn: sea_orm::Database::connect(options).await?,
|
conn: sea_orm::Database::connect(options).await?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn connection(&self) -> &DatabaseConnection {
|
||||||
|
&self.conn
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,9 @@ mod error;
|
||||||
|
|
||||||
pub use db::Database;
|
pub use db::Database;
|
||||||
pub use db::entity;
|
pub use db::entity;
|
||||||
|
use log::info;
|
||||||
|
use migration::Migrator;
|
||||||
|
use migration::MigratorTrait;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct AppConfig {
|
struct AppConfig {
|
||||||
|
@ -24,6 +27,10 @@ async fn main() -> std::io::Result<()> {
|
||||||
|
|
||||||
let database = Database::new(database_url.into()).await.unwrap();
|
let database = Database::new(database_url.into()).await.unwrap();
|
||||||
|
|
||||||
|
info!("Running migrations");
|
||||||
|
Migrator::up(database.connection(), None).await.unwrap();
|
||||||
|
info!("Migrations completed");
|
||||||
|
|
||||||
let redis_conn = connect_to_redis_database().await;
|
let redis_conn = connect_to_redis_database().await;
|
||||||
|
|
||||||
let app_config = AppConfig { ldap_auth: false };
|
let app_config = AppConfig { ldap_auth: false };
|
||||||
|
|
|
@ -1,26 +1,23 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { RouterLink, RouterView } from 'vue-router';
|
import { RouterLink, RouterView } from 'vue-router';
|
||||||
import HeaderNav from './components/HeaderNav.vue';
|
import HeaderNav from './components/HeaderNav.vue';
|
||||||
|
import { BoltIcon } from 'lucide-vue-next';
|
||||||
|
|
||||||
const isTeacher = false
|
const isTeacher = true;
|
||||||
const isLoggedIn = true
|
const isLoggedIn = true;
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="sticky top-0">
|
<header class="sticky top-0 z-50 bg-black w-full">
|
||||||
<header>
|
|
||||||
<HeaderNav :isLoggedIn="isLoggedIn" :isTeacher="isTeacher">
|
<HeaderNav :isLoggedIn="isLoggedIn" :isTeacher="isTeacher">
|
||||||
<template #left-icon>
|
<template #left-icon>
|
||||||
<BoltIcon class="icon" /> <!--Hier dann ein richtiges Logo rein-->
|
<BoltIcon class="icon" />
|
||||||
</template>
|
</template>
|
||||||
</HeaderNav>
|
</HeaderNav>
|
||||||
</header>
|
</header>
|
||||||
</div>
|
<div id="app" class="flex flex-col min-h-screen overflow-x-hidden">
|
||||||
|
<main class="flex-grow p-4">
|
||||||
<RouterView />
|
<RouterView />
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -20,16 +20,3 @@ a,
|
||||||
background-color: hsla(160, 100%, 37%, 0.2);
|
background-color: hsla(160, 100%, 37%, 0.2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1024px) {
|
|
||||||
body {
|
|
||||||
display: flex;
|
|
||||||
place-items: start;
|
|
||||||
}
|
|
||||||
|
|
||||||
#app {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
padding: 0 2rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<nav class="header-container">
|
<nav class="header-container">
|
||||||
<div class="left-icon">
|
<div class="left-icon">
|
||||||
<!-- Platzhalter für ein Icon -->
|
|
||||||
<slot name="left-icon"></slot>
|
<slot name="left-icon"></slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-items">
|
<div class="nav-items">
|
||||||
|
@ -12,8 +11,7 @@
|
||||||
<component :is="LogInIcon" class="icon" />
|
<component :is="LogInIcon" class="icon" />
|
||||||
Login
|
Login
|
||||||
</button>
|
</button>
|
||||||
|
<template v-if="isLoggedIn">
|
||||||
<template v-else>
|
|
||||||
<button class="nav-button">
|
<button class="nav-button">
|
||||||
<component :is="LogOutIcon" class="icon" />
|
<component :is="LogOutIcon" class="icon" />
|
||||||
Logout
|
Logout
|
||||||
|
@ -29,31 +27,40 @@
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { LogInIcon, LogOutIcon, BoltIcon } from 'lucide-vue-next';
|
import { LogInIcon, LogOutIcon, BoltIcon } from 'lucide-vue-next';
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
isLoggedIn: boolean;
|
isLoggedIn: boolean;
|
||||||
isTeacher: boolean;
|
isTeacher: boolean;
|
||||||
}>();
|
}>();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.header-container {
|
.header-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
}
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-items {
|
.left-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-items {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
}
|
align-items: center;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.nav-button {
|
.nav-button {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
|
@ -61,11 +68,11 @@
|
||||||
border: none;
|
border: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
height: 1rem;
|
height: 1rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue