mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-27 06:18:50 +01:00
Rebase node-sqlite-migration onto dev
Squashed migration of node Hive→SQLite, default-node handling, isPow/proxy support, arbitrum node updates, and related fixes. Replays node-sqlite-migration on top of current dev without the amount-refactor merge that the original branch carried. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -128,15 +128,16 @@ class _NodeCreateOrEditPageState extends State<NodeCreateOrEditPage> {
|
||||
),
|
||||
) ??
|
||||
false;
|
||||
|
||||
|
||||
if (confirmed) {
|
||||
await widget.editingNode!.delete();
|
||||
await widget.nodeCreateOrEditViewModel.delete(editingNode: widget.editingNode!);
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
},
|
||||
text: S.of(context).delete,
|
||||
isDisabled: widget.editingNode == null ||
|
||||
!widget.nodeCreateOrEditViewModel.isReady ||
|
||||
widget.editingNode!.isBuiltin ||
|
||||
(widget.isSelected ?? false),
|
||||
color: Theme.of(context).colorScheme.errorContainer,
|
||||
textColor: Theme.of(context).colorScheme.onErrorContainer,
|
||||
@@ -151,9 +152,9 @@ class _NodeCreateOrEditPageState extends State<NodeCreateOrEditPage> {
|
||||
if (_nodeFormKey.currentState != null && !_nodeFormKey.currentState!.validate()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
await widget.nodeCreateOrEditViewModel.save(
|
||||
editingNode: widget.editingNode, saveAsCurrent: widget.isSelected ?? false);
|
||||
saveAsCurrent: widget.isSelected ?? false);
|
||||
if (context.mounted) {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ class _PowNodeCreateOrEditPageState extends State<PowNodeCreateOrEditPage> {
|
||||
}
|
||||
|
||||
await widget.nodeCreateOrEditViewModel.save(
|
||||
editingNode: widget.editingNode, saveAsCurrent: widget.isSelected ?? false);
|
||||
saveAsCurrent: widget.isSelected ?? false);
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
text: S.of(context).save,
|
||||
|
||||
@@ -65,66 +65,77 @@ class NodeFormState extends State<NodeForm> {
|
||||
key: _formKey,
|
||||
child: NewListSections(
|
||||
sections: {
|
||||
'main': [
|
||||
ListItemTextField(
|
||||
keyValue: vm.nodeLabelUIKey,
|
||||
label: 'Node label',
|
||||
initialValue: vm.label,
|
||||
),
|
||||
ListItemTextField(
|
||||
keyValue: vm.nodeAddressUIKey,
|
||||
label: S.current.node_address,
|
||||
initialValue: vm.address,
|
||||
validator: vm.walletType == WalletType.decred
|
||||
? NodeAddressValidatorDecredBlankException()
|
||||
: NodeAddressValidator(),
|
||||
),
|
||||
if (vm.hasPathSupport)
|
||||
if(!(vm.editingNode?.isBuiltin ?? false)) ...{
|
||||
'main': [
|
||||
ListItemTextField(
|
||||
keyValue: vm.nodePathUIKey,
|
||||
label: '/path',
|
||||
initialValue: vm.path,
|
||||
validator: NodePathValidator(),
|
||||
),
|
||||
ListItemTextField(
|
||||
keyValue: vm.nodePortUIKey,
|
||||
label: S.current.node_port,
|
||||
initialValue: '',
|
||||
//keyboardType: TextInputType.numberWithOptions(signed: false, decimal: false),
|
||||
validator: NodePortValidator(),
|
||||
),
|
||||
if (vm.hasAuthCredentials) ...[
|
||||
ListItemTextField(
|
||||
keyValue: vm.nodeUsernameUIKey,
|
||||
label: S.current.login,
|
||||
initialValue: vm.login,
|
||||
keyValue: vm.nodeLabelUIKey,
|
||||
label: 'Node label',
|
||||
initialValue: vm.label,
|
||||
),
|
||||
ListItemTextField(
|
||||
keyValue: vm.nodePasswordUIKey,
|
||||
label: S.current.password,
|
||||
initialValue: vm.password,
|
||||
keyValue: vm.nodeAddressUIKey,
|
||||
label: S.current.node_address,
|
||||
initialValue: vm.address,
|
||||
validator: vm.walletType == WalletType.decred
|
||||
? NodeAddressValidatorDecredBlankException()
|
||||
: NodeAddressValidator(),
|
||||
),
|
||||
]
|
||||
],
|
||||
'advanced': [
|
||||
ListItemCheckbox(
|
||||
keyValue: vm.useSSLUIKey,
|
||||
label: S.current.use_ssl,
|
||||
value: vm.useSSL,
|
||||
onChanged: (value) => vm.useSSL = value),
|
||||
ListItemCheckbox(
|
||||
keyValue: vm.nodeTrustedUIKey,
|
||||
label: S.current.trusted,
|
||||
value: vm.trusted,
|
||||
onChanged: (value) => vm.trusted = value,
|
||||
),
|
||||
if (vm.usesEmbeddedProxy)
|
||||
if (vm.hasPathSupport)
|
||||
ListItemTextField(
|
||||
keyValue: vm.nodePathUIKey,
|
||||
label: '/path',
|
||||
initialValue: vm.path,
|
||||
validator: NodePathValidator(),
|
||||
),
|
||||
ListItemTextField(
|
||||
keyValue: vm.nodePortUIKey,
|
||||
label: S.current.node_port,
|
||||
initialValue: '',
|
||||
//keyboardType: TextInputType.numberWithOptions(signed: false, decimal: false),
|
||||
validator: NodePortValidator(),
|
||||
),
|
||||
if (vm.hasAuthCredentials) ...[
|
||||
ListItemTextField(
|
||||
keyValue: vm.nodeUsernameUIKey,
|
||||
label: S.current.login,
|
||||
initialValue: vm.login,
|
||||
),
|
||||
ListItemTextField(
|
||||
keyValue: vm.nodePasswordUIKey,
|
||||
label: S.current.password,
|
||||
initialValue: vm.password,
|
||||
),
|
||||
]
|
||||
],
|
||||
'advanced': [
|
||||
ListItemCheckbox(
|
||||
keyValue: vm.nodeEmbeddedTorProxyUIKey,
|
||||
label: 'Embedded Tor SOCKS Proxy',
|
||||
value: vm.usesEmbeddedProxy,
|
||||
onChanged: (_) {},
|
||||
keyValue: vm.useSSLUIKey,
|
||||
label: S.current.use_ssl,
|
||||
value: vm.useSSL,
|
||||
onChanged: (value) => vm.useSSL = value),
|
||||
ListItemCheckbox(
|
||||
keyValue: vm.nodeTrustedUIKey,
|
||||
label: S.current.trusted,
|
||||
value: vm.trusted,
|
||||
onChanged: (value) => vm.trusted = value,
|
||||
),
|
||||
if (vm.usesEmbeddedProxy)
|
||||
ListItemCheckbox(
|
||||
keyValue: vm.nodeEmbeddedTorProxyUIKey,
|
||||
label: 'Embedded Tor SOCKS Proxy',
|
||||
value: vm.usesEmbeddedProxy,
|
||||
onChanged: (_) {},
|
||||
),
|
||||
if(FeatureFlag.isAutomaticNodeSwitchingEnabled)
|
||||
ListItemCheckbox(
|
||||
keyValue: vm.autoSwitchingUIKey,
|
||||
label: S.current.enable_for_auto_switching,
|
||||
value: vm.isEnabledForAutoSwitching,
|
||||
onChanged: (value) => vm.isEnabledForAutoSwitching = value),
|
||||
],
|
||||
},
|
||||
|
||||
"proxy" : [
|
||||
ListItemCheckbox(
|
||||
keyValue: vm.useSocksProxyUIKey,
|
||||
label: 'Use SOCKS Proxy',
|
||||
@@ -141,13 +152,7 @@ class NodeFormState extends State<NodeForm> {
|
||||
initialValue: vm.socksProxyAddress,
|
||||
validator: SocksProxyNodeAddressValidator(),
|
||||
),
|
||||
if(FeatureFlag.isAutomaticNodeSwitchingEnabled)
|
||||
ListItemCheckbox(
|
||||
keyValue: vm.autoSwitchingUIKey,
|
||||
label: S.current.enable_for_auto_switching,
|
||||
value: vm.isEnabledForAutoSwitching,
|
||||
onChanged: (value) => vm.isEnabledForAutoSwitching = value),
|
||||
],
|
||||
]
|
||||
},
|
||||
controllers: _controllers,
|
||||
getCheckboxValue: vm.getCheckboxValue,
|
||||
|
||||
@@ -94,9 +94,9 @@ class ManageNodesPage extends BasePage {
|
||||
nodeListViewModel?.nodes[index] ?? powNodeListViewModel!.nodes[index];
|
||||
late bool isSelected;
|
||||
if (isPow) {
|
||||
isSelected = node.keyIndex == powNodeListViewModel!.currentNode.keyIndex;
|
||||
isSelected = node.id == powNodeListViewModel!.currentNode.id;
|
||||
} else {
|
||||
isSelected = node.keyIndex == nodeListViewModel!.currentNode.keyIndex;
|
||||
isSelected = node.id == nodeListViewModel!.currentNode.id;
|
||||
}
|
||||
final nodeListRow = NodeListRow(
|
||||
title: node.uriRaw,
|
||||
|
||||
Reference in New Issue
Block a user