-
-
- {{ t('确定') }}
-
-
+
+ {{ t('确定') }}
+
@@ -97,19 +91,26 @@
const layoutStyle = {
height: `${contentHeight}px`,
};
+
const tooltip = computed(() => {
const path = router.resolve({
name: 'taskHistory'
});
- return {
- theme: 'light',
- disabled: hostSelectList.value.length < 1,
- content: () => (
-
- {t('提交后,将会进行主机初始化任务,具体的导入结果,可以通过“')}
{t('任务历史')}{t('”查看')}
-
- )
- }
+ return !hostSelectList.value.length
+ ? {
+ disabled: !!hostSelectList.value.length,
+ content: t('请选择主机'),
+ }
+ : {
+ theme: 'light',
+ content: () => (
+
+ {t('提交后,将会进行主机初始化任务,具体的导入结果,可以通过“')}
+
{t('任务历史')}
+ {t('”查看')}
+
+ ),
+ }
});
const handleSubmit = () => {
diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/import-host/components/FormPanel.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/import-host/components/FormPanel.vue
index fd782c3dc0..00787722ca 100644
--- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/import-host/components/FormPanel.vue
+++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/import-host/components/FormPanel.vue
@@ -151,7 +151,7 @@
import { useCopy } from '@hooks';
- import TagSelector from '@views/resource-manage/pool/components/host-list/components/tag-selector/Index.vue';
+ import TagSelector from '@views/resource-manage/pool/components/tag-selector/Index.vue';
import { messageWarn } from '@utils';
diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/resource-search-selector/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/resource-search-selector/Index.vue
index 8275defaf0..47ac6336fb 100644
--- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/resource-search-selector/Index.vue
+++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/resource-search-selector/Index.vue
@@ -125,8 +125,8 @@
diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/review-data-dialog/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/review-data-dialog/Index.vue
index 0a134f0da0..a3d94c64c0 100644
--- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/review-data-dialog/Index.vue
+++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/review-data-dialog/Index.vue
@@ -42,7 +42,7 @@
{{ t('确定') }}
@@ -66,6 +66,7 @@
tip: string;
loading: boolean;
selected: string[];
+ theme?: 'primary' | 'danger';
}
interface Emits {
@@ -73,7 +74,10 @@
(e: 'cancel'): void;
}
- defineProps();
+ withDefaults(defineProps(), {
+ theme: 'primary',
+ });
+
const emits = defineEmits();
const isShow = defineModel('isShow', {
default: false,
@@ -123,17 +127,21 @@
}
.selected-content {
+ display: grid;
+ grid-template-columns: repeat(2, 1fr);
font-size: 12px;
.selected-item {
padding: 6px 16px;
- &:nth-child(even) {
- background-color: #fafbfd;
+ &:nth-child(4n-3),
+ &:nth-child(4n-2) {
+ background-color: #ffffff;
}
- &:nth-child(odd) {
- background-color: #ffffff;
+ &:nth-child(4n-1),
+ &:nth-child(4n) {
+ background-color: #fafbfd;
}
}
}
diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/com-factory/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/com-factory/Index.vue
index b3630d1e4d..00914cbe0c 100644
--- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/com-factory/Index.vue
+++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/com-factory/Index.vue
@@ -90,7 +90,7 @@
mount_point: MountPoint,
cpu: Cpu,
mem: Mem,
- label: Label,
+ labels: Label,
disk: Disk,
disk_type: DiskType,
city: CitySubzones,
diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/field-config.ts b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/field-config.ts
index b807008e0c..ddd027181a 100644
--- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/field-config.ts
+++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/field-config.ts
@@ -135,9 +135,9 @@ export default {
return true;
},
},
- label: {
+ labels: {
label: t('标签'),
- component: 'label',
+ component: 'labels',
type: 'string',
},
disk: {
diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/field-input/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/field-input/Index.vue
index f4cb42b674..e9bf3bba78 100644
--- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/field-input/Index.vue
+++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/search-box/components/field-input/Index.vue
@@ -73,7 +73,7 @@
@@ -164,7 +164,7 @@
os_type: true,
cpu: true,
mem: true,
- label: true,
+ labels: true,
mount_point: true,
disk: true,
disk_type: true,
diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/update-assign/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/update-assign/Index.vue
index 06e0b090ce..c5167edaf1 100644
--- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/update-assign/Index.vue
+++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/update-assign/Index.vue
@@ -72,7 +72,7 @@
import { fetchDbTypeList } from '@services/source/infras';
import type { BizItem } from '@services/types';
- import TagSelector from '../tag-selector/Index.vue';
+ import TagSelector from '@views/resource-manage/pool/components/tag-selector/Index.vue';
interface Props {
editData: DbResourceModel;
@@ -153,7 +153,7 @@
await formRef.value!.validate();
runUpdate({
bk_host_ids: [props.editData.bk_host_id],
- for_biz: +formData.for_biz,
+ for_biz: Number(formData.for_biz),
resource_type: formData.resource_type,
labels: formData.labels,
rack_id: '',
diff --git a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/tag-selector/Index.vue b/dbm-ui/frontend/src/views/resource-manage/pool/components/tag-selector/Index.vue
similarity index 91%
rename from dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/tag-selector/Index.vue
rename to dbm-ui/frontend/src/views/resource-manage/pool/components/tag-selector/Index.vue
index 1fa30ebc9c..87e67fa1a1 100644
--- a/dbm-ui/frontend/src/views/resource-manage/pool/components/host-list/components/tag-selector/Index.vue
+++ b/dbm-ui/frontend/src/views/resource-manage/pool/components/tag-selector/Index.vue
@@ -18,18 +18,17 @@
class="editor-wrapper">
+ class="editor" />
+ @click.stop="handleCreate">
+ @click.stop="handleClose">
@@ -110,18 +109,20 @@
const { run: runCreate } = useRequest(createTag, {
manual: true,
onSuccess() {
- pagination.count += 1;
- loadMore();
- isEdit.value = false;
+ if (pagination.count === tagList.value.length) {
+ runListTag({
+ bk_biz_id: props.bkBizId,
+ offset: tagList.value.length,
+ ordering: 'create_at',
+ });
+ }
+ handleClose();
messageSuccess(t('新建成功'));
},
});
const loadMore = () => {
- if (listTagLoading.value) {
- return;
- }
- if (tagList.value.length >= pagination.count) {
+ if (listTagLoading.value || pagination.offset >= pagination.count) {
return;
}
pagination.offset = Math.min(pagination.count, pagination.offset + pagination.limit);
@@ -140,6 +141,7 @@
tagList.value = [];
runListTag({
bk_biz_id: props.bkBizId,
+ ordering: 'create_at',
});
},
);
@@ -153,6 +155,7 @@
offset: pagination.offset,
limit: pagination.limit,
value: searchVal.value,
+ ordering: 'create_at',
});
});
@@ -161,6 +164,7 @@
};
const handleClose = () => {
+ tagValue.value = '';
isEdit.value = false;
};
@@ -204,6 +208,7 @@
bk_biz_id: props.bkBizId,
offset: 0,
limit: pagination.limit,
+ ordering: 'create_time',
});
});
@@ -250,7 +255,6 @@
&:hover {
cursor: pointer;
- background-color: #e1ecff;
}
.check-line {
diff --git a/dbm-ui/frontend/src/views/resource-manage/routes.ts b/dbm-ui/frontend/src/views/resource-manage/routes.ts
index 4d8c87f2f8..02f2e65445 100644
--- a/dbm-ui/frontend/src/views/resource-manage/routes.ts
+++ b/dbm-ui/frontend/src/views/resource-manage/routes.ts
@@ -26,6 +26,24 @@ const resourcePoolRoute = {
component: () => import('@views/resource-manage/pool/global/Index.vue'),
};
+const faultPoolRoute = {
+ name: 'faultPool',
+ path: 'fault-pool',
+ meta: {
+ navName: t('故障池'),
+ },
+ component: () => import('@views/resource-manage/pool/components/fault-or-recycle-list/Index.vue'),
+};
+
+const toRecyclePoolRoute = {
+ name: 'toRecyclePool',
+ path: 'to-recycle-pool',
+ meta: {
+ navName: t('待回收池'),
+ },
+ component: () => import('@views/resource-manage/pool/components/fault-or-recycle-list/Index.vue'),
+};
+
const resourcePoolOperationRecordRoute = {
name: 'resourcePoolOperationRecord',
path: 'record',
@@ -87,6 +105,14 @@ export default function getRoutes() {
existResourcePool = true;
}
+ if (checkDbConsole('resourceManage.faultPool')) {
+ mainRoute[0].children.push(faultPoolRoute);
+ }
+
+ if (checkDbConsole('resourceManage.toRecyclePool')) {
+ mainRoute[0].children.push(toRecyclePoolRoute);
+ }
+
if (checkDbConsole('resourceManage.dirtyHostManage')) {
mainRoute[0].children.push(resourcePoolDirtyMachinesRoute);
}
diff --git a/dbm-ui/frontend/src/views/tag-manage/Index.vue b/dbm-ui/frontend/src/views/tag-manage/Index.vue
index 1e88a85779..dfc89aee20 100644
--- a/dbm-ui/frontend/src/views/tag-manage/Index.vue
+++ b/dbm-ui/frontend/src/views/tag-manage/Index.vue
@@ -165,7 +165,7 @@
const { href } = router.resolve({
name: isBusiness ? 'BizResourcePool' : 'resourcePool',
query: {
- label: data.id
+ labels: data.id
},
params: {
page: isBusiness ? 'business' : 'host-list'
diff --git a/dbm-ui/frontend/src/views/tag-manage/components/CreateTag.vue b/dbm-ui/frontend/src/views/tag-manage/components/CreateTag.vue
index a4acc621f9..f6e5ece1fe 100644
--- a/dbm-ui/frontend/src/views/tag-manage/components/CreateTag.vue
+++ b/dbm-ui/frontend/src/views/tag-manage/components/CreateTag.vue
@@ -163,8 +163,8 @@
.header-wrapper {
display: flex;
align-items: center;
- color: #979ba5;
font-size: 14px;
+ color: #979ba5;
.title {
font-size: 20px;