working dev web-ui

This commit is contained in:
Nickiel12 2024-07-28 04:21:55 +00:00
parent 64580dcda7
commit 1d3196c56e
7 changed files with 69 additions and 11 deletions

View file

@ -79,11 +79,12 @@ pub async fn start_coordinator(
jpeg_quality,
);
state
.pipeline
.pipeline
.set_state(State::Playing)
.expect("Could not set pipeline state to playing");
// state
// .pipeline
// .pipeline
// .set_state(State::Playing)
// .expect("Could not set pipeline state to playing");
//
state.check_states().await;

View file

@ -22,7 +22,13 @@ impl WebcamPipeline {
// All of the following errors are unrecoverable
let source = ElementFactory::make("mfvideosrc")
let mut video_src = "";
if cfg!(windows) {
video_src = "mfvideosrc";
} else if cfg!(unix) {
video_src = "v4l2src";
}
let source = ElementFactory::make(video_src)
.build()
.context(BuildSnafu {
element: "mfvideosrc",

View file

@ -50,7 +50,7 @@ async fn main() {
let (to_mec, mec) = async_channel::bounded::<ApplicationEvent>(10);
let coordinator = tokio::spawn(start_coordinator(
let _coordinator = tokio::spawn(start_coordinator(
mec,
to_mec.clone(),
config

View file

@ -1,5 +1,7 @@
use std::{collections::VecDeque, time::Duration};
use tracing::info;
const MAX_RECORDED_TIMES: usize = 10;
const DEGRADED_TRACKER_TIME: u128 = 150;
@ -23,7 +25,8 @@ impl TrackerMetrics {
}
fn update_gui(&mut self) {
todo!("No gui channel sent yet");
info!("Trying to update the gui");
// todo!("No gui channel sent yet");
}
pub fn starting_connection(&mut self, fail_count: Option<usize>) {

File diff suppressed because one or more lines are too long

13
controller/static/feather.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -1,14 +1,49 @@
<html lang="en">
<head>
<link href="/static/css/main.css" rel="stylesheet"/>
<script src="/static/feather.min.js"></script>
<script src="/static/htmx@2.0.min.js"></script>
<script src="/static/index.js"></script>
</head>
<body>
<div class="me-0 ms-auto justify-center text-white">
Hello {{ name }}!
<nav class="bg-cyan-500">
<div class="mx-auto max-w-7xl px-2 sm:px-6 lg:px-8">
<div class="relative flex h-16 items-center justify-between">
<div class="flex flex-1 items-center justify-center sm:items-stretch sm:justify-start">
<div class="hidden sm:ml-6 sm:block">
<div class="flex space-x-4">
<!-- Current: "bg-gray-900 text-white", Default: "text-gray-300 hover:bg-gray-700 hover:text-white" -->
<a href="#" class="rounded-md bg-slate-800 px-3 py-2 text-sm font-medium text-white" aria-current="page">Dashboard</a>
</div>
</div>
<div class="me-0 ms-auto py-2">
<button class="rounded-full p-2 hover:bg-cyan-700 transition-colors">
<i data-feather="menu"></i>
</button>
</div>
</div>
</div>
</div>
</nav>
<div class="flex flex-row h-dvh w-100">
<div class="flex flex-col bg-neutral-300 h-dvh w-1/8">
<button class="rounded-full font-semibold mx-3 mt-2 px-4 py-2 text-white bg-cyan-600">Connect to Camera</button>
<button class="rounded-full font-semibold mx-3 mt-2 px-4 py-2 text-white bg-cyan-600">Connect to Computer</button>
</div>
<div class="bg-emerald-700 h-dvh w-7/8">
</div>
</div>
<script>
feather.replace();
</script>
</body>
</html>