working dev web-ui
This commit is contained in:
parent
64580dcda7
commit
1d3196c56e
7 changed files with 69 additions and 11 deletions
|
@ -79,11 +79,12 @@ pub async fn start_coordinator(
|
||||||
jpeg_quality,
|
jpeg_quality,
|
||||||
);
|
);
|
||||||
|
|
||||||
state
|
// state
|
||||||
.pipeline
|
// .pipeline
|
||||||
.pipeline
|
// .pipeline
|
||||||
.set_state(State::Playing)
|
// .set_state(State::Playing)
|
||||||
.expect("Could not set pipeline state to playing");
|
// .expect("Could not set pipeline state to playing");
|
||||||
|
//
|
||||||
|
|
||||||
state.check_states().await;
|
state.check_states().await;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,13 @@ impl WebcamPipeline {
|
||||||
|
|
||||||
// All of the following errors are unrecoverable
|
// 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()
|
.build()
|
||||||
.context(BuildSnafu {
|
.context(BuildSnafu {
|
||||||
element: "mfvideosrc",
|
element: "mfvideosrc",
|
||||||
|
|
|
@ -50,7 +50,7 @@ async fn main() {
|
||||||
|
|
||||||
let (to_mec, mec) = async_channel::bounded::<ApplicationEvent>(10);
|
let (to_mec, mec) = async_channel::bounded::<ApplicationEvent>(10);
|
||||||
|
|
||||||
let coordinator = tokio::spawn(start_coordinator(
|
let _coordinator = tokio::spawn(start_coordinator(
|
||||||
mec,
|
mec,
|
||||||
to_mec.clone(),
|
to_mec.clone(),
|
||||||
config
|
config
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
use std::{collections::VecDeque, time::Duration};
|
use std::{collections::VecDeque, time::Duration};
|
||||||
|
|
||||||
|
use tracing::info;
|
||||||
|
|
||||||
const MAX_RECORDED_TIMES: usize = 10;
|
const MAX_RECORDED_TIMES: usize = 10;
|
||||||
const DEGRADED_TRACKER_TIME: u128 = 150;
|
const DEGRADED_TRACKER_TIME: u128 = 150;
|
||||||
|
|
||||||
|
@ -23,7 +25,8 @@ impl TrackerMetrics {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_gui(&mut self) {
|
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>) {
|
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
13
controller/static/feather.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,14 +1,49 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<link href="/static/css/main.css" rel="stylesheet"/>
|
<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/htmx@2.0.min.js"></script>
|
||||||
<script src="/static/index.js"></script>
|
<script src="/static/index.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="me-0 ms-auto justify-center text-white">
|
<nav class="bg-cyan-500">
|
||||||
Hello {{ name }}!
|
<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>
|
</div>
|
||||||
|
<script>
|
||||||
|
feather.replace();
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue