Mode configuration backported to beta (#3213)

* Mode improvements for UI (#3109)

* `--mode=off` now works.

* Add Mode::Off as a persistent CLI option.

* "last" not "auto" as default.

* Commit accidentally unsaved file.

* Whitespace

[ci:skip]

* Mode CLI parse fix

* or offline

* Save mode when it gets changed.

* Fix Offline mode

* Fix up mode operations.

* Make passive default, but not overriding.

* Fix test

* Maybe not everyone wants to run an archive node...

* Parity configuration settings, i.e. mode (#3212)

* Add initial page

* Add parity icon

* opacity for parity icon

* Mode selector

* Actually set mode when value changes


Former-commit-id: 64386d94adfa58aa30bab2005eeb64f6343c8248
This commit is contained in:
Arkadiy Paronyan
2016-11-05 14:37:45 +01:00
committed by Gav Wood
parent 8b5a9b701a
commit e727d92e0f
27 changed files with 325 additions and 105 deletions

View File

@@ -351,7 +351,7 @@ impl<C, M, S: ?Sized, F> Ethcore for EthcoreClient<C, M, S, F> where
fn mode(&self) -> Result<String, Error> {
Ok(match take_weak!(self.client).mode() {
Mode::Off => "off",
Mode::Off => "offline",
Mode::Dark(..) => "dark",
Mode::Passive(..) => "passive",
Mode::Active => "active",

View File

@@ -151,7 +151,7 @@ impl<C, M> EthcoreSet for EthcoreSetClient<C, M> where
fn set_mode(&self, mode: String) -> Result<bool, Error> {
take_weak!(self.client).set_mode(match mode.as_str() {
"off" => Mode::Off,
"offline" => Mode::Off,
"dark" => Mode::Dark(300),
"passive" => Mode::Passive(300, 3600),
"active" => Mode::Active,

View File

@@ -130,7 +130,7 @@ build_rpc_trait! {
#[rpc(name = "ethcore_nextNonce")]
fn next_nonce(&self, H160) -> Result<U256, Error>;
/// Get the mode. Results one of: "active", "passive", "dark", "off".
/// Get the mode. Results one of: "active", "passive", "dark", "offline".
#[rpc(name = "ethcore_mode")]
fn mode(&self) -> Result<String, Error>;

View File

@@ -76,11 +76,11 @@ build_rpc_trait! {
/// Stop the network.
///
/// Deprecated. Use `set_mode("off")` instead.
/// Deprecated. Use `set_mode("offline")` instead.
#[rpc(name = "ethcore_stopNetwork")]
fn stop_network(&self) -> Result<bool, Error>;
/// Set the mode. Argument must be one of: "active", "passive", "dark", "off".
/// Set the mode. Argument must be one of: "active", "passive", "dark", "offline".
#[rpc(name = "ethcore_setMode")]
fn set_mode(&self, String) -> Result<bool, Error>;
}