diff --git a/frontend/desktop/data/config.yaml b/frontend/desktop/data/config.yaml index 0a3ca0a33..b69dcf0ef 100644 --- a/frontend/desktop/data/config.yaml +++ b/frontend/desktop/data/config.yaml @@ -73,6 +73,9 @@ desktop: phoneAlertEnabled: false announcementEnabled: false kcRotationEnabled: true + communityEnabled: true + communityQRCodeImage: "" + communityLink: "" gtmId: null auth: billingToken: "" diff --git a/frontend/desktop/deploy/README.md b/frontend/desktop/deploy/README.md index a45b85dd3..2ec51bc49 100644 --- a/frontend/desktop/deploy/README.md +++ b/frontend/desktop/deploy/README.md @@ -232,6 +232,9 @@ desktop: emailAlertEnabled: false phoneAlertEnabled: false announcementEnabled: false + communityEnabled: true + communityQRCodeImage: '' + communityLink: '' auth: proxyAddress: '' callbackURL: 'https://cloud.example.com/callback' diff --git a/frontend/desktop/deploy/README_CN.md b/frontend/desktop/deploy/README_CN.md index ceaad2e9a..e5df1f1f3 100644 --- a/frontend/desktop/deploy/README_CN.md +++ b/frontend/desktop/deploy/README_CN.md @@ -232,6 +232,9 @@ desktop: emailAlertEnabled: false phoneAlertEnabled: false announcementEnabled: false + communityEnabled: true + communityQRCodeImage: '' + communityLink: '' auth: proxyAddress: '' callbackURL: 'https://cloud.example.com/callback' diff --git a/frontend/desktop/deploy/charts/desktop-frontend/desktop-frontend-values.yaml b/frontend/desktop/deploy/charts/desktop-frontend/desktop-frontend-values.yaml index 17e30f556..7e9c370d8 100644 --- a/frontend/desktop/deploy/charts/desktop-frontend/desktop-frontend-values.yaml +++ b/frontend/desktop/deploy/charts/desktop-frontend/desktop-frontend-values.yaml @@ -57,6 +57,9 @@ desktopConfig: trackingEnabled: false realNameAuthEnabled: false kcRotationEnabled: false + communityEnabled: true + communityQRCodeImage: "" + communityLink: "" # Common URLs (default values) realNameReward: 0 diff --git a/frontend/desktop/deploy/charts/desktop-frontend/templates/configmap.yaml b/frontend/desktop/deploy/charts/desktop-frontend/templates/configmap.yaml index b5c4f8ed6..8f802e90f 100644 --- a/frontend/desktop/deploy/charts/desktop-frontend/templates/configmap.yaml +++ b/frontend/desktop/deploy/charts/desktop-frontend/templates/configmap.yaml @@ -91,6 +91,9 @@ data: phoneAlertEnabled: false announcementEnabled: false kcRotationEnabled: {{ .Values.desktopConfig.kcRotationEnabled }} + communityEnabled: {{ .Values.desktopConfig.communityEnabled }} + communityQRCodeImage: {{ .Values.desktopConfig.communityQRCodeImage | quote }} + communityLink: {{ .Values.desktopConfig.communityLink | quote }} auth: callbackURL: "https://{{ .Values.desktopConfig.cloudDomain }}{{ if .Values.desktopConfig.cloudPort }}:{{ .Values.desktopConfig.cloudPort }}{{ end }}/callback" signUpEnabled: {{ .Values.desktopConfig.signUpEnabled }} @@ -189,4 +192,4 @@ data: ssl: {{ .Values.desktopConfig.realNameOSSSSL }} port: {{ .Values.desktopConfig.realNameOSSPort }} realNameBucket: "{{ .Values.desktopConfig.realNameOSSRealNameBucket }}" - enterpriseRealNameBucket: "{{ .Values.desktopConfig.realNameOSSEnterpriseRealNameBucket }}" \ No newline at end of file + enterpriseRealNameBucket: "{{ .Values.desktopConfig.realNameOSSEnterpriseRealNameBucket }}" diff --git a/frontend/desktop/public/images/boxgrid.svg b/frontend/desktop/public/images/boxgrid.svg new file mode 100644 index 000000000..93ad84f31 --- /dev/null +++ b/frontend/desktop/public/images/boxgrid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/desktop/public/images/hexgrid.svg b/frontend/desktop/public/images/hexgrid.svg new file mode 100644 index 000000000..a3b227f52 --- /dev/null +++ b/frontend/desktop/public/images/hexgrid.svg @@ -0,0 +1 @@ + diff --git a/frontend/desktop/public/images/sealos-box.svg b/frontend/desktop/public/images/sealos-box.svg new file mode 100644 index 000000000..c8d362291 --- /dev/null +++ b/frontend/desktop/public/images/sealos-box.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/desktop/public/locales/en/common.json b/frontend/desktop/public/locales/en/common.json index 8b191f451..35f4d305d 100644 --- a/frontend/desktop/public/locales/en/common.json +++ b/frontend/desktop/public/locales/en/common.json @@ -90,6 +90,19 @@ "click_on_any_shadow_to_skip": "Click on any shadow to skip", "click_to_upload_file": "Click to upload file", "completed": "Finish", + "community": { + "menu": { + "title": "Community", + "badge": "Featured", + "description": "Updates • Events • Stories" + }, + "modal": { + "title": "Join the Sealos Community", + "description": "Help shape the future of Sealos.", + "button": "Join Us", + "qr_alt": "Sealos community QR code" + } + }, "completed_the_deployment_of_an_nginx_for_the_first_time": "Completed a deployment of nginx for the first time", "confirm": "Confirm", "confirm_again": "confirm again", diff --git a/frontend/desktop/public/locales/zh/common.json b/frontend/desktop/public/locales/zh/common.json index 5712896fe..b74613a50 100644 --- a/frontend/desktop/public/locales/zh/common.json +++ b/frontend/desktop/public/locales/zh/common.json @@ -90,6 +90,19 @@ "click_on_any_shadow_to_skip": "点击任意阴影跳过", "click_to_upload_file": "点击上传文件", "completed": "完成", + "community": { + "menu": { + "title": "加入 Sealos 生态群", + "badge": "推荐", + "description": "产品更新 • 活动福利 • 案例共创" + }, + "modal": { + "title": "加入 Sealos 生态群", + "description": "与 Sealos 官方共建产品形态!", + "button": "即刻入群", + "qr_alt": "Sealos 生态群二维码" + } + }, "completed_the_deployment_of_an_nginx_for_the_first_time": "部署一个 nginx ,首次完成 将", "confirm": "确认", "copy": "复制", diff --git a/frontend/desktop/src/components/account/index.tsx b/frontend/desktop/src/components/account/index.tsx index d960d520a..44c526923 100644 --- a/frontend/desktop/src/components/account/index.tsx +++ b/frontend/desktop/src/components/account/index.tsx @@ -14,6 +14,10 @@ import { MenuButton, MenuItem, MenuList, + Modal, + ModalCloseButton, + ModalContent, + ModalOverlay, Text, useBreakpointValue, useDisclosure, @@ -28,7 +32,9 @@ import WorkspaceToggle from '../team/WorkspaceToggle'; import useAppStore from '@/stores/app'; import { ArrowLeftRight, + ArrowRight, Bell, + ChevronRight, Copy, Dock, FileCode, @@ -44,6 +50,7 @@ import { useGuideModalStore } from '@/stores/guideModal'; import SecondaryLinks from '../SecondaryLinks'; import { useSubscriptionStore } from '@/stores/subscription'; import { Badge } from '@sealos/shadcn-ui/badge'; +import { Button } from '@sealos/shadcn-ui/button'; import { cn } from '@sealos/shadcn-ui'; import { getPlanBackgroundClass } from '@/utils/styling'; import { AlertSettings } from './AlertSettings'; @@ -71,6 +78,7 @@ export default function Account() { const kubeconfig = session?.kubeconfig || ''; const toast = useToast(); const showDisclosure = useDisclosure(); + const communityDisclosure = useDisclosure(); const [, setNotificationAmount] = useState(0); const { openDesktopApp, autolaunch } = useAppStore(); const { openGuideModal, initGuide, autoOpenBlocked, blockAutoOpen } = useGuideModalStore(); @@ -83,6 +91,9 @@ export default function Account() { const emailAlertEnabled = layoutConfig?.common.emailAlertEnabled && authConfig?.idp.email.enabled; const phoneAlertEnabled = layoutConfig?.common.phoneAlertEnabled && authConfig?.idp.sms.enabled; const alertSettingsEnabled = emailAlertEnabled || phoneAlertEnabled; + const communityEnabled = layoutConfig?.common.communityEnabled !== false; + const communityQRCodeImage = layoutConfig?.common.communityQRCodeImage; + const communityLink = layoutConfig?.common.communityLink; const logout = (e: React.MouseEvent) => { e.preventDefault(); @@ -394,7 +405,87 @@ export default function Account() { + {communityEnabled && ( + <> + + + + + + + + + {t('common:community.menu.title')} + + + {t('common:community.menu.badge')} + + + + + + {t('common:community.menu.description')} + + + + + + + + + + > + )} + + {/* + + + + + + + + {t('common:community.modal.title')} + + + {communityQRCodeImage && ( + + )} + + + {t('common:community.modal.description')} + + + communityLink && window.open(communityLink, '_blank', 'noopener,noreferrer') + } + > + {t('common:community.modal.button')} + + + + + {/* {layoutConfig?.common.workorderEnabled && (