Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/synchronization-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Synchronization issue
description: Neuron doesn't synchronize
title: '[Synchronization] **brief description**'
labels:
- bug
assignees:
- Keith-CY
body:
- type: markdown
attributes:
value: |
Please check if these issues help
- [Synchronization doesnt' start](https://github.com/nervosnetwork/neuron/issues/2388)
- [Transactions keep pending on Neuron v0.101.3](https://github.com/nervosnetwork/neuron/issues/2384)
- [`Check for update` in settings doesn't work](https://github.com/nervosnetwork/neuron/issues/2372)

- type: textarea
id: detial
validations:
required: true
attributes:
label: Detail of the issue
description: Elaborate on your issue in this field

- type: markdown
attributes:
value: |

---
## Please add neuron logs if possible, they can be exported by `Menu -> Help -> Export Debug Information`

- type: textarea
id: bundled-ckb
validations:
required: false
attributes:
label: bundled-ckb.log
render: shell

- type: textarea
id: main-log
validations:
required: false
attributes:
label: main.log
render: shell

- type: textarea
id: status
validations:
required: false
attributes:
label: status.log
render: shell

19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# 0.103.2 (2022-07-09)

### New features
* #2422: Add heart beat and retry closed ckb/ckb-indexer process(@yanguoyu)
* #2433: Add ckb node/indexer data path config in setting(@yanguoyu)
* #2434: Adapt to ledger nano s plus(@yanguoyu)
* #2441: Verify short and long address for hard wallet(@yanguoyu)


### Bug fixes
* #2425: Fix dialog route error after importing seed(@yanguoyu)
* #2436: Fix link to Nervos DAO rule(@Keith-CY)
* #2438: Fix duplicated addressd(@yanguoyu)


**Full Changelog**: https://github.com/nervosnetwork/neuron/compare/v0.103.1...v0.103.2



# 0.103.1 (2022-06-11)

### New features
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "0.103.1",
"version": "0.103.2",
"npmClient": "yarn",
"useWorkspaces": true
}
4 changes: 2 additions & 2 deletions packages/neuron-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neuron-ui",
"version": "0.103.1",
"version": "0.103.2",
"private": true,
"author": {
"name": "Nervos Core Dev",
Expand Down Expand Up @@ -77,7 +77,7 @@
"@types/storybook__addon-storyshots": "5.1.2",
"@types/styled-components": "4.4.0",
"babel-jest": "25.1.0",
"electron": "16.0.6",
"electron": "16.2.6",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.2",
"eslint-config-airbnb": "19.0.4",
Expand Down
41 changes: 19 additions & 22 deletions packages/neuron-ui/src/components/ClearCache/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import React, { useEffect, useCallback, useState, useRef } from 'react'
import { useTranslation } from 'react-i18next'
import Button from 'widgets/Button'
import Spinner from 'widgets/Spinner'
import { ReactComponent as Attention } from 'widgets/Icons/Attention.svg'
import WarningIcon from 'widgets/Icons/Warning.png'
import { StateDispatch, addPopup } from 'states'
import { clearCellCache } from 'services/remote'
import { cacheClearDate } from 'services/localCache'
import { isSuccessResponse, useDialog, uniformTimeFormatter } from 'utils'

import { Tooltip } from 'widgets/Icons/icon'
import styles from './style.module.scss'

const I18N_PATH = 'settings.clear-cache'
Expand Down Expand Up @@ -71,28 +71,25 @@ const ClearCache = ({ dispatch }: { dispatch: StateDispatch }) => {

return (
<>
<div className={`${styles.clearCache} ${styles.detail}`}>
{clearedDate ? (
<div className={styles.date}>{t('settings.general.cache-cleared-on', { date: clearedDate })}</div>
) : null}
<div className={styles.desc}>
<Attention />
{t('settings.general.clear-cache-description')}
</div>
</div>
<div className={`${styles.clearCache} ${styles.action}`}>
<Button label={t(`settings.general.clear-cache`)} onClick={showDialog} disabled={isClearing}>
{isClearing ? (
<Spinner
label={t('settings.general.clear-cache')}
labelPosition="right"
styles={{ root: { marginRight: 5 } }}
/>
) : (
(t('settings.general.clear-cache') as string)
)}
</Button>
<div className={styles.clearCache}>
{t('settings.data.cache')}
<span className={styles.tooltip} data-tooltip={t('settings.data.clear-cache-description')}>
<Tooltip />
</span>
:
</div>
<div className={styles.clearedDate}>{t('settings.data.cache-cleared-on', { date: clearedDate })}</div>
<Button label={t('settings.data.clear-cache')} onClick={showDialog} disabled={isClearing}>
{isClearing ? (
<Spinner
label={t('settings.data.clearing-cache')}
labelPosition="right"
styles={{ root: { marginRight: 5 } }}
/>
) : (
(t('settings.data.clear-cache') as string)
)}
</Button>
<dialog ref={dialogRef} className={styles.dialog}>
<img src={WarningIcon} alt="warning" className={styles.warningIcon} />
<div className={styles.title}>{t(`${I18N_PATH}.title`)}</div>
Expand Down
48 changes: 27 additions & 21 deletions packages/neuron-ui/src/components/ClearCache/style.module.scss
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
@import '../../styles//mixin.scss';

.clearCache {
&.detail {
grid-area: clear-cache-detail;
.date {
display: flex;
align-items: center;
font-size: 0.875rem;
height: 1.125rem;
margin-bottom: 5px;
}
.desc {
display: flex;
font-size: 0.6875rem;
color: #666;
font-weight: bold;
display: flex;

.tooltip {
position: relative;
display: inline-flex;
align-items: center;
padding-left: 4px;

&::after {
display: none;
position: absolute;
left: -20px;
top: 120%;
content: attr(data-tooltip);
padding: 4px 12px;
border-radius: 6px;
background: #cccccc99;
font-weight: 300;
width: 600px;
}
svg {
height: 0.6875rem;
width: 0.6875rem;
filter: grayscale(1) opacity(0.6);
margin: 2px 5px 0 0;

&:hover::after {
display: block;
}
}
&.action {
grid-area: clear-cache-action;
}
}

.clearedDate {
font-size: 12px;
}

.dialog {
Expand Down
70 changes: 70 additions & 0 deletions packages/neuron-ui/src/components/DataSetting/hooks.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
import {
getCkbNodeDataPath,
getIndexerDataPath,
invokeShowOpenDialog,
startProcessMonitor,
stopProcessMonitor,
setCkbNodeDataPath,
setIndexerDataPath,
} from 'services/remote'
import { isSuccessResponse, useDialogWrapper, useDidMount } from 'utils'

export const useDataPath = (
getPath: typeof getCkbNodeDataPath | typeof getIndexerDataPath,
setPath: typeof setCkbNodeDataPath | typeof setIndexerDataPath,
type: Parameters<typeof stopProcessMonitor>[0]
) => {
const [t] = useTranslation()
const [prevPath, setPrevPath] = useState<string>()
const [currentPath, setCurrentPath] = useState<string | undefined>()
const { dialogRef, openDialog, closeDialog } = useDialogWrapper()
useDidMount(() => {
getPath(undefined).then(res => {
if (isSuccessResponse(res)) {
setPrevPath(res.result!)
}
})
})
const onSetting = useCallback(() => {
invokeShowOpenDialog({
buttonLabel: t('settings.data.set', { lng: navigator.language }),
properties: ['openDirectory', 'createDirectory', 'promptToCreate', 'treatPackageAsDirectory'],
}).then(res => {
if (isSuccessResponse(res) && !res.result?.canceled && res.result?.filePaths?.length) {
setCurrentPath(res.result?.filePaths?.[0])
stopProcessMonitor(type).then(stopRes => {
if (isSuccessResponse(stopRes)) {
openDialog()
}
})
}
})
}, [t, type])
const onCancel = useCallback(() => {
startProcessMonitor(type).then(res => {
if (isSuccessResponse(res)) {
closeDialog()
}
})
}, [closeDialog, type])
const onConfirm = useCallback(() => {
setPath(currentPath!).then(res => {
if (isSuccessResponse(res)) {
setPrevPath(currentPath)
closeDialog()
}
})
}, [currentPath, closeDialog, setPrevPath, setPath])
return {
prevPath,
currentPath,
onSetting,
dialogRef,
onCancel,
onConfirm,
}
}

export default useDataPath
66 changes: 66 additions & 0 deletions packages/neuron-ui/src/components/DataSetting/index.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
@import '../../styles/mixin.scss';

.root {
margin-top: 20px;
display: grid;
grid-template-columns: auto 1fr 140px;
grid-gap: 30px 20px;
align-items: center;

.name {
font-weight: bold;
}

.content {
font-size: 12px;
word-break: break-all;
}

button {
line-height: 1;
height: 1.625rem;
}
}

.dialog {
@include dialog-container;
padding: 30px 50px;

.describe {
word-break: break-all;
font-size: 14px;
}

.attention {
position: relative;
padding-left: 1rem;
font-size: 0.75rem;
letter-spacing: 0.5px;
margin: 14px 0 20px 0;
color: #666;

svg {
position: absolute;
left: 0;
top: 0.13rem;
filter: grayscale(1) opacity(0.6);
width: 0.625rem;
height: 0.625rem;
}
}

.action {
padding-top: 16px;
display: flex;
justify-content: space-between;
}
}

.path {
display: flex;
align-items: center;

& > svg {
flex-shrink: 0;
}
}
Loading