Skip to content

Commit

Permalink
fix(frontend): redis机器部署问题 TencentBlueKing#7740
Browse files Browse the repository at this point in the history
  • Loading branch information
3octaves authored and hLinx committed Nov 5, 2024
1 parent f7cf590 commit 8c166a5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -629,11 +629,16 @@
};
const handleChangeClusterType = () => {
const count = [ClusterTypes.PREDIXY_TENDISPLUS_CLUSTER, ClusterTypes.PREDIXY_REDIS_CLUSTER].includes(
state.formdata.details.cluster_type,
)
? 3
: 1;
state.formdata.details.db_version = '';
state.formdata.details.resource_spec.proxy.spec_id = '';
state.formdata.details.resource_spec.backend_group = {
...state.formdata.details.resource_spec.backend_group,
count: 1,
count,
spec_id: '',
capacity: '',
future_capacity: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@
const specs = shallowRef<ClusterSpecModel[]>([]);
const countMap = shallowRef({} as Record<number, number>)
const isTendisCache = computed(() => props.clusterType === ClusterTypes.TWEMPROXY_REDIS_INSTANCE);
const targetCapacityTitle = computed(() => (isTendisCache.value ? t('集群容量需求(内存容量)') : t('集群容量需求(磁盘容量)')));
const futureCapacityTitle = computed(() => (isTendisCache.value ? t('未来集群容量需求(内存容量)') : t('未来集群容量需求(磁盘容量)')));
const isMemoryType = computed(() => [ClusterTypes.TWEMPROXY_REDIS_INSTANCE, ClusterTypes.PREDIXY_REDIS_CLUSTER].includes(props.clusterType as ClusterTypes));
const targetCapacityTitle = computed(() => (isMemoryType.value ? t('集群容量需求(内存容量)') : t('集群容量需求(磁盘容量)')));
const futureCapacityTitle = computed(() => (isMemoryType.value ? t('未来集群容量需求(内存容量)') : t('未来集群容量需求(磁盘容量)')));
const columns = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<BkInput
v-model="modelValue.count"
clearable
:min="1"
:min="countMin"
show-clear-only-hover
style="width: 314px"
type="number" />
Expand Down Expand Up @@ -103,6 +103,16 @@
const specSelectorRef = ref<ComponentExposed<typeof SpecSelector>>();
const shardNum = ref(1);
const countMin = computed(() => {
if (
[ClusterTypes.PREDIXY_TENDISPLUS_CLUSTER, ClusterTypes.PREDIXY_REDIS_CLUSTER].includes(
props.clusterType as ClusterTypes,
)
) {
return 3;
}
return 1;
});
const clusterShardNum = computed(() => modelValue.value.count * shardNum.value || '');
const totalCapcity = computed(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@
}
return true
});
const isTendisCache = computed(() => props.data.clusterType === ClusterTypes.TWEMPROXY_REDIS_INSTANCE);
const targetCapacityTitle = computed(() => (isTendisCache.value ? t('目标集群容量需求(内存容量)') : t('目标集群容量需求(磁盘容量)')));
const futureCapacityTitle = computed(() => (isTendisCache.value ? t('未来集群容量需求(内存容量)') : t('未来集群容量需求(磁盘容量)')));
const isMemoryType = computed(() => [ClusterTypes.TWEMPROXY_REDIS_INSTANCE, ClusterTypes.PREDIXY_REDIS_CLUSTER].includes(props.data.clusterType));
const targetCapacityTitle = computed(() => (isMemoryType.value ? t('目标集群容量需求(内存容量)') : t('目标集群容量需求(磁盘容量)')));
const futureCapacityTitle = computed(() => (isMemoryType.value ? t('未来集群容量需求(内存容量)') : t('未来集群容量需求(磁盘容量)')));

const currentSpec = computed(() => {
if (props?.data) {
Expand Down

0 comments on commit 8c166a5

Please sign in to comment.