diff --git a/apps/web/src/services/alert-manager/v2/components/AlertsManagementTable.vue b/apps/web/src/services/alert-manager/v2/components/AlertsManagementTable.vue index 2d31136f9c..df7b9b3cd5 100644 --- a/apps/web/src/services/alert-manager/v2/components/AlertsManagementTable.vue +++ b/apps/web/src/services/alert-manager/v2/components/AlertsManagementTable.vue @@ -19,6 +19,8 @@ import type { ValueHandlerMap } from '@cloudforet/mirinae/types/controls/search/ import type { DataTableFieldType } from '@cloudforet/mirinae/types/data-display/tables/data-table/type'; import { iso8601Formatter } from '@cloudforet/utils'; +import type { ExportParameter } from '@/api-clients/_common/schema/api-verbs/export'; +import { QueryType } from '@/api-clients/_common/schema/api-verbs/export'; import { ALERT_STATUS, ALERT_URGENCY } from '@/schema/alert-manager/alert/constants'; import type { AlertModel } from '@/schema/alert-manager/alert/model'; import type { CloudServiceGetParameters } from '@/schema/inventory/cloud-service/api-verbs/get'; @@ -32,8 +34,7 @@ import type { ServiceReferenceMap } from '@/store/reference/service-reference-st import type { WebhookReferenceMap } from '@/store/reference/webhook-reference-store'; import { useUserStore } from '@/store/user/user-store'; -import { FILE_NAME_PREFIX } from '@/lib/excel-export/constant'; -import { downloadExcel } from '@/lib/helper/file-download-helper'; +import { downloadExcelByExportFetcher } from '@/lib/helper/file-download-helper'; import { replaceUrlQuery } from '@/lib/router-query-string'; import CustomDateModal from '@/common/components/custom-date-modal/CustomDateModal.vue'; @@ -295,15 +296,27 @@ const handleCustomFieldUpdate = (fields: DataTableFieldType[]) => { state.fields = fields; }; const handleExportToExcel = async () => { - await downloadExcel({ - url: '/alert-manager/alert/list', - param: { - query: { ...alertListApiQueryHelper.data, only: ALERT_EXCEL_FIELDS.map((d) => d.key) }, - }, - fields: ALERT_EXCEL_FIELDS, - file_name_prefix: FILE_NAME_PREFIX.alert, - timezone: storeState.timezone, - }); + const excelQuery = new ApiQueryHelper() + .setMultiSortV2([{ key: 'created_at', desc: true }]) + .setFilters([...filterQueryHelper.filters]); + const excelExportFetcher = () => { + const alertExcelExportParams: ExportParameter = { + file_name: 'alert_export', + options: [ + { + name: 'Main Table', + query_type: QueryType.SEARCH, + search_query: { + ...excelQuery.data, + fields: ALERT_EXCEL_FIELDS, + }, + }, + ], + timezone: state.timezone, + }; + return SpaceConnector.clientV2.alertManager.alert.export(alertExcelExportParams); + }; + await downloadExcelByExportFetcher(excelExportFetcher); }; const handleCustomRangeModalConfirm = (start: string, end: string) => { alertPageStore.setSelectedPeriodRange(ALERT_PERIOD_DROPDOWN_MENU.CUSTOM); diff --git a/apps/web/src/services/alert-manager/v2/components/ServiceDetailHeader.vue b/apps/web/src/services/alert-manager/v2/components/ServiceDetailHeader.vue index 92414637f1..87f8d57211 100644 --- a/apps/web/src/services/alert-manager/v2/components/ServiceDetailHeader.vue +++ b/apps/web/src/services/alert-manager/v2/components/ServiceDetailHeader.vue @@ -84,6 +84,7 @@ const handleGoBackButton = () => { const validHealthyPage = (!Number.isNaN(serviceListPageStore.healthyThisPage) && serviceListPageStore.healthyThisPage > 0) ? serviceListPageStore.healthyThisPage : 1; + router.push({ name: ALERT_MANAGER_ROUTE.SERVICE._NAME, query: { diff --git a/apps/web/src/services/alert-manager/v2/components/ServiceList.vue b/apps/web/src/services/alert-manager/v2/components/ServiceList.vue index 8768009464..1c398eacf6 100644 --- a/apps/web/src/services/alert-manager/v2/components/ServiceList.vue +++ b/apps/web/src/services/alert-manager/v2/components/ServiceList.vue @@ -61,7 +61,29 @@ const queryTagHelper = useQueryTags({ keyItemSets: SERVICE_SEARCH_HANDLER.keyIte const { queryTags } = queryTagHelper; const handleToolbox = async (options: ToolboxOptions) => { - if (options.queryTags !== undefined) queryTagHelper.setQueryTags(options.queryTags); + if (options.queryTags !== undefined) { + queryTagHelper.setQueryTags(options.queryTags); + + const nameTags = options.queryTags.filter((tag) => tag.key?.name === 'name'); + const nameValues = nameTags.map((tag) => tag.value.name).filter(Boolean); + + const newQuery: Record = { + unhealthyPage: String(serviceListPageStore.unhealthyThisPage), + healthyPage: String(serviceListPageStore.healthyThisPage), + }; + + if (nameValues.length > 0) { + newQuery.serviceName = nameValues.join(','); + } else { + newQuery.serviceName = undefined; + } + + replaceUrlQuery(newQuery); + + serviceListPageStore.setUnhealthyPage(1); + serviceListPageStore.setHealthyPage(1); + } + await fetchBothLists(); }; @@ -166,33 +188,35 @@ onMounted(async () => { serviceListPageStore.setUnhealthyPage(parsedUnhealthy); serviceListPageStore.setHealthyPage(parsedHealthy); + const { serviceName } = route.query; + if (serviceName && typeof serviceName === 'string') { + const nameValues = serviceName.split(',').map((name) => ({ + key: { name: 'name' }, + value: { label: name, name }, + })); + queryTagHelper.setQueryTags(nameValues); + } + await fetchBothLists(); }); -watch(() => route.query.serviceName, async (serviceName) => { - if (!serviceName) return; - queryTagHelper.setQueryTags([ - { - key: { name: 'name', label: 'Name' }, - operator: '=', - value: { label: serviceName as string, name: serviceName }, - }, - ]); - await fetchBothLists(); -}, { immediate: true }); watch(() => serviceListPageStore.unhealthyThisPage, (val) => { - replaceUrlQuery({ - unhealthyPage: String(val), - healthyPage: String(serviceListPageStore.healthyThisPage), - }); + if (!queryTags.value.some((tag) => tag.key?.name === 'name')) { + replaceUrlQuery({ + unhealthyPage: String(val), + healthyPage: String(serviceListPageStore.healthyThisPage), + }); + } handleUnhealthyPageChange(); }); watch(() => serviceListPageStore.healthyThisPage, (val) => { - replaceUrlQuery({ - unhealthyPage: String(serviceListPageStore.unhealthyThisPage), - healthyPage: String(val), - }); + if (!queryTags.value.some((tag) => tag.key?.name === 'name')) { + replaceUrlQuery({ + unhealthyPage: String(serviceListPageStore.unhealthyThisPage), + healthyPage: String(val), + }); + } handleHealthyPageChange(); }); @@ -212,10 +236,12 @@ watch(() => serviceListPageStore.healthyThisPage, (val) => { />
-
serviceListPageStore.healthyThisPage, (val) => { />
serviceListPageStore.healthyThisPage, (val) => { />
+
+ +
serviceListPageStore.healthyThisPage, (val) => { @navigate-to-detail="handleNavigateToDetail" />
- serviceListPageStore.healthyThisPage, (val) => { />
-
+ +
+ + + + {{ $t('ALERT_MANAGER.SERVICE.NO_DATA_DESC') }} + +
- - diff --git a/apps/web/src/services/cost-explorer/components/BudgetCreateStep3.vue b/apps/web/src/services/cost-explorer/components/BudgetCreateStep3.vue index 6c987a4093..91a2d2a4c0 100644 --- a/apps/web/src/services/cost-explorer/components/BudgetCreateStep3.vue +++ b/apps/web/src/services/cost-explorer/components/BudgetCreateStep3.vue @@ -38,7 +38,7 @@ watch(() => budgetCreatePageState.thresholds, () => { const values = budgetCreatePageState.thresholds.map((t) => Number(t.value)); invalidThreshold.value = budgetCreatePageState.thresholds.map((threshold, idx) => { const val = values[idx]; - const isValidNumber = val > 0 && val < 101; + const isValidNumber = val > 0; const isDuplicate = values.indexOf(val) !== idx; return !(isValidNumber && !isDuplicate); }); diff --git a/apps/web/src/services/cost-explorer/components/BudgetLastThreeMonthCostTrendBarChart.vue b/apps/web/src/services/cost-explorer/components/BudgetLastThreeMonthCostTrendBarChart.vue index 353bf30c87..7e96db6154 100644 --- a/apps/web/src/services/cost-explorer/components/BudgetLastThreeMonthCostTrendBarChart.vue +++ b/apps/web/src/services/cost-explorer/components/BudgetLastThreeMonthCostTrendBarChart.vue @@ -159,11 +159,7 @@ watch(() => budgetCreatePageState, async () => {