8000 [pull] main from labring:main by pull[bot] · Pull Request #85 · erickirt/sealos · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[pull] main from labring:main #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
346 changes: 284 additions & 62 deletions frontend/pnpm-lock.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/providers/dbprovider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"jszip": "^3.10.1",
"lodash": "^4.17.21",
"minio": "^7.1.3",
"sharp": "^0.32.6",
"multer": "1.4.5-lts.1",
"nanoid": "^4.0.2",
"next": "13.1.6",
Expand Down
2 changes: 2 additions & 0 deletions frontend/providers/invite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
"date-fns": "^2.30.0",
"dayjs": "^1.11.10",
"echarts": "^5.4.3",
"exceljs": "^4.4.0",
"framer-motion": "^10.16.4",
"i18next": "^23.11.5",
"immer": "^9.0.21",
"js-cookie": "^3.0.5",
"js-yaml": "^4.1.0",
"jszip": "^3.10.1",
"lodash": "^4.17.21",
"lucide-react": "^0.503.0",
"mongodb": "^5.9.0",
"nanoid": "^4.0.2",
"next": "13.1.6",
Expand Down
33 changes: 32 additions & 1 deletion frontend/providers/invite/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,36 @@
"Time": "Time",
"Amount": "Amount",
"No invitation records": "No invitation records~",
"cashback_first_rule": "1. After a friend completes real-name authentication, you and TA will receive a <strong>{{amount}}</strong> yuan balance reward"
"cashback_first_rule": "1. After a friend completes real-name authentication, you and TA will receive a <strong style='color: #2563EB;' >{{amount}}</strong> yuan balance reward",
"invite_friends_title": "Invite friends to get Sealos balance",
"friend_certification_text": "After friends complete real-name certification, both parties will receive <strong>{{amount}}</strong> yuan balance reward",
"balance_reward": " balance reward",
"activity_subsidy": "Activity Subsidy",
"total_earnings": "Total Earnings",
"loading": "Loading...",
"invitation_code": "Invitation Code",
"reward_status": "Reward Status",
"completed_users": "Completed Users",
"pending_users": "In Progress Users",
"user_list": "User List",
"export_excel": "Export Excel",
"serial_number": "No.",
"registration_time": "Registration Time",
"completion_time": "Completion Time",
"completed": "Completed",
"in_progress": "In Progress",
"previous_page": "Previous",
"next_page": "Next",
"activity_subsidy_text": "Cash Reward",
"invite_number_text": "Cashback ratio",
"invite_number": "Number of invites",
"apply_now": "Apply now",
"invite_example": "Example: A invites user B. User B recharged 10,000 yuan in the first year and 5k in the second year, then user A's account balance is 1,000, and only the first year recharge is recharged.",
"balance_reward_text": "10% of the first year recharge amount of the invitee will be returned to the agent's Sealos account",
"invite_number_text_1": "20 - 100",
"invite_number_text_2": "5 yuan per person",
"invite_number_text_3": "100 - 500",
"invite_number_text_4": "7 yuan per person",
"invite_number_text_5": "More than 500 people",
"invite_number_text_6": "8 yuan per person"
}
33 changes: 32 additions & 1 deletion frontend/providers/invite/public/locales/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,36 @@
"Time": "时间",
"Amount": "金额",
"No invitation records": "无邀请记录~",
"cashback_first_rule": "1. 好友完成实名认证后,您和TA都将获得 <strong>{{amount}}</strong> 元余额奖励"
"cashback_first_rule": "1. 好友完成实名认证后,您和TA都将获得 <strong>{{amount}}</strong> 元余额奖励",
"invite_friends_title": "邀请好友领 Sealos 余额",
"friend_certification_text": "好友完成 <strong style='color: #2563EB;'>实名认证</strong> 后,双方各得 <strong style='color: #2563EB;' >{{amount}}</strong> 元",
"balance_reward": "余额奖励",
"activity_subsidy": "活动补贴",
"total_earnings": "总收益",
"loading": "加载中...",
"invitation_code": "邀请码",
"reward_status": "奖励状态",
"completed_users": "已完成用户",
"pending_users": "进行中用户",
"user_list": "用户列表",
"export_excel": "导出 Excel",
"serial_number": "序号",
"registration_time": "注册时间",
"completion_time": "完成时间",
"completed": "已完成",
"in_progress": "进行中",
"previous_page": "上一页",
"next_page": "下一页",
"activity_subsidy_text": "现金奖励",
"invite_number_text": "返现比例",
"invite_number": "邀请人数",
"apply_now": "立即申请",
"invite_example": "例:A 邀请 B 用户,B 用户第 1 年充值了 10000 元,第 2 年充了 5k,则 A 用户账户余额+1000,仅第一年充值返还。",
"balance_reward_text": "被邀请人首年充值金额的 10% 会返还至代理商 Sealos 账户内",
"invite_number_text_1": "20 - 100",
"invite_number_text_2": "5 元/人",
"invite_number_text_3": "100 - 500",
"invite_number_text_4": "7 元/人",
"invite_number_text_5": "500 人以上",
"invite_number_text_6": "8 元/人"
}
56 changes: 56 additions & 0 deletions frontend/providers/invite/public/sealos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions frontend/providers/invite/src/api/account.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { InvitationResult } from '@/pages/api/account/list';
import { GET } from '@/services/request';
import { GET, POST } from '@/services/request';

export const getInvitationIno = (data: { inviterId: string }) =>
export const getInvitationIno = (data: { inviterId: string; page: string; pageSize: string }) =>
GET<InvitationResult>('/api/account/list', data);
67 changes: 51 additions & 16 deletions frontend/providers/invite/src/pages/api/account/list.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,61 @@
import { jsonRes } from '@/services/response';
import type { NextApiRequest, NextApiResponse } from 'next';

type TRewardList = {
invitee: string;
inviter: string;
amount: number;
arrival_time: string;
status: string;
registerTime: string;
};

export type InvitationResult = {
totalPeople: string;
totalPeople: number;
totalAmount: number;
rewardList: {
invitee: string;
inviter: string;
amount: number;
arrival_time: Date;
status: 1;
}[];
completedUsers: number;
pendingUsers: number;
rewardList: TRewardList[];
pagination?: {
total: number;
currentPage: number;
pageSize: number;
totalPages: number;
};
};

export const getInvitationList = async (
inviterId: string,
page: string = '1',
pageSize: string = '10'
) => {
const baseUrl = process.env.LAF_BASE_URL;
const result = (await fetch(
`https://${baseUrl}/listById?inviterId=${inviterId}&page=${page}&pageSize=${pageSize}`
).then((response) => response.json())) as {
code: number;
data: InvitationResult;
};
return result.data;
};

export default async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
try {
const { inviterId } = req.query;
const baseUrl = process.env.LAF_BASE_URL;
const {
inviterId,
page = '1',
pageSize = '10'
} = req.query as {
inviterId: string;
page: string;
pageSize: string;
};

const defaultObj: InvitationResult = {
totalAmount: 0,
totalPeople: '0',
totalPeople: 0,
completedUsers: 0,
pendingUsers: 0,
rewardList: []
};

Expand All @@ -30,13 +65,13 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
});
}

const result = await fetch(`https://${baseUrl}/listById?inviterId=${inviterId}`).then(
(response) => response.json()
);
const data = await getInvitationList(inviterId, page, pageSize);

jsonRes(res, result);
return jsonRes(res, {
data
});
} catch (err) {
jsonRes(res, {
return jsonRes(res, {
code: 500,
error: err
});
Expand Down
Loading
Loading
0