mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
Merge pull request #529 from cake-tech/CW-182-allow-trusted-nodes
Cw 182 allow trusted nodes
This commit is contained in:
@@ -174,7 +174,22 @@ class NodeCreateOrEditPage extends BasePage {
|
||||
caption: S.of(context).use_ssl,
|
||||
))
|
||||
],
|
||||
))
|
||||
)),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 20),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Observer(
|
||||
builder: (_) => StandardCheckbox(
|
||||
value: nodeCreateOrEditViewModel.trusted,
|
||||
onChanged: (value) =>
|
||||
nodeCreateOrEditViewModel.trusted = value,
|
||||
caption: S.of(context).trusted,
|
||||
))
|
||||
],
|
||||
)),
|
||||
]
|
||||
],
|
||||
)),
|
||||
|
||||
@@ -18,7 +18,8 @@ abstract class NodeCreateOrEditViewModelBase with Store {
|
||||
address = '',
|
||||
port = '',
|
||||
login = '',
|
||||
password = '';
|
||||
password = '',
|
||||
trusted = false;
|
||||
|
||||
@observable
|
||||
ExecutionState state;
|
||||
@@ -41,6 +42,9 @@ abstract class NodeCreateOrEditViewModelBase with Store {
|
||||
@observable
|
||||
bool useSSL;
|
||||
|
||||
@observable
|
||||
bool trusted;
|
||||
|
||||
@computed
|
||||
bool get isReady =>
|
||||
address.isNotEmpty && port.isNotEmpty;
|
||||
@@ -68,6 +72,7 @@ abstract class NodeCreateOrEditViewModelBase with Store {
|
||||
login = '';
|
||||
password = '';
|
||||
useSSL = false;
|
||||
trusted = false;
|
||||
}
|
||||
|
||||
@action
|
||||
@@ -76,7 +81,7 @@ abstract class NodeCreateOrEditViewModelBase with Store {
|
||||
state = IsExecutingState();
|
||||
final node =
|
||||
Node(uri: uri, type: _wallet.type, login: login, password: password,
|
||||
useSSL: useSSL);
|
||||
useSSL: useSSL, trusted: trusted);
|
||||
await _nodeSource.add(node);
|
||||
state = ExecutedSuccessfullyState();
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user