diff --git a/app/lib/breadcrumb_controller.dart b/app/lib/breadcrumb_page/breadcrumb_controller.dart similarity index 100% rename from app/lib/breadcrumb_controller.dart rename to app/lib/breadcrumb_page/breadcrumb_controller.dart diff --git a/app/lib/breadcrumb_page/breadcrumb_page.dart b/app/lib/breadcrumb_page/breadcrumb_page.dart index dcadb61..eed6b62 100644 --- a/app/lib/breadcrumb_page/breadcrumb_page.dart +++ b/app/lib/breadcrumb_page/breadcrumb_page.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_breadcrumb/flutter_breadcrumb.dart'; import 'package:provider/provider.dart'; -import '../breadcrumb_controller.dart'; +import 'breadcrumb_controller.dart'; class BreadCrumbPage extends StatefulWidget { const BreadCrumbPage( diff --git a/app/lib/disk_page.dart b/app/lib/disk_page.dart index ac92048..dc39654 100644 --- a/app/lib/disk_page.dart +++ b/app/lib/disk_page.dart @@ -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/file_formatter.dart'; -import 'breadcrumb_controller.dart'; +import 'breadcrumb_page/breadcrumb_controller.dart'; class DiskPage extends StatefulWidget { const DiskPage({Key? key}) : super(key: key); diff --git a/app/lib/utils/disk_info_page.dart b/app/lib/utils/disk_info_page.dart index cffd190..bbd0253 100644 --- a/app/lib/utils/disk_info_page.dart +++ b/app/lib/utils/disk_info_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../breadcrumb_controller.dart'; +import '../breadcrumb_page/breadcrumb_controller.dart'; class DiskInfoPage extends StatefulWidget { const DiskInfoPage({Key? key}) : super(key: key); diff --git a/lib/src/main.rs b/lib/src/main.rs index 8c7640d..64e0883 100644 --- a/lib/src/main.rs +++ b/lib/src/main.rs @@ -5,6 +5,7 @@ mod parser; #[cfg(feature = "static")] mod embed; +use rocket::error::ErrorKind; use rocket::serde::json::Json; #[cfg(feature = "static")] use crate::embed::CustomHandler; @@ -23,11 +24,18 @@ fn get_disks() -> Json> { #[rocket::main] 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 = b.mount("/api", routes![get_raid_devices, get_disks]); #[cfg(feature = "static")] 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(()) }