File tree Expand file tree Collapse file tree 3 files changed +70
-14
lines changed
components/render-table/columns/spec-display
views/db-manage/redis/REDIS_SCALE_UPDOWN/components Expand file tree Collapse file tree 3 files changed +70
-14
lines changed Original file line number Diff line number Diff line change 1515 <BkLoading :loading =" isLoading" >
1616 <div
1717 class =" render-spec-box"
18- :class =" { 'default-display': !data }" >
18+ :class =" { 'default-display': !displayInfo }" >
1919 <span
20- v-if =" !data "
20+ v-if =" !displayInfo "
2121 style =" color : #c4c6cc " >
2222 {{ placeholder || t('输入主机后自动生成') }}
2323 </span >
2424 <span
2525 v-else
2626 class =" content" >
27- {{ data?.name ? `${data.name} ${isIgnoreCounts ? '' : t('((n))台', { n: data?.count })}` : '' }}
27+ {{
28+ displayInfo?.name
29+ ? `${displayInfo.name} ${isIgnoreCounts ? '' : t('((n))台', { n: displayInfo?.count })}`
30+ : ''
31+ }}
2832 <SpecPanel
29- :data =" data "
33+ :data =" displayInfo "
3034 :hide-qps =" hideQps" >
3135 <DbIcon
3236 class =" visible-icon ml-4"
4448 interface Props {
4549 data? : {
4650 count? : number ;
47- cpu: {
51+ cpu? : {
4852 max: number ;
4953 min: number ;
5054 };
51- // id : number;
52- mem: {
55+ id ? : number ;
56+ mem? : {
5357 max: number ;
5458 min: number ;
5559 };
56- name: string ;
57- qps: {
60+ name? : string ;
61+ qps? : {
5862 max: number ;
5963 min: number ;
6064 };
61- storage_spec: {
65+ spec_id? : number ;
66+ spec_name? : string ;
67+ storage_spec? : {
6268 mount_point: string ;
6369 size: number ;
6470 type: string ;
7076 placeholder? : string ;
7177 }
7278
73- withDefaults (defineProps <Props >(), {
74- data: undefined ,
79+ const props = withDefaults (defineProps <Props >(), {
80+ data : () => ({
81+ count: 0 ,
82+ cpu: {
83+ max: 1 ,
84+ min: 0 ,
85+ },
86+ id: 0 ,
87+ mem: {
88+ max: 1 ,
89+ min: 0 ,
90+ },
91+ name: ' ' ,
92+ qps: {
93+ max: 1 ,
94+ min: 0 ,
95+ },
96+ spec_id: 0 ,
97+ spec_name: ' ' ,
98+ storage_spec: [],
99+ }),
75100 hideQps: true ,
76101 isIgnoreCounts: false ,
77102 isLoading: false ,
78103 placeholder: undefined ,
79104 });
80105
81106 const { t } = useI18n ();
107+
108+ const displayInfo = computed (() =>
109+ Object .assign (
110+ {
111+ count: 0 ,
112+ cpu: {
113+ max: 1 ,
114+ min: 0 ,
115+ },
116+ id: 0 ,
117+ mem: {
118+ max: 1 ,
119+ min: 0 ,
120+ },
121+ name: ' ' ,
122+ qps: {
123+ max: 1 ,
124+ min: 0 ,
125+ },
126+ spec_id: 0 ,
127+ spec_name: ' ' ,
128+ storage_spec: [],
129+ },
130+ props .data ,
131+ {
132+ id: props .data ?.id || (props .data ?.spec_id as number ),
133+ name: props .data ?.name || (props .data ?.spec_name as string ),
134+ },
135+ ),
136+ );
82137 </script >
83138<style lang="less" scoped>
84139 .render-spec-box {
Original file line number Diff line number Diff line change 1717 :label =" t('当前容量')"
1818 :min-width =" 200" >
1919 <div
20- v-if =" cluster?.cluster_stats?.total "
20+ v-if =" cluster.id "
2121 class =" capacity-box" >
2222 <div class =" display-content" >
2323 <div class =" item" >
7474 cluster_spec: RedisModel [' cluster_spec' ];
7575 cluster_stats: RedisModel [' cluster_stats' ];
7676 group_num: number ;
77+ id: number ;
7778 shard_num: number ;
7879 };
7980 }
Original file line number Diff line number Diff line change 6969 <div class =" column-content" >
7070 <RenderSpec
7171 :data =" data.currentSepc"
72- :hide-qps =" !data.currentSepc.qps?.max"
72+ :hide-qps =" !data.currentSepc? .qps?.max"
7373 is-ignore-counts />
7474 </div >
7575 </div >
You can’t perform that action at this time.
0 commit comments