Skip to content

Commit

Permalink
feat(frontend): 集群列表支持批量禁用/启用、删除集群 TencentBlueKing#7753
Browse files Browse the repository at this point in the history
  • Loading branch information
3octaves committed Nov 12, 2024
1 parent 37bee41 commit c700b13
Show file tree
Hide file tree
Showing 18 changed files with 119 additions and 43 deletions.
6 changes: 5 additions & 1 deletion dbm-ui/frontend/src/services/model/es/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { uniq } from 'lodash';

import type { ClusterListEntry, ClusterListNode, ClusterListOperation } from '@services/types';

import { utcDisplayTime } from '@utils';
import { isRecentDays, utcDisplayTime } from '@utils';

import { t } from '@locales/index';

Expand Down Expand Up @@ -233,6 +233,10 @@ export default class Es {
}));
}

get isNew() {
return isRecentDays(this.create_at, 24);
}

initOperations(payload = [] as Es['operations']) {
if (!Array.isArray(payload)) {
return [];
Expand Down
6 changes: 5 additions & 1 deletion dbm-ui/frontend/src/services/model/hdfs/hdfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { uniq } from 'lodash';

import type { ClusterListEntry, ClusterListNode, ClusterListOperation } from '@services/types';

import { utcDisplayTime } from '@utils';
import { isRecentDays, utcDisplayTime } from '@utils';

import { t } from '@locales/index';

Expand Down Expand Up @@ -238,4 +238,8 @@ export default class Hdfs {
get isStarting() {
return Boolean(this.operations.find((item) => item.ticket_type === Hdfs.HDFS_ENABLE));
}

get isNew() {
return isRecentDays(this.create_at, 24);
}
}
6 changes: 5 additions & 1 deletion dbm-ui/frontend/src/services/model/mysql/tendbha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { uniq } from 'lodash';

import type { ClusterListEntry, ClusterListNode, ClusterListOperation } from '@services/types';

import { utcDisplayTime } from '@utils';
import { isRecentDays, utcDisplayTime } from '@utils';

import { t } from '@locales/index';

Expand Down Expand Up @@ -232,4 +232,8 @@ export default class Tendbha {
ticketId: item.ticket_id,
}));
}

get isNew() {
return isRecentDays(this.create_at, 24);
}
}
6 changes: 5 additions & 1 deletion dbm-ui/frontend/src/services/model/mysql/tendbsingle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { uniq } from 'lodash';

import type { ClusterListEntry, ClusterListNode, ClusterListOperation } from '@services/types';

import { utcDisplayTime } from '@utils';
import { isRecentDays, utcDisplayTime } from '@utils';

import { t } from '@locales/index';

Expand Down Expand Up @@ -210,4 +210,8 @@ export default class Tendbsingle {
ticketId: item.ticket_id,
}));
}

get isNew() {
return isRecentDays(this.create_at, 24);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,14 @@
)
}
{
isRecentDays(data.create_at, 24 * 3)
&& <span class="glob-new-tag cluster-tag ml-4" data-text="NEW" />
data.isNew && (
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
{data.domain && (
<RenderCellCopy copyItems={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,14 @@
)
}
{
isRecentDays(data.create_at, 24 * 3)
&& <span class="glob-new-tag cluster-tag ml-4" data-text="NEW" />
data.isNew && (
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
{data.domain && (
<RenderCellCopy copyItems={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,12 @@
}
{
data.isNew && (
<span class="glob-new-tag cluster-tag" data-text="NEW" />
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
<db-icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@

import RenderClusterStatus from '@components/cluster-status/Index.vue';
import DbTable from '@components/db-table/index.vue';
import MiniTag from '@components/mini-tag/index.vue';
import RenderTextEllipsisOneLine from '@components/text-ellipsis-one-line/index.vue';
import TextOverflowLayout from '@components/text-overflow-layout/Index.vue';

Expand Down Expand Up @@ -425,11 +424,12 @@
<>
{
data.isNew && (
<MiniTag
content='NEW'
class="new-tag"
theme='success'>
</MiniTag>
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@

import RenderClusterStatus from '@components/cluster-status/Index.vue';
import DbTable from '@components/db-table/index.vue';
import MiniTag from '@components/mini-tag/index.vue';
import RenderTextEllipsisOneLine from '@components/text-ellipsis-one-line/index.vue';
import TextOverflowLayout from '@components/text-overflow-layout/Index.vue';

Expand Down Expand Up @@ -380,9 +379,12 @@
<>
{
data.isNew && (
<MiniTag
content='NEW'
theme='success' />
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,13 @@
)
}
{
isRecentDays(data.create_at, 24 * 3) && (
<span
class="glob-new-tag cluster-tag ml-4"
data-text="NEW" />
data.isNew && (
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
<RenderCellCopy copyItems={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,12 @@
<span>{data.id}</span>
{
data.isNew && (
<span
class="glob-new-tag cluster-tag ml-4"
data-text="NEW" />
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,13 @@
)
}
{
isRecentDays(data.create_at, 24 * 3) && (
<span
class="glob-new-tag cluster-tag ml-4"
data-text="NEW" />
data.isNew && (
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
<RenderCellCopy copyItems={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,16 @@
render: ({ data }: {data: PulsarNodeModel}) => (
<>
<span>{data.ip}</span>
{ data.isNew && <span class="glob-new-tag cluster-tag ml-4" data-text="NEW" /> }
{
data.isNew && (
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
</>
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,16 @@
</bk-tag>
)
}
{ data.isNew && <span class="glob-new-tag cluster-tag ml-4" data-text="NEW" /> }
{
data.isNew && (
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
{data.domain && (
<RenderCellCopy copyItems={
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,12 @@
}/>
{
data.isNew && (
<span
class="glob-new-tag cluster-tag ml-4"
data-text="NEW"/>
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
<span v-db-console="sqlserver.haClusterList.modifyEntryConfiguration">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,12 @@
} />
{
data.isNew && (
<span
class="glob-new-tag cluster-tag ml-4"
data-text="NEW" />
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
<span v-db-console="sqlserver.singleClusterList.modifyEntryConfiguration">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,13 @@
)
}
{
!data.isNew && (
<span class="glob-new-tag cluster-tag" data-text="NEW" />
data.isNew && (
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
{data.master_domain && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,12 @@
<span>{data.id}</span>
{
data.isNew && (
<span
class="glob-new-tag cluster-tag ml-4"
data-text="NEW" />
<bk-tag
theme="success"
size="small"
class="ml-4">
NEW
</bk-tag>
)
}
{
Expand Down

0 comments on commit c700b13

Please sign in to comment.