diff --git a/.vscode/settings.json b/.vscode/settings.json
index bcad4d9..7ed0999 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -3,6 +3,7 @@
"Frontend",
"Backend",
"Judger",
- "Testsuit"
+ "Testsuit",
+ "Grpc"
],
}
\ No newline at end of file
diff --git a/frontend/src/components/button.rs b/frontend/src/components/button.rs
index f5c8b64..0a675ad 100644
--- a/frontend/src/components/button.rs
+++ b/frontend/src/components/button.rs
@@ -24,11 +24,10 @@ pub fn Button(
disabled=disabled
id=id
on:click=move |e| {
- on_click
- .map(|f| {
- e.stop_propagation();
- f(e);
- });
+ if let Some(f) = on_click {
+ e.stop_propagation();
+ f(e);
+ }
}
>
diff --git a/frontend/src/components/modal.rs b/frontend/src/components/modal.rs
index f8f67d3..959837d 100644
--- a/frontend/src/components/modal.rs
+++ b/frontend/src/components/modal.rs
@@ -14,6 +14,8 @@ pub fn Modal(
#[prop(into, optional)] on_close: Option>,
children: Children,
) -> impl IntoView {
+ // FIXME: what is level for? color?
+ let _level = level;
view! {
}
}>
- {move || {
- r.get()
- .map(|v| v.map(|v|view!{
-
-
-
- {
- v.list.into_iter().map(|info| {
+ {move || {
+ r.get()
+ .map(|v| {
+ v
+ .map(|v| {
view! {
-
-
-
{info.title}
+
+
+
+
+ {v
+ .list
+ .into_iter()
+ .map(|info| {
+ view! {
+
+
+
+ {info.ac_rate} %
+
+
+ {info.submit_count}
+
+
+ {difficulty_color(info.difficulty)}
+
+
+ }
+ })
+ .collect_view()}
+
-
{info.ac_rate} %
-
{info.submit_count}
-
{difficulty_color(info.difficulty)}
+
+
+ {v
+ .previous_queries
+ .into_iter()
+ .enumerate()
+ .map(|(n, query)| {
+ view! {
+ -
+ back {n + 1} page
+
+ }
+ })
+ .collect_view()}
+
+
+
+
+ {v
+ .next_queries
+ .into_iter()
+ .enumerate()
+ .map(|(n, query)| {
+ view! {
+ -
+ next {n + 1} page
+
+ }
+ })
+ .collect_view()}
+
+
}
})
- .collect_view()
- }
-
-
-
- {
- v.previous_queries.into_iter().enumerate()
- .map(|(n,query)|view!{
- -
- back {n+1} page
-
- }).collect_view()
- }
-
-
- {
- v.next_queries.into_iter().enumerate()
- .map(|(n,query)|view!{
- -
- next {n+1} page
-
- }).collect_view()
- }
-
- }))
- }
- }
+ })
+ }}
+
}
diff --git a/grpc/build.rs b/grpc/build.rs
index 46c98c6..bf4368b 100644
--- a/grpc/build.rs
+++ b/grpc/build.rs
@@ -28,8 +28,7 @@ fn main() {
.file_descriptor_set_path(&descriptor_file)
.compile(&["proto/backend.proto", "proto/judger.proto"], &["proto"])
.unwrap();
- #[cfg(feature = "serde")]
- #[cfg(feature = "wkt")]
+ #[cfg(all(feature = "wkt", feature = "serde"))]
{
use prost_wkt_build::*;
let descriptor_bytes = std::fs::read(descriptor_file).unwrap();
diff --git a/grpc/src/lib.rs b/grpc/src/lib.rs
index c813a10..0f64bea 100644
--- a/grpc/src/lib.rs
+++ b/grpc/src/lib.rs
@@ -1,15 +1,18 @@
#[cfg(feature = "wkt")]
+#[allow(clippy::all, non_local_definitions)]
pub mod backend {
tonic::include_proto!("oj.backend");
}
#[cfg(feature = "backend")]
#[cfg(not(feature = "wkt"))]
+#[allow(clippy::all, non_local_definitions)]
pub mod backend {
tonic::include_proto!("oj.backend");
}
#[cfg(feature = "backend")]
+#[allow(clippy::all, non_local_definitions)]
pub mod judger {
tonic::include_proto!("oj.judger");
}