Skip to content

Commit

Permalink
fix(frontend): 年度大版本测试v1.5.0前端问题修复 TencentBlueKing#6958
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 19177
  • Loading branch information
jinquantianxia authored and iSecloud committed Sep 24, 2024
1 parent 78aff30 commit e2e4e33
Show file tree
Hide file tree
Showing 18 changed files with 131 additions and 103 deletions.
68 changes: 35 additions & 33 deletions dbm-ui/frontend/src/components/cluster-common/RenderBaseInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,41 @@
<template>
<div class="render-cluster-base-info">
<table>
<tr>
<td>ID:</td>
<td>{{ data.id }}</td>
<td>{{ $t('状态') }}:</td>
<td>
<RenderClusterStatus
v-if="data.status"
:data="data.status" />
</td>
</tr>
<tr>
<td>{{ $t('集群名称') }}:</td>
<td>
{{ data.cluster_name }}
<span
v-if="data.cluster_alias"
style="color: #63656e">
({{ data.cluster_alias }})
</span>
</td>
<td>{{ $t('域名') }}:</td>
<td>{{ data.domain }}</td>
</tr>
<tr>
<td>{{ $t('所属业务') }}:</td>
<td>{{ displayBizName }}</td>
<td>{{ $t('数据版本') }}:</td>
<td>{{ data.major_version }}</td>
</tr>
<tr>
<td>{{ $t('创建时间') }}:</td>
<td>{{ data.create_at }}</td>
</tr>
<tbody>
<tr>
<td>ID:</td>
<td>{{ data.id }}</td>
<td>{{ $t('状态') }}:</td>
<td>
<RenderClusterStatus
v-if="data.status"
:data="data.status" />
</td>
</tr>
<tr>
<td>{{ $t('集群名称') }}:</td>
<td>
{{ data.cluster_name }}
<span
v-if="data.cluster_alias"
style="color: #63656e">
({{ data.cluster_alias }})
</span>
</td>
<td>{{ $t('域名') }}:</td>
<td>{{ data.domain }}</td>
</tr>
<tr>
<td>{{ $t('所属业务') }}:</td>
<td>{{ displayBizName }}</td>
<td>{{ $t('数据版本') }}:</td>
<td>{{ data.major_version }}</td>
</tr>
<tr>
<td>{{ $t('创建时间') }}:</td>
<td>{{ data.create_at }}</td>
</tr>
</tbody>
</table>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,37 @@
{{ data.spec_name }}
</div>
<table class="info-box">
<tr>
<td>CPU:</td>
<td>
<span>{{ data.cpu.min }} ~ {{ data.cpu.max }} {{ t('核') }}</span>
</td>
</tr>
<tr>
<td>{{ t('内存') }}:</td>
<td>
<span>{{ data.mem.min }} ~ {{ data.mem.max }} G</span>
</td>
</tr>
<tr>
<td>{{ t('磁盘') }}:</td>
<td>
<BkTable
:border="['outer']"
:columns="tableColumns"
:data="data.storage_spec"
:max-height="200"
style="width: 420px" />
</td>
</tr>
<tr>
<td>{{ t('每台主机实例数量') }}:</td>
<td>
<span>{{ data.instance_num }}</span>
</td>
</tr>
<tbody>
<tr>
<td>CPU:</td>
<td>
<span>{{ data.cpu.min }} ~ {{ data.cpu.max }} {{ t('核') }}</span>
</td>
</tr>
<tr>
<td>{{ t('内存') }}:</td>
<td>
<span>{{ data.mem.min }} ~ {{ data.mem.max }} G</span>
</td>
</tr>
<tr>
<td>{{ t('磁盘') }}:</td>
<td>
<BkTable
:border="['outer']"
:columns="tableColumns"
:data="data.storage_spec"
:max-height="200"
style="width: 420px" />
</td>
</tr>
<tr>
<td>{{ t('每台主机实例数量') }}:</td>
<td>
<span>{{ data.instance_num }}</span>
</td>
</tr>
</tbody>
</table>
</div>
</template>
Expand Down
18 changes: 9 additions & 9 deletions dbm-ui/frontend/src/components/locale-switch/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@
</div>
<template #content>
<div class="local-switch-menu">
<div
class="item"
:class="{ active: $i18n.locale === 'zh-cn' }"
@click="handleSwitchLocale('zh-cn')">
<DbIcon
class="mr-4"
type="cn" />
中文
</div>
<div
class="item"
:class="{
Expand All @@ -35,15 +44,6 @@
type="en" />
English
</div>
<div
class="item"
:class="{ active: $i18n.locale === 'zh-cn' }"
@click="handleSwitchLocale('zh-cn')">
<DbIcon
class="mr-4"
type="cn" />
中文
</div>
</div>
</template>
</BkPopover>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
:list="selectList"
:placeholder="t('请选择')"
:rules="rules"
@change="(value) => handleChange(value as string)"
@option-click="(value) => handleOptionClick(value as string)">
@change="(value) => handleChange(value as string)">
<template #default="{ optionItem }">
<div class="role-host-select-option">
<div>{{ optionItem.label }}</div>
Expand Down Expand Up @@ -167,11 +166,11 @@
emits('type-change', value);
};

