-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Manage panel -cluster (#68)
feat: add manage pane-cluster - [x] add root level section of manage - [x] add tool bar with connection selector, manage switch tab - [x] implement manage cluster section Refs: #17 --------- Signed-off-by: seven <[email protected]>
- Loading branch information
Showing
15 changed files
with
351 additions
and
7 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"private": true, | ||
"type": "module", | ||
"version": "0.4.2", | ||
"description": "A faster, better and more stable NoSQL desktop tools", | ||
"description": "DocKit is a desktop client designed for NoSQL database, support Elasticsearch and OpenSearch across Mac, windows and Linux", | ||
"author": "geekfun <[email protected]>", | ||
"homepage": "ttps://dockit.geekfun.club", | ||
"license": "Apache-2.0", | ||
|
@@ -31,6 +31,7 @@ | |
"monaco-editor": "^0.50.0", | ||
"pinia": "^2.1.7", | ||
"pinia-plugin-persistedstate": "^3.2.1", | ||
"pretty-bytes": "^6.1.1", | ||
"tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store#v1", | ||
"tauri-plugin-system-info-api": "^1.0.2", | ||
"ulidx": "^2.3.0", | ||
|
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
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,93 @@ | ||
<template> | ||
<div class="manage-state-container"> | ||
<n-card class="cluster-item-box cluster-cluster-box"> | ||
<p :class="clusterStatusClass"> | ||
<span>{{ $t('manage.cluster') }}</span> | ||
<n-icon size="24"> | ||
<CheckmarkOutline v-if="props.cluster?.status == 'green'" /> | ||
<WarningAlt v-else-if="props.cluster?.status == 'yellow'" /> | ||
<MisuseOutline v-else-if="props.cluster?.status == 'red'" /> | ||
</n-icon> | ||
</p> | ||
<p>name: {{ props.cluster?.cluster_name }}</p> | ||
<p>id: {{ props.cluster?.cluster_uuid }}</p> | ||
<p>version: {{ props.cluster?.nodes.versions }}</p> | ||
</n-card> | ||
<n-card class="cluster-item-box cluster-nodes-box"> | ||
<p>{{ $t('manage.nodes') }}: {{ props.cluster?.nodes.count.total }}</p> | ||
<p>master: {{ props.cluster?.nodes.count.master }}</p> | ||
<p>data: {{ props.cluster?.nodes.count.data }}</p> | ||
</n-card> | ||
<n-card class="cluster-item-box cluster-shards-box"> | ||
<p>{{ $t('manage.shards') }}: {{ props.cluster?.indices.shards.total }}</p> | ||
<p>primaries: {{ props.cluster?.indices.shards.primaries }}</p> | ||
<p> | ||
replicas: | ||
{{ | ||
(props.cluster?.indices?.shards?.total || 0) - | ||
(props.cluster?.indices.shards?.primaries || 0) | ||
}} | ||
</p> | ||
</n-card> | ||
<n-card class="cluster-item-box cluster-indices-box"> | ||
<p>{{ $t('manage.indices') }}: {{ props.cluster?.indices.count }}</p> | ||
<p>docs: {{ props.cluster?.indices.docs.count }}</p> | ||
<p>size: {{ prettyBytes(props.cluster?.indices.store.size_in_bytes || 0) }}</p> | ||
</n-card> | ||
</div> | ||
</template> | ||
<script setup lang="ts"> | ||
import prettyBytes from 'pretty-bytes'; | ||
import { CheckmarkOutline, WarningAlt, MisuseOutline } from '@vicons/carbon'; | ||
import { RawClusterStats } from '../../../store'; | ||
const props = defineProps<{ cluster: RawClusterStats | null }>(); | ||
const clusterStatusClass = computed(() => { | ||
if (!props.cluster) return ''; | ||
return `cluster-status-color-${props.cluster.status}`; | ||
}); | ||
const emits = defineEmits(['switch-manage-tab']); | ||
</script> | ||
<style lang="scss" scoped> | ||
.manage-state-container { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-around; | ||
margin-top: 10px; | ||
.n-card { | ||
max-width: 300px; | ||
} | ||
.cluster-item-box p:first-of-type { | ||
font-size: 28px; | ||
font-weight: bold; | ||
margin-block: 0; | ||
color: #2478ec; | ||
} | ||
.cluster-cluster-box p:first-of-type { | ||
color: #36ad6a; | ||
span { | ||
height: 100%; | ||
margin-right: 10px; | ||
} | ||
} | ||
.cluster-status-color-green { | ||
color: #36ad6a; | ||
} | ||
.cluster-status-color-yellow { | ||
color: #f1c40f; | ||
} | ||
.cluster-status-color-red { | ||
color: #e74c3c; | ||
} | ||
} | ||
</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,7 @@ | ||
<template> | ||
<div>nodes page</div> | ||
</template> | ||
|
||
<script setup lang="ts"></script> | ||
|
||
<style scoped></style> |
Oops, something went wrong.