This commit is contained in:
4
.github/workflows/github-actions-demo.yml
vendored
4
.github/workflows/github-actions-demo.yml
vendored
@@ -46,10 +46,10 @@ jobs:
|
|||||||
- name: Build the project
|
- name: Build the project
|
||||||
run: perseus --wasm-opt-version version_118 deploy --verbose
|
run: perseus --wasm-opt-version version_118 deploy --verbose
|
||||||
- name: Run clippy for server
|
- name: Run clippy for server
|
||||||
run: RUSTFLAGS="--cfg=engine" cargo clippy --all -- -D warnings
|
run: RUSTFLAGS="--cfg=engine" cargo clippy --all --future-incompat-report -- -D warnings
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Run clippy for frontend
|
- name: Run clippy for frontend
|
||||||
run: RUSTFLAGS="--cfg=client" cargo clippy --all -- -D warnings
|
run: RUSTFLAGS="--cfg=client" cargo clippy --all --future-incompat-report -- -D warnings
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: Check for formatting issues
|
- name: Check for formatting issues
|
||||||
run: cargo fmt --check
|
run: cargo fmt --check
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ sea-orm = { version = "0.12.0", features = [
|
|||||||
] }
|
] }
|
||||||
|
|
||||||
[target.'cfg(client)'.dependencies]
|
[target.'cfg(client)'.dependencies]
|
||||||
wasm-bindgen = "0.2"
|
wasm-bindgen = "0.2.93"
|
||||||
reqwest = { version = "0.11", features = ["json"] }
|
reqwest = { version = "0.11", features = ["json"] }
|
||||||
sea-orm = { version = "0.12.0" }
|
sea-orm = { version = "0.1" }
|
||||||
|
|
||||||
[lints.rust]
|
[lints.rust]
|
||||||
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(engine)', 'cfg(client)'] }
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(engine)', 'cfg(client)'] }
|
||||||
|
|||||||
@@ -2,14 +2,17 @@ use sycamore::prelude::*;
|
|||||||
|
|
||||||
#[derive(Prop)]
|
#[derive(Prop)]
|
||||||
pub struct LayoutProps<'a, G: Html> {
|
pub struct LayoutProps<'a, G: Html> {
|
||||||
pub title: &'a str,
|
pub _title: &'a str,
|
||||||
pub children: Children<'a, G>,
|
pub children: Children<'a, G>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Layout<'a, G: Html>(
|
pub fn Layout<'a, G: Html>(
|
||||||
cx: Scope<'a>,
|
cx: Scope<'a>,
|
||||||
LayoutProps { title: _, children }: LayoutProps<'a, G>,
|
LayoutProps {
|
||||||
|
_title: _,
|
||||||
|
children,
|
||||||
|
}: LayoutProps<'a, G>,
|
||||||
) -> View<G> {
|
) -> View<G> {
|
||||||
let children = children.call(cx);
|
let children = children.call(cx);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
mod components;
|
mod components;
|
||||||
mod endpoints;
|
mod endpoints;
|
||||||
|
#[allow(unused_imports)]
|
||||||
mod entity;
|
mod entity;
|
||||||
mod error_views;
|
mod error_views;
|
||||||
#[cfg(engine)]
|
#[cfg(engine)]
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
// (Server only) Routes
|
// (Server only) Routes
|
||||||
use crate::{endpoints::USER, entity::user};
|
use crate::{
|
||||||
|
endpoints::{MATCH, USER},
|
||||||
|
entity::{game, user},
|
||||||
|
};
|
||||||
use axum::{
|
use axum::{
|
||||||
extract::Json,
|
extract::Json,
|
||||||
routing::{post, Router},
|
routing::{post, Router},
|
||||||
@@ -7,10 +10,15 @@ use axum::{
|
|||||||
|
|
||||||
pub fn register_routes(app: Router) -> Router {
|
pub fn register_routes(app: Router) -> Router {
|
||||||
let app = app.route(USER, post(post_user));
|
let app = app.route(USER, post(post_user));
|
||||||
app
|
app.route(MATCH, post(post_match))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn post_user(user: String) -> Json<user::Model> {
|
async fn post_user(_user: String) -> Json<user::Model> {
|
||||||
|
// Update the store with the new match
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn post_match(_user: String) -> Json<game::Model> {
|
||||||
// Update the store with the new match
|
// Update the store with the new match
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ fn add_game_form_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, state: &'a PageStat
|
|||||||
};
|
};
|
||||||
|
|
||||||
view! { cx,
|
view! { cx,
|
||||||
Layout(title = "Add Game Results") {
|
Layout(_title = "Add Game Results") {
|
||||||
div (class = "flex flex-wrap") {
|
div (class = "flex flex-wrap") {
|
||||||
select {
|
select {
|
||||||
option (value="red")
|
option (value="red")
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
|
|
||||||
cfg_if::cfg_if! {
|
cfg_if::cfg_if! {
|
||||||
if #[cfg(engine)] {
|
if #[cfg(engine)] {
|
||||||
use std::thread;
|
|
||||||
use std::ops::Deref;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use sycamore::prelude::*;
|
|||||||
|
|
||||||
fn index_page<G: Html>(cx: Scope) -> View<G> {
|
fn index_page<G: Html>(cx: Scope) -> View<G> {
|
||||||
view! { cx,
|
view! { cx,
|
||||||
Layout(title = "Index") {
|
Layout(_title = "Index") {
|
||||||
// Anything we put in here will be rendered inside the `<main>` block of the layout
|
// Anything we put in here will be rendered inside the `<main>` block of the layout
|
||||||
p { "Hello World!" }
|
p { "Hello World!" }
|
||||||
br {}
|
br {}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ struct PageState {}
|
|||||||
|
|
||||||
fn one_v_one_board_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, _state: &'a PageStateRx) -> View<G> {
|
fn one_v_one_board_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, _state: &'a PageStateRx) -> View<G> {
|
||||||
view! { cx,
|
view! { cx,
|
||||||
Layout(title = "1v1 Leaderboard") {
|
Layout(_title = "1v1 Leaderboard") {
|
||||||
p { "leaderboard" }
|
p { "leaderboard" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ use sycamore::prelude::*;
|
|||||||
struct PageState {}
|
struct PageState {}
|
||||||
|
|
||||||
fn overall_board_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, _state: &'a PageStateRx) -> View<G> {
|
fn overall_board_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, _state: &'a PageStateRx) -> View<G> {
|
||||||
let global_state = Reactor::<G>::from_cx(cx).get_global_state::<AppStateRx>(cx);
|
let _global_state = Reactor::<G>::from_cx(cx).get_global_state::<AppStateRx>(cx);
|
||||||
|
|
||||||
view! { cx,
|
view! { cx,
|
||||||
Layout(title = "Overall Leaderboard") {
|
Layout(_title = "Overall Leaderboard") {
|
||||||
ul {
|
ul {
|
||||||
(View::new_fragment(
|
(View::new_fragment(
|
||||||
vec![],
|
vec![],
|
||||||
|
|||||||
Reference in New Issue
Block a user