Skip to content

Commit

Permalink
fix(frontend): tendbCluster 扩容/缩容接入层无法选择异常集群 TencentBlueKing#7354
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 21189
  • Loading branch information
hLinx authored and iSecloud committed Oct 18, 2024
1 parent bd27d25 commit a7e67bc
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@
const tabListConfig = {
[ClusterTypes.TENDBCLUSTER]: {
disabledRowConfig: [
{
handler: (data: TendbClusterModel) => data.status !== 'normal',
tip: t('集群异常'),
},
{
handler: (data: TendbClusterModel) => data.spider_master.length <= 2 && data.spider_slave.length <= 1,
tip: t('Master 至少保留 2 台 ,Slave 至少 保留 1台'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,8 @@

const tabListConfig = {
[ClusterTypes.TENDBCLUSTER]: {
disabledRowConfig: [
{
handler: (data: TendbClusterModel) => data.status !== 'normal',
tip: t('集群异常'),
},
],
id: ClusterTypes.TENDBCLUSTER,
name: t('集群选择'),
},
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<template>
<DbCard
mode="collapse"
:title="t('基本信息')">
<table class="ticket-base-info">
<tbody>
<tr>
<td>{{ t('单号') }}:</td>
<td>{{ ticketData.id }}</td>
<td>{{ t('单据状态') }}:</td>
<td>
<BkTag :theme="ticketData.tagTheme">
{{ t(ticketData.statusText) }}
</BkTag>
</td>
<td>{{ t('已耗时') }}:</td>
<td>
<CostTimer
:is-timing="ticketData?.status === 'RUNNING'"
:start-time="utcTimeToSeconds(ticketData?.create_at)"
:value="ticketData?.cost_time || 0" />
</td>
</tr>
<tr>
<td>{{ t('单据类型') }}:</td>
<td>{{ ticketData.ticket_type_display }}</td>
<td>{{ t('申请人') }}:</td>
<td>{{ ticketData.creator }}</td>
<td>{{ t('申请时间') }}:</td>
<td>{{ utcDisplayTime(ticketData.create_at) }}</td>
</tr>
</tbody>
</table>
</DbCard>
</template>
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import TicketModel from '@services/model/ticket/ticket';
import CostTimer from '@components/cost-timer/CostTimer.vue';
import { utcDisplayTime, utcTimeToSeconds } from '@utils';
interface Props {
ticketData: TicketModel<unknown>;
}
defineProps<Props>();
const { t } = useI18n();
</script>
<style lang="less">
.ticket-base-info {
td {
width: 18%;
line-height: 32px;
color: #313238;
&:nth-child(2n + 1) {
width: 12%;
padding-right: 8px;
text-align: right;
}
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,33 @@
mode="collapse"
:title="t('基本信息')">
<table class="ticket-base-info">
<tr>
<td>{{ t('单号') }}:</td>
<td>{{ ticketData.id }}</td>
<td>{{ t('单据状态') }}:</td>
<td>
<BkTag :theme="ticketData.tagTheme">
{{ t(ticketData.statusText) }}
</BkTag>
</td>
<td>{{ t('已耗时') }}:</td>
<td>
<CostTimer
:is-timing="ticketData?.status === 'RUNNING'"
:start-time="utcTimeToSeconds(ticketData?.create_at)"
:value="ticketData?.cost_time || 0" />
</td>
</tr>
<tr>
<td>{{ t('单据类型') }}:</td>
<td>{{ ticketData.ticket_type_display }}</td>
<td>{{ t('申请人') }}:</td>
<td>{{ ticketData.creator }}</td>
<td>{{ t('申请时间') }}:</td>
<td>{{ utcDisplayTime(ticketData.create_at) }}</td>
</tr>
<tbody>
<tr>
<td>{{ t('单号') }}:</td>
<td>{{ ticketData.id }}</td>
<td>{{ t('单据状态') }}:</td>
<td>
<BkTag :theme="ticketData.tagTheme">
{{ t(ticketData.statusText) }}
</BkTag>
</td>
<td>{{ t('已耗时') }}:</td>
<td>
<CostTimer
:is-timing="ticketData?.status === 'RUNNING'"
:start-time="utcTimeToSeconds(ticketData?.create_at)"
:value="ticketData?.cost_time || 0" />
</td>
</tr>
<tr>
<td>{{ t('单据类型') }}:</td>
<td>{{ ticketData.ticket_type_display }}</td>
<td>{{ t('申请人') }}:</td>
<td>{{ ticketData.creator }}</td>
<td>{{ t('申请时间') }}:</td>
<td>{{ utcDisplayTime(ticketData.create_at) }}</td>
</tr>
</tbody>
</table>
</DbCard>
</template>
Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/frontend/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default defineConfig(({ mode }) => {
}),
].concat(isHttps ? [basicSsl()] : []),
optimizeDeps: {
exclude: ['@blueking/ip-selector/dist/vue3.x.js', 'lib/'],
exclude: ['@blueking/ip-selector/dist/vue3.x.js'],
},
server: {
strictPort: true,
Expand Down

0 comments on commit a7e67bc

Please sign in to comment.