Skip to content

Commit

Permalink
fix: applaunchpad unhandledRejection promise (#4771)
Browse files Browse the repository at this point in the history
* fix: applaunchpad unhandledRejection promise

* fix: workorder text truncation

* fix INGRESS_SECRET
  • Loading branch information
zjy365 authored Jun 12, 2024
1 parent 1cec081 commit 0ca8f84
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ export const defaultAppConfig: AppConfigType = {
}
};

process.on('unhandledRejection', (reason, promise) => {
console.error(`Caught unhandledRejection:`, reason, promise);
});

process.on('uncaughtException', (err) => {
console.error(`Caught uncaughtException:`, err);
});

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
try {
if (!global.AppConfig || process.env.NODE_ENV !== 'production') {
Expand Down
2 changes: 1 addition & 1 deletion frontend/providers/applaunchpad/src/store/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const serverLoadInitData = () => {
try {
SEALOS_DOMAIN = global.AppConfig.cloud.domain || 'cloud.sealos.io';
DOMAIN_PORT = global.AppConfig.cloud.port || '';
INGRESS_SECRET = global.AppConfig.cloud.domain || 'wildcard-cert';
INGRESS_SECRET = global.AppConfig.launchpad.ingressTlsSecretName || 'wildcard-cert';
SHOW_EVENT_ANALYZE = global.AppConfig.launchpad.eventAnalyze.enabled;
} catch (error) {}
};
4 changes: 3 additions & 1 deletion frontend/providers/workorder/src/api/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { RegionDB } from '@/types/region';
import { AppSession, UserDB } from '@/types/user';

export const findUserById = ({ orderId }: { orderId: string }) =>
GET<{ user: UserDB; regionInfo: RegionDB }>('/api/auth/findById', { orderId: orderId });
GET<{ user: UserDB; regionInfo: RegionDB; workorderLink: string }>('/api/auth/findById', {
orderId: orderId
});

export const AuthByDesktopSession = (payload: { token: string }) =>
POST<AppSession>('/api/auth/desktop', payload);
3 changes: 2 additions & 1 deletion frontend/providers/workorder/src/pages/api/auth/findById.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
jsonRes(res, {
data: {
user: result?.userInfo,
regionInfo: regionInfo
regionInfo: regionInfo,
workorderLink: `https://hzh.sealos.run/?openapp=system-workorder?orderId=${orderId}`
}
});
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const AppBaseInfo = ({ app }: { app: WorkOrderDB }) => {
window.open(fileUrl);
};

const { data: userInfo } = useQuery(
const { data: workorderInfo } = useQuery(
['findUserById'],
() => findUserById({ orderId: app?.orderId || '' }),
{
Expand Down Expand Up @@ -158,17 +158,20 @@ const AppBaseInfo = ({ app }: { app: WorkOrderDB }) => {
gap={'4px'}
cursor={'pointer'}
>
<Box onClick={() => copyData(userInfo?.user?.userId || '')}>
userID: {userInfo?.user?.userId}
<Box onClick={() => copyData(workorderInfo?.user?.userId || '')}>
userID: {workorderInfo?.user?.userId}
</Box>
<Box onClick={() => copyData(userInfo?.user?.userCrName || '')}>
userCrName: {userInfo?.user?.userCrName}
<Box onClick={() => copyData(workorderInfo?.user?.userCrName || '')}>
userCrName: {workorderInfo?.user?.userCrName}
</Box>
<Box onClick={() => copyData(userInfo?.user?.workspaceId || '')}>
workspaceId: {userInfo?.user?.workspaceId}
<Box onClick={() => copyData(workorderInfo?.user?.workspaceId || '')}>
workspaceId: {workorderInfo?.user?.workspaceId}
</Box>
<Box onClick={() => copyData(userInfo?.regionInfo?.sealosRegionDomain || '')}>
region: {userInfo?.regionInfo?.sealosRegionDomain}
<Box onClick={() => copyData(workorderInfo?.regionInfo?.sealosRegionDomain || '')}>
region: {workorderInfo?.regionInfo?.sealosRegionDomain}
</Box>
<Box onClick={() => copyData(workorderInfo?.workorderLink || '')}>
workorderLink: {workorderInfo?.workorderLink}
</Box>
</Flex>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ const OrderList = ({
key: 'description',
render: (item: WorkOrderDB) => {
return (
<Box color={'#24282C'} fontSize={'12px'} fontWeight={'500'} noOfLines={1}>
<Box
maxW={'300px'}
color={'#24282C'}
fontSize={'12px'}
fontWeight={'500'}
noOfLines={1}
>
{item.description}
</Box>
);
Expand Down

0 comments on commit 0ca8f84

Please sign in to comment.