move breadcrumb controller to right dir

port info on server start
This commit is contained in:
lukas-heiligenbrunner 2022-12-09 15:44:27 +01:00
parent 4e7694f653
commit 7c3a80522f
5 changed files with 13 additions and 5 deletions

View File

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_breadcrumb/flutter_breadcrumb.dart'; import 'package:flutter_breadcrumb/flutter_breadcrumb.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../breadcrumb_controller.dart'; import 'breadcrumb_controller.dart';
class BreadCrumbPage extends StatefulWidget { class BreadCrumbPage extends StatefulWidget {
const BreadCrumbPage( const BreadCrumbPage(

View File

@ -6,7 +6,7 @@ import 'package:raid_manager/types/disk.dart';
import 'package:raid_manager/utils/disk_info_page.dart'; import 'package:raid_manager/utils/disk_info_page.dart';
import 'package:raid_manager/utils/file_formatter.dart'; import 'package:raid_manager/utils/file_formatter.dart';
import 'breadcrumb_controller.dart'; import 'breadcrumb_page/breadcrumb_controller.dart';
class DiskPage extends StatefulWidget { class DiskPage extends StatefulWidget {
const DiskPage({Key? key}) : super(key: key); const DiskPage({Key? key}) : super(key: key);

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../breadcrumb_controller.dart'; import '../breadcrumb_page/breadcrumb_controller.dart';
class DiskInfoPage extends StatefulWidget { class DiskInfoPage extends StatefulWidget {
const DiskInfoPage({Key? key}) : super(key: key); const DiskInfoPage({Key? key}) : super(key: key);

View File

@ -5,6 +5,7 @@ mod parser;
#[cfg(feature = "static")] #[cfg(feature = "static")]
mod embed; mod embed;
use rocket::error::ErrorKind;
use rocket::serde::json::Json; use rocket::serde::json::Json;
#[cfg(feature = "static")] #[cfg(feature = "static")]
use crate::embed::CustomHandler; use crate::embed::CustomHandler;
@ -23,11 +24,18 @@ fn get_disks() -> Json<Vec<Disk>> {
#[rocket::main] #[rocket::main]
async fn main() -> Result<(), rocket::Error> { async fn main() -> Result<(), rocket::Error> {
println!("init"); println!("init server");
println!("access at: http://127.0.0.1:8000/");
let b = rocket::build(); let b = rocket::build();
let b = b.mount("/api", routes![get_raid_devices, get_disks]); let b = b.mount("/api", routes![get_raid_devices, get_disks]);
#[cfg(feature = "static")] #[cfg(feature = "static")]
let b = b.mount("/", CustomHandler{}); let b = b.mount("/", CustomHandler{});
let _rocket = b.launch().await?; if let Err(_rocket) = b.launch().await {
match _rocket.kind() {
ErrorKind::Bind(_) => println!("Bind address already in use!"),
e => println!("{}", e.to_string())
}
}
Ok(()) Ok(())
} }