Initial import of new UI (compiled JS code) (#2220)
* Normalizing dapps format for signer. * Adding new ui * Adding New UI to dapps * Adding parity styles for signer errors * Adding pre-compiled JS as submodule * Fixing struct declaration [ci:skip] * Bumping js * Adding styles * build dest * Correct whitespace @tomusdrw please note the alterations - no mixing tabs and spaces in the indentation portion and always just one tab per indent.
This commit is contained in:
@@ -25,13 +25,15 @@ use jsonrpc_core::IoHandler;
|
||||
use util::{H256, Mutex, version};
|
||||
|
||||
#[cfg(feature = "ui")]
|
||||
mod signer {
|
||||
use signer::SignerApp;
|
||||
use dapps::{self, WebApp};
|
||||
mod ui {
|
||||
extern crate parity_ui as ui;
|
||||
extern crate parity_dapps_glue as dapps;
|
||||
|
||||
use self::dapps::WebApp;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Handler {
|
||||
signer: SignerApp,
|
||||
ui: ui::App,
|
||||
}
|
||||
|
||||
impl Handler {
|
||||
@@ -40,20 +42,20 @@ mod signer {
|
||||
"" | "/" => "index.html",
|
||||
path => &path[1..],
|
||||
};
|
||||
self.signer.file(file)
|
||||
self.ui.file(file)
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(feature = "ui"))]
|
||||
mod signer {
|
||||
mod ui {
|
||||
pub struct File {
|
||||
pub content: &'static str,
|
||||
pub content: &'static [u8],
|
||||
pub content_type: &'static str,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Handler {
|
||||
}
|
||||
pub struct Handler;
|
||||
|
||||
impl Handler {
|
||||
pub fn handle(&self, _req: &str) -> Option<&File> {
|
||||
@@ -125,7 +127,7 @@ pub struct Session {
|
||||
self_origin: String,
|
||||
authcodes_path: PathBuf,
|
||||
handler: Arc<IoHandler>,
|
||||
file_handler: Arc<signer::Handler>,
|
||||
file_handler: Arc<ui::Handler>,
|
||||
}
|
||||
|
||||
impl ws::Handler for Session {
|
||||
@@ -200,7 +202,7 @@ pub struct Factory {
|
||||
skip_origin_validation: bool,
|
||||
self_origin: String,
|
||||
authcodes_path: PathBuf,
|
||||
file_handler: Arc<signer::Handler>,
|
||||
file_handler: Arc<ui::Handler>,
|
||||
}
|
||||
|
||||
impl Factory {
|
||||
@@ -210,7 +212,7 @@ impl Factory {
|
||||
skip_origin_validation: skip_origin_validation,
|
||||
self_origin: self_origin,
|
||||
authcodes_path: authcodes_path,
|
||||
file_handler: Arc::new(signer::Handler::default()),
|
||||
file_handler: Arc::new(ui::Handler::default()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user