diff --git a/Cargo.lock b/Cargo.lock index 2116272..272f479 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,6 +23,12 @@ version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" +[[package]] +name = "anymap2" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" + [[package]] name = "argon2" version = "0.5.3" @@ -208,6 +214,12 @@ dependencies = [ "generic-array", ] +[[package]] +name = "boolinator" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" + [[package]] name = "bumpalo" version = "3.20.2" @@ -653,10 +665,11 @@ dependencies = [ "gloo-storage 0.4.0", "serde", "serde_json", + "theme", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "yew", + "yew 0.23.0", "yew-router", ] @@ -795,6 +808,44 @@ dependencies = [ "wasip3", ] +[[package]] +name = "gloo" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28999cda5ef6916ffd33fb4a7b87e1de633c47c0dc6d97905fee1cdaa142b94d" +dependencies = [ + "gloo-console 0.2.3", + "gloo-dialogs 0.1.1", + "gloo-events 0.1.2", + "gloo-file 0.2.3", + "gloo-history 0.1.5", + "gloo-net 0.3.1", + "gloo-render 0.1.1", + "gloo-storage 0.2.2", + "gloo-timers 0.2.6", + "gloo-utils 0.1.7", + "gloo-worker 0.2.1", +] + +[[package]] +name = "gloo" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd35526c28cc55c1db77aed6296de58677dbab863b118483a27845631d870249" +dependencies = [ + "gloo-console 0.3.0", + "gloo-dialogs 0.2.0", + "gloo-events 0.2.0", + "gloo-file 0.3.0", + "gloo-history 0.2.2", + "gloo-net 0.4.0", + "gloo-render 0.2.0", + "gloo-storage 0.3.0", + "gloo-timers 0.3.0", + "gloo-utils 0.2.0", + "gloo-worker 0.4.0", +] + [[package]] name = "gloo" version = "0.11.0" @@ -833,6 +884,19 @@ dependencies = [ "gloo-worker 0.6.0", ] +[[package]] +name = "gloo-console" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b7ce3c05debe147233596904981848862b068862e9ec3e34be446077190d3f" +dependencies = [ + "gloo-utils 0.1.7", + "js-sys", + "serde", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "gloo-console" version = "0.3.0" @@ -859,6 +923,16 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-dialogs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67062364ac72d27f08445a46cab428188e2e224ec9e37efdba48ae8c289002e6" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "gloo-dialogs" version = "0.2.0" @@ -879,6 +953,16 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-events" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b107f8abed8105e4182de63845afcc7b69c098b7852a813ea7462a320992fc" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "gloo-events" version = "0.2.0" @@ -899,6 +983,18 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-file" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d5564e570a38b43d78bdc063374a0c3098c4f0d64005b12f9bbe87e869b6d7" +dependencies = [ + "gloo-events 0.1.2", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "gloo-file" version = "0.3.0" @@ -924,6 +1020,22 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-history" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85725d90bf0ed47063b3930ef28e863658a7905989e9929a8708aab74a1d5e7f" +dependencies = [ + "gloo-events 0.1.2", + "gloo-utils 0.1.7", + "serde", + "serde-wasm-bindgen 0.5.0", + "serde_urlencoded", + "thiserror 1.0.69", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "gloo-history" version = "0.2.2" @@ -934,7 +1046,7 @@ dependencies = [ "gloo-events 0.2.0", "gloo-utils 0.2.0", "serde", - "serde-wasm-bindgen", + "serde-wasm-bindgen 0.6.5", "serde_urlencoded", "thiserror 1.0.69", "wasm-bindgen", @@ -951,13 +1063,55 @@ dependencies = [ "gloo-events 0.3.0", "gloo-utils 0.3.0", "serde", - "serde-wasm-bindgen", + "serde-wasm-bindgen 0.6.5", "serde_urlencoded", "thiserror 2.0.18", "wasm-bindgen", "web-sys", ] +[[package]] +name = "gloo-net" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a66b4e3c7d9ed8d315fd6b97c8b1f74a7c6ecbbc2320e65ae7ed38b7068cc620" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils 0.1.7", + "http 0.2.12", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror 1.0.69", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-net" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ac9e8288ae2c632fa9f8657ac70bfe38a1530f345282d7ba66a1f70b72b7dc4" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils 0.2.0", + "http 0.2.12", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror 1.0.69", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "gloo-net" version = "0.5.0" @@ -1000,6 +1154,16 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-render" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd9306aef67cfd4449823aadcd14e3958e0800aa2183955a309112a84ec7764" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + [[package]] name = "gloo-render" version = "0.2.0" @@ -1020,6 +1184,21 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-storage" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6ab60bf5dbfd6f0ed1f7843da31b41010515c745735c970e821945ca91e480" +dependencies = [ + "gloo-utils 0.1.7", + "js-sys", + "serde", + "serde_json", + "thiserror 1.0.69", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "gloo-storage" version = "0.3.0" @@ -1050,6 +1229,16 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "gloo-timers" version = "0.3.0" @@ -1072,6 +1261,19 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gloo-utils" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e" +dependencies = [ + "js-sys", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "gloo-utils" version = "0.2.0" @@ -1098,6 +1300,42 @@ dependencies = [ "web-sys", ] +[[package]] +name = "gloo-worker" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13471584da78061a28306d1359dd0178d8d6fc1c7c80e5e35d27260346e0516a" +dependencies = [ + "anymap2", + "bincode", + "gloo-console 0.2.3", + "gloo-utils 0.1.7", + "js-sys", + "serde", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-worker" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76495d3dd87de51da268fa3a593da118ab43eb7f8809e17eb38d3319b424e400" +dependencies = [ + "bincode", + "futures", + "gloo-utils 0.2.0", + "gloo-worker-macros 0.1.0", + "js-sys", + "pinned", + "serde", + "thiserror 1.0.69", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "gloo-worker" version = "0.5.0" @@ -1490,6 +1728,16 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "implicit-clone" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a9aa791c7b5a71b636b7a68207fdebf171ddfc593d9c8506ec4cbc527b6a84" +dependencies = [ + "implicit-clone-derive", + "indexmap", +] + [[package]] name = "implicit-clone" version = "0.6.0" @@ -2089,6 +2337,23 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prokio" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03b55e106e5791fa5a13abd13c85d6127312e8e09098059ca2bc9b03ca4cf488" +dependencies = [ + "futures", + "gloo 0.8.1", + "num_cpus", + "once_cell", + "pin-project", + "pinned", + "tokio", + "tokio-stream", + "wasm-bindgen-futures", +] + [[package]] name = "quote" version = "1.0.45" @@ -2290,6 +2555,17 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-wasm-bindgen" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + [[package]] name = "serde-wasm-bindgen" version = "0.6.5" @@ -2737,6 +3013,17 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "theme" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5379f4c4eb851af44d4d818ba43fac8cff83e9b8e624aedc8a3346ca45065fe" +dependencies = [ + "serde", + "web-sys", + "yew 0.21.0", +] + [[package]] name = "thiserror" version = "1.0.69" @@ -3459,6 +3746,31 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" +[[package]] +name = "yew" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f1a03f255c70c7aa3e9c62e15292f142ede0564123543c1cc0c7a4f31660cac" +dependencies = [ + "console_error_panic_hook", + "futures", + "gloo 0.10.0", + "implicit-clone 0.4.9", + "indexmap", + "js-sys", + "prokio", + "rustversion", + "serde", + "slab", + "thiserror 1.0.69", + "tokio", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "yew-macro 0.21.0", +] + [[package]] name = "yew" version = "0.23.0" @@ -3468,7 +3780,7 @@ dependencies = [ "console_error_panic_hook", "futures", "gloo 0.11.0", - "implicit-clone", + "implicit-clone 0.6.0", "indexmap", "js-sys", "rustversion", @@ -3481,7 +3793,22 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "yew-macro", + "yew-macro 0.23.0", +] + +[[package]] +name = "yew-macro" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fd8ca5166d69e59f796500a2ce432ff751edecbbb308ca59fd3fe4d0343de2" +dependencies = [ + "boolinator", + "once_cell", + "prettyplease", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.117", ] [[package]] @@ -3513,7 +3840,7 @@ dependencies = [ "urlencoding", "wasm-bindgen", "web-sys", - "yew", + "yew 0.23.0", "yew-router-macro", ] diff --git a/frontend/Cargo.toml b/frontend/Cargo.toml index 083c177..e4c6c43 100644 --- a/frontend/Cargo.toml +++ b/frontend/Cargo.toml @@ -26,3 +26,4 @@ gloo = "0.12.0" chrono = { workspace = true } chrono-tz = "0.10.4" wasm-bindgen = "0.2.120" +theme = { version = "0.0.3", features = ["yew"] } diff --git a/frontend/src/pages/basic_pages.rs b/frontend/src/pages/basic_pages.rs index 064f03c..27f3a34 100644 --- a/frontend/src/pages/basic_pages.rs +++ b/frontend/src/pages/basic_pages.rs @@ -56,11 +56,11 @@ pub fn home_component() -> Html { } html! { -
+
-

{ "You are logged in as: " }

-

{ &*name }

+ +

{ &*name }

} } diff --git a/frontend/src/pages/ticket.rs b/frontend/src/pages/ticket.rs index 0d980a5..ac27088 100644 --- a/frontend/src/pages/ticket.rs +++ b/frontend/src/pages/ticket.rs @@ -508,7 +508,7 @@ pub fn ticket_by_id_component(props: &TicketProps) -> Html { html! {

{ format!("Error: {}", e) }

} } else if let Some(t) = &*ticket { html! { -
+

{ format!("Ticket #{}", t.id) }

{ "Kategorie: " }{ &t.category }

{ "Betreff: " }{ &t.betreff }

@@ -676,21 +676,11 @@ pub fn all_tickets_component() -> Html { html! {
  • - to={crate::Route::TicketById{id: t.id}}>

    { format!("{} - #{}", t.betreff, t.id) }

    > -

    { &t.description }

    -

    { match t.status.as_str() { - "ToDo" => "Zu tun", - "InProgress" => "In Bearbeitung", - "Completed" => "Erledigt", - "Archived" => "Archiviert", - _ => "Ungültiger Status" - }}

    + to={crate::Route::TicketById{id: t.id}}>

    { format!("{}", t.betreff,) }

    >
  • }})} - - to={crate::Route::Ticket}>{ "Zurück zur Startseite" }> } } @@ -807,9 +797,9 @@ pub fn archived_tickets_component() -> Html { html! {

    { format!("Error: {}", e) }

    } } else { html! { -
      +
        { for tickets.iter().filter(|t| t.status == "Archived" && (user.is_admin || if let Some(uid) = user.id { t.user_id == uid } else { false })).map(|t| html! { -
        +
      • to={crate::Route::TicketById{id: t.id}}>

        { format!("{} - #{}", t.betreff, t.id) }

        >

        { &t.description }

        diff --git a/frontend/src/pages/user.rs b/frontend/src/pages/user.rs index 642e156..3f99738 100644 --- a/frontend/src/pages/user.rs +++ b/frontend/src/pages/user.rs @@ -428,7 +428,7 @@ pub fn all_users_component() -> Html {
          { for users.iter().map(|t| html! {
        • - to={crate::Route::UserByID{id: t.id}}>

          { format!("{} {}- #{}", t.first_name, t.last_name, t.id) }

          > + to={crate::Route::UserByID{id: t.id}}>

          { format!("{} {}", t.first_name, t.last_name) }

          >
        • })}
        @@ -670,7 +670,7 @@ pub fn user_by_id_component(props: &UserProps) -> Html { html! {

        { format!("Error: {}", e) }

        } } else if let Some(u) = &*user { html! { -
        +

        { "Vorname: " }{ &u.first_name }

        { "Nachname: " }{ &u.last_name }

        diff --git a/frontend/src/pages/utilities.rs b/frontend/src/pages/utilities.rs index 861cb99..ca67905 100644 --- a/frontend/src/pages/utilities.rs +++ b/frontend/src/pages/utilities.rs @@ -169,7 +169,7 @@ fn parse_room(r: i16) -> String { #[component(Diagnostics)] pub fn diagnostics_component() -> Html { html! { -
        +
        @@ -287,7 +287,7 @@ pub fn ticket_count_component() -> Html { }) .count(); html! { -
        +

        { "Offene Tickets" }

        { count }

        diff --git a/frontend/src/styles/components/_diagnostics.scss b/frontend/src/styles/components/_diagnostics.scss index 6628de7..7816a2e 100644 --- a/frontend/src/styles/components/_diagnostics.scss +++ b/frontend/src/styles/components/_diagnostics.scss @@ -47,6 +47,7 @@ flex: 1; min-width: 60px; height: 100%; + justify-content: end; .bar { width: 100%; diff --git a/frontend/src/styles/components/_home.scss b/frontend/src/styles/components/_home.scss index e69de29..955a580 100644 --- a/frontend/src/styles/components/_home.scss +++ b/frontend/src/styles/components/_home.scss @@ -0,0 +1,9 @@ +.login-status { + font-weight: bold; + margin: 4px 8px; +} + +.name { + font-size: 24px; + margin: 4px 8px; +} diff --git a/frontend/src/styles/components/_tickets.scss b/frontend/src/styles/components/_tickets.scss index 6e733b4..623d8be 100644 --- a/frontend/src/styles/components/_tickets.scss +++ b/frontend/src/styles/components/_tickets.scss @@ -18,17 +18,18 @@ margin:0 0; background-color: #90ff82; background-color: $rundbgbackgroundcolor; - padding-bottom: 96px; + padding-bottom: 8px; color: white; - padding-left: 32px; - padding-right: 32px; - padding-top: 96px; + padding-left: 8px; + padding-right: 8px; + padding-top: 8px; border-radius: 20px; border-color: #000000; border-style: double; box-shadow: 10px 10px 10px rgba(43, 43, 43, 0.8); font-size: 26px; list-style-type: none; + text-align: center; &.To-Do { @@ -46,14 +47,33 @@ &.Archived { background-color: #af69ee; } + + a { + text-decoration: none; + color: white; + } } .postits { display: grid; - grid-template-columns: auto auto auto; gap: 8px; margin-top: 96px; } .warning { color: #570000; } + +.ticket-count { + border-radius: 10px; + border: 2px solid black; + width: fit-content; + padding: 8px; + margin: 0 auto; + margin-bottom: 32px; + + h4 { + text-align: center; + font-size: 32px; + margin: 8px; + } +} diff --git a/frontend/src/styles/main.scss b/frontend/src/styles/main.scss index 796cad1..610a2be 100644 --- a/frontend/src/styles/main.scss +++ b/frontend/src/styles/main.scss @@ -60,7 +60,7 @@ body { display: flex; justify-content: center; flex-direction: column; - max-width: 40%; + max-width: 60%; margin: 0 auto; background-color: variables.$rundbgbackgroundcolor; padding-bottom: 96px; @@ -106,6 +106,11 @@ body { &.login { margin-top: 96px; + max-width: 40%; + } + + &.home { + padding-top: 16px; } }