Skip to content

Commit

Permalink
feat: desktop add two beginner tasks (labring#5279)
Browse files Browse the repository at this point in the history
* feat: add two beginner tasks

* update

* filter app

* update RealNameModal
  • Loading branch information
zjy365 authored Dec 10, 2024
1 parent 7b94860 commit 5024732
Show file tree
Hide file tree
Showing 15 changed files with 471 additions and 202 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- AlterEnum
ALTER TYPE "TaskType" ADD VALUE 'CRONJOB';
ALTER TYPE "TaskType" ADD VALUE 'DEVBOX';
ALTER TYPE "TaskType" ADD VALUE 'CONTACT';
ALTER TYPE "TaskType" ADD VALUE 'REAL_NAME_AUTH';
4 changes: 4 additions & 0 deletions frontend/desktop/prisma/global/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,10 @@ enum TaskType {
DATABASE
DESKTOP
APPSTORE
CRONJOB
DEVBOX
CONTACT
REAL_NAME_AUTH
}

enum TaskStatus {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion frontend/desktop/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@
"github": "Github",
"google": "Google",
"guide_applaunchpad": "Quickly deploy applications without cumbersome configuration",
"guide_costcenter": "Billing standards and resource consumption detailed dashboard",
"guide_dbprovider": "Create multiple databases in seconds to meet different application needs",
"guide_devbox": "Automated development environment setup and seamless connection with local IDE",
"guide_objectstorage": "Massive storage space, almost bare metal speed experience",
"guide_workorder": "Technical question consultation portal",
"handle": "Handle",
"have_read": "Have read",
"healthy_pod": "Healthy Pods: {{count}}",
Expand Down Expand Up @@ -211,6 +214,7 @@
"rename": "Rename",
"retry_get_qr_code": "reacquire",
"scan_qr_code_for_face_recognition": "Use WeChat on your mobile phone to scan the QR code to complete identity verification",
"scan_to_join_group": "Scan the QR code to add exclusive customer service",
"scan_with_wechat": "Scan with WeChat",
"sealos_copilot": "Sealos Copilot",
"sealos_document": "Sealos Document",
Expand Down Expand Up @@ -268,4 +272,4 @@
"you_can_view_fees_through_the_fee_center": "You can view fees through the fee center",
"you_have_not_purchased_the_license": "You have not purchased the License",
"yuan": "Yuan"
}
}
6 changes: 5 additions & 1 deletion frontend/desktop/public/locales/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@
"github": "Github",
"google": "Google",
"guide_applaunchpad": "快速部署应用,无需繁琐配置",
"guide_costcenter": "计费标准、资源消耗明细看板",
"guide_dbprovider": "多种数据库秒级创建,满足不同应用需求",
"guide_devbox": "自动化开发环境设置、与本地 IDE 无缝连接",
"guide_objectstorage": "海量存储空间,近乎裸机的速度体验",
"guide_workorder": "技术问题咨询入口",
"handle": "操作",
"have_read": "已读",
"healthy_pod": "健康 Pods: {{count}}",
Expand Down Expand Up @@ -207,6 +210,7 @@
"rename": "重命名",
"retry_get_qr_code": "重新获取",
"scan_qr_code_for_face_recognition": "使用手机微信扫描二维码,完成身份验证",
"scan_to_join_group": "扫码添加专属客服",
"scan_with_wechat": "微信扫码支付",
"sealos_copilot": "Sealos 小助理",
"sealos_newcomer_benefits": "Sealos 新手福利",
Expand Down Expand Up @@ -261,4 +265,4 @@
"you_can_view_fees_through_the_fee_center": "您可通过费用中心查看费用",
"you_have_not_purchased_the_license": "您还没有购买 License",
"yuan": ""
}
}
30 changes: 22 additions & 8 deletions frontend/desktop/src/components/account/RealNameModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ import {
} from '@chakra-ui/react';
import { CloseIcon, useMessage, WarningIcon } from '@sealos/ui';
import { useTranslation } from 'next-i18next';
import React, { ReactElement, useCallback, useEffect, useState } from 'react';
import React, {
forwardRef,
ReactElement,
useCallback,
useEffect,
useImperativeHandle,
useState
} from 'react';
import { Tabs, TabList, TabPanels, Tab, TabPanel } from '@chakra-ui/react';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
Expand Down Expand Up @@ -140,12 +147,15 @@ export function useRealNameAuthNotification(props?: UseToastOptions) {
};
}

function RealNameModal(props: {
children: React.ReactElement;
onModalOpen?: () => void;
onModalClose?: () => void;
onFormSuccess?: () => void;
}): ReactElement {
const RealNameModal = forwardRef<
{ onOpen: () => void },
{
children?: React.ReactElement;
onModalOpen?: () => void;
onModalClose?: () => void;
onFormSuccess?: () => void;
}
>(function RealNameModal(props, ref) {
const { t } = useTranslation();
const { children } = props;
const { isOpen, onOpen, onClose } = useDisclosure();
Expand All @@ -157,6 +167,10 @@ function RealNameModal(props: {
}
};

useImperativeHandle(ref, () => ({
onOpen
}));

return (
<>
{children &&
Expand Down Expand Up @@ -245,7 +259,7 @@ function RealNameModal(props: {
</Modal>
</>
);
}
});

export function RealNameAuthForm(
props: FlexProps & {
Expand Down
7 changes: 0 additions & 7 deletions frontend/desktop/src/components/desktop_content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,6 @@ export default function Desktop(props: any) {
}}
/>
)}
{taskComponentState === 'button' && (
<FloatingTaskButton
onClick={() => {
setTaskComponentState('modal');
}}
/>
)}
</Box>
)}
</Flex>
Expand Down
Loading

0 comments on commit 5024732

Please sign in to comment.