diff --git a/frontend/src/views/container/template/import/index.vue b/frontend/src/views/container/template/import/index.vue
index 06d0e3049..199528a33 100644
--- a/frontend/src/views/container/template/import/index.vue
+++ b/frontend/src/views/container/template/import/index.vue
@@ -22,7 +22,13 @@
-
+
@@ -48,7 +54,7 @@
-
+
@@ -85,6 +91,12 @@ const currentData = ref([]);
const uploadRef = ref();
const uploaderFiles = ref();
const detailRef = ref();
+const pageData = ref([]);
+const paginationConfig = reactive({
+ currentPage: 1,
+ pageSize: 10,
+ total: 0,
+});
const acceptParams = async (): Promise => {
visible.value = true;
@@ -102,8 +114,10 @@ const loadTemplates = async () => {
currentData.value = res.data.items || [];
};
-const handleSelectionChange = (val: any) => {
- selects.value = val;
+const search = () => {
+ const startIndex = (paginationConfig.currentPage - 1) * paginationConfig.pageSize;
+ const endIndex = startIndex + paginationConfig.pageSize;
+ pageData.value = displayData.value.slice(startIndex, endIndex);
};
const onOpenDetail = async (row: Container.TemplateInfo) => {
@@ -186,6 +200,8 @@ const compareData = (importLists: any[]) => {
}
displayData.value = [...news, ...conflicts, ...duplicates];
+ paginationConfig.total = displayData.value.length;
+ search();
};
const onImport = async () => {
diff --git a/frontend/src/views/cronjob/cronjob/import/index.vue b/frontend/src/views/cronjob/cronjob/import/index.vue
index e6c9e7da5..78131c4e5 100644
--- a/frontend/src/views/cronjob/cronjob/import/index.vue
+++ b/frontend/src/views/cronjob/cronjob/import/index.vue
@@ -22,7 +22,13 @@
-
+
-
+
@@ -93,14 +99,22 @@ const data = ref();
const uploadRef = ref();
const uploaderFiles = ref();
+const pageData = ref([]);
+const paginationConfig = reactive({
+ currentPage: 1,
+ pageSize: 10,
+ total: 0,
+});
const acceptParams = (): void => {
visible.value = true;
data.value = [];
};
-const handleSelectionChange = (val: any) => {
- selects.value = val;
+const search = () => {
+ const startIndex = (paginationConfig.currentPage - 1) * paginationConfig.pageSize;
+ const endIndex = startIndex + paginationConfig.pageSize;
+ pageData.value = data.value.slice(startIndex, endIndex);
};
const fileOnChange = (_uploadFile: UploadFile, uploadFiles: UploadFiles) => {
@@ -125,6 +139,8 @@ const fileOnChange = (_uploadFile: UploadFile, uploadFiles: UploadFiles) => {
}
}
data.value = parsed;
+ paginationConfig.total = data.value.length;
+ search();
loading.value = false;
} catch (error) {
MsgError(i18n.global.t('commons.msg.errImport') + error.message);
diff --git a/frontend/src/views/host/firewall/forward/import/index.vue b/frontend/src/views/host/firewall/forward/import/index.vue
index 582d1ea69..4daf320b5 100644
--- a/frontend/src/views/host/firewall/forward/import/index.vue
+++ b/frontend/src/views/host/firewall/forward/import/index.vue
@@ -22,7 +22,13 @@
-
+
@@ -49,7 +55,7 @@
-
+
@@ -85,6 +91,12 @@ const availableInterfaces = ref([]);
const uploadRef = ref();
const uploaderFiles = ref();
+const pageData = ref([]);
+const paginationConfig = reactive({
+ currentPage: 1,
+ pageSize: 10,
+ total: 0,
+});
const acceptParams = async (fireName: string): Promise => {
visible.value = true;
@@ -110,8 +122,10 @@ const loadCurrentData = async (fireName: string) => {
}
};
-const handleSelectionChange = (val: any) => {
- selects.value = val;
+const search = () => {
+ const startIndex = (paginationConfig.currentPage - 1) * paginationConfig.pageSize;
+ const endIndex = startIndex + paginationConfig.pageSize;
+ pageData.value = displayData.value.slice(startIndex, endIndex);
};
const fileOnChange = (_uploadFile: UploadFile, uploadFiles: UploadFiles) => {
@@ -197,6 +211,8 @@ const compareRules = (importedRules: any[]) => {
}
displayData.value = [...newRules, ...conflictRules, ...duplicateRules];
+ paginationConfig.total = displayData.value.length;
+ search();
};
const onImport = async () => {
diff --git a/frontend/src/views/host/firewall/forward/index.vue b/frontend/src/views/host/firewall/forward/index.vue
index 9c7a05d83..f3e850eda 100644
--- a/frontend/src/views/host/firewall/forward/index.vue
+++ b/frontend/src/views/host/firewall/forward/index.vue
@@ -239,7 +239,7 @@ const onExport = () => {
cancelButtonText: i18n.global.t('commons.button.cancel'),
},
).then(async () => {
- const exportData = data.value.map((item: Host.RuleInfo) => ({
+ const exportData = selects.value.map((item: Host.RuleInfo) => ({
family: item.family,
protocol: item.protocol,
port: item.port,
diff --git a/frontend/src/views/host/firewall/ip/import/index.vue b/frontend/src/views/host/firewall/ip/import/index.vue
index a7c03ef5f..8f606bd7f 100644
--- a/frontend/src/views/host/firewall/ip/import/index.vue
+++ b/frontend/src/views/host/firewall/ip/import/index.vue
@@ -22,7 +22,13 @@
-
+
@@ -46,7 +52,7 @@
prop="description"
show-overflow-tooltip
/>
-
+
@@ -80,6 +86,12 @@ const currentRules = ref([]);
const uploadRef = ref();
const uploaderFiles = ref();
+const pageData = ref([]);
+const paginationConfig = reactive({
+ currentPage: 1,
+ pageSize: 10,
+ total: 0,
+});
const acceptParams = async (): Promise => {
visible.value = true;
@@ -100,8 +112,10 @@ const loadCurrentData = async () => {
currentRules.value = res.data.items || [];
};
-const handleSelectionChange = (val: any) => {
- selects.value = val;
+const search = () => {
+ const startIndex = (paginationConfig.currentPage - 1) * paginationConfig.pageSize;
+ const endIndex = startIndex + paginationConfig.pageSize;
+ pageData.value = displayData.value.slice(startIndex, endIndex);
};
const fileOnChange = (_uploadFile: UploadFile, uploadFiles: UploadFiles) => {
@@ -183,6 +197,8 @@ const compareRules = (importedRules: any[]) => {
}
displayData.value = [...newRules, ...conflictRules, ...duplicateRules];
+ paginationConfig.total = displayData.value.length;
+ search();
};
const onImport = async () => {
diff --git a/frontend/src/views/host/firewall/ip/index.vue b/frontend/src/views/host/firewall/ip/index.vue
index 45e9cd975..260a260ee 100644
--- a/frontend/src/views/host/firewall/ip/index.vue
+++ b/frontend/src/views/host/firewall/ip/index.vue
@@ -303,7 +303,7 @@ const onExport = () => {
cancelButtonText: i18n.global.t('commons.button.cancel'),
},
).then(async () => {
- const exportData = data.value.map((item: Host.RuleInfo) => ({
+ const exportData = selects.value.map((item: Host.RuleInfo) => ({
family: item.family,
address: item.address,
strategy: item.strategy,
diff --git a/frontend/src/views/host/firewall/port/import/index.vue b/frontend/src/views/host/firewall/port/import/index.vue
index 54cc94d95..0e257015e 100644
--- a/frontend/src/views/host/firewall/port/import/index.vue
+++ b/frontend/src/views/host/firewall/port/import/index.vue
@@ -22,7 +22,13 @@
-
+
@@ -48,7 +54,7 @@
prop="description"
show-overflow-tooltip
/>
-
+
@@ -82,6 +88,12 @@ const currentRules = ref([]);
const uploadRef = ref();
const uploaderFiles = ref();
+const pageData = ref([]);
+const paginationConfig = reactive({
+ currentPage: 1,
+ pageSize: 10,
+ total: 0,
+});
const acceptParams = async (): Promise => {
visible.value = true;
@@ -103,8 +115,10 @@ const loadCurrentData = async () => {
currentRules.value = res.data.items || [];
};
-const handleSelectionChange = (val: any) => {
- selects.value = val;
+const search = () => {
+ const startIndex = (paginationConfig.currentPage - 1) * paginationConfig.pageSize;
+ const endIndex = startIndex + paginationConfig.pageSize;
+ pageData.value = displayData.value.slice(startIndex, endIndex);
};
const fileOnChange = (_uploadFile: UploadFile, uploadFiles: UploadFiles) => {
@@ -189,6 +203,8 @@ const compareRules = (importedRules: any[]) => {
}
displayData.value = [...newRules, ...conflictRules, ...duplicateRules];
+ paginationConfig.total = displayData.value.length;
+ search();
};
const onImport = async () => {
diff --git a/frontend/src/views/terminal/command/import/index.vue b/frontend/src/views/terminal/command/import/index.vue
index 331948189..0af6b70c8 100644
--- a/frontend/src/views/terminal/command/import/index.vue
+++ b/frontend/src/views/terminal/command/import/index.vue
@@ -34,7 +34,13 @@
-
+
-
+
@@ -90,6 +96,12 @@ const data = ref([]);
const uploadRef = ref();
const uploaderFiles = ref();
+const pageData = ref([]);
+const paginationConfig = reactive({
+ currentPage: 1,
+ pageSize: 10,
+ total: 0,
+});
const currentGroup = ref();
const groupList = ref();
@@ -100,6 +112,13 @@ const acceptParams = (): void => {
loadGroups();
currentGroup.value = '';
data.value = [];
+ pageData.value = [];
+};
+
+const search = () => {
+ const startIndex = (paginationConfig.currentPage - 1) * paginationConfig.pageSize;
+ const endIndex = startIndex + paginationConfig.pageSize;
+ pageData.value = data.value.slice(startIndex, endIndex);
};
const loadGroups = async () => {
@@ -120,10 +139,6 @@ const changeGroup = () => {
}
};
-const handleSelectionChange = (val: any) => {
- selects.value = val;
-};
-
const fileOnChange = async (_uploadFile: UploadFile, uploadFiles: UploadFiles) => {
uploaderFiles.value = uploadFiles;
if (uploaderFiles.value.length !== 1) {
@@ -142,6 +157,8 @@ const fileOnChange = async (_uploadFile: UploadFile, uploadFiles: UploadFiles) =
if (data.value.length === 0) {
MsgError(i18n.global.t('terminal.noSuchCommand'));
}
+ paginationConfig.total = data.value.length;
+ search();
})
.catch(() => {
loading.value = false;