Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
cdd31b6
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Mar 18, 2025
0e33fa9
Merge remote-tracking branch 'cloudforet-io/develop' into feature-ser…
skdud4659 Mar 18, 2025
2a7a063
feat: update languages (#5703)
seungyeoneeee Mar 19, 2025
da60ff1
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Mar 20, 2025
cec9679
Feat: add features related to service account manager (#5707)
seungyeoneeee Mar 24, 2025
b94355a
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Mar 24, 2025
ecfe231
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Mar 27, 2025
017d290
Feat: update budget landing page & create page initial mark-up and ap…
seungyeoneeee Mar 27, 2025
fc092ed
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Mar 27, 2025
7bda682
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Mar 28, 2025
e70ac02
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Mar 28, 2025
3b070cc
Feat: update budget create page with reactivity chart (#5728)
seungyeoneeee Mar 29, 2025
9ca0e17
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 1, 2025
0484431
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 1, 2025
e6dca15
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 3, 2025
b7e0063
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 7, 2025
50282db
feat: update budget schema and create Page (#5757)
seungyeoneeee Apr 9, 2025
4fe992f
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 10, 2025
ea258f6
feat: update budget main page as feedback (#5758)
seungyeoneeee Apr 10, 2025
7a15bcf
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 14, 2025
36ee82f
feat: update budget main page (#5769)
seungyeoneeee Apr 14, 2025
7f1a454
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 14, 2025
4bec120
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 14, 2025
8aa3d34
feat: update unifiedCost trend chart at budget create page (#5771)
seungyeoneeee Apr 15, 2025
06a17b3
feat: update budget minor changes (#5772)
seungyeoneeee Apr 15, 2025
7280cf2
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 16, 2025
94bfa70
feat: add budget detail page & fix minor changes (#5775)
seungyeoneeee Apr 16, 2025
98c74ff
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 17, 2025
96006d6
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 17, 2025
ee196dc
feat: update budget main list filter toolset (#5780)
seungyeoneeee Apr 17, 2025
e782d76
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 17, 2025
f2895a6
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 17, 2025
3226c49
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 17, 2025
3e09b60
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 18, 2025
f11338e
feat: update all pages with feedback (#5784)
seungyeoneeee Apr 18, 2025
435f713
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 18, 2025
09a32d0
Merge branch 'develop' into feature-service-account-budget
seungyeoneeee Apr 21, 2025
a774e09
feat: update budget languages & pages (minor changes) (#5785)
seungyeoneeee Apr 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export interface BudgetUsageAnalyzeResult {
project_id?: string;
workspace_id?: string;
data_source_id?: string;
provider_filter?: {
state?: string;
providers?: string[];
};
// provider_filter?: {
// state?: string;
// providers?: string[];
// };
resource_group: Extract<ResourceGroupType, 'WORKSPACE' | 'PROJECT'>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export interface BudgetUsageListParameters {
data_source_id?: string;
workspace_id?: string;
project_id?: string;
service_account_id?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import type { ResourceGroupType } from '@/api-clients/_common/schema/type';
import type { Currency } from '@/store/display/type';


interface ProviderFilter {
providers: string[];
state: 'ENABLED' | 'DISABLED';
}
// interface ProviderFilter {
// providers: string[];
// state: 'ENABLED' | 'DISABLED';
// }

export interface BudgetUsageModel {
budget_id: string;
Expand All @@ -15,11 +15,11 @@ export interface BudgetUsageModel {
cost: number;
limit: number;
currency: Currency;
provider_filter?: ProviderFilter;
data_source_id: string;
resource_group: Extract<ResourceGroupType, 'WORKSPACE'|'PROJECT'>;
project_id: string;
workspace_id: string;
service_account_id: string;
domain_id: string;
updated_at: string;
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
import type { Tags } from '@/api-clients/_common/schema/model';
import type { ResourceGroupType } from '@/api-clients/_common/schema/type';
import type {
BudgetNotification, BudgetPlannedLimit, BudgetTimeUnit, ProviderFilter,
BudgetNotification, BudgetPlannedLimit, BudgetTimeUnit,
} from '@/api-clients/cost-analysis/budget/schema/type';

import type { Currency } from '@/store/display/type';

export interface BudgetCreateParameters {
data_source_id: string;
name?: string;
limit?: number;
planned_limits?: BudgetPlannedLimit[];
provider_filter?: ProviderFilter;
currency: Currency;
time_unit: BudgetTimeUnit;
start: string;
end: string;
notifications?: BudgetNotification[];
notification?: BudgetNotification;
tags?: Tags;
resource_group: Extract<ResourceGroupType, 'WORKSPACE'|'PROJECT'>;
workspace_id?: string;
project_id?: string;
service_account_id?: string;
budget_manager_id?: string;
budget_year?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import type { BudgetNotification } from '@/api-clients/cost-analysis/budget/sche

export interface BudgetSetNotificationParameters {
budget_id: string;
notifications: BudgetNotification[];
notification: BudgetNotification;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ export interface BudgetUpdateParameters {
name?: string;
limit?: number;
planned_limits?: BudgetPlannedLimit[];
start?: string;
end?: string;
utilization_rate?: number;
tags?: Tags;
}
46 changes: 26 additions & 20 deletions apps/web/src/api-clients/cost-analysis/budget/schema/model.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@

import type { Tags } from '@/api-clients/_common/schema/model';
import type { ResourceGroupType } from '@/api-clients/_common/schema/type';
import type {
BudgetNotification, BudgetPlannedLimit, BudgetTimeUnit, ProviderFilter,
BudgetNotification,
BudgetPlannedLimit,
BudgetTimeUnit,
} from '@/api-clients/cost-analysis/budget/schema/type';

import type { Currency } from '@/store/display/type';


export interface BudgetModel {
budget_id: string;
name: string;
limit: number;
planned_limits: BudgetPlannedLimit[];
currency: Currency;
provider_filter: ProviderFilter;
time_unit: BudgetTimeUnit;
start: string;
end: string;
notifications: BudgetNotification[];
tags: Tags;
data_source_id: string;
resource_group: Extract<ResourceGroupType, 'WORKSPACE' | 'PROJECT'>
project_id: string;
workspace_id: string;
domain_id: string;
created_at: string;
updated_at: string;
budget_id: string;
name: string;
limit: number;
planned_limits: BudgetPlannedLimit[];
currency: Currency;
time_unit: BudgetTimeUnit;
start: string;
end: string;
notification: BudgetNotification;
tags: Tags;
data_source_id: string;
resource_group: Extract<ResourceGroupType, 'WORKSPACE' | 'PROJECT'>;
project_id: string;
workspace_id: string;
service_account_id: string;
budget_manager_id: string;
domain_id: string;
created_at: string;
updated_at: string;
budget_year: string;
notified_month: string;
utilization_rate: number;
}
17 changes: 13 additions & 4 deletions apps/web/src/api-clients/cost-analysis/budget/schema/type.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
export type BudgetTimeUnit = 'MONTHLY' | 'TOTAL';
type BudgetNotificationType = 'CRITICAL' | 'WARNING';
type BudgetNotificationUnit = 'PERCENT' | 'ACTUAL_COST';
type BudgetNotificationUnit = 'PERCENT';
type BudgetNotificationState = 'ENABLED' | 'DISABLED';

export interface BudgetNotification {
interface BudgetNotificationPlan {
threshold: number;
unit: BudgetNotificationUnit;
notification_type: BudgetNotificationType;
}

export interface BudgetNotificationRecipients {
users: string[];
}

export interface BudgetNotification {
state: BudgetNotificationState;
plans?: BudgetNotificationPlan[];
recipients?: BudgetNotificationRecipients;
}

export interface BudgetPlannedLimit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface ServiceAccountCreateParameters {
secret_schema_id?: string;
secret_data?: Record<string, any>;
tags?: Tags;
service_account_mgr_id?: string;
trusted_account_id?: string;
project_id: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ export interface ServiceAccountUpdateParameters {
name?: string;
data?: Record<string, any>;
tags?: Tags;
service_account_mgr_id?: string;
project_id?: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface ServiceAccountModel {
created_at: string;
last_synced_at: string;
state: ServiceAccountType;
service_account_mgr_id: string;
// asset_info: ServiceAccountAssetInfoType;
// cost_info: ServiceAccountCostInfoType;
}
Expand Down
10 changes: 10 additions & 0 deletions apps/web/src/common/modules/project/ProjectSelectDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ interface Props {
styleType?: string;
appearanceType?: 'stack'|'badge';
showDeleteAllButton?: boolean;
showDropdownLeftArea?: boolean;
}

const props = withDefaults(defineProps<Props>(), {
Expand All @@ -73,6 +74,7 @@ const props = withDefaults(defineProps<Props>(), {
styleType: undefined,
appearanceType: undefined,
showDeleteAllButton: undefined,
showDropdownLeftArea: false,
});

const emit = defineEmits<{(e: 'select', value: ProjectTreeNodeData[]): void;
Expand Down Expand Up @@ -321,6 +323,14 @@ watch(() => state._selectedProjectIds, (selectedProjectIds) => {
@update:visible-menu="handleUpdateVisibleMenu"
@delete-tag="handleDeleteTag"
>
<template v-if="props.showDropdownLeftArea"
#dropdown-left-area
>
<p-i name="ic_project"
width="1rem"
height="1rem"
/>
</template>
<template #menu-no-data-format>
<div />
</template>
Expand Down
7 changes: 6 additions & 1 deletion apps/web/src/common/modules/user/UserSelectDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ const props = withDefaults(defineProps<{
showCategoryTitle?: boolean;
placeholder?: string;
excludedSelectedIds?: string[];
size?: 'sm'|'md';
pageSize?: number;
}>(), {
selectedId: undefined,
selectedIds: undefined,
Expand All @@ -71,6 +73,8 @@ const props = withDefaults(defineProps<{
showCategoryTitle: true,
placeholder: 'Select',
excludedSelectedIds: undefined,
size: 'md',
pageSize: 10,
});

const emit = defineEmits<{(event: 'update:selected-id', value?: string): void;
Expand Down Expand Up @@ -267,7 +271,6 @@ watch([() => props.selectedId, () => props.selectedIds], ([newUserId, newUserIds

<template>
<p-select-dropdown class="user-select-dropdown"
page-size="10"
show-select-marker
is-filterable
show-delete-all-button
Expand All @@ -283,6 +286,8 @@ watch([() => props.selectedId, () => props.selectedIds], ([newUserId, newUserIds
:style-type="props.styleType"
:placeholder="props.placeholder"
:block="props.block"
:size="props.size"
:page-size="props.pageSize"
@update:selected="handleUpdateSelectedUserItems"
>
<template v-if="props.appearanceType === 'stack'"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<script setup lang="ts">
import { PButtonModal } from '@cloudforet/mirinae';

import ErrorHandler from '@/common/composables/error/errorHandler';

import { useBudgetDetailPageStore } from '../stores/budget-detail-page-store';

interface Props {
visible: boolean;
budgetOnOffValue: boolean;
}

const budgetPageStore = useBudgetDetailPageStore();
const budgetPageState = budgetPageStore.$state;

const props = withDefaults(defineProps<Props>(), {
visible: false,
budgetOnOffValue: false,
});

const emit = defineEmits<{(e: 'update:visible', value: boolean): void;
}>();

const setNotification = async () => {
try {
await budgetPageStore.updateBudgetNotifications({
budget_id: budgetPageState.budgetData?.budget_id ?? '',
notification: {
...budgetPageState.budgetData?.notification,
state: !props.budgetOnOffValue ? 'ENABLED' : 'DISABLED',
},
});
} catch (error) {
ErrorHandler.handleError(error);
}
};

const handleClose = () => {
emit('update:visible', false);
};

const handleConfirm = () => {
setNotification();
emit('update:visible', false);
};
</script>

<template>
<p-button-modal :visible="props.visible"
:header-title="$t('BILLING.COST_MANAGEMENT.BUDGET.DETAIL.MODAL.UPDATE_BUDGET_ALERT')"
size="sm"
@cancel="handleClose"
@close="handleClose"
@confirm="handleConfirm"
>
<template #body>
<div v-if="props.budgetOnOffValue">
{{ $t('BILLING.COST_MANAGEMENT.BUDGET.DETAIL.MODAL.BUDGET_ALERT_MODAL_DESC1') }}
</div>
<div v-else-if="!props.budgetOnOffValue">
{{ $t('BILLING.COST_MANAGEMENT.BUDGET.DETAIL.MODAL.BUDGET_ALERT_MODAL_DESC2') }}
</div>
</template>
</p-button-modal>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ watch([() => state.amountPlanInfo, () => state.isAllValid], ([amountPlanInfo, is
<p-pane-layout class="budget-create-form-amount-plan">
<p-heading class="pt-8 px-4 pb-4"
heading-type="sub"
:title="$t('BILLING.COST_MANAGEMENT.BUDGET.FORM.AMOUNT_PLAN.AMOUNT_PLANNING')"
:title="$t('BILLING.COST_MANAGEMENT.BUDGET.FORM.BUDGET_DETAILS.TITLE')"
/>
<div class="p-4">
<budget-create-period-select
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<script setup lang="ts">
import { watch } from 'vue';

import { SpaceConnector } from '@cloudforet/core-lib/space-connector';
import { PFieldGroup } from '@cloudforet/mirinae';

import type { ServiceAccountGetParameters } from '@/api-clients/identity/service-account/schema/api-verbs/get';
import type { ServiceAccountModel } from '@/api-clients/identity/service-account/schema/model';

import ErrorHandler from '@/common/composables/error/errorHandler';
import UserSelectDropdown from '@/common/modules/user/UserSelectDropdown.vue';

import { useBudgetCreatePageStore } from '../stores/budget-create-page-store';

const budgetCreatePageStore = useBudgetCreatePageStore();
const budgetCreatePageState = budgetCreatePageStore.state;

const handleSelectId = (selectedId: string|undefined) => {
if (selectedId) budgetCreatePageStore.setBudgetManager(selectedId);
};

const handleFormatBudgetManager = (value: Record<string, any>) => {
if (Array.isArray(value.USER) && value.USER.length === 0) {
budgetCreatePageStore.setBudgetManager('');
}
};

const fetchSelectedServiceAccount = async (serviceAccountId: string) => {
try {
const result = await SpaceConnector.clientV2.identity.serviceAccount.get<ServiceAccountGetParameters, ServiceAccountModel>({
service_account_id: serviceAccountId,
});
if (result.service_account_mgr_id.length > 0) {
budgetCreatePageStore.setBudgetManager(result.service_account_mgr_id);
}
} catch (error) {
ErrorHandler.handleError(error);
}
};

watch(() => budgetCreatePageState.scope.serviceAccount, async () => {
if (budgetCreatePageState.scope.serviceAccount) {
await fetchSelectedServiceAccount(budgetCreatePageState.scope.serviceAccount);
}
}, { immediate: true, deep: true });
</script>

<template>
<p-field-group required
:label="$t('BILLING.COST_MANAGEMENT.BUDGET.FORM.CREATE.BUDGET_MANAGER')"
>
<user-select-dropdown
show-user-list
:show-user-group-list="false"
:selected-id="budgetCreatePageState.budgetManager"
@update:selected-id="handleSelectId"
@formatted-selected-ids="handleFormatBudgetManager"
/>
</p-field-group>
</template>
Loading
Loading