Skip to content

Commit

Permalink
feat:update costcenter
Browse files Browse the repository at this point in the history
  • Loading branch information
xudaotutou committed Aug 8, 2024
1 parent 4fd0ebc commit 955f25f
Show file tree
Hide file tree
Showing 144 changed files with 5,003 additions and 1,765 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ const smsBindGen = (smsType: SmsType) =>
>
<FormControl isInvalid={!!formState.errors.id}>
<HStack>
<FormLabel w={'120px'}>{smsType === 'phone' ? t('common:phone') : t('common:email')}</FormLabel>
<FormLabel w={'120px'}>
{smsType === 'phone' ? t('common:phone') : t('common:email')}
</FormLabel>
<SettingInputGroup>
<SettingInput
{...register('id', smsIdValid(smsType))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ function NewSms({
if (data.code === 200) {
toast({
status: 'success',
title: smsType === 'phone' ? t('common:phonechangesuccess') : t('common:emailchangesuccess')
title:
smsType === 'phone' ? t('common:phonechangesuccess') : t('common:emailchangesuccess')
});
reset();
onClose?.();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ const smsUnBindGen = (smsType: SmsType) =>
>
<FormControl isInvalid={!!formState.errors.id}>
<HStack>
<FormLabel w={'120px'}>{smsType === 'phone' ? t('common:phone') : t('common:email')}</FormLabel>
<FormLabel w={'120px'}>
{smsType === 'phone' ? t('common:phone') : t('common:email')}
</FormLabel>
<SettingInputGroup>
<SettingInput
{...register('id', smsIdValid(smsType))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export default function Index(props: Omit<IconButtonProps, 'aria-label'>) {
else if (pageState === PageState.PASSWORD) return t('common:changepassword');
else if (Object.values(PhoneState).includes(pageState as PhoneState))
return t('common:changephone'); // bind or unbind
else if (Object.values(EmailState).includes(pageState as EmailState)) return t('common:changeemail');
else if (Object.values(EmailState).includes(pageState as EmailState))
return t('common:changeemail');
else return '';
}, [t, pageState]);
const queryClient = useQueryClient();
Expand Down
4 changes: 3 additions & 1 deletion frontend/desktop/src/components/team/RemoveMember.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export default function RemoveMember({
? t('common:quit')
: t('common:remove');
const removeTips =
selfUserCrUid === targetUserCrUid ? t('common:quit_workspace_tips') : t('common:remove_member_tips');
selfUserCrUid === targetUserCrUid
? t('common:quit_workspace_tips')
: t('common:remove_member_tips');
return (
<>
<Button
Expand Down
8 changes: 7 additions & 1 deletion frontend/desktop/src/components/team/userTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ export default function UserTable({
nsid: string;
}) {
const { t } = useTranslation();
const headList = [t('common:user_name'), t('common:access'), t('common:in_time'), t('common:status'), t('common:operating')];
const headList = [
t('common:user_name'),
t('common:access'),
t('common:in_time'),
t('common:status'),
t('common:operating')
];
const status = [t('common:waiting'), t('common:added')];
const session = useSessionStore((s) => s.session);
const userCrUid = session?.user.userCrUid;
Expand Down
26 changes: 13 additions & 13 deletions frontend/packages/ui/src/components/icons/PortIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ const PortIcon = createIcon({
displayName: 'PortIcon',
viewBox: '0 0 16 16',
path: (
<g fill="none" xmlns="http://www.w3.org/2000/svg">
<g width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M3.9167 6.24996C3.9167 6.59996 4.15004 6.8333 4.50004 6.8333C4.85004 6.8333 5.08337 6.59996 5.08337 6.24996V5.66663C5.08337 5.31663 4.85004 5.0833 4.50004 5.0833C4.15004 5.0833 3.9167 5.31663 3.9167 5.66663V6.24996Z"
fill="#24282C"
d="M3.93331 5.73697C3.93331 5.36878 4.23179 5.0703 4.59998 5.0703C4.96817 5.0703 5.26664 5.36878 5.26664 5.73697V6.6703C5.26664 7.03849 4.96817 7.33697 4.59998 7.33697C4.23179 7.33697 3.93331 7.03849 3.93331 6.6703V5.73697Z"
fill="#485264"
/>
<path
d="M6.25004 6.24996C6.25004 6.59996 6.48337 6.8333 6.83337 6.8333C7.18337 6.8333 7.4167 6.59996 7.4167 6.24996V5.66663C7.4167 5.31663 7.18337 5.0833 6.83337 5.0833C6.48337 5.0833 6.25004 5.31663 6.25004 5.66663V6.24996Z"
fill="#24282C"
d="M6.19995 5.73697C6.19995 5.36878 6.49843 5.0703 6.86662 5.0703C7.23481 5.0703 7.53328 5.36878 7.53328 5.73697V6.6703C7.53328 7.03849 7.23481 7.33697 6.86662 7.33697C6.49843 7.33697 6.19995 7.03849 6.19995 6.6703V5.73697Z"
fill="#485264"
/>
<path
d="M8.58337 6.24996C8.58337 6.59996 8.8167 6.8333 9.1667 6.8333C9.5167 6.8333 9.75004 6.59996 9.75004 6.24996V5.66663C9.75004 5.31663 9.5167 5.0833 9.1667 5.0833C8.8167 5.0833 8.58337 5.31663 8.58337 5.66663V6.24996Z"
fill="#24282C"
d="M8.46663 5.73697C8.46663 5.36878 8.76511 5.0703 9.1333 5.0703C9.50149 5.0703 9.79997 5.36878 9.79997 5.73697V6.6703C9.79997 7.03849 9.50149 7.33697 9.1333 7.33697C8.76511 7.33697 8.46663 7.03849 8.46663 6.6703V5.73697Z"
fill="#485264"
/>
<path
d="M10.9167 6.24996C10.9167 6.59996 11.15 6.8333 11.5 6.8333C11.85 6.8333 12.0834 6.59996 12.0834 6.24996V5.66663C12.0834 5.31663 11.85 5.0833 11.5 5.0833C11.15 5.0833 10.9167 5.31663 10.9167 5.66663V6.24996Z"
fill="#24282C"
d="M10.7333 5.73697C10.7333 5.36878 11.0318 5.0703 11.3999 5.0703C11.7681 5.0703 12.0666 5.36878 12.0666 5.73697V6.6703C12.0666 7.03849 11.7681 7.33697 11.3999 7.33697C11.0318 7.33697 10.7333 7.03849 10.7333 6.6703V5.73697Z"
fill="#485264"
/>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M5.49167 13.25H10.5083C10.975 13.25 11.4417 12.9583 11.6167 12.4917L12.4917 10.3333H13.8333C14.475 10.3333 15 9.80833 15 9.16667V3.91667C15 3.275 14.475 2.75 13.8333 2.75H2.16667C1.525 2.75 1 3.275 1 3.91667V9.16667C1 9.80833 1.525 10.3333 2.16667 10.3333H3.50833L4.38333 12.4917C4.55833 12.9583 5.025 13.25 5.49167 13.25ZM2.16667 9.16667V3.91667H13.8333V9.16667H12.4917C11.9667 9.16667 11.5583 9.45833 11.3833 9.925L10.5083 12.0833H5.49167L4.61667 9.925C4.44167 9.45833 3.975 9.16667 3.50833 9.16667H2.16667Z"
fill="#24282C"
fill-rule="evenodd"
clip-rule="evenodd"
d="M2.66659 2.66821C1.93021 2.66821 1.33325 3.26517 1.33325 4.00155V9.0827C1.33325 9.81908 1.93021 10.416 2.66659 10.416H3.33354C3.43108 10.416 3.52084 10.4693 3.56759 10.5549L4.70498 12.6376C4.93872 13.0657 5.3875 13.3319 5.87519 13.3319H9.97543C10.4631 13.3319 10.9119 13.0657 11.1456 12.6376L12.283 10.5549C12.3298 10.4693 12.4195 10.416 12.5171 10.416H13.3333C14.0696 10.416 14.6666 9.81908 14.6666 9.0827V4.00155C14.6666 3.26517 14.0696 2.66821 13.3333 2.66821H2.66659ZM4.47239 9.42984C4.35552 9.21583 4.13113 9.0827 3.88729 9.0827H2.93325C2.78598 9.0827 2.66659 8.96331 2.66659 8.81603V4.26821C2.66659 4.12094 2.78598 4.00155 2.93325 4.00155L13.0666 4.00155C13.2139 4.00155 13.3333 4.12094 13.3333 4.26821V8.81603C13.3333 8.96331 13.2139 9.0827 13.0666 9.0827H11.9633C11.7195 9.0827 11.4951 9.21583 11.3782 9.42984L10.0892 11.7903C10.019 11.9187 9.88441 11.9986 9.73811 11.9986H6.11251C5.9662 11.9986 5.83157 11.9187 5.76144 11.7903L4.47239 9.42984Z"
fill="#485264"
/>
</g>
)
Expand Down
3 changes: 3 additions & 0 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/providers/applaunchpad/next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ module.exports = {
localeDetection: false
},
reloadOnPrerender: process.env.NODE_ENV === 'development'
}
};
6 changes: 6 additions & 0 deletions frontend/providers/costcenter/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"i18n-ally.localesPaths": [
"public/locales"
],
"i18n-ally.keystyle": "nested"
}
26 changes: 0 additions & 26 deletions frontend/providers/costcenter/data/config.yaml.local

This file was deleted.

1 change: 0 additions & 1 deletion frontend/providers/costcenter/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const nextConfig = {
outputFileTracingRoot: path.join(__dirname, '../../')
},
async headers() {
console.log(ContentSecurityPolicy.replace(/\s{2,}/g, ' ').trim());
return [
{
source: '/',
Expand Down
1 change: 1 addition & 0 deletions frontend/providers/costcenter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"devDependencies": {
"@types/js-cookie": "^3.0.4",
"@types/js-yaml": "^4.0.6",
"@types/lodash": "^4.14.199",
"@types/node": "18.15.5",
"@types/nprogress": "^0.2.1",
"@types/react": "18.2.37",
Expand Down
4 changes: 3 additions & 1 deletion frontend/providers/costcenter/public/locales/en/applist.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
"CLOUD-VM":"CLOUD-VM",
"DB": "DATABASE",
"APP": "APP",
"All APP": "ALL"
"All APP": "ALL APP",
"APP-STORE": "APP-STORE",
"all_app_type": "ALL APP TYPE"
}
43 changes: 37 additions & 6 deletions frontend/providers/costcenter/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
"Scan with WeChat": "Scan with WeChat",
"Balance": "Balance",
"SideBar": {
"Index": "Home Page",
"CostOverview": "Cost Overview",
"BillingDetails": "Billing Details",
"ValuationStandard": "Standard",
"resource_analysis": "Resource Analysis",
"CreateInvoice": "Create Invoice"
},
"Valuation": {
Expand All @@ -20,21 +22,28 @@
"All Namespace": "All Team ID",
"Bonus": "Bonus",
"Select Amount": "Select Amount",
"Port Amount": "Port Amount",
"CPU Amount": "CPU Amount",
"Storage Amount": "Storage Amount",
"Memory Amount": "Memory Amount",
"Network Amount": "Network Amount",
"Recent Transactions": "Recent Transactions",
"Cost Trend": "Cost Trend",
"Total Cost": "Total Cost",
"Income And Expense": "Income And Expense",
"Deduction": "Deduction",
"Cost Distribution": "Cost Distribution",
"Expenditure": "Expenditure",
"Total Expenditure": "Total Expenditure",
"Total Recharge": "Total Recharge",
"Recharge Amount": "Recharge Amount",
"Confirm": "Confirm",
"Balance Recharge": "Balance Recharge",
"Order Number": "Order Number",
"Transaction Time": "Transaction Time",
"Type": "Type",
"CPU": "CPU",
"Port": "TCP External Port",
"Port": "Port",
"onlyChargedWhenOpenDBPublicAccess": "Only charged when enabling public access to the database",
"Memory": "Memory",
"Network": "Network",
Expand All @@ -48,6 +57,7 @@
"Payment Result": "Payment Result",
"Payment Successful": "Payment Successful",
"In Payment": "In Payment ...",
"Region": "Region",
"Hour": "Hour",
"Day": "Day",
"Week": "Week",
Expand Down Expand Up @@ -78,7 +88,7 @@
"Stripe Cancel": "cancel to pay with Stripe",
"GPU Unit": "Card",
"Gpu valuation": "GPU Price Table",
"common valuation": "Price Table",
"common valuation": "Basic Valuation",
"Billing Details": "Billing Details",
"orders": {
"list": "Order List",
Expand Down Expand Up @@ -160,9 +170,30 @@
"APP Name": "App name",
"APP Type": "App type",
"Details": "Details",
"Transfer Type":"Transfer Type",
"Transfer Type": "Transfer Type",
"Handle": "Handle",
"currencyUnit": "Currency Unit",
"Trader ID":"Trader"

}
"Trader ID": "Trader",
"region_type": "region",
"region": "Region",
"all_workspace_id": "All Workspace ID",
"workspace": "Workspace",
"app_name": "App Name",
"Last 7 days": "Last 7 days",
"Last 6 Months": "last 6 months",
"All Regions": "All Regions",
"Annual Income and Expenditure": "Annual Income and Expenditure",
"Billing List": "Billing List",
"Network valuation": "Network Valuation",
"applist": {
"Other": "others"
},
"Used": "Used",
"Remain": "Remain",
"Cost Form": "Cost Form",
"All App Cost Form": "All App Cost Form",
"Price Table": "Price Table",
"all_workspace": "All Workspace",
"preferential_rules": "Preferential Rules",
"preferential_strength": "Preferential Strength"
}
4 changes: 3 additions & 1 deletion frontend/providers/costcenter/public/locales/zh/applist.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
"CLOUD-VM":"云主机",
"DB": "数据库",
"APP": "应用",
"All APP": "所有应用"
"All APP": "所有应用",
"APP-STORE": "应用商店",
"all_app_type": "所有应用类型"
}
47 changes: 39 additions & 8 deletions frontend/providers/costcenter/public/locales/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
"Scan with WeChat": "微信扫码支付",
"Balance": "账户余额",
"SideBar": {
"CostOverview": "成本总览",
"Index": "首页",
"CostOverview": "账单概览",
"BillingDetails": "账单明细",
"ValuationStandard": "计价标准",
"resource_analysis": "资源分析",
"CreateInvoice": "开具发票"
},
"Valuation": {
Expand All @@ -24,7 +26,7 @@
"Deduction": "扣费",
"Total Cost": "总成本",
"Cost Distribution": "成本分布",
"Income And Expense": "收支",
"Income And Expense": "账户总收支",
"Expenditure": "支出",
"Recharge Amount": "充值金额",
"Select Amount": "选择金额",
Expand All @@ -35,11 +37,16 @@
"Transaction Time": "交易时间",
"Type": "类型",
"CPU": "CPU",
"Port": "TCP外网端口",
"Port": "端口",
"onlyChargedWhenOpenDBPublicAccess": "仅在打开数据库外网访问功能时会计费",
"Memory": "内存",
"Storage": "存储卷",
"Network": "网络",
"CPU Amount": "CPU金额",
"Port Amount": "端口金额",
"Storage Amount": "存储金额",
"Memory Amount": "内存金额",
"Network Amount": "网络金额",
"cpu": "CPU",
"memory": "内存",
"storage": "存储卷",
Expand Down Expand Up @@ -81,7 +88,7 @@
"Price": "价格",
"Unit": "单位",
"Gpu valuation": "GPU 计价",
"common valuation": "计价表",
"common valuation": "基础计价",
"Billing Details": "订单详情",
"orders": {
"list": "订单列表",
Expand Down Expand Up @@ -151,18 +158,42 @@
},
"pay with wechat": "微信支付",
"pay with stripe": "Stripe 支付",
"Total Expenditure": "总支出",
"Total Recharge": "总充值",
"Pay Minimum Tips": "使用Stripe支付时,购买额度不低于10",
"Source Quota": "资源配额",
"Total Quota": "总计",
"Used Quota": "已用",
"Remaining Quota": "剩余",
"Receipts And Disbursements": "收支",
"APP Name": "应用名称",

"APP Type": "应用类型",
"Transfer Type": "转账类型",
"Region": "可用区",
"Transfer Type": "转账类型",
"Details": "详情",
"Handle": "操作",
"currencyUnit": "金额单位",
"Trader ID": "交易用户"
}
"Trader ID": "交易用户",
"region_type": "可用区",
"region": "可用区",
"all_workspace_id": "所有工作空间ID",
"workspace": "工作空间",
"app_name": "应用名",
"Last 7 days": "最近7天",
"Last 6 Months": "最近6个月",
"All Regions": "所有可用区",
"Annual Income and Expenditure": "年度收支",
"Billing List": "账单列表",
"Network valuation": "流量计价",
"applist": {
"Other": "其他"
},
"Used": "已用",
"Remain": "剩余",
"Cost Form": "成本分布",
"All App Cost Form": "所有应用成本分布",
"Price Table": "计价表",
"all_workspace": "所有工作空间",
"preferential_rules": "优惠规则",
"preferential_strength": "优惠力度"
}
2 changes: 1 addition & 1 deletion frontend/providers/costcenter/src/assert/Vector.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 955f25f

Please sign in to comment.