Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Whirlpool
whirlpool-gui
Commits
61972b61
Commit
61972b61
authored
Jul 10, 2020
by
zeroleak
Browse files
System: add resync button
parent
c917c41f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
5 deletions
+27
-5
app/containers/ConfigPage.js
app/containers/ConfigPage.js
+2
-2
app/containers/StatusPage.js
app/containers/StatusPage.js
+12
-3
app/services/backendService.js
app/services/backendService.js
+5
-0
app/services/walletService.js
app/services/walletService.js
+8
-0
No files found.
app/containers/ConfigPage.js
View file @
61972b61
...
...
@@ -212,10 +212,10 @@ export default class ConfigPage extends Component<Props> {
<
div
className
=
"
form-group row
"
>
<
div
className
=
"
col-sm-5
"
>
<
button
type
=
'
button
'
className
=
'
btn btn-danger
'
onClick
=
{
this
.
onResetConfig
}
><
FontAwesomeIcon
icon
=
{
Icons
.
faExclamationTriangle
}
/> Reset {cliService.getResetLabel
()
}</
button
>
<
button
type
=
'
button
'
className
=
'
btn btn-danger
btn-sm
'
onClick
=
{
this
.
onResetConfig
}
><
FontAwesomeIcon
icon
=
{
Icons
.
faExclamationTriangle
}
/> Reset {cliService.getResetLabel
()
}</
button
>
<
/div
>
<
div
className
=
"
col-sm-5
"
>
<
button
type
=
"
submit
"
className
=
"
btn btn-primary
"
>
Save
<
/button
>
<
button
type
=
"
submit
"
className
=
"
btn btn-primary
"
>
Save
&
amp
;
restart
<
/button
>
<
/div
>
<
/div
>
<
/form
>
...
...
app/containers/StatusPage.js
View file @
61972b61
...
...
@@ -18,6 +18,7 @@ import LinkExternal from '../components/Utils/LinkExternal';
import
{
Card
}
from
'
react-bootstrap
'
;
import
utils
from
'
../services/utils
'
;
import
guiConfig
from
'
../mainProcess/guiConfig
'
;
import
walletService
from
'
../services/walletService
'
;
type
Props
=
{};
...
...
@@ -28,6 +29,7 @@ export default class StatusPage extends Component<Props> {
this
.
onResetConfig
=
this
.
onResetConfig
.
bind
(
this
)
this
.
onRestartCli
=
this
.
onRestartCli
.
bind
(
this
)
this
.
onResync
=
this
.
onResync
.
bind
(
this
)
this
.
cliLogFile
=
CLI_LOG_FILE
this
.
cliLogErrorFile
=
CLI_LOG_ERROR_FILE
...
...
@@ -46,6 +48,12 @@ export default class StatusPage extends Component<Props> {
}
}
onResync
()
{
if
(
confirm
(
'
This will resync mix counters. Are you sure?
'
))
{
walletService
.
resync
()
}
}
render
()
{
const
cliStatusIcon
=
cliService
.
getStatusIcon
((
icon
,
text
)
=><
div
>
{
icon
}
{
text
}
<
/div>
)
...
...
@@ -65,7 +73,7 @@ export default class StatusPage extends Component<Props> {
<
/Card.Header
>
<
Card
.
Body
>
<
div
style
=
{{
'
float
'
:
'
right
'
}}
>
<
button
type
=
'
button
'
className
=
'
btn btn-danger
'
onClick
=
{
this
.
onResetConfig
}
><
FontAwesomeIcon
icon
=
{
Icons
.
faExclamationTriangle
}
/> Reset {cliService.getResetLabel
()
}</
button
>
<
button
type
=
'
button
'
className
=
'
btn btn-danger
btn-sm
'
onClick
=
{
this
.
onResetConfig
}
><
FontAwesomeIcon
icon
=
{
Icons
.
faExclamationTriangle
}
/> Reset {cliService.getResetLabel
()
}</
button
>
<
/div
>
<
div
className
=
'
row
'
>
<
div
className
=
'
col-sm-2
'
>
...
...
@@ -123,8 +131,9 @@ export default class StatusPage extends Component<Props> {
<
/div
>
<
/Card.Header
>
<
Card
.
Body
>
<
div
style
=
{{
'
float
'
:
'
right
'
}}
>
<
button
type
=
'
button
'
className
=
'
btn btn-danger
'
onClick
=
{
this
.
onRestartCli
}
>
Restart
CLI
<
/button
>
<
div
className
=
'
float-right text-right
'
>
<
button
type
=
'
button
'
className
=
'
btn btn-primary btn-sm
'
onClick
=
{
this
.
onRestartCli
}
>
Restart
CLI
<
/button>{' '
}
{
walletService
.
isReady
()
&&
<
button
type
=
'
button
'
className
=
'
btn btn-secondary btn-sm
'
onClick
=
{
this
.
onResync
}
>
Resync
mix
counters
<
/button>
}
<
/div
>
<
div
className
=
'
row
'
>
<
div
className
=
'
col-sm-2
'
>
...
...
app/services/backendService.js
View file @
61972b61
...
...
@@ -87,6 +87,11 @@ class BackendService {
this
.
fetchBackendAsJson
(
'
/rest/cli/restart
'
,
'
POST
'
)
,
'
cli.restart
'
)
},
resync
:
()
=>
{
return
this
.
withStatus
(
'
CLI
'
,
'
Resynchronize
'
,
()
=>
this
.
fetchBackend
(
'
/rest/cli/resync
'
,
'
POST
'
)
,
'
cli.resync
'
)
},
getConfig
:
()
=>
{
return
this
.
withStatus
(
'
CLI
'
,
'
Fetch configuration
'
,
()
=>
this
.
fetchBackendAsJson
(
'
/rest/cli/config
'
,
'
GET
'
)
...
...
app/services/walletService.js
View file @
61972b61
...
...
@@ -118,6 +118,14 @@ class WalletService {
})
}
resync
()
{
// resync
backendService
.
cli
.
resync
()
// fetch updated utxos
return
this
.
fetchState
()
}
// deposit
fetchDepositAddress
(
increment
=
false
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment