-
+
+
+
+
+
- {{ url }}
-
+
+
-
+
@@ -20,10 +24,12 @@ import { computed, PropType } from 'vue'
import { useStore } from 'vuex'
import type { NodeStatusResult } from '@/lib/nodes/abstract.node'
import type { TNodeLabel } from '@/lib/nodes/constants'
+import NodeUrl from '@/components/nodes/components/NodeUrl.vue'
import NodeColumn from '@/components/nodes/components/NodeColumn.vue'
import NodeLabel from '@/components/nodes/components/NodeLabel.vue'
import NodeStatus from '@/components/nodes/components/NodeStatus.vue'
import NodeVersion from '@/components/nodes/components/NodeVersion.vue'
+import NodeStatusCheckbox from '@/components/nodes/components/NodeStatusCheckbox.vue'
const className = 'nodes-table-item'
const classes = {
@@ -38,7 +44,9 @@ export default {
NodeColumn,
NodeStatus,
NodeVersion,
- NodeLabel
+ NodeLabel,
+ NodeUrl,
+ NodeStatusCheckbox
},
props: {
node: {
@@ -56,9 +64,11 @@ export default {
const url = computed(() => props.node.url)
const active = computed(() => props.node.active)
const isUnsupported = computed(() => props.node.status === 'unsupported_version')
+ const type = computed(() => props.node.type)
const toggleActiveStatus = () => {
store.dispatch('nodes/toggle', {
+ type: type.value,
url: url.value,
active: !active.value
})
@@ -79,4 +89,7 @@ export default {
diff --git a/src/components/nodes/components/NodeColumn.vue b/src/components/nodes/components/NodeColumn.vue
index 25194eec4..aeb32017a 100644
--- a/src/components/nodes/components/NodeColumn.vue
+++ b/src/components/nodes/components/NodeColumn.vue
@@ -2,6 +2,7 @@
- {{ nodeStatusTitle }}
+
+ {{ nodeStatusTitle
+ }}{{
+ $t('nodes.ms')
+ }}
+
{{ nodeStatusDetail.text }}
@@ -29,6 +34,7 @@ import { useNodeStatus } from '@/components/nodes/hooks'
const className = 'node-status'
const classes = {
+ textMs: `${className}__text-ms`,
statusTitle: `${className}__status-title`,
statusText: `${className}__status-text`,
icon: `${className}__icon`,
@@ -63,10 +69,12 @@ export default defineComponent({
diff --git a/src/components/nodes/components/NodesTableContainer.vue b/src/components/nodes/components/NodesTableContainer.vue
index 6b760829c..e0c6a0a8b 100644
--- a/src/components/nodes/components/NodesTableContainer.vue
+++ b/src/components/nodes/components/NodesTableContainer.vue
@@ -25,6 +25,7 @@ export default defineComponent({
@import 'vuetify/settings';
.nodes-table-container {
+ line-height: 14px;
}
.v-theme--dark {
diff --git a/src/components/nodes/components/NodesTableHead.vue b/src/components/nodes/components/NodesTableHead.vue
index 02af0bc13..5e24d0c20 100644
--- a/src/components/nodes/components/NodesTableHead.vue
+++ b/src/components/nodes/components/NodesTableHead.vue
@@ -2,7 +2,7 @@
|
- |
+ {{ t('nodes.coin') }} |
{{ t('nodes.host') }}
|
@@ -70,6 +70,7 @@ export default {
}
&__label {
+ font-size: 12px;
width: 104px;
}
}
diff --git a/src/components/nodes/hooks/index.ts b/src/components/nodes/hooks/index.ts
index cb4e771c9..24ffaef2e 100644
--- a/src/components/nodes/hooks/index.ts
+++ b/src/components/nodes/hooks/index.ts
@@ -1 +1 @@
-export * from './useNodeStatus.ts'
+export * from './useNodeStatus'
diff --git a/src/components/nodes/hooks/useNodeStatus.ts b/src/components/nodes/hooks/useNodeStatus.ts
index 43d0cd1ca..ca7c82e7b 100644
--- a/src/components/nodes/hooks/useNodeStatus.ts
+++ b/src/components/nodes/hooks/useNodeStatus.ts
@@ -3,6 +3,7 @@ import { useI18n, VueI18nTranslation } from 'vue-i18n'
import { NodeStatusResult } from '@/lib/nodes/abstract.node'
import { NodeStatus } from '@/lib/nodes/types'
+import { formatHeight } from '@/components/nodes/utils/formatHeight'
type StatusColor = 'green' | 'red' | 'grey' | 'orange'
type NodeStatusDetail = {
@@ -15,7 +16,7 @@ type NodeStatusDetail = {
function getNodeStatusTitle(node: NodeStatusResult, t: VueI18nTranslation) {
const i18n: Record = {
- online: node.ping + ' ' + t('nodes.ms'),
+ online: node.ping + ' ',
offline: 'nodes.offline',
disabled: 'nodes.inactive',
sync: 'nodes.sync',
@@ -44,7 +45,7 @@ function getNodeStatusDetail(
}
} else if (node.online) {
return {
- text: node.height,
+ text: formatHeight(node.height),
icon: 'mdi-cube-outline'
}
}
diff --git a/src/components/nodes/utils/formatHeight.ts b/src/components/nodes/utils/formatHeight.ts
new file mode 100644
index 000000000..de9e13a10
--- /dev/null
+++ b/src/components/nodes/utils/formatHeight.ts
@@ -0,0 +1,4 @@
+export function formatHeight(height: number) {
+ const formatted = height.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')
+ return formatted
+}
diff --git a/src/lib/nodes/abstract.node.ts b/src/lib/nodes/abstract.node.ts
index 48285629d..94401f836 100644
--- a/src/lib/nodes/abstract.node.ts
+++ b/src/lib/nodes/abstract.node.ts
@@ -27,7 +27,7 @@ export abstract class Node {
* Indicates whether node is out of sync (i.e. its block height is
* either too big or too small compared to the other nodes)
*/
- outOfSync = false
+ outOfSync = true
/**
* Default `wsPort`. Will be updated after `GET /api/node/status`
@@ -180,6 +180,7 @@ export abstract class Node {
socketSupport: this.socketSupport,
height: this.height,
status: this.getNodeStatus(),
+ type: this.type,
label: this.label
}
}
diff --git a/src/lib/nodes/storage.ts b/src/lib/nodes/storage.ts
index e3d2a89c6..28b58fc3c 100644
--- a/src/lib/nodes/storage.ts
+++ b/src/lib/nodes/storage.ts
@@ -41,11 +41,11 @@ function saveState(newState: State) {
const defaultOptions: Options = {
adm: { useFastest: false },
- btc: { useFastest: false },
- doge: { useFastest: false },
- dash: { useFastest: false },
- eth: { useFastest: false },
- lsk: { useFastest: false }
+ btc: { useFastest: true },
+ doge: { useFastest: true },
+ dash: { useFastest: true },
+ eth: { useFastest: true },
+ lsk: { useFastest: true }
}
function getOptions() {
diff --git a/src/locales/en.json b/src/locales/en.json
index 7ded3de6a..c4bb1e3ec 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -170,6 +170,7 @@
"ms": "ms",
"nodeLabelDescription": "Support decentralization and enhance privacy level—run your own ADAMANT node. To add your nodes to the list, you need to deploy web application on separate domain. This limitation refers to Content Security Policy (CSP).",
"offline": "Offline",
+ "coin": "Coin",
"ping": "Ping",
"socket": "Socket",
"unsupported": "Unsupported",
@@ -206,7 +207,7 @@
"idb_not_supported": "Browser does not support IndexedDB and in Private Browsing mode too",
"language_label": "Language",
"currency_label": "Main currency",
- "nodes_list": "Nodes list",
+ "nodes_list": "Nodes and services",
"notification_title": "Notifications",
"page_title": "Settings",
"push_denied": "Push notifications have been denied in browser settings",
diff --git a/src/locales/ru.json b/src/locales/ru.json
index 6283e870e..260b0872a 100644
--- a/src/locales/ru.json
+++ b/src/locales/ru.json
@@ -171,6 +171,7 @@
"ms": "мс",
"nodeLabelDescription": "Поддержите децентрализацию и повысьте уровень приватности — установите свой узел (ноду) АДАМАНТа. Чтобы добавить свои узлы в список для подключения, вам нужно развернуть свое веб-приложение на отдельном домене. Это ограничение связано с политикой безопасности Content Security Policy (CSP).",
"offline": "Недоступна",
+ "coin": "Coin",
"ping": "Пинг",
"socket": "Сокеты",
"unsupported": "Не поддерживается",
@@ -207,7 +208,7 @@
"idb_not_supported": "Браузер не поддерживает IndexedDB или открыт в режиме приватного просмотра",
"language_label": "Язык",
"currency_label": "Основная валюта",
- "nodes_list": "Список узлов",
+ "nodes_list": "Узлы и сервисы",
"notification_title": "Уведомления",
"page_title": "Настройки",
"push_denied": "Push-уведомления запрещены в настройках браузера",
diff --git a/src/locales/zh.json b/src/locales/zh.json
index 962752bd2..822082e0e 100644
--- a/src/locales/zh.json
+++ b/src/locales/zh.json
@@ -170,6 +170,7 @@
"ms": "ms",
"nodeLabelDescription": "支持去中心化并提高隐私级别--运行您自己的ADAMANT节点。若要将节点添加到列表中,您需要在单独的域上部署web应用程序。此限制指的是内容安全策略(CSP)。",
"offline": "脱机",
+ "coin": "硬币",
"ping": "Ping",
"socket": "套接字",
"unsupported": "不受欢迎",
@@ -206,7 +207,7 @@
"idb_not_supported": "浏览器不支持IndexedDB,也处于私有浏览模式",
"language_label": "语言",
"currency_label": "主货币",
- "nodes_list": "节点列表",
+ "nodes_list": "节点和服务",
"notification_title": "通知",
"page_title": "设置",
"push_denied": "推送通知在浏览器设置中被拒绝",
diff --git a/src/store/modules/nodes/nodes-actions.js b/src/store/modules/nodes/nodes-actions.js
index d25de04c5..3661d4e06 100644
--- a/src/store/modules/nodes/nodes-actions.js
+++ b/src/store/modules/nodes/nodes-actions.js
@@ -11,7 +11,10 @@ export default {
context.commit('toggle', payload)
},
- setUseFastest(context, payload) {
- context.commit('useFastest', payload)
+ setUseFastestAdmNode(context, payload) {
+ context.commit('useFastestAdmNode', payload)
+ },
+ setUseFastestCoinNode(context, payload) {
+ context.commit('useFastestCoinNode', payload)
}
}
diff --git a/src/store/modules/nodes/nodes-mutations.js b/src/store/modules/nodes/nodes-mutations.js
index 133fd559e..8c747c815 100644
--- a/src/store/modules/nodes/nodes-mutations.js
+++ b/src/store/modules/nodes/nodes-mutations.js
@@ -1,10 +1,13 @@
export default {
- useFastest(state, value) {
- state.useFastest = value
+ useFastestAdmNode(state, value) {
+ state.useFastestAdmNode = value
+ },
+ useFastestCoinNode(state, value) {
+ state.useFastestCoinNode = value
},
toggle(state, payload) {
- const node = state.adm[payload.url]
+ const node = state[payload.type][payload.url]
if (node) {
node.active = payload.active
}
diff --git a/src/store/modules/nodes/nodes-plugin.js b/src/store/modules/nodes/nodes-plugin.js
index 050e7ba96..1ce0cb4b6 100644
--- a/src/store/modules/nodes/nodes-plugin.js
+++ b/src/store/modules/nodes/nodes-plugin.js
@@ -1,7 +1,6 @@
import { nodes } from '@/lib/nodes'
export default (store) => {
- // initial nodes state
for (const [nodeType, client] of Object.entries(nodes)) {
client.getNodes().forEach((status) => store.commit('nodes/status', { status, nodeType }))
@@ -9,20 +8,30 @@ export default (store) => {
store.commit('nodes/status', { status, nodeType })
})
}
- store.commit('nodes/useFastest', nodes.adm.useFastest)
+ store.commit('nodes/useFastestAdmNode', nodes.adm.useFastest)
+ store.commit('nodes/useFastestCoinNode', nodes.btc.useFastest)
store.subscribe((mutation) => {
const { type, payload } = mutation
- if (type === 'nodes/useFastest') {
- nodes.adm.setUseFastest(!!mutation.payload)
+ if (type === 'nodes/useFastestAdmNode') {
+ nodes.adm.setUseFastest(!!payload)
+ }
+
+ if (type === 'nodes/useFastestCoinNode') {
+ nodes.btc.setUseFastest(!!payload)
+ nodes.dash.setUseFastest(!!payload)
+ nodes.doge.setUseFastest(!!payload)
+ nodes.eth.setUseFastest(!!payload)
+ nodes.lsk.setUseFastest(!!payload)
}
if (type === 'nodes/toggle') {
- const newStatus = nodes.adm.toggleNode(payload.url, payload.active)
+ const selectedNodeType = payload.type
+ const newStatus = nodes[selectedNodeType].toggleNode(payload.url, payload.active)
if (newStatus) {
- store.commit('nodes/status', { status: newStatus, nodeType: 'adm' })
+ store.commit('nodes/status', { status: newStatus, nodeType: selectedNodeType })
}
}
})
diff --git a/src/store/modules/nodes/nodes-state.js b/src/store/modules/nodes/nodes-state.js
index f4b7249b0..ac1dc1535 100644
--- a/src/store/modules/nodes/nodes-state.js
+++ b/src/store/modules/nodes/nodes-state.js
@@ -5,5 +5,6 @@ export default {
doge: {},
dash: {},
lsk: {},
- useFastest: false
+ useFastestAdmNode: false,
+ useFastestCoinNode: true
}
diff --git a/src/views/Login.vue b/src/views/Login.vue
index 6a5630333..1d0cbf44c 100644
--- a/src/views/Login.vue
+++ b/src/views/Login.vue
@@ -219,6 +219,7 @@ export default defineComponent({
position: absolute;
right: 0;
margin-right: 8px;
+ color: map-get($adm-colors, 'grey-transparent');
}
}
diff --git a/src/views/Nodes.vue b/src/views/Nodes.vue
index e915e52be..c739403bf 100644
--- a/src/views/Nodes.vue
+++ b/src/views/Nodes.vue
@@ -6,38 +6,6 @@
-
-
-
- {{ $t('nodes.fastest_tooltip') }}
-
-
-
-
- {{ $t('nodes.use_socket_connection_tooltip') }}
-
-
-
-
-
-
-
@@ -61,26 +29,7 @@ export default {
timer: null
}),
computed: {
- className: () => 'nodes-view',
- useSocketConnection: {
- get() {
- return this.$store.state.options.useSocketConnection
- },
- set(value) {
- this.$store.commit('options/updateOption', {
- key: 'useSocketConnection',
- value
- })
- }
- },
- preferFastestNodeOption: {
- get() {
- return this.$store.state.nodes.useFastest
- },
- set(value) {
- this.$store.dispatch('nodes/setUseFastest', value)
- }
- }
+ className: () => 'nodes-view'
},
mounted() {
this.$store.dispatch('nodes/updateStatus')
@@ -94,41 +43,12 @@ export default {
|