diff --git a/.gitignore b/.gitignore index 82e8fb40..eebe647b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ tarpaulin-report.html .env .env -tarpaulin-report.html +cobertura.xml diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..29660e8b --- /dev/null +++ b/Makefile @@ -0,0 +1,47 @@ +# WIP +default: build-frontend + cargo build + +run: build-frontend + cargo run + +dev-env: + cargo fetch + cd frontend; yarn install + +docs: + cargo doc --no-deps --workspace --all-features + +build-frontend: + cd frontend; yarn build + +test: migrate + cargo test + +xml-test-coverage: migrate + cargo tarpaulin -t 1200 --out Xml + +coverage: migrate + cargo tarpaulin -t 1200 --out Html + +release: build-frontend + cargo build --release + +clean: + cargo clean + cd frontend + yarn clean + +migrate: + cargo run --bin tests-migrate + +help: + @echo ' docs - build documentation' + @echo ' run - run developer instance' + @echo ' test - run unit and integration tests' + @echo ' migrate - run database migrations' + @echo ' dev-env - download dependencies' + @echo ' clean - drop builds and environments' + @echo ' coverage - build test coverage in HTML format' + @echo ' xml-coverage - build test coverage in XML for upload to codecov' + @echo '' diff --git a/frontend/src/main.rs b/frontend/src/main.rs index a4f9cff8..85080aec 100644 --- a/frontend/src/main.rs +++ b/frontend/src/main.rs @@ -114,6 +114,8 @@ pub mod panel { pub active: &'static SubPanel, } + const TITLE: &str = "Dashboard"; + impl Default for IndexPage { fn default() -> Self { IndexPage { diff --git a/frontend/templates/panel/add-site-key/index.html b/frontend/templates/panel/add-site-key/index.html new file mode 100644 index 00000000..e2bb2ecb --- /dev/null +++ b/frontend/templates/panel/add-site-key/index.html @@ -0,0 +1,48 @@ +
+
+ Add Site Key +
+
+ +
+ + +
+ + +
+ + + +
+ +
+ +
+ + + + +
+ +
diff --git a/frontend/templates/panel/header/index.html b/frontend/templates/panel/header/index.html new file mode 100644 index 00000000..bbab0382 --- /dev/null +++ b/frontend/templates/panel/header/index.html @@ -0,0 +1,3 @@ +
+ <. include!("./sidebar/index.html"); .> +
diff --git a/frontend/templates/panel/header/sidebar/index.html b/frontend/templates/panel/header/sidebar/index.html new file mode 100644 index 00000000..8199e3f8 --- /dev/null +++ b/frontend/templates/panel/header/sidebar/index.html @@ -0,0 +1,88 @@ + + diff --git a/frontend/templates/panel/help-banner/index.html b/frontend/templates/panel/help-banner/index.html new file mode 100644 index 00000000..52f3fbd9 --- /dev/null +++ b/frontend/templates/panel/help-banner/index.html @@ -0,0 +1,14 @@ + diff --git a/frontend/templates/panel/index.html b/frontend/templates/panel/index.html index 261bf0ca..63e45bd8 100644 --- a/frontend/templates/panel/index.html +++ b/frontend/templates/panel/index.html @@ -1,39 +1,356 @@ -<. include!("../components/headers.html"); .> <. include!("nav/index.html"); .> + + + + + + <.= TITLE .> + + -
-
-
- - -
-
- Hello Batman -
- 1 - - - + <. include!("./header/index.html"); .> + +
+ + <. include!("./taskbar/index.html"); .> + + <. include!("./help-banner/index.html"); .> + +
+ + + <. include!("./add-site-key/index.html"); .>
-
-
-
-
-
-
-
-
-
-
-
+ + + + + diff --git a/frontend/templates/panel/layout.html b/frontend/templates/panel/layout.html deleted file mode 100644 index cfec7e46..00000000 --- a/frontend/templates/panel/layout.html +++ /dev/null @@ -1,577 +0,0 @@ - - - - - - Document - - -
- - -
- - -
-
    - -
  • -
  • - -
  • -
  • - Profile -
  • - - -
  • - Notifications -
  • - -
  • - Profile -
  • -
- - - - - -
    -
  • - 1 - Add sitekey -
  • -
  • - 2 - Add client-side code snippets in places that you want to protext -
  • -
  • - 3 - Add servers-side verification logic -
  • -
- - -
- - -
-
- Add Site Key -
-
- -
- - -
- - -
- - - -
- -
- -
- - - - -
- -
-
- -
- - - diff --git a/frontend/templates/panel/main.scss b/frontend/templates/panel/main.scss deleted file mode 100644 index 260c57b6..00000000 --- a/frontend/templates/panel/main.scss +++ /dev/null @@ -1,37 +0,0 @@ -@use './vars'; - -/* - ---> diff --git a/frontend/templates/panel/nav/theme-toggle/index.html b/frontend/templates/panel/nav/theme-toggle/index.html deleted file mode 100644 index b46b4e12..00000000 --- a/frontend/templates/panel/nav/theme-toggle/index.html +++ /dev/null @@ -1,13 +0,0 @@ -
- - - -
diff --git a/frontend/templates/panel/style.html b/frontend/templates/panel/style.html deleted file mode 100644 index 8c277f21..00000000 --- a/frontend/templates/panel/style.html +++ /dev/null @@ -1,559 +0,0 @@ - diff --git a/frontend/templates/panel/taskbar/index.html b/frontend/templates/panel/taskbar/index.html new file mode 100644 index 00000000..30492b69 --- /dev/null +++ b/frontend/templates/panel/taskbar/index.html @@ -0,0 +1,20 @@ +
    + +
  • +
  • + +
  • +
  • + Profile +
  • + +
  • + Notifications +
  • + +
  • + Profile +
  • +
diff --git a/frontend/templates/panel/vars.scss b/frontend/templates/panel/vars.scss deleted file mode 100644 index e9617734..00000000 --- a/frontend/templates/panel/vars.scss +++ /dev/null @@ -1,4 +0,0 @@ -$page-content-blockColor: #fff; -$border-radius: 4px; -$black: #333; -$white: #fff; diff --git a/src/tests-migrate.rs b/src/tests-migrate.rs index 43e93282..377c6157 100644 --- a/src/tests-migrate.rs +++ b/src/tests-migrate.rs @@ -32,8 +32,8 @@ lazy_static! { #[cfg(not(tarpaulin_include))] #[actix_rt::main] async fn main() { - let data = Data::new().await; pretty_env_logger::init(); + let data = Data::new().await; sqlx::migrate!("./migrations/").run(&data.db).await.unwrap(); }