Skip to content

Commit

Permalink
adds warning for using unsupported version of elasticvue
Browse files Browse the repository at this point in the history
  • Loading branch information
cars10 committed Jul 18, 2023
1 parent 0d5f506 commit 0b335f9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
27 changes: 20 additions & 7 deletions src/components/clusterselection/ClusterTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
:pagination="{sortBy: 'name'}"
:rows-per-page-options="DEFAULT_ROWS_PER_PAGE">
<template #body="{row}">
<tr class="clickable" :data-testid="`cluster-table-row-${row.index}`"
:title="t('cluster_selection.cluster_table.row.title', {uri: row.uri})"
@click="loadCluster(row.index)">
<td>
<tr class="clickable" :data-testid="`cluster-table-row-${row.index}`" @click="loadCluster(row.index)">
<td :title="t('cluster_selection.cluster_table.row.title', {uri: row.uri})">
<div style="flex-shrink: 0" class="flex items-center">
<cluster-status-indicator :status="row.status" />

Expand All @@ -39,13 +37,28 @@
</q-chip>
</div>
</td>
<td>
<td :title="t('cluster_selection.cluster_table.row.title', {uri: row.uri})">
<div class="ellipsis inline-block vertical-middle q-mr-sm" style="max-width: 300px;">
{{ row.uri }}
</div>
<copy-button :value="row.uri" round size="sm" flat />
</td>
<td class="small-wrap">{{ row.version }}</td>
<td class="small-wrap">
<div class="flex items-center no-wrap">
{{ row.version }}
<q-icon v-if="!SUPPORTED_MAJOR_VERSIONS.includes(row.majorVersion)" name="warning" color="warning"
class="q-pl-xs">
<q-tooltip class="bg-dark text-body2">
{{
t('cluster_selection.cluster_table.row.unsupported', {
majorVersion: row.majorVersion,
supportedVersions: SUPPORTED_MAJOR_VERSIONS.join(", ")
})
}}
</q-tooltip>
</q-icon>
</div>
</td>
<td class="small-wrap">
<edit-cluster :index="row.index" />
<q-btn icon="delete" round flat size="sm" data-testid="cluster-delete"
Expand All @@ -61,7 +74,7 @@
import EditCluster from './EditCluster.vue'
import FilterInput from '../shared/FilterInput.vue'
import NewCluster from './NewCluster.vue'
import { DEFAULT_ROWS_PER_PAGE } from '../../consts'
import { DEFAULT_ROWS_PER_PAGE, SUPPORTED_MAJOR_VERSIONS } from '../../consts'
import { useClusterTable } from '../../composables/components/clusterselection/ClusterTable'
import { useConnectionStore } from '../../store/connection'
import { useTranslation } from '../../composables/i18n.ts'
Expand Down
1 change: 1 addition & 0 deletions src/consts.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const SUPPORTED_MAJOR_VERSIONS = ['6', '7', '8']
export const REQUEST_DEFAULT_HEADERS = {
Accept: 'application/json',
'Content-Type': 'application/json'
Expand Down
3 changes: 2 additions & 1 deletion src/locales/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"title": "连接到集群 '{uri}'",
"remove_cluster": {
"confirm": "移除集群 '{name}' ({uri})?"
}
},
"unsupported": null
}
},
"edit_cluster": {
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"title": "Connect to cluster at '{uri}'",
"remove_cluster": {
"confirm": "Remove cluster '{name}' ({uri})?"
}
},
"unsupported": "Elasticsearch {majorVersion} is not officially supported by elasticvue. Only elasticsearch versions {supportedVersions} are supported."
}
},
"edit_cluster": {
Expand Down

0 comments on commit 0b335f9

Please sign in to comment.