Rename web::interface to web::ui

This commit is contained in:
Lucien Greathouse
2019-09-03 13:58:44 -07:00
parent a31bfbefa7
commit 27517e1aee
2 changed files with 11 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
mod api;
mod interface;
mod ui;
mod util;
use std::sync::Arc;
@@ -13,11 +13,11 @@ use log::trace;
use crate::serve_session::ServeSession;
use self::{api::ApiService, interface::InterfaceService};
use self::{api::ApiService, ui::UiService};
pub struct RootService {
api: api::ApiService,
interface: interface::InterfaceService,
api: ApiService,
ui: UiService,
}
impl Service for RootService {
@@ -32,7 +32,7 @@ impl Service for RootService {
if request.uri().path().starts_with("/api") {
self.api.call(request)
} else {
self.interface.call(request)
self.ui.call(request)
}
}
}
@@ -41,7 +41,7 @@ impl RootService {
pub fn new(serve_session: Arc<ServeSession>) -> RootService {
RootService {
api: ApiService::new(Arc::clone(&serve_session)),
interface: InterfaceService::new(Arc::clone(&serve_session)),
ui: UiService::new(Arc::clone(&serve_session)),
}
}
}

View File

@@ -10,12 +10,12 @@ use crate::{serve_session::ServeSession, web_interface::SERVER_VERSION};
static HOME_CSS: &str = include_str!("../../assets/index.css");
pub struct InterfaceService {
pub struct UiService {
#[allow(unused)] // TODO: Fill out interface service
serve_session: Arc<ServeSession>,
}
impl Service for InterfaceService {
impl Service for UiService {
type ReqBody = Body;
type ResBody = Body;
type Error = hyper::Error;
@@ -36,9 +36,9 @@ impl Service for InterfaceService {
}
}
impl InterfaceService {
pub fn new(serve_session: Arc<ServeSession>) -> InterfaceService {
InterfaceService { serve_session }
impl UiService {
pub fn new(serve_session: Arc<ServeSession>) -> UiService {
UiService { serve_session }
}
fn handle_home(&self) -> Response<Body> {