-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #630 from Adamant-im/feat/service-tab
Feat/service tab
- Loading branch information
Showing
82 changed files
with
1,313 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<template> | ||
<NodesTableContainer> | ||
<NodesTableHead hide-socket :label="$t('nodes.service')" /> | ||
|
||
<tbody> | ||
<ServiceNodesTableItem | ||
v-for="node in nodes" | ||
:key="node.url" | ||
:label="node.label" | ||
:node="node" | ||
/> | ||
</tbody> | ||
</NodesTableContainer> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { computed, defineComponent } from 'vue' | ||
import { useStore } from 'vuex' | ||
import NodesTableContainer from '@/components/nodes/components/NodesTableContainer.vue' | ||
import NodesTableHead from '@/components/nodes/components/NodesTableHead.vue' | ||
import ServiceNodesTableItem from './ServiceNodesTableItem.vue' | ||
import { type NodeStatusResult } from '@/lib/nodes/abstract.node' | ||
import { sortNodesFn } from '@/components/nodes/utils/sortNodesFn' | ||
const className = 'nodes-table' | ||
const classes = { | ||
root: className | ||
} | ||
export default defineComponent({ | ||
components: { | ||
NodesTableContainer, | ||
NodesTableHead, | ||
ServiceNodesTableItem | ||
}, | ||
setup() { | ||
const store = useStore() | ||
const nodes = computed<NodeStatusResult[]>(() => { | ||
const arr = store.getters['services/services'] | ||
return [...arr].sort(sortNodesFn) | ||
}) | ||
return { | ||
nodes, | ||
classes | ||
} | ||
} | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<template> | ||
<tr :class="classes.root"> | ||
<NodeColumn checkbox> | ||
<NodeStatusCheckbox :value="active" @change="toggleActiveStatus" /> | ||
</NodeColumn> | ||
|
||
<NodeColumn align="left"> | ||
<NodeLabel :label="label" /> | ||
</NodeColumn> | ||
|
||
<NodeColumn> | ||
<NodeUrl :node="node" /> | ||
</NodeColumn> | ||
|
||
<NodeColumn ping :colspan="isUnsupported ? 2 : 1"> | ||
<NodeStatus :node="node" /> | ||
</NodeColumn> | ||
</tr> | ||
</template> | ||
|
||
<script lang="ts"> | ||
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 NodeStatusCheckbox from '@/components/nodes/components/NodeStatusCheckbox.vue' | ||
const className = 'nodes-table-item' | ||
const classes = { | ||
root: className, | ||
column: `${className}__column`, | ||
columnCheckbox: `${className}__column--checkbox`, | ||
checkbox: `${className}__checkbox` | ||
} | ||
export default { | ||
components: { | ||
NodeColumn, | ||
NodeStatus, | ||
NodeLabel, | ||
NodeUrl, | ||
NodeStatusCheckbox | ||
}, | ||
props: { | ||
node: { | ||
type: Object as PropType<NodeStatusResult>, | ||
required: true | ||
}, | ||
label: { | ||
type: String as PropType<TNodeLabel>, | ||
required: true | ||
} | ||
}, | ||
setup(props) { | ||
const store = useStore() | ||
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.label) | ||
const toggleActiveStatus = () => { | ||
store.dispatch('services/toggle', { | ||
type: type.value, | ||
url: url.value, | ||
active: !active.value | ||
}) | ||
store.dispatch('services/updateStatus') | ||
} | ||
return { | ||
classes, | ||
url, | ||
active, | ||
isUnsupported, | ||
toggleActiveStatus | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
.nodes-table-item { | ||
} | ||
.nodeName { | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as ServiceNodesTable } from './ServiceNodesTable.vue' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.