Compare commits
1 commit
main
...
ci/fmt-non
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9e8533fc87 |
40 changed files with 201 additions and 5404 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
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
when:
|
|
||||||
- event: pull_request
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: "Run cargo check"
|
|
||||||
image: docker.nix-community.org/nixpkgs/nix-flakes
|
|
||||||
commands:
|
|
||||||
- nix shell github:nixos/nixpkgs/nixos-unstable#cargo github:nixos/nixpkgs/nixos-unstable#gcc
|
|
||||||
- cargo check --workspace --all-targets
|
|
|
@ -1,9 +0,0 @@
|
||||||
when:
|
|
||||||
- event: pull_request
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: "Run cargo clippy"
|
|
||||||
image: docker.nix-community.org/nixpkgs/nix-flakes
|
|
||||||
commands:
|
|
||||||
- nix shell github:nixos/nixpkgs/nixos-unstable#clippy github:nixos/nixpkgs/nixos-unstable#cargo github:nixos/nixpkgs/nixos-unstable#gcc
|
|
||||||
- cargo clippy
|
|
|
@ -1,9 +0,0 @@
|
||||||
when:
|
|
||||||
- event: pull_request
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: "Run cargo test"
|
|
||||||
image: docker.nix-community.org/nixpkgs/nix-flakes
|
|
||||||
commands:
|
|
||||||
- nix shell github:nixos/nixpkgs/nixos-unstable#cargo github:nixos/nixpkgs/nixos-unstable#gcc
|
|
||||||
- cargo test --workspace --all-targets
|
|
|
@ -2,7 +2,8 @@ when:
|
||||||
- event: pull_request
|
- event: pull_request
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Run treefmt"
|
- name: "Run check fmt"
|
||||||
image: docker.nix-community.org/nixpkgs/nix-flakes
|
image: docker.nix-community.org/nixpkgs/nix-flakes
|
||||||
commands:
|
commands:
|
||||||
- nix fmt -- --fail-on-change
|
- nix fmt
|
||||||
|
- git diff
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
steps:
|
|
||||||
- name: build-docker
|
|
||||||
image: docker:latest
|
|
||||||
commands:
|
|
||||||
- docker build -f backend.Dockerfile -t backend .
|
|
||||||
|
|
||||||
- name: login-forgejo
|
|
||||||
image: docker:latest
|
|
||||||
commands:
|
|
||||||
- docker login -u $$FORGEJO_USERNAME -p $$FORGEJO_PASSWORD git.mixel.cloud
|
|
||||||
environment:
|
|
||||||
FORGEJO_USERNAME:
|
|
||||||
from_secret: FORGEJO_USERNAME
|
|
||||||
FORGEJO_PASSWORD:
|
|
||||||
from_secret: FORGEJO_PASSWORD
|
|
||||||
|
|
||||||
|
|
||||||
- name: publish-forgejo
|
|
||||||
image: docker:latest
|
|
||||||
commands:
|
|
||||||
- export IMAGE_NAME=git.mixel.cloud/Turbo/peer-group-grading:$${CI_COMMIT_SHA:0:8}
|
|
||||||
- docker tag backend $$IMAGE_NAME
|
|
||||||
- docker push $$IMAGE_NAME
|
|
4284
Cargo.lock
generated
4284
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
members = ["crates/backend", "crates/migration"]
|
members = ["crates/backend", "crates/migration", "crates/xtask"]
|
||||||
resolver = "3"
|
resolver = "3"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
# ---- Stage 1: Build (Static Linking) ----
|
|
||||||
FROM rust:latest as builder
|
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
|
||||||
|
|
||||||
# Install the musl target and musl-tools
|
|
||||||
RUN rustup target add x86_64-unknown-linux-musl
|
|
||||||
RUN apt-get update && apt-get install -y musl-tools
|
|
||||||
|
|
||||||
# Create a .cargo directory and configure for static linking with musl
|
|
||||||
RUN mkdir -p .cargo
|
|
||||||
RUN echo '[target.x86_64-unknown-linux-musl]' > .cargo/config.toml
|
|
||||||
RUN echo 'linker = "rust-lld"' >> .cargo/config.toml
|
|
||||||
|
|
||||||
# Copy configuration and lock files needed to resolve dependencies
|
|
||||||
COPY Cargo.toml ./Cargo.toml
|
|
||||||
COPY Cargo.lock ./Cargo.lock
|
|
||||||
COPY crates/backend/Cargo.toml crates/backend/Cargo.toml
|
|
||||||
COPY crates/migration/Cargo.toml crates/migration/Cargo.toml
|
|
||||||
|
|
||||||
# Fetch dependencies based on the lock file.
|
|
||||||
RUN cargo fetch
|
|
||||||
|
|
||||||
# Copy the actual source code for all workspace members
|
|
||||||
COPY crates/backend/ crates/backend/
|
|
||||||
COPY crates/migration/ crates/migration/
|
|
||||||
|
|
||||||
# Build the release binary for the musl target
|
|
||||||
RUN cargo build --release --target x86_64-unknown-linux-musl
|
|
||||||
|
|
||||||
# Debug: List the built binaries to verify what we have
|
|
||||||
RUN ls -la /usr/src/app/target/x86_64-unknown-linux-musl/release/
|
|
||||||
|
|
||||||
# ---- Stage 2: Runtime ----
|
|
||||||
FROM alpine:latest
|
|
||||||
|
|
||||||
# Install minimal runtime dependencies (ca-certificates is often needed)
|
|
||||||
RUN apk add --no-cache ca-certificates
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copy only the statically linked compiled binary from the builder stage
|
|
||||||
COPY --from=builder /usr/src/app/target/x86_64-unknown-linux-musl/release/backend /app/backend
|
|
||||||
|
|
||||||
# Verify the binary exists and is executable
|
|
||||||
RUN ls -la /app && chmod +x /app/backend
|
|
||||||
|
|
||||||
# Expose the port the application listens on
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
# Set the command to run the application
|
|
||||||
CMD ["/app/backend"]
|
|
|
@ -1,15 +0,0 @@
|
||||||
meta {
|
|
||||||
name: Get user
|
|
||||||
type: http
|
|
||||||
seq: 2
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{api_base}}/user/:id
|
|
||||||
body: none
|
|
||||||
auth: inherit
|
|
||||||
}
|
|
||||||
|
|
||||||
params:path {
|
|
||||||
id: 293ef329-91b2-4912-ad5d-0277490c7b55
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
meta {
|
|
||||||
name: Get users
|
|
||||||
type: http
|
|
||||||
seq: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get {
|
|
||||||
url: {{api_base}}/user
|
|
||||||
body: none
|
|
||||||
auth: inherit
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
meta {
|
|
||||||
name: Logout User
|
|
||||||
type: http
|
|
||||||
seq: 5
|
|
||||||
}
|
|
||||||
|
|
||||||
post {
|
|
||||||
url: {{api_base}}/auth/logout
|
|
||||||
body: none
|
|
||||||
auth: inherit
|
|
||||||
}
|
|
|
@ -29,12 +29,5 @@ uuid = "1"
|
||||||
|
|
||||||
dotenvy = "0.15"
|
dotenvy = "0.15"
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
temp-env = "*"
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
serve = []
|
serve = []
|
||||||
|
|
||||||
[[bin]]
|
|
||||||
name = "backend"
|
|
||||||
path = "src/main.rs"
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
use actix_session::Session;
|
use actix_session::Session;
|
||||||
use actix_web::{
|
use actix_web::{
|
||||||
HttpRequest, HttpResponse, Responder, post,
|
post,
|
||||||
web::{self, ServiceConfig},
|
web::{self, ServiceConfig},
|
||||||
|
HttpResponse, Responder,
|
||||||
};
|
};
|
||||||
use log::debug;
|
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
use crate::{Database, error::ApiError};
|
use crate::{error::ApiError, Database};
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct LoginRequest {
|
struct LoginRequest {
|
||||||
|
@ -15,7 +15,7 @@ struct LoginRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn setup(cfg: &mut ServiceConfig) {
|
pub fn setup(cfg: &mut ServiceConfig) {
|
||||||
cfg.service(login).service(logout);
|
cfg.service(login);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[post("/login")]
|
#[post("/login")]
|
||||||
|
@ -30,20 +30,7 @@ async fn login(
|
||||||
.verify_local_user(&login_request.username, &login_request.password)
|
.verify_local_user(&login_request.username, &login_request.password)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if session.get::<String>("user").is_ok() {
|
|
||||||
return Err(ApiError::AlreadyLoggedIn);
|
|
||||||
}
|
|
||||||
|
|
||||||
session.insert("user", user_id)?;
|
session.insert("user", user_id)?;
|
||||||
|
|
||||||
Ok(HttpResponse::Ok())
|
Ok(HttpResponse::Ok())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[post("/logout")]
|
|
||||||
async fn logout(session: Session, request: HttpRequest) -> Result<impl Responder, ApiError> {
|
|
||||||
debug!("request cookies: {:?}", request.cookies());
|
|
||||||
debug!("Session entries: {:?}", session.entries());
|
|
||||||
session.purge();
|
|
||||||
debug!("Session entries after purge: {:?}", session.entries());
|
|
||||||
Ok(HttpResponse::Ok().body("Logged out successfully"))
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::{Database, entity, error::ApiError};
|
use crate::{entity, error::ApiError, Database};
|
||||||
use actix_web::{Responder, delete, get, post, put, web};
|
use actix_web::{delete, get, post, put, web, Responder};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use validator::Validate;
|
use validator::Validate;
|
||||||
|
|
||||||
|
@ -20,21 +20,13 @@ struct CreateUser {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("")]
|
#[get("")]
|
||||||
async fn get_users(
|
async fn get_users() -> impl Responder {
|
||||||
db: web::Data<Database>,
|
""
|
||||||
) -> Result<web::Json<Vec<entity::user::Model>>, ApiError> {
|
|
||||||
let users = db.get_users().await?;
|
|
||||||
Ok(web::Json(users))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/{id}")]
|
#[get("/{id}")]
|
||||||
async fn get_user(
|
async fn get_user() -> impl Responder {
|
||||||
db: web::Data<Database>,
|
""
|
||||||
id: web::Path<uuid::Uuid>,
|
|
||||||
) -> Result<web::Json<entity::user::Model>, ApiError> {
|
|
||||||
let user = db.get_user(id.into_inner()).await?;
|
|
||||||
|
|
||||||
Ok(web::Json(user.unwrap()))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[post("")]
|
#[post("")]
|
||||||
|
@ -56,11 +48,6 @@ async fn update_user() -> impl Responder {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[delete("/{id}")]
|
#[delete("/{id}")]
|
||||||
async fn delete_user(
|
async fn delete_user() -> impl Responder {
|
||||||
db: web::Data<Database>,
|
""
|
||||||
id: web::Path<uuid::Uuid>,
|
|
||||||
) -> Result<web::Json<String>, ApiError> {
|
|
||||||
let id = id.into_inner();
|
|
||||||
db.delete_user(id).await?;
|
|
||||||
Ok(web::Json(format!("User {} deleted", id)))
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,4 @@ impl Database {
|
||||||
conn: sea_orm::Database::connect(options).await?,
|
conn: sea_orm::Database::connect(options).await?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn connection(&self) -> &DatabaseConnection {
|
|
||||||
&self.conn
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,18 @@
|
||||||
use crate::error::ApiError;
|
use crate::error::ApiError;
|
||||||
use argon2::{
|
use argon2::{
|
||||||
|
password_hash::{rand_core::OsRng, PasswordHasher, SaltString},
|
||||||
Argon2, PasswordHash, PasswordVerifier,
|
Argon2, PasswordHash, PasswordVerifier,
|
||||||
password_hash::{PasswordHasher, SaltString, rand_core::OsRng},
|
|
||||||
};
|
};
|
||||||
use sea_orm::{
|
use sea_orm::{
|
||||||
ActiveModelTrait,
|
ActiveModelTrait,
|
||||||
ActiveValue::{NotSet, Set},
|
ActiveValue::{NotSet, Set},
|
||||||
ColumnTrait, DbErr, DeleteResult, EntityTrait, ModelTrait, QueryFilter, TransactionTrait,
|
ColumnTrait, DbErr, EntityTrait, ModelTrait, QueryFilter, TransactionTrait,
|
||||||
};
|
};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use crate::{Database, entity};
|
use crate::{entity, Database};
|
||||||
|
|
||||||
impl Database {
|
impl Database {
|
||||||
pub async fn get_users(&self) -> Result<Vec<entity::user::Model>, ApiError> {
|
|
||||||
let users = entity::user::Entity::find().all(&self.conn).await?;
|
|
||||||
|
|
||||||
Ok(users)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn get_user(&self, id: Uuid) -> Result<Option<entity::user::Model>, ApiError> {
|
|
||||||
let user = entity::user::Entity::find()
|
|
||||||
.filter(entity::user::Column::Id.eq(id))
|
|
||||||
.one(&self.conn)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
if user.is_none() {
|
|
||||||
return Err(ApiError::NotFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(user)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn create_user(
|
pub async fn create_user(
|
||||||
&self,
|
&self,
|
||||||
name: String,
|
name: String,
|
||||||
|
@ -101,18 +82,6 @@ impl Database {
|
||||||
Ok(user.id)
|
Ok(user.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn delete_user(&self, id: Uuid) -> Result<DeleteResult, ApiError> {
|
|
||||||
let user = entity::user::Entity::delete_by_id(id)
|
|
||||||
.exec(&self.conn)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
if user.rows_affected == 0 {
|
|
||||||
return Err(ApiError::NotFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(user)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn verify_ldap_user() {}
|
pub async fn verify_ldap_user() {}
|
||||||
|
|
||||||
pub async fn change_user_password() {}
|
pub async fn change_user_password() {}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use actix_web::{HttpResponse, ResponseError, cookie::time::error, http::StatusCode};
|
use actix_web::{cookie::time::error, http::StatusCode, HttpResponse, ResponseError};
|
||||||
use sea_orm::TransactionError;
|
use sea_orm::TransactionError;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ pub enum ApiError {
|
||||||
Argon2Error(String),
|
Argon2Error(String),
|
||||||
#[error("Session insert error: {0}")]
|
#[error("Session insert error: {0}")]
|
||||||
SessionInsertError(#[from] actix_session::SessionInsertError),
|
SessionInsertError(#[from] actix_session::SessionInsertError),
|
||||||
#[error("Already logged in")]
|
|
||||||
AlreadyLoggedIn,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ResponseError for ApiError {
|
impl ResponseError for ApiError {
|
||||||
|
@ -32,7 +30,6 @@ impl ResponseError for ApiError {
|
||||||
ApiError::ValidationError(..) => StatusCode::BAD_REQUEST,
|
ApiError::ValidationError(..) => StatusCode::BAD_REQUEST,
|
||||||
ApiError::Argon2Error(..) => StatusCode::INTERNAL_SERVER_ERROR,
|
ApiError::Argon2Error(..) => StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
ApiError::SessionInsertError(..) => StatusCode::INTERNAL_SERVER_ERROR,
|
ApiError::SessionInsertError(..) => StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
ApiError::AlreadyLoggedIn => StatusCode::BAD_REQUEST,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,14 @@
|
||||||
use actix_files::NamedFile;
|
use actix_files::NamedFile;
|
||||||
use actix_session::Session;
|
use actix_session::{storage::RedisSessionStore, SessionMiddleware};
|
||||||
use actix_session::{SessionMiddleware, storage::RedisSessionStore};
|
use actix_web::{cookie::Key, middleware::Logger, web, App, HttpResponse, HttpServer};
|
||||||
use actix_web::cookie::SameSite;
|
|
||||||
use actix_web::{App, HttpResponse, HttpServer, cookie::Key, middleware::Logger, web};
|
|
||||||
use log::debug;
|
use log::debug;
|
||||||
|
|
||||||
mod controller;
|
mod controller;
|
||||||
mod db;
|
mod db;
|
||||||
mod error;
|
mod error;
|
||||||
|
|
||||||
pub use db::Database;
|
|
||||||
pub use db::entity;
|
pub use db::entity;
|
||||||
use log::info;
|
pub use db::Database;
|
||||||
use migration::Migrator;
|
|
||||||
use migration::MigratorTrait;
|
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
struct AppConfig {
|
struct AppConfig {
|
||||||
|
@ -29,10 +24,6 @@ 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 };
|
||||||
|
@ -42,23 +33,14 @@ async fn main() -> std::io::Result<()> {
|
||||||
debug!("Secret Key {:?}", secret_key.master());
|
debug!("Secret Key {:?}", secret_key.master());
|
||||||
|
|
||||||
HttpServer::new(move || {
|
HttpServer::new(move || {
|
||||||
let session_middleware = SessionMiddleware::builder(redis_conn.clone(), secret_key.clone());
|
|
||||||
|
|
||||||
let session_middleware = if cfg!(debug_assertions) {
|
|
||||||
session_middleware.cookie_secure(false)
|
|
||||||
} else {
|
|
||||||
session_middleware
|
|
||||||
.cookie_same_site(SameSite::Strict)
|
|
||||||
.cookie_secure(true)
|
|
||||||
};
|
|
||||||
|
|
||||||
let session_middleware = session_middleware.build();
|
|
||||||
|
|
||||||
let app = App::new()
|
let app = App::new()
|
||||||
.app_data(web::Data::new(database.clone()))
|
.app_data(web::Data::new(database.clone()))
|
||||||
.app_data(web::Data::new(app_config.clone()))
|
.app_data(web::Data::new(app_config.clone()))
|
||||||
.wrap(Logger::default())
|
.wrap(Logger::default())
|
||||||
.wrap(session_middleware)
|
.wrap(SessionMiddleware::new(
|
||||||
|
redis_conn.clone(),
|
||||||
|
secret_key.clone(),
|
||||||
|
))
|
||||||
.service(web::scope("/api/v1").configure(controller::register_controllers));
|
.service(web::scope("/api/v1").configure(controller::register_controllers));
|
||||||
|
|
||||||
#[cfg(feature = "serve")]
|
#[cfg(feature = "serve")]
|
||||||
|
@ -98,120 +80,8 @@ fn build_database_url() -> String {
|
||||||
.map(|x| x.parse::<u16>().expect("DB_PORT is not a valid port"))
|
.map(|x| x.parse::<u16>().expect("DB_PORT is not a valid port"))
|
||||||
.unwrap_or(5432);
|
.unwrap_or(5432);
|
||||||
|
|
||||||
let result = format!(
|
format!(
|
||||||
"postgresql://{}:{}@{}:{}/{}",
|
"postgresql://{}:{}@{}:{}/{}",
|
||||||
db_user, db_password, db_host, db_port, db_name
|
db_user, db_password, db_host, db_port, db_name
|
||||||
);
|
)
|
||||||
|
|
||||||
println!("Database URL: {}", result);
|
|
||||||
result
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
use temp_env::{with_vars, with_vars_unset};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn build_database_url_with_defaults() {
|
|
||||||
temp_env::with_vars(
|
|
||||||
[
|
|
||||||
("DB_USER", None::<&str>),
|
|
||||||
("DB_NAME", None::<&str>),
|
|
||||||
("DB_PASSWORD", None::<&str>),
|
|
||||||
("DB_HOST", Some("localhost")),
|
|
||||||
("DB_PORT", None::<&str>),
|
|
||||||
],
|
|
||||||
|| {
|
|
||||||
let expected_url = "postgresql://pgg:pgg@localhost:5432/pgg";
|
|
||||||
let actual_url = build_database_url();
|
|
||||||
assert_eq!(
|
|
||||||
actual_url, expected_url,
|
|
||||||
"Database URL should use default values for unset env vars."
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn build_database_url_with_all_vars() {
|
|
||||||
with_vars(
|
|
||||||
[
|
|
||||||
("DB_USER", Some("testuser")),
|
|
||||||
("DB_NAME", Some("testdb")),
|
|
||||||
("DB_PASSWORD", Some("testpass")),
|
|
||||||
("DB_HOST", Some("otherhost.internal")),
|
|
||||||
("DB_PORT", Some("5433")),
|
|
||||||
],
|
|
||||||
|| {
|
|
||||||
let expected_url = "postgresql://testuser:testpass@otherhost.internal:5433/testdb";
|
|
||||||
let actual_url = build_database_url();
|
|
||||||
assert_eq!(
|
|
||||||
actual_url, expected_url,
|
|
||||||
"Database URL should use all provided env vars."
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[should_panic(expected = "DB_HOST must be set in .env")]
|
|
||||||
fn build_database_url_missing_host_panics() {
|
|
||||||
// Clear the environment variable completely
|
|
||||||
unsafe { std::env::remove_var("DB_HOST") };
|
|
||||||
build_database_url();
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn connect_to_redis_database_with_defaults() {
|
|
||||||
// This test requires a running Redis instance
|
|
||||||
// We're mocking the successful connection here
|
|
||||||
with_vars(
|
|
||||||
[
|
|
||||||
("REDIS_HOST", Some("localhost")),
|
|
||||||
("REDIS_PORT", None::<&str>),
|
|
||||||
],
|
|
||||||
|| {
|
|
||||||
let expected_conn_string = "redis://localhost:6379";
|
|
||||||
|
|
||||||
// Just verify the connection string format is correct
|
|
||||||
// Actual connection would need integration tests
|
|
||||||
let redis_host = dotenvy::var("REDIS_HOST").unwrap_or_default();
|
|
||||||
let redis_port = dotenvy::var("REDIS_PORT")
|
|
||||||
.map(|x| x.parse::<u16>().unwrap_or(6379))
|
|
||||||
.unwrap_or(6379);
|
|
||||||
let actual_conn_string = format!("redis://{}:{}", redis_host, redis_port);
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
actual_conn_string, expected_conn_string,
|
|
||||||
"Redis connection string should use default port when not specified."
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn connect_to_redis_database_with_custom_port() {
|
|
||||||
with_vars(
|
|
||||||
[
|
|
||||||
("REDIS_HOST", Some("redis.internal")),
|
|
||||||
("REDIS_PORT", Some("6380")),
|
|
||||||
],
|
|
||||||
|| {
|
|
||||||
let expected_conn_string = "redis://redis.internal:6380";
|
|
||||||
|
|
||||||
// Verify connection string format
|
|
||||||
let redis_host = dotenvy::var("REDIS_HOST").unwrap_or_default();
|
|
||||||
let redis_port = dotenvy::var("REDIS_PORT")
|
|
||||||
.map(|x| x.parse::<u16>().unwrap_or(6379))
|
|
||||||
.unwrap_or(6379);
|
|
||||||
let actual_conn_string = format!("redis://{}:{}", redis_host, redis_port);
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
actual_conn_string, expected_conn_string,
|
|
||||||
"Redis connection string should use specified host and port."
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,26 +13,21 @@ struct LoginRequest {
|
||||||
// HTTP POST endpoint for user login
|
// HTTP POST endpoint for user login
|
||||||
#[post("/login")]
|
#[post("/login")]
|
||||||
async fn login(credentials: web::Json<LoginRequest>) -> impl Responder {
|
async fn login(credentials: web::Json<LoginRequest>) -> impl Responder {
|
||||||
// Get LDAP server and base DN from environment variables or use defaults
|
|
||||||
let ldap_server = env::var("LDAP_SERVER").unwrap_or("ldap://127.0.0.1:389".to_string());
|
|
||||||
let base_dn = env::var("LDAP_BASE_DN").unwrap_or("dc=schule,dc=local".to_string());
|
|
||||||
|
|
||||||
// Authenticate user and return appropriate response
|
// Authenticate user and return appropriate response
|
||||||
match authenticate_user(&ldap_server, &base_dn, &credentials.username, &credentials.password) {
|
match authenticate_user(&credentials.username, &credentials.password) {
|
||||||
Ok(true) => HttpResponse::Ok().body("Login erfolgreich"), // Login successful
|
Ok(true) => HttpResponse::Ok().body("Login erfolgreich"), // Login successful
|
||||||
_ => HttpResponse::Unauthorized().body("Login fehlgeschlagen"), // Login failed
|
_ => HttpResponse::Unauthorized().body("Login fehlgeschlagen"), // Login failed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to authenticate user against LDAP server
|
// Function to authenticate user against LDAP server
|
||||||
fn authenticate_user(
|
fn authenticate_user(username: &str, password: &str) -> Result<bool, Box<dyn std::error::Error>> {
|
||||||
ldap_server: &str,
|
// Get LDAP server and base DN from environment variables or use defaults
|
||||||
base_dn: &str,
|
let ldap_server = env::var("LDAP_SERVER").unwrap_or("ldap://127.0.0.1:389".to_string());
|
||||||
username: &str,
|
let base_dn = env::var("LDAP_BASE_DN").unwrap_or("dc=schule,dc=local".to_string());
|
||||||
password: &str,
|
|
||||||
) -> Result<bool, Box<dyn std::error::Error>> {
|
|
||||||
// Establish connection to LDAP server
|
// Establish connection to LDAP server
|
||||||
let ldap = LdapConn::new(ldap_server)?;
|
let ldap = LdapConn::new(&ldap_server)?;
|
||||||
|
|
||||||
// Search for the user in the LDAP directory
|
// Search for the user in the LDAP directory
|
||||||
let (rs, _res) = ldap
|
let (rs, _res) = ldap
|
||||||
|
@ -49,7 +44,7 @@ fn authenticate_user(
|
||||||
let user_dn = SearchEntry::construct(entry).dn; // Extract user DN
|
let user_dn = SearchEntry::construct(entry).dn; // Extract user DN
|
||||||
|
|
||||||
// Reconnect and bind with user credentials
|
// Reconnect and bind with user credentials
|
||||||
let user_ldap = LdapConn::new(ldap_server)?;
|
let user_ldap = LdapConn::new(&ldap_server)?;
|
||||||
let auth_result = user_ldap.simple_bind(&user_dn, password)?.success();
|
let auth_result = user_ldap.simple_bind(&user_dn, password)?.success();
|
||||||
return Ok(auth_result.is_ok()); // Return true if authentication succeeds
|
return Ok(auth_result.is_ok()); // Return true if authentication succeeds
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,46 +1 @@
|
||||||
use ldap3::{LdapConn, Scope, SearchEntry};
|
|
||||||
|
|
||||||
/// Authenticates a user against an LDAP server.
|
|
||||||
///
|
|
||||||
/// # Arguments
|
|
||||||
/// * `ldap_server` - The LDAP server URL.
|
|
||||||
/// * `base_dn` - The base DN for the LDAP directory.
|
|
||||||
/// * `username` - The username to authenticate.
|
|
||||||
/// * `password` - The password for the user.
|
|
||||||
///
|
|
||||||
/// # Returns
|
|
||||||
/// * `Ok(true)` if authentication is successful.
|
|
||||||
/// * `Ok(false)` if authentication fails.
|
|
||||||
/// * `Err` if an error occurs during the process.
|
|
||||||
pub fn authenticate_user(
|
|
||||||
ldap_server: &str,
|
|
||||||
base_dn: &str,
|
|
||||||
username: &str,
|
|
||||||
password: &str,
|
|
||||||
) -> Result<bool, Box<dyn std::error::Error>> {
|
|
||||||
// Establish connection to LDAP server
|
|
||||||
let ldap = LdapConn::new(ldap_server)?;
|
|
||||||
|
|
||||||
// Search for the user in the LDAP directory
|
|
||||||
let (rs, _res) = ldap
|
|
||||||
.search(
|
|
||||||
&format!("ou=users,{}", base_dn), // Search under "ou=users"
|
|
||||||
Scope::Subtree, // Search all levels
|
|
||||||
&format!("(uid={})", username), // Filter by username
|
|
||||||
vec!["dn"], // Retrieve the distinguished name (DN)
|
|
||||||
)?
|
|
||||||
.success()?;
|
|
||||||
|
|
||||||
// If user is found, attempt to authenticate with their DN and password
|
|
||||||
if let Some(entry) = rs.into_iter().next() {
|
|
||||||
let user_dn = SearchEntry::construct(entry).dn; // Extract user DN
|
|
||||||
|
|
||||||
// Reconnect and bind with user credentials
|
|
||||||
let user_ldap = LdapConn::new(ldap_server)?;
|
|
||||||
let auth_result = user_ldap.simple_bind(&user_dn, password)?.success();
|
|
||||||
return Ok(auth_result.is_ok()); // Return true if authentication succeeds
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(false) // Return false if user is not found
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
use actix_web::{post, web, App, HttpResponse, HttpServer, Responder};
|
|
||||||
use serde::Deserialize;
|
|
||||||
use ldap::authenticate_user; // Import the library function
|
|
||||||
use std::env;
|
|
||||||
|
|
||||||
// Struct to deserialize login request payload
|
|
||||||
#[derive(Deserialize)]
|
|
||||||
struct LoginRequest {
|
|
||||||
username: String,
|
|
||||||
password: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
// HTTP POST endpoint for user login
|
|
||||||
#[post("/login")]
|
|
||||||
async fn login(credentials: web::Json<LoginRequest>) -> impl Responder {
|
|
||||||
// Get LDAP server and base DN from environment variables or use defaults
|
|
||||||
let ldap_server = env::var("LDAP_SERVER").unwrap_or("ldap://127.0.0.1:389".to_string());
|
|
||||||
let base_dn = env::var("LDAP_BASE_DN").unwrap_or("dc=schule,dc=local".to_string());
|
|
||||||
|
|
||||||
// Authenticate user and return appropriate response
|
|
||||||
match authenticate_user(&ldap_server, &base_dn, &credentials.username, &credentials.password) {
|
|
||||||
Ok(true) => HttpResponse::Ok().body("Login erfolgreich"), // Login successful
|
|
||||||
_ => HttpResponse::Unauthorized().body("Login fehlgeschlagen"), // Login failed
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Main function to start the Actix Web server
|
|
||||||
#[actix_web::main]
|
|
||||||
async fn main() -> std::io::Result<()> {
|
|
||||||
env_logger::init(); // Initialize logger
|
|
||||||
|
|
||||||
// Start HTTP server and bind to localhost:8080
|
|
||||||
HttpServer::new(|| App::new().service(login))
|
|
||||||
.bind(("127.0.0.1", 8080))?
|
|
||||||
.run()
|
|
||||||
.await
|
|
||||||
}
|
|
|
@ -52,26 +52,6 @@ services:
|
||||||
interval: 30s
|
interval: 30s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|
||||||
backend:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: ./backend.Dockerfile
|
|
||||||
image: peer-group-grading:latest
|
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
|
||||||
DB_NAME: ${DB_NAME}
|
|
||||||
DB_USER: ${DB_USER}
|
|
||||||
DB_PASSWORD: ${DB_PASSWORD}
|
|
||||||
DB_HOST: db
|
|
||||||
DB_PORT: 5432
|
|
||||||
REDIS_HOST: redis
|
|
||||||
REDIS_PORT: 6379
|
|
||||||
ports:
|
|
||||||
- "8080:8080"
|
|
||||||
depends_on:
|
|
||||||
- db
|
|
||||||
- redis
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
redis:
|
redis:
|
||||||
|
|
97
flake.nix
97
flake.nix
|
@ -24,69 +24,58 @@
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
corepack_latest
|
corepack_latest
|
||||||
nodejs
|
nodejs
|
||||||
cargo
|
|
||||||
clippy
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
packages = forSystems (
|
|
||||||
system:
|
|
||||||
let
|
|
||||||
pkgs = pkgs' system;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
fmt = pkgs.treefmt.withConfig {
|
|
||||||
runtimeInputs = with pkgs; [
|
|
||||||
nixfmt-rfc-style
|
|
||||||
nodePackages.prettier
|
|
||||||
rustfmt
|
|
||||||
];
|
|
||||||
settings = {
|
|
||||||
tree-root-file = ".git/index";
|
|
||||||
formatter = {
|
|
||||||
nixfmt = {
|
|
||||||
command = "nixfmt";
|
|
||||||
includes = [ "*.nix" ];
|
|
||||||
};
|
|
||||||
rustfmt = {
|
|
||||||
command = "rustfmt";
|
|
||||||
options = [
|
|
||||||
"--edition"
|
|
||||||
"2018"
|
|
||||||
];
|
|
||||||
includes = [ "*.rs" ];
|
|
||||||
};
|
|
||||||
prettier = {
|
|
||||||
command = "prettier";
|
|
||||||
options = [ "--write" ];
|
|
||||||
excludes = [ "pnpm-lock.yaml" ];
|
|
||||||
includes = [
|
|
||||||
"*.css"
|
|
||||||
"*.html"
|
|
||||||
"*.js"
|
|
||||||
"*.json"
|
|
||||||
"*.jsx"
|
|
||||||
"*.md"
|
|
||||||
"*.mdx"
|
|
||||||
"*.scss"
|
|
||||||
"*.ts"
|
|
||||||
"*.yaml"
|
|
||||||
"*.yml"
|
|
||||||
"*.vue"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
formatter = forSystems (
|
formatter = forSystems (
|
||||||
system:
|
system:
|
||||||
let
|
let
|
||||||
pkgs = pkgs' system;
|
pkgs = pkgs' system;
|
||||||
in
|
in
|
||||||
self.outputs.packages.${system}.fmt
|
pkgs.treefmt.withConfig {
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
nixfmt-rfc-style
|
||||||
|
nodePackages.prettier
|
||||||
|
rustfmt
|
||||||
|
];
|
||||||
|
settings = {
|
||||||
|
tree-root-file = ".git/index";
|
||||||
|
formatter = {
|
||||||
|
nixfmt = {
|
||||||
|
command = "nixfmt";
|
||||||
|
includes = [ "*.nix" ];
|
||||||
|
};
|
||||||
|
rustfmt = {
|
||||||
|
command = "rustfmt";
|
||||||
|
options = [
|
||||||
|
"--edition"
|
||||||
|
"2018"
|
||||||
|
];
|
||||||
|
includes = [ "*.rs" ];
|
||||||
|
};
|
||||||
|
prettier = {
|
||||||
|
command = "prettier";
|
||||||
|
options = [ "--write" ];
|
||||||
|
excludes = [ "pnpm-lock.yaml" ];
|
||||||
|
includes = [
|
||||||
|
"*.css"
|
||||||
|
"*.html"
|
||||||
|
"*.js"
|
||||||
|
"*.json"
|
||||||
|
"*.jsx"
|
||||||
|
"*.md"
|
||||||
|
"*.mdx"
|
||||||
|
"*.scss"
|
||||||
|
"*.ts"
|
||||||
|
"*.yaml"
|
||||||
|
"*.yml"
|
||||||
|
"*.vue"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,14 +14,9 @@
|
||||||
"format": "prettier --write src/"
|
"format": "prettier --write src/"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@primeuix/themes": "^1.0.1",
|
|
||||||
"@primevue/forms": "^4.3.3",
|
|
||||||
"lucide-vue-next": "^0.487.0",
|
|
||||||
"pinia": "^3.0.1",
|
"pinia": "^3.0.1",
|
||||||
"primevue": "^4.3.3",
|
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-router": "^4.5.0",
|
"vue-router": "^4.5.0"
|
||||||
"zod": "^3.24.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/node22": "^22.0.0",
|
"@tsconfig/node22": "^22.0.0",
|
||||||
|
|
|
@ -1,28 +1,85 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
|
||||||
import HeaderNav from './components/HeaderNav.vue'
|
|
||||||
import SideBar from './components/SideBar.vue'
|
|
||||||
import { RouterLink, RouterView } from 'vue-router'
|
import { RouterLink, RouterView } from 'vue-router'
|
||||||
|
import HelloWorld from './components/HelloWorld.vue'
|
||||||
const isTeacher = ref(true)
|
|
||||||
const isLoggedIn = ref(true)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="sticky top-0">
|
<header>
|
||||||
<header>
|
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />
|
||||||
<HeaderNav :isLoggedIn="isLoggedIn" :isTeacher="isTeacher">
|
|
||||||
<template #left-icon>
|
<div class="wrapper">
|
||||||
<BoltIcon class="icon" />
|
<HelloWorld msg="You did it!" />
|
||||||
<!--Hier dann ein richtiges Logo rein-->
|
|
||||||
</template>
|
<nav>
|
||||||
</HeaderNav>
|
<RouterLink to="/">Home</RouterLink>
|
||||||
</header>
|
<RouterLink to="/about">About</RouterLink>
|
||||||
</div>
|
</nav>
|
||||||
<SideBar :isLoggedIn="isLoggedIn" :isTeacher="isTeacher" />
|
</div>
|
||||||
<div>
|
</header>
|
||||||
<RouterView />
|
|
||||||
</div>
|
<RouterView />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped>
|
||||||
|
header {
|
||||||
|
line-height: 1.5;
|
||||||
|
max-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
display: block;
|
||||||
|
margin: 0 auto 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a.router-link-exact-active {
|
||||||
|
color: var(--color-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a.router-link-exact-active:hover {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 1rem;
|
||||||
|
border-left: 1px solid var(--color-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a:first-of-type {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1024px) {
|
||||||
|
header {
|
||||||
|
display: flex;
|
||||||
|
place-items: center;
|
||||||
|
padding-right: calc(var(--section-gap) / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
margin: 0 2rem 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
header .wrapper {
|
||||||
|
display: flex;
|
||||||
|
place-items: flex-start;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav {
|
||||||
|
text-align: left;
|
||||||
|
margin-left: -1rem;
|
||||||
|
font-size: 1rem;
|
||||||
|
|
||||||
|
padding: 1rem 0;
|
||||||
|
margin-top: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
@import './base.css';
|
@import './base.css';
|
||||||
|
|
||||||
#app {
|
#app {
|
||||||
margin-left: 325px;
|
max-width: 1280px;
|
||||||
margin-right: 20px;
|
margin: 0 auto;
|
||||||
|
padding: 2rem;
|
||||||
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
a,
|
a,
|
||||||
|
@ -18,3 +20,16 @@ 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: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#app {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
padding: 0 2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
<script setup lang="ts">
|
|
||||||
import { LogInIcon, LogOutIcon, BoltIcon } from 'lucide-vue-next'
|
|
||||||
|
|
||||||
defineProps<{
|
|
||||||
isLoggedIn: boolean
|
|
||||||
isTeacher: boolean
|
|
||||||
}>()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<nav class="header-container">
|
|
||||||
<div class="left-icon">
|
|
||||||
<!-- Platzhalter für ein Icon -->
|
|
||||||
<slot name="left-icon"></slot>
|
|
||||||
</div>
|
|
||||||
<div class="nav-items">
|
|
||||||
<button v-if="!isLoggedIn" class="nav-button">
|
|
||||||
<component :is="LogInIcon" class="icon" />
|
|
||||||
Login
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<template v-else>
|
|
||||||
<button class="nav-button">
|
|
||||||
<component :is="LogOutIcon" class="icon" />
|
|
||||||
Logout
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button v-if="isTeacher" class="nav-button">
|
|
||||||
<component :is="BoltIcon" class="icon" />
|
|
||||||
Lehrerverwaltung
|
|
||||||
</button>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.header-container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-items {
|
|
||||||
display: flex;
|
|
||||||
gap: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-button {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0.5rem;
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
cursor: pointer;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
width: 1rem;
|
|
||||||
height: 1rem;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,80 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="card">
|
|
||||||
<Menubar :model="items">
|
|
||||||
<template #item="{ item, props, hasSubmenu }">
|
|
||||||
<router-link v-if="item.route" v-slot="{ href, navigate }" :to="item.route" custom>
|
|
||||||
<a v-ripple :href="href" v-bind="props.action" @click="navigate">
|
|
||||||
<span :class="item.icon" />
|
|
||||||
<span>{{ item.label }}</span>
|
|
||||||
</a>
|
|
||||||
</router-link>
|
|
||||||
<a v-else v-ripple :href="item.url" :target="item.target" v-bind="props.action">
|
|
||||||
<span :class="item.icon" />
|
|
||||||
<span> n/A {{ item.label }}</span>
|
|
||||||
<span v-if="hasSubmenu" class="pi pi-fw pi-angle-down" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</Menubar>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import Menubar from 'primevue/menubar';
|
|
||||||
|
|
||||||
import { ref } from "vue";
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
|
|
||||||
const items = ref([
|
|
||||||
{
|
|
||||||
label: 'Home',
|
|
||||||
icon: 'pi pi-home',
|
|
||||||
route: '/'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Student',
|
|
||||||
icon: 'pi pi-graduation-cap',
|
|
||||||
route: '/Student'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Login',
|
|
||||||
icon: 'pi pi-graduation-cap',
|
|
||||||
route: '/Login'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Projects',
|
|
||||||
icon: 'pi pi-search',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
label: 'Components',
|
|
||||||
icon: 'pi pi-bolt'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Blocks',
|
|
||||||
icon: 'pi pi-server'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'UI Kit',
|
|
||||||
icon: 'pi pi-pencil'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Templates',
|
|
||||||
icon: 'pi pi-palette',
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
label: 'Apollo',
|
|
||||||
icon: 'pi pi-palette'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Ultima',
|
|
||||||
icon: 'pi pi-palette'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Contact',
|
|
||||||
icon: 'pi pi-envelope'
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
</script>
|
|
|
@ -1,54 +0,0 @@
|
||||||
<script setup lang="ts">
|
|
||||||
import Drawer from 'primevue/drawer'
|
|
||||||
import { ref } from 'vue'
|
|
||||||
import { useClassStore } from '@/stores/classStore'
|
|
||||||
import router from '@/router'
|
|
||||||
|
|
||||||
const store = useClassStore()
|
|
||||||
|
|
||||||
store.loadClasses()
|
|
||||||
|
|
||||||
defineProps<{
|
|
||||||
isLoggedIn: boolean
|
|
||||||
isTeacher: boolean
|
|
||||||
}>()
|
|
||||||
|
|
||||||
var elements = store.classInfoList
|
|
||||||
var visible = ref(true)
|
|
||||||
var closeIcon = ref(false)
|
|
||||||
|
|
||||||
function setClass(input: number) {
|
|
||||||
store.setActiveClass(input)
|
|
||||||
router.push({ name: 'about' })
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<Drawer
|
|
||||||
v-model:visible="visible"
|
|
||||||
:showCloseIcon="closeIcon"
|
|
||||||
:modal="false"
|
|
||||||
:dismissable="false"
|
|
||||||
v-on:hide="visible = true"
|
|
||||||
header="Sidebar"
|
|
||||||
v-if="isLoggedIn"
|
|
||||||
>
|
|
||||||
<div v-if="isTeacher">
|
|
||||||
<ul>
|
|
||||||
<li v-for="item in elements">
|
|
||||||
<p href="/about" @click="setClass(item.id)">{{ item.name }}</p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<ul>
|
|
||||||
<li>
|
|
||||||
<p href="/about">Offene/Abgegebene Evaluaionsbögen</p>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<p href="/about">Notenübersicht</p>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</Drawer>
|
|
||||||
</template>
|
|
|
@ -2,25 +2,13 @@ import './assets/main.css'
|
||||||
|
|
||||||
import { createApp } from 'vue'
|
import { createApp } from 'vue'
|
||||||
import { createPinia } from 'pinia'
|
import { createPinia } from 'pinia'
|
||||||
import PrimeVue from 'primevue/config'
|
|
||||||
import Aura from '@primeuix/themes/aura'
|
|
||||||
import Ripple from 'primevue/ripple'
|
|
||||||
import ToastService from 'primevue/toastservice';
|
|
||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
import router from './router'
|
import router from './router'
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
const pinia = createPinia()
|
|
||||||
|
|
||||||
app.use(PrimeVue, {
|
|
||||||
theme: {
|
|
||||||
preset: Aura,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
app.use(pinia)
|
|
||||||
app.use(ToastService);
|
|
||||||
app.use(createPinia())
|
app.use(createPinia())
|
||||||
app.use(router)
|
app.use(router)
|
||||||
app.directive('ripple', Ripple)
|
|
||||||
|
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHistory } from 'vue-router'
|
||||||
import TeacherView from '../views/TeacherView.vue'
|
import HomeView from '../views/HomeView.vue'
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(import.meta.env.BASE_URL),
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
routes: [
|
routes: [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'teacher',
|
name: 'home',
|
||||||
component: TeacherView,
|
component: HomeView,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/about',
|
path: '/about',
|
||||||
|
@ -17,18 +17,6 @@ const router = createRouter({
|
||||||
// which is lazy-loaded when the route is visited.
|
// which is lazy-loaded when the route is visited.
|
||||||
component: () => import('../views/AboutView.vue'),
|
component: () => import('../views/AboutView.vue'),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/Student',
|
|
||||||
name: 'Student',
|
|
||||||
|
|
||||||
component: () => import('../views/StudentView.vue'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/Login',
|
|
||||||
name: 'Login',
|
|
||||||
|
|
||||||
component: () => import('../views/LoginView.vue'),
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
import { ref, computed } from 'vue'
|
|
||||||
import { defineStore } from 'pinia'
|
|
||||||
interface State {
|
|
||||||
classInfoList: ClassInfo[]
|
|
||||||
classInfo: ClassInfo | null
|
|
||||||
}
|
|
||||||
|
|
||||||
export const useClassStore = defineStore('class', {
|
|
||||||
state: (): State => {
|
|
||||||
return {
|
|
||||||
classInfoList: [],
|
|
||||||
classInfo: null,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
loadClasses() {
|
|
||||||
/* Beispieldaten */
|
|
||||||
if (this.classInfoList.length < 1) {
|
|
||||||
this.classInfoList.push({ name: 'Steve', id: 1 })
|
|
||||||
this.classInfoList.push({ name: 'Garett', id: 2 })
|
|
||||||
this.classInfoList.push({ name: 'Natalie', id: 3 })
|
|
||||||
this.classInfoList.push({ name: 'Henry', id: 4 })
|
|
||||||
this.classInfoList.push({ name: 'Dawn', id: 5 })
|
|
||||||
}
|
|
||||||
},
|
|
||||||
setActiveClass(id: number) {
|
|
||||||
this.classInfoList.map((item) => {
|
|
||||||
if (item.id == id) {
|
|
||||||
this.classInfo = item
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
interface ClassInfo {
|
|
||||||
name: string
|
|
||||||
id: number
|
|
||||||
}
|
|
|
@ -1,46 +1,15 @@
|
||||||
<script setup lang="ts">
|
|
||||||
import Button from 'primevue/button'
|
|
||||||
import { useClassStore } from '@/stores/classStore'
|
|
||||||
import Accordion from 'primevue/accordion'
|
|
||||||
import AccordionPanel from 'primevue/accordionpanel'
|
|
||||||
import AccordionHeader from 'primevue/accordionheader'
|
|
||||||
import AccordionContent from 'primevue/accordioncontent'
|
|
||||||
|
|
||||||
const store = useClassStore()
|
|
||||||
</script>
|
|
||||||
<template>
|
<template>
|
||||||
<div class="about">
|
<div class="about">
|
||||||
<h1>{{ store.classInfo?.name }}</h1>
|
<h1>This is an about page</h1>
|
||||||
<Accordion value="0">
|
|
||||||
<AccordionPanel value="0">
|
|
||||||
<AccordionHeader>Lernfeld I</AccordionHeader>
|
|
||||||
<AccordionContent>
|
|
||||||
<Button>FE</Button>
|
|
||||||
<Button>LF</Button>
|
|
||||||
<Button>SuK</Button>
|
|
||||||
<Button>Wug</Button>
|
|
||||||
</AccordionContent>
|
|
||||||
</AccordionPanel>
|
|
||||||
<AccordionPanel value="1">
|
|
||||||
<AccordionHeader>Lernfeld II</AccordionHeader>
|
|
||||||
<AccordionContent>
|
|
||||||
<Button>FE</Button>
|
|
||||||
<Button>LF</Button>
|
|
||||||
<Button>SuK</Button>
|
|
||||||
<Button>Wug</Button>
|
|
||||||
</AccordionContent>
|
|
||||||
</AccordionPanel>
|
|
||||||
<AccordionPanel value="2">
|
|
||||||
<AccordionHeader>Lernfeld III</AccordionHeader>
|
|
||||||
<AccordionContent>
|
|
||||||
<Button>FE</Button>
|
|
||||||
<Button>LF</Button>
|
|
||||||
<Button>SuK</Button>
|
|
||||||
<Button>Wug</Button>
|
|
||||||
</AccordionContent>
|
|
||||||
</AccordionPanel>
|
|
||||||
</Accordion>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style></style>
|
<style>
|
||||||
|
@media (min-width: 1024px) {
|
||||||
|
.about {
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
9
frontend/src/views/HomeView.vue
Normal file
9
frontend/src/views/HomeView.vue
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import TheWelcome from '../components/TheWelcome.vue'
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<main>
|
||||||
|
<TheWelcome />
|
||||||
|
</main>
|
||||||
|
</template>
|
|
@ -1,76 +0,0 @@
|
||||||
<script setup>
|
|
||||||
import InputText from 'primevue/inputtext'
|
|
||||||
import Button from 'primevue/button'
|
|
||||||
import Message from 'primevue/message'
|
|
||||||
import Password from 'primevue/password'
|
|
||||||
import Checkbox from 'primevue/checkbox'
|
|
||||||
|
|
||||||
import { FormField } from '@primevue/forms'
|
|
||||||
import { Form } from '@primevue/forms'
|
|
||||||
import { zodResolver } from '@primevue/forms/resolvers/zod'
|
|
||||||
import { z } from 'zod'
|
|
||||||
import { useToast } from 'primevue/usetoast'
|
|
||||||
import { ref } from 'vue'
|
|
||||||
|
|
||||||
const remember = ref(false)
|
|
||||||
|
|
||||||
const toast = useToast()
|
|
||||||
|
|
||||||
const resolver = zodResolver(
|
|
||||||
z.object({
|
|
||||||
username: z.string().min(1, { message: 'Username is required.' }),
|
|
||||||
password: z.string().min(1, { message: 'Password is required.' }),
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
|
|
||||||
const onFormSubmit = ({ valid }) => {
|
|
||||||
if (valid) {
|
|
||||||
toast.add({ severity: 'success', summary: 'Form is submitted.', life: 3000 })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="Login">
|
|
||||||
<h1>This is the Login Page</h1>
|
|
||||||
</div>
|
|
||||||
<div class="card flex justify-center">
|
|
||||||
<Form :resolver @submit="onFormSubmit" class="flex flex-col gap-4 w-full sm:w-56">
|
|
||||||
<FormField
|
|
||||||
v-slot="$field"
|
|
||||||
as="section"
|
|
||||||
name="username"
|
|
||||||
initialValue=""
|
|
||||||
class="flex flex-col gap-2"
|
|
||||||
>
|
|
||||||
<InputText type="text" placeholder="Username" />
|
|
||||||
<Message v-if="$field?.invalid" severity="error" size="small" variant="simple">{{
|
|
||||||
$field.error?.message
|
|
||||||
}}</Message>
|
|
||||||
</FormField>
|
|
||||||
<FormField v-slot="$field" asChild name="password" initialValue="">
|
|
||||||
<section class="flex flex-col gap-2">
|
|
||||||
<Password type="text" placeholder="Password" :feedback="false" toggleMask fluid />
|
|
||||||
<Message v-if="$field?.invalid" severity="error" size="small" variant="simple">{{
|
|
||||||
$field.error?.message
|
|
||||||
}}</Message>
|
|
||||||
</section>
|
|
||||||
</FormField>
|
|
||||||
<Button type="submit" severity="secondary" label="Submit" />
|
|
||||||
</Form>
|
|
||||||
<div class="flex items-center gap-2">
|
|
||||||
<Checkbox v-model="remember" inputId="rememberme" binary />
|
|
||||||
<label for="rememberme"> Rememberme </label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
@media (min-width: 1024px) {
|
|
||||||
.about {
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,15 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="Student">
|
|
||||||
<h1>This is an Student page</h1>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
@media (min-width: 1024px) {
|
|
||||||
.about {
|
|
||||||
min-height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -1,35 +0,0 @@
|
||||||
<script setup lang="ts">
|
|
||||||
import { useClassStore } from '@/stores/classStore'
|
|
||||||
import Card from 'primevue/card'
|
|
||||||
import router from '@/router'
|
|
||||||
|
|
||||||
const store = useClassStore()
|
|
||||||
|
|
||||||
store.loadClasses()
|
|
||||||
|
|
||||||
var elements = store.classInfoList
|
|
||||||
|
|
||||||
function setClass(input: number) {
|
|
||||||
store.setActiveClass(input)
|
|
||||||
router.push({ name: 'about' })
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<Card v-for="item in elements" class="cards" href="/about" @click="setClass(item.id)">
|
|
||||||
<template #title>{{ item.name }}</template>
|
|
||||||
<template #content>
|
|
||||||
<p class="m-0">Klassebereich von: {{ item.name }}</p>
|
|
||||||
</template>
|
|
||||||
</Card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.cards {
|
|
||||||
outline-style: solid;
|
|
||||||
margin-top: 20px;
|
|
||||||
outline-color: gray;
|
|
||||||
}
|
|
||||||
</style>
|
|
120
pnpm-lock.yaml
generated
120
pnpm-lock.yaml
generated
|
@ -10,30 +10,15 @@ importers:
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@primeuix/themes':
|
|
||||||
specifier: ^1.0.1
|
|
||||||
version: 1.0.1
|
|
||||||
'@primevue/forms':
|
|
||||||
specifier: ^4.3.3
|
|
||||||
version: 4.3.3(vue@3.5.13(typescript@5.8.2))
|
|
||||||
lucide-vue-next:
|
|
||||||
specifier: ^0.487.0
|
|
||||||
version: 0.487.0(vue@3.5.13(typescript@5.8.2))
|
|
||||||
pinia:
|
pinia:
|
||||||
specifier: ^3.0.1
|
specifier: ^3.0.1
|
||||||
version: 3.0.1(typescript@5.8.2)(vue@3.5.13(typescript@5.8.2))
|
version: 3.0.1(typescript@5.8.2)(vue@3.5.13(typescript@5.8.2))
|
||||||
primevue:
|
|
||||||
specifier: ^4.3.3
|
|
||||||
version: 4.3.3(vue@3.5.13(typescript@5.8.2))
|
|
||||||
vue:
|
vue:
|
||||||
specifier: ^3.5.13
|
specifier: ^3.5.13
|
||||||
version: 3.5.13(typescript@5.8.2)
|
version: 3.5.13(typescript@5.8.2)
|
||||||
vue-router:
|
vue-router:
|
||||||
specifier: ^4.5.0
|
specifier: ^4.5.0
|
||||||
version: 4.5.0(vue@3.5.13(typescript@5.8.2))
|
version: 4.5.0(vue@3.5.13(typescript@5.8.2))
|
||||||
zod:
|
|
||||||
specifier: ^3.24.2
|
|
||||||
version: 3.24.2
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@tsconfig/node22':
|
'@tsconfig/node22':
|
||||||
specifier: ^22.0.0
|
specifier: ^22.0.0
|
||||||
|
@ -531,42 +516,6 @@ packages:
|
||||||
'@polka/url@1.0.0-next.28':
|
'@polka/url@1.0.0-next.28':
|
||||||
resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==}
|
resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==}
|
||||||
|
|
||||||
'@primeuix/forms@0.0.4':
|
|
||||||
resolution: {integrity: sha512-WKrxZPM9fPAEsM0xcTrOOJn86MbfOEzPwSwpO94Y7RtguWw+1nrvqYNzCcmVqO6zBi0BVMihoWxMKFIRzTOuZg==}
|
|
||||||
engines: {node: '>=12.11.0'}
|
|
||||||
|
|
||||||
'@primeuix/styled@0.5.1':
|
|
||||||
resolution: {integrity: sha512-5Ftw/KSauDPClQ8F2qCyCUF7cIUEY4yLNikf0rKV7Vsb8zGYNK0dahQe7CChaR6M2Kn+NA2DSBSk76ZXqj6Uog==}
|
|
||||||
engines: {node: '>=12.11.0'}
|
|
||||||
|
|
||||||
'@primeuix/styles@1.0.1':
|
|
||||||
resolution: {integrity: sha512-R7SX001ILHIJM9hh1opbsuOFFK8dOM8GY1y99jaCFnAc5gGy3mFPJMhoexRYV1a6UZ2YbfcsQVPbIhoONI1gfg==}
|
|
||||||
|
|
||||||
'@primeuix/themes@1.0.1':
|
|
||||||
resolution: {integrity: sha512-RllttI3oGTZa66UQDCIA2lPnJvO/xqtNpy+0eNql6fIxdS2AUg5n7L81jTZrHNZ+31T5OBzL/SGFCDycmHTz2g==}
|
|
||||||
|
|
||||||
'@primeuix/utils@0.4.1':
|
|
||||||
resolution: {integrity: sha512-5+1NLfyna+gLRPeFTo+xlR0tfPVLuVdidbeahAMLkQga5Rw0LxyUBCyD2/Zv2JkV69o2T+hpEDyddl3VdnYoBw==}
|
|
||||||
engines: {node: '>=12.11.0'}
|
|
||||||
|
|
||||||
'@primeuix/utils@0.5.3':
|
|
||||||
resolution: {integrity: sha512-7SGh7734wcF1/uK6RzO6Z6CBjGQ97GDHfpyl2F1G/c7R0z9hkT/V72ypDo82AWcCS7Ta07oIjDpOCTkSVZuEGQ==}
|
|
||||||
engines: {node: '>=12.11.0'}
|
|
||||||
|
|
||||||
'@primevue/core@4.3.3':
|
|
||||||
resolution: {integrity: sha512-kSkN5oourG7eueoFPIqiNX3oDT/f0I5IRK3uOY/ytz+VzTZp5yuaCN0Nt42ZQpVXjDxMxDvUhIdaXVrjr58NhQ==}
|
|
||||||
engines: {node: '>=12.11.0'}
|
|
||||||
peerDependencies:
|
|
||||||
vue: ^3.5.0
|
|
||||||
|
|
||||||
'@primevue/forms@4.3.3':
|
|
||||||
resolution: {integrity: sha512-GZYMd8wp+7/4DVMoGGUtRkAHw352peT3pgwgzaFYQqNIjxxGw9eI253XTxrppRCowrGJ2jEe80p9WfHi087B1g==}
|
|
||||||
engines: {node: '>=12.11.0'}
|
|
||||||
|
|
||||||
'@primevue/icons@4.3.3':
|
|
||||||
resolution: {integrity: sha512-ouQaxHyeFB6MSfEGGbjaK5Qv9efS1xZGetZoU5jcPm090MSYLFtroP1CuK3lZZAQals06TZ6T6qcoNukSHpK5w==}
|
|
||||||
engines: {node: '>=12.11.0'}
|
|
||||||
|
|
||||||
'@rollup/pluginutils@5.1.4':
|
'@rollup/pluginutils@5.1.4':
|
||||||
resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==}
|
resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==}
|
||||||
engines: {node: '>=14.0.0'}
|
engines: {node: '>=14.0.0'}
|
||||||
|
@ -1560,11 +1509,6 @@ packages:
|
||||||
lru-cache@5.1.1:
|
lru-cache@5.1.1:
|
||||||
resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
|
resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==}
|
||||||
|
|
||||||
lucide-vue-next@0.487.0:
|
|
||||||
resolution: {integrity: sha512-ilVgu9EHkfId7WSjmoPkzp13cuzpSGO5J16AmltjRHFoj6MlCBGY8BzsBU/ISKVlDheUxM+MsIYjNo/1hSEa6w==}
|
|
||||||
peerDependencies:
|
|
||||||
vue: '>=3.0.1'
|
|
||||||
|
|
||||||
magic-string@0.30.17:
|
magic-string@0.30.17:
|
||||||
resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==}
|
resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==}
|
||||||
|
|
||||||
|
@ -1769,10 +1713,6 @@ packages:
|
||||||
resolution: {integrity: sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==}
|
resolution: {integrity: sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
primevue@4.3.3:
|
|
||||||
resolution: {integrity: sha512-nooYVoEz5CdP3EhUkD6c3qTdRmpLHZh75fBynkUkl46K8y5rksHTjdSISiDijwTA5STQIOkyqLb+RM+HQ6nC1Q==}
|
|
||||||
engines: {node: '>=12.11.0'}
|
|
||||||
|
|
||||||
proto-list@1.2.4:
|
proto-list@1.2.4:
|
||||||
resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==}
|
resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==}
|
||||||
|
|
||||||
|
@ -2205,9 +2145,6 @@ packages:
|
||||||
resolution: {integrity: sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==}
|
resolution: {integrity: sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
zod@3.24.2:
|
|
||||||
resolution: {integrity: sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==}
|
|
||||||
|
|
||||||
snapshots:
|
snapshots:
|
||||||
|
|
||||||
'@ampproject/remapping@2.3.0':
|
'@ampproject/remapping@2.3.0':
|
||||||
|
@ -2613,47 +2550,6 @@ snapshots:
|
||||||
|
|
||||||
'@polka/url@1.0.0-next.28': {}
|
'@polka/url@1.0.0-next.28': {}
|
||||||
|
|
||||||
'@primeuix/forms@0.0.4':
|
|
||||||
dependencies:
|
|
||||||
'@primeuix/utils': 0.4.1
|
|
||||||
|
|
||||||
'@primeuix/styled@0.5.1':
|
|
||||||
dependencies:
|
|
||||||
'@primeuix/utils': 0.5.3
|
|
||||||
|
|
||||||
'@primeuix/styles@1.0.1':
|
|
||||||
dependencies:
|
|
||||||
'@primeuix/styled': 0.5.1
|
|
||||||
|
|
||||||
'@primeuix/themes@1.0.1':
|
|
||||||
dependencies:
|
|
||||||
'@primeuix/styled': 0.5.1
|
|
||||||
|
|
||||||
'@primeuix/utils@0.4.1': {}
|
|
||||||
|
|
||||||
'@primeuix/utils@0.5.3': {}
|
|
||||||
|
|
||||||
'@primevue/core@4.3.3(vue@3.5.13(typescript@5.8.2))':
|
|
||||||
dependencies:
|
|
||||||
'@primeuix/styled': 0.5.1
|
|
||||||
'@primeuix/utils': 0.5.3
|
|
||||||
vue: 3.5.13(typescript@5.8.2)
|
|
||||||
|
|
||||||
'@primevue/forms@4.3.3(vue@3.5.13(typescript@5.8.2))':
|
|
||||||
dependencies:
|
|
||||||
'@primeuix/forms': 0.0.4
|
|
||||||
'@primeuix/utils': 0.5.3
|
|
||||||
'@primevue/core': 4.3.3(vue@3.5.13(typescript@5.8.2))
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- vue
|
|
||||||
|
|
||||||
'@primevue/icons@4.3.3(vue@3.5.13(typescript@5.8.2))':
|
|
||||||
dependencies:
|
|
||||||
'@primeuix/utils': 0.5.3
|
|
||||||
'@primevue/core': 4.3.3(vue@3.5.13(typescript@5.8.2))
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- vue
|
|
||||||
|
|
||||||
'@rollup/pluginutils@5.1.4(rollup@4.37.0)':
|
'@rollup/pluginutils@5.1.4(rollup@4.37.0)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/estree': 1.0.6
|
'@types/estree': 1.0.6
|
||||||
|
@ -3711,10 +3607,6 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
yallist: 3.1.1
|
yallist: 3.1.1
|
||||||
|
|
||||||
lucide-vue-next@0.487.0(vue@3.5.13(typescript@5.8.2)):
|
|
||||||
dependencies:
|
|
||||||
vue: 3.5.13(typescript@5.8.2)
|
|
||||||
|
|
||||||
magic-string@0.30.17:
|
magic-string@0.30.17:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@jridgewell/sourcemap-codec': 1.5.0
|
'@jridgewell/sourcemap-codec': 1.5.0
|
||||||
|
@ -3887,16 +3779,6 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
parse-ms: 4.0.0
|
parse-ms: 4.0.0
|
||||||
|
|
||||||
primevue@4.3.3(vue@3.5.13(typescript@5.8.2)):
|
|
||||||
dependencies:
|
|
||||||
'@primeuix/styled': 0.5.1
|
|
||||||
'@primeuix/styles': 1.0.1
|
|
||||||
'@primeuix/utils': 0.5.3
|
|
||||||
'@primevue/core': 4.3.3(vue@3.5.13(typescript@5.8.2))
|
|
||||||
'@primevue/icons': 4.3.3(vue@3.5.13(typescript@5.8.2))
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- vue
|
|
||||||
|
|
||||||
proto-list@1.2.4: {}
|
proto-list@1.2.4: {}
|
||||||
|
|
||||||
punycode@2.3.1: {}
|
punycode@2.3.1: {}
|
||||||
|
@ -4309,5 +4191,3 @@ snapshots:
|
||||||
yocto-queue@0.1.0: {}
|
yocto-queue@0.1.0: {}
|
||||||
|
|
||||||
yoctocolors@2.1.1: {}
|
yoctocolors@2.1.1: {}
|
||||||
|
|
||||||
zod@3.24.2: {}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue