{{ props.title }}
diff --git a/ui/src/utils/locales/en.json b/ui/src/utils/locales/en.json
index 70f20f0..59458bd 100644
--- a/ui/src/utils/locales/en.json
+++ b/ui/src/utils/locales/en.json
@@ -63,12 +63,14 @@
"Sector Events": "Sector Events",
"Edit Configuration": "Edit Configuration",
"Running Tasks": "Running Tasks",
- "Storages": "Storages"
+ "Storages": "Storages",
+ "Node": "Node|Nodes"
},
"msgs": {
"weekBlock": "This Week Total Mined",
"sectorNotFailed": "THIS SECTOR IS NOT FAILED!|SOME SECTORS HAVE NOT FAILED!",
"sureRemoveSector": "Are you sure you want to remove this sector?|Are you sure you want to remove this sectors?",
+ "sureRemoveConfig": "Are you sure you want to remove this configuration?|Are you sure you want to remove this configurations?",
"actionCantUndo": "This action can't be undone!",
"understand": "I understand"
},
diff --git a/ui/src/utils/locales/zh.json b/ui/src/utils/locales/zh.json
index d951f6a..6865a92 100644
--- a/ui/src/utils/locales/zh.json
+++ b/ui/src/utils/locales/zh.json
@@ -63,7 +63,8 @@
"Sector Events": "扇区事件",
"Edit Configuration": "编辑配置",
"Running Tasks": "运行的任务",
- "Storages": "存储"
+ "Storages": "存储",
+ "Node": "节点|节点"
},
"actions": {
"Create": "创建",
@@ -76,6 +77,7 @@
"weekBlock": "本周出块数",
"sectorNotFailed": "这个 SECTOR 没有失败!|一些 SECTOR 没有失败!",
"sureRemoveSector": "确定要删除这个 Sector 吗?|确定要删除这些 Sector 吗?",
+ "sureRemoveConfig": "确定要删除这个配置吗?|确定要删除这些配置吗?",
"actionCantUndo": "此操作无法撤销!",
"understand": "我明白"
},
diff --git a/ui/src/views/configurations/ConfigRemoveDialog.vue b/ui/src/views/configurations/ConfigRemoveDialog.vue
index 693db89..8419166 100644
--- a/ui/src/views/configurations/ConfigRemoveDialog.vue
+++ b/ui/src/views/configurations/ConfigRemoveDialog.vue
@@ -2,7 +2,7 @@
import { ref } from 'vue'
import { useMutation } from '@vue/apollo-composable'
import { GetConfigs, RemoveConfig } from '@/views/query/config'
-import { IconTrash } from '@tabler/icons-vue'
+import { IconAlertOctagon, IconTrash } from '@tabler/icons-vue'
import { useUIStore } from '@/stores/ui'
const uiStore = useUIStore()
@@ -11,11 +11,23 @@ const props = defineProps({
type: String,
required: true,
},
+ useIcon: {
+ type: Boolean,
+ default: false,
+ },
+ color: {
+ type: String,
+ default: 'error',
+ },
+ size: {
+ type: String,
+ default: undefined,
+ },
})
const dialog = ref(false)
-const { mutate: removeConfig, loading, onDone, error } = useMutation(RemoveConfig, () => ({
+const { mutate: removeConfig, loading, onDone, onError } = useMutation(RemoveConfig, () => ({
variables: {
title: props.title,
},
@@ -33,38 +45,94 @@ onDone(() => {
})
})
+onError(e => {
+ uiStore.appendMsg({
+ type: 'error',
+ msg: e.message,
+ })
+})
+
-
-
-
+
+
+
+ Remove
- Remove
-
-
-
- {{ props.title }}
-
+
+
+
+
+
+
+ {{ $t('msgs.sureRemoveConfig', 1) }}
+
+
+
+
+
+ {{ $t('msgs.actionCantUndo') }}
+ Configuration: {{ props.title }}
+
+ {{ $t('actions.Cancel') }}
Confirm
+ variant="flat"
+ @click="removeConfig"
+ >{{ $t('actions.Remove') }}
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ui/src/views/configurations/ConfigurationEdit.vue b/ui/src/views/configurations/ConfigurationEdit.vue
index 58ea218..afef739 100644
--- a/ui/src/views/configurations/ConfigurationEdit.vue
+++ b/ui/src/views/configurations/ConfigurationEdit.vue
@@ -25,7 +25,7 @@ const props = defineProps({
const enableEdit = ref(false)
-const { result, error } = useQuery(GetConfig, {
+const { result, loading, error } = useQuery(GetConfig, {
layer: props.layer,
}, () => ({
fetchPolicy: 'cache-first',
@@ -41,7 +41,7 @@ watch(result, () => {
editTitle.value = config.value?.title
})
-const { mutate: updateConfig, loading, onDone } = useMutation(UpdateConfig)
+const { mutate: updateConfig, loading: updateLoading, onDone } = useMutation(UpdateConfig)
function saveEdit () {
updateConfig({
@@ -83,12 +83,12 @@ const extensions = computed(() => {
-
+
diff --git a/ui/src/views/configurations/ConfigurationList.vue b/ui/src/views/configurations/ConfigurationList.vue
index ff04f12..727c6a6 100644
--- a/ui/src/views/configurations/ConfigurationList.vue
+++ b/ui/src/views/configurations/ConfigurationList.vue
@@ -2,11 +2,12 @@
import { useQuery } from '@vue/apollo-composable'
import { computed, ComputedRef, ref } from 'vue'
-import { Config } from '@/typed-graph'
+import { Config, MachineDetail, Maybe } from '@/typed-graph'
import { GetConfigs } from '@/views/query/config'
import { IconPlus, IconReload, IconSearch } from '@tabler/icons-vue'
import ConfigRemoveDialog from '@/views/configurations/ConfigRemoveDialog.vue'
import { useI18n } from 'vue-i18n'
+import UsedByListDialog from '@/views/configurations/UsedByListDialog.vue'
const { t } = useI18n()
@@ -19,7 +20,7 @@ const headers = [
{ title: 'ID', key: 'id' },
{ title: 'Layer', key: 'title' },
{ title: 'Used By', key: 'usedBy' },
- { title: ' ', key: 'action' },
+ { title: 'Actions', key: 'actions', sortable: false },
]
const searchValue = ref('')
@@ -81,12 +82,10 @@ const searchValue = ref('')
{{ value }}
-
- {{ by?.machineName || by?.machineId }}
-
+
-
-
+
+
diff --git a/ui/src/views/configurations/UsedByListDialog.vue b/ui/src/views/configurations/UsedByListDialog.vue
new file mode 100644
index 0000000..46c38f0
--- /dev/null
+++ b/ui/src/views/configurations/UsedByListDialog.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+ {{ props.usedBy.length }} {{ $t('fields.Node', props.usedBy.length) }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ $d(value, 'short') }}
+
+
+
+
+
+
+
diff --git a/ui/src/views/query/config.ts b/ui/src/views/query/config.ts
index a2bdb28..40c907a 100644
--- a/ui/src/views/query/config.ts
+++ b/ui/src/views/query/config.ts
@@ -7,8 +7,12 @@ export const GetConfigs = gql`
title
config
usedBy {
+ id
machineId
machineName
+ minersArray
+ miners
+ startupTime
}
}
}
@@ -21,8 +25,12 @@ export const GetConfig = gql`
title
config
usedBy {
+ id
machineId
machineName
+ minersArray
+ miners
+ startupTime
}
}
}`