diff --git a/settings.html b/settings.html
new file mode 100644
index 0000000..3803889
--- /dev/null
+++ b/settings.html
@@ -0,0 +1,472 @@
+
+
+
+
+
+
ActivityWatch Settings
+
+
+
+
+
+
+
+
Discovery Paths
+
Directories where ActivityWatch will search for watcher modules
+
+
+
+
+
+
Autostart
+
+
+
+
+
+
+
+
+
+
+
+
Autostart Modules
+
Modules that will automatically start when ActivityWatch launches
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index 57b16b3..6b9399d 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -493,10 +493,10 @@ dependencies = [
"fern 0.7.1",
"glob",
"lazy_static",
- "libc",
"log",
"nix",
"notify",
+ "rocket",
"serde",
"serde_json",
"shell-words",
@@ -508,7 +508,9 @@ dependencies = [
"tauri-plugin-opener",
"tauri-plugin-shell",
"tauri-plugin-single-instance",
+ "tokio",
"toml 0.9.5",
+ "urlencoding",
"winapi 0.3.9",
]
@@ -5420,6 +5422,7 @@ dependencies = [
"bytes",
"libc",
"mio",
+ "parking_lot",
"pin-project-lite",
"signal-hook-registry",
"socket2",
@@ -5795,6 +5798,12 @@ dependencies = [
"serde",
]
+[[package]]
+name = "urlencoding"
+version = "2.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
+
[[package]]
name = "urlpattern"
version = "0.3.0"
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index fb2c65c..78883c0 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -21,6 +21,9 @@ tauri-build = { version = "2.0.5", features = [] }
[dependencies]
shell-words = "1.1.0"
+urlencoding = "2.1"
+rocket = "0.5"
+tokio = { version = "1", features = ["full"] }
tauri = { version = "2.2.2", features = ["tray-icon"] }
tauri-plugin-shell = "2.2.0"
tauri-plugin-dialog = "2.2.0"
@@ -42,7 +45,6 @@ tauri-plugin-opener = "2"
glob = "0.3.1"
[target.'cfg(unix)'.dependencies]
nix = { version = "0.29.0", features = ["process", "signal"] }
-libc = "0.2"
[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = ["winuser", "jobapi2", "handleapi", "processthreadsapi", "winnt"] }
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 19e40bb..130274e 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -1,6 +1,12 @@
use aw_server::endpoints::build_rocket;
use lazy_static::lazy_static;
use notify::{Config, Event, EventKind, RecommendedWatcher, RecursiveMode, Watcher};
+use rocket::{
+ fairing::{Fairing, Info, Kind},
+ http::{Header, Status},
+ serde::json::Json,
+ Request, Response, State,
+};
use serde::{Deserialize, Serialize};
use std::env;
use std::fs::{create_dir_all, read_to_string, remove_file, write, OpenOptions};
@@ -279,14 +285,14 @@ impl ModuleEntry {
}
}
-#[derive(Debug, Serialize, Deserialize)]
+#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AutostartConfig {
pub enabled: bool,
pub minimized: bool,
pub modules: Vec