mirror of
https://github.com/ellmau/adf-obdd.git
synced 2025-12-19 09:29:36 +01:00
* Introduce separate server package * Implement basic visualization of solve response * Make fetch endpoint depend on environment * Introduce features flag for localhost cors support * Serve static files from './assets' directory * Add Dockerfile as example for server with frontend * Support multiple solving strategies * Support stable model semantics with nogoods * Introduce custom node type for nicer layout * Support more options and multiple models * Use standard example for adfs on the frontend * Use unoptimised hybrid step for better presentation * Upgrade frontend dependencies * Animate graph changes * Experiment with timeout on API endpoints * Relax CORS restrictions for local development * Add API for adding/deleting users; login; logout * Add API for uploading and solving adf problems * Add API for getting and updating user * Return early for parse and solve; Add Adf GET * Add Delete and Index endpoints for ADFs * Add basic UI for user endpoints * Enforce username and password to be set on login * Show colored snackbars * Allow file upload for ADF; fix some server bugs * Implement ADF Add Form and Overview * Add Detail View for ADF problems * Add docker-compose file for mongodb (development) * Add mongodb (DEV) data directory to dockerignore * Let unknown routes be handled by frontend * Add legal information page to frontend * Change G6 Graph layout slightly * Add missing doc comments to lib * Update legal information regarding cookies * Add project logos to frontend * Add help texts to frontend * Move DoubleLabeledGraph from lib to server * Give example for custom Adf datastructure in docs * Update README and Project Website * Update devskim.yml * Add READMEs for frontend and server --------- Co-authored-by: monsterkrampe <monsterkrampe@users.noreply.github.com>
38 lines
1005 B
Rust
38 lines
1005 B
Rust
use std::collections::HashSet;
|
|
use std::sync::Mutex;
|
|
use std::time::Duration;
|
|
|
|
use mongodb::Client;
|
|
use serde::Serialize;
|
|
|
|
use crate::adf::Strategy;
|
|
|
|
pub(crate) const COOKIE_DURATION: actix_web::cookie::time::Duration =
|
|
actix_web::cookie::time::Duration::minutes(30);
|
|
pub(crate) const COMPUTE_TIME: Duration = Duration::from_secs(120);
|
|
|
|
pub(crate) const ASSET_DIRECTORY: &str = "./assets";
|
|
|
|
pub(crate) const DB_NAME: &str = "adf-obdd";
|
|
pub(crate) const USER_COLL: &str = "users";
|
|
pub(crate) const ADF_COLL: &str = "adf-problems";
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize)]
|
|
#[serde(tag = "type", content = "content")]
|
|
pub(crate) enum Task {
|
|
Parse,
|
|
Solve(Strategy),
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
|
pub(crate) struct RunningInfo {
|
|
pub(crate) username: String,
|
|
pub(crate) adf_name: String,
|
|
pub(crate) task: Task,
|
|
}
|
|
|
|
pub(crate) struct AppState {
|
|
pub(crate) mongodb_client: Client,
|
|
pub(crate) currently_running: Mutex<HashSet<RunningInfo>>,
|
|
}
|