const handleOptionClick = (value: string) => {
if (value === localValue.value) {
isShowInstanceSelecotr.value = true;
}
};
// const handleOptionClick = (value: string) => {
// if (value === localValue.value) {
// isShowInstanceSelecotr.value = true;
// }
// };

const handleInstancesChange = (selectedValues: InstanceSelectorValues<IValue>) => {
selected.value = selectedValues;
Expand Down
5 changes: 2 additions & 3 deletions dbm-ui/frontend/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@
"新Proxy主机": "New Proxy host",
"新主库IP": "New Master IP",
"新从库IP": "New Slave IP",
"新从库主机": "New Slave host",
"新实例": "New instance",
"新客户端IP": "New client IP",
"新节点IP": "New node IP",
Expand Down Expand Up @@ -1005,7 +1004,7 @@
"清空": "Cleanup",
"角色": "Role",
"解析并添加": "Parse and add",
"请输入IP_Port_如_1_1_1_1_10000_多个可使用换行_空格或_分隔": "Please enter IP:Port, such as (127.0.0.1:10000)\nMultiples can be separated by newlines, spaces or ;, |",
"请输入IP_Port_如_1_1_1_1_10000_多个可使用换行_空格或_分隔": "Please enter IP:Port, such as (127.0.0.1:10000)\nMultiples can be separated by newlines, spaces or ;,|",
"请输入实例": "Please enter an instance",
"请选择实例": "Please select an instance",
"Agent异常无法使用": "Agent is abnormally",
Expand Down Expand Up @@ -1596,6 +1595,6 @@
"规格名称不能为空": "Specification name cannot be empty",
"主机资源不足_等待管理员users补货_补货完成后可以前往place重试": "Host resources are insufficient. Wait for the administrator ({users}) to replenish the inventory. After the replenishment is complete, you can go to \"{place}\" and try again",
"可用主机数": "Number of available hosts",

"版本日志": "Release Notes",
"这行勿动!新增翻译请在上一行添加!": ""
}
6 changes: 5 additions & 1 deletion dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3430,6 +3430,10 @@
"我的申请": "我的申请",
"我负责的业务": "我负责的业务",
"统一设置": "统一设置",
"统一设置:将该列统一设置为相同的值": "统一设置:将该列统一设置为相同的值",
"仅DataNode类型的节点支持替换": "仅DataNode类型的节点支持替换",
"库表输入说明": "库表输入说明",
"不允许输入系统库和特殊库,如mysql、sys 等": "不允许输入系统库和特殊库,如mysql、sys 等",
"支持 %(指代任意长度字符串), ?(指代单个字符串), *(指代全部)三个通配符": "支持 %(指代任意长度字符串), ?(指代单个字符串), *(指代全部)三个通配符",
"包含通配符时, 每一单元格只允许输入单个对象。% ? 不能独立使用, * 只能单独使用": "包含通配符时, 每一单元格只允许输入单个对象。% ? 不能独立使用, * 只能单独使用",
"这行勿动!新增翻译请在上一行添加!": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@
label: t('部署时间'),
field: 'create_at',
sort: true,
width: 250,
render: ({ data }: {data: EsNodeModel}) => <span>{data.createAtDisplay}</span>,
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@
'es_datanode_hot',
'es_datanode_cold',
],
showLineHeight: false,
trigger: 'manual' as const,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,24 @@
return options;
};

const checkNodeReplaceDisable = (node: HdfsNodeModel) => {
const options = {
disabled: false,
tooltips: {
disabled: true,
content: '',
},
};

if (!node.isDataNode) {
options.disabled = true;
options.tooltips.disabled = false;
options.tooltips.content = t('节点类型不支持替换');
}

return options;
};

const globalBizsStore = useGlobalBizs();
const copy = useCopy();
const { t, locale } = useI18n();
Expand Down Expand Up @@ -342,7 +360,7 @@
if (_.find(selectList, item => !item.isDataNode)) {
options.disabled = true;
options.tooltips.disabled = false;
options.tooltips.content = t('仅DataNode类型的节点支持缩容');
options.tooltips.content = t('仅DataNode类型的节点支持替换');
return options;
}
return options;
Expand Down Expand Up @@ -371,6 +389,7 @@
label: t('节点IP'),
field: 'ip',
showOverflowTooltip: false,
width: 120,
render: ({ data }: { data: HdfsNodeModel }) => (
<div style="display: flex; align-items: center;">
<div class="text-overflow" v-overflow-tips>
Expand Down Expand Up @@ -428,6 +447,7 @@
label: t('部署时间'),
field: 'create_at',
sort: true,
width: 250,
render: ({ data }: {data: HdfsNodeModel}) => <span>{data.createAtDisplay}</span>,
},
{
Expand All @@ -436,6 +456,7 @@
fixed: 'right',
render: ({ data }: { data: HdfsNodeModel }) => {
const shrinkDisableTooltips = checkNodeShrinkDisable(data);
const replaceDisableTooltips = checkNodeReplaceDisable(data);
return (
<>
<OperationBtnStatusTips
Expand All @@ -458,17 +479,17 @@
v-db-console="hdfs.nodeList.replace"
data={operationData.value}>
<span v-bk-tooltips={{
content: t('节点类型不支持替换'),
disabled: data.isDataNode,
}}>
<auth-button
content: t('节点类型不支持替换'),
disabled: data.isDataNode,
}}>
<auth-button
text
theme="primary"
action-id="hdfs_replace"
permission={data.permission.hdfs_replace}
resource={data.bk_host_id}
class="ml8"
disabled={operationData.value?.operationDisabled}
disabled={replaceDisableTooltips.disabled || operationData.value?.operationDisabled}
onClick={() => handleReplaceOne(data)}
>
{t('替换')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
:disabled="isBatchRestartDisabled || isRestartActionDisabled"
:loading="isBatchRestartLoading"
@click="handleBatchRestart">
{{ $t('批量重启') }}
{{ t('批量重启') }}
</BkButton>
</div>
<BkLoading :loading="isLoading">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,7 @@
'hdfs_journalnode',
'hdfs_datanode',
],
showLineHeight: false,
trigger: 'manual' as const,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@
'zookeeper',
'broker',
],
showLineHeight: false,
trigger: 'manual' as const,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,15 @@
nextTick(() => {
tableRef.value.fetchData({
config_name: searchKey.value,
}, {
cluster_type: 'tendbha,tendbsingle',
});
})
},
{
immediate: true
}
);
const fetchData = () => {
tableRef.value.fetchData({
tableRef.value.fetchData({}, {
cluster_type: 'tendbha,tendbsingle',
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@
'pulsar_zookeeper',
'pulsar_broker',
],
showLineHeight: false,
trigger: 'manual' as const,
};

Expand Down
Loading

0 comments on commit e2e4e33

Please sign in to comment.