Skip to content

Commit 7acd232

Browse files
authored
v2.16.4 (#227)
2 parents 576e19b + 10e6d52 commit 7acd232

File tree

25 files changed

+1493
-1264
lines changed

25 files changed

+1493
-1264
lines changed

app/(Layout)/desktop/HeaderBar/HeaderBar.module.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ $logoBG: rgba(0, 190, 245, 35%);
44
height: 3.7rem;
55
width: 85dvw;
66
margin: 2rem auto;
7+
margin-bottom: 0;
78

89
display: flex;
910
flex-direction: row;
@@ -13,8 +14,8 @@ $logoBG: rgba(0, 190, 245, 35%);
1314
cursor: default;
1415
user-select: none;
1516

16-
& > img {
17+
&>img {
1718
margin: auto 0;
1819
cursor: pointer;
1920
}
20-
}
21+
}

app/(Layout)/splitBlock.module.scss

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
.app {
44
width: 90dvw;
5-
height: 65dvh;
6-
max-height: 65dvh;
5+
height: 70dvh;
6+
// max-height: 70dvh;
77
border-radius: 1.8rem;
8-
margin: auto;
8+
margin-left: auto;
9+
margin-right: auto;
910

1011
display: grid;
11-
grid-gap: 1.2rem;
12+
grid-gap: 1rem;
1213
grid-template-columns: repeat(10, 1fr);
1314
grid-auto-rows: 1fr;
1415

@@ -21,7 +22,8 @@
2122
background-color: transparent;
2223
grid-column: span 7;
2324
max-width: 90dvw;
24-
max-height: 65dvh;
25+
// max-height: 70dvh;
26+
height: 100%;
2527
border-radius: $border-radius;
2628

2729
overflow-y: auto;

app/(home)/desktop/Information.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const Information = () => {
5656
})();
5757
}, []);
5858

59-
const pageSize = 5;
59+
const pageSize = 3;
6060
const { data, isLoading } = useTopPost({ pageSize });
6161

6262
if (isLoading) {
@@ -67,7 +67,7 @@ const Information = () => {
6767
<div className={style.information}>
6868
<div className={style.wrapper}>
6969
<div className={style.likedPosts}>
70-
<h2>Top 5 Posts</h2>
70+
<h2>Top 3 Posts</h2>
7171
<div className={style.likePostWrapper}>
7272
{data?.pages[0].map((item: TThread) => {
7373
return (

app/(home)/desktop/ThreadsList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const ThreadsList = () => {
2626
) : (
2727
<InfinityThreadsList
2828
data={data}
29-
height="65dvh"
29+
height="70dvh"
3030
fetchNextPage={fetchNextPage}
3131
isFetchingNextPage={isFetchingNextPage}
3232
announcementData={announcementData}

app/[userID]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function UserInfinityThreadList({ id }: { id: string }) {
9292
) : (
9393
<InfinityThreadsList
9494
data={data}
95-
height="65dvh"
95+
height="70dvh"
9696
fetchNextPage={fetchNextPage}
9797
isFetchingNextPage={isFetchingNextPage}
9898
/>
@@ -111,7 +111,7 @@ function SIGInfinityThreadList({ id }: { id: string }) {
111111
) : (
112112
<InfinityThreadsList
113113
data={data}
114-
height="65dvh"
114+
height="70dvh"
115115
fetchNextPage={fetchNextPage}
116116
isFetchingNextPage={isFetchingNextPage}
117117
/>

app/api/auth/[...nextauth]/route.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import axios from "axios";
33
import GoogleProvider from "next-auth/providers/google";
44

55
const emoji: { [key: string]: string } = {
6-
"developer": "<:developer:1222933983164235876>",
6+
developer: "<:developer:1222933983164235876>",
77
"10.21_user": "<:1021user:1222933998913851442>",
8-
"bug_hunter": "<:bughunter:1245079303000031282>",
8+
bug_hunter: "<:bughunter:1245079303000031282>",
99
};
1010

1111
const handler = NextAuth({
@@ -47,28 +47,26 @@ const handler = NextAuth({
4747
data.append("code", response.data.code);
4848
data.append("class", response.data.class || "No Class");
4949

50-
if (badges.length > 0) {
51-
50+
if (response.data.badge.length > 0) {
5251
badges[0]?.split(",").forEach((badge: string) => {
5352
badgeData += emoji[badge];
5453
badgeData += " ";
5554
});
56-
5755
}
5856

59-
data.append("badge", badgeData || "No Badge");
57+
data.append("badge", badgeData !== "" ? badgeData : "No Badge");
6058

61-
axios(`${process.env.NEXTAUTH_URL}/api/webhook/login`, {
59+
fetch(`${process.env.NEXTAUTH_URL}/api/webhook/login`, {
6260
method: "POST",
63-
data: data,
61+
body: data,
6462
});
6563
}
6664
}
6765
return true;
6866
},
6967
async jwt({ token, account }) {
7068
const _token = token;
71-
if (account) {
69+
if (account) {
7270
_token.accessToken = account?.access_token;
7371
}
7472

app/api/webhook/login/route.ts

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,91 @@
11
import axios from "axios";
22
import { NextRequest, NextResponse } from "next/server";
33

4-
export async function POST(req : NextRequest) {
4+
export async function POST(req: NextRequest) {
55
const data = await req.formData();
66
const content = {
77
username: "MDSIG Login",
8-
avatar_url: "https://cdn.discordapp.com/attachments/1222932958667870279/1222933028259496080/sig2_pfp__1.png",
8+
avatar_url:
9+
"https://cdn.discordapp.com/attachments/1222932958667870279/1222933028259496080/sig2_pfp__1.png",
910
embeds: [
1011
{
11-
"title":`${data.get("name")} ${((req.url.includes("localhost")) || (req.url.includes("-dev")) ? "(Development)" : "") }`,
12-
"description": data.get("description"),
13-
"color": parseInt("0x34e718"),
14-
"thumbnail": {
15-
"url": data.get("avatar"),
12+
title: `${data.get("name")} ${req.url.includes("localhost") ? "(Development)" : ""}${req.url.includes("dev") ? "(Development)" : ""}`,
13+
description: data.get("description"),
14+
color: parseInt("0x34e718"),
15+
thumbnail: {
16+
url: data.get("avatar"),
1617
},
17-
"fields": [
18+
fields: [
1819
{
19-
"name": "ID",
20-
"value": data.get("id"),
21-
"inline": true
20+
name: "ID",
21+
value: data.get("id"),
22+
inline: true,
2223
},
2324
{
24-
"name": "Custom ID",
25-
"value": data.get("customId"),
26-
"inline": true
25+
name: "Custom ID",
26+
value: data.get("customId"),
27+
inline: true,
2728
},
2829
{
29-
"name": "Identity",
30-
"value": data.get("identity"),
31-
"inline": true
30+
name: "Identity",
31+
value: data.get("identity"),
32+
inline: true,
3233
},
3334
{
34-
"name": "Email",
35-
"value": data.get("email"),
36-
"inline": true
35+
name: "Email",
36+
value: data.get("email"),
37+
inline: true,
3738
},
3839
{
39-
"name": "Badge",
40-
"value": data.get("badge") || "No Data",
41-
"inline": true
40+
name: "Badge",
41+
value: data.get("badge") || "No Data",
42+
inline: true,
4243
},
4344
{
44-
"name": "\u200b",
45-
"value": "\u200b",
46-
"inline": true
45+
name: "\u200b",
46+
value: "\u200b",
47+
inline: true,
4748
},
4849
{
49-
"name": "Code",
50-
"value": data.get("code"),
51-
"inline": true
50+
name: "Code",
51+
value: data.get("code"),
52+
inline: true,
5253
},
5354
{
54-
"name": "Class",
55-
"value": data.get("class"),
56-
"inline": true
55+
name: "Class",
56+
value: data.get("class"),
57+
inline: true,
5758
},
5859
{
59-
"name": "\u200b",
60-
"value": "\u200b",
61-
"inline": true
60+
name: "\u200b",
61+
value: "\u200b",
62+
inline: true,
6263
},
6364
],
64-
"timestamp": new Date().toISOString(),
65-
"footer": {
66-
"text": "MDSIG 2.0 Login System",
67-
"icon_url": "https://cdn.discordapp.com/attachments/1222932958667870279/1222933028259496080/sig2_pfp__1.png?ex=66180422&is=66058f22&hm=a0229ab4733f6a2c4d2db217500663987351acdee83ff724afcfddc84e61fc45&",
65+
timestamp: new Date().toISOString(),
66+
footer: {
67+
text: "MDSIG 2.0 Login System",
68+
icon_url:
69+
"https://cdn.discordapp.com/attachments/1222932958667870279/1222933028259496080/sig2_pfp__1.png?ex=66180422&is=66058f22&hm=a0229ab4733f6a2c4d2db217500663987351acdee83ff724afcfddc84e61fc45&",
6870
},
6971
},
7072
],
7173
};
7274

73-
axios(String(process.env.NEXT_PUBLIC_WEBHOOK_LOGIN),{
75+
axios(String(process.env.NEXT_PUBLIC_WEBHOOK_LOGIN), {
7476
method: "POST",
7577
headers: {
76-
"Content-type": "application/json"
78+
"Content-type": "application/json",
7779
},
7880
data: JSON.stringify(content),
7981
});
80-
81-
return NextResponse.json({ "message": "Request Sent!" });
82+
83+
return NextResponse.json({ message: "Request Sent!" });
8284
}
8385

8486
export const dynamic = "force-dynamic";
8587
export const dynamicParams = false;
8688
export const revalidate = false;
8789
export const fetchCache = "auto";
8890
export const runtime = "nodejs";
89-
export const preferredRegion = "auto";
91+
export const preferredRegion = "auto";

app/dashboard/(Dashboard)/Desktop/index.module.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
.wrapper {
44
padding-top: 1.2rem;
5-
max-height: 65dvh;
6-
height: 65dvh;
5+
max-height: 70dvh;
6+
height: 70dvh;
77
max-width: 60rem;
88
width: 90dvw;
99
margin-left: auto;
@@ -46,7 +46,7 @@
4646
}
4747

4848
.sigChart {
49-
height: calc(65dvh - 7.2rem);
49+
height: calc(70dvh - 7.2rem);
5050
width: 90dvw;
5151
max-width: 60rem;
5252
background-color: $panel-background-color;
@@ -69,5 +69,5 @@
6969

7070
.chartBar {
7171
height: auto !important;
72-
width: auto !important;
72+
width: 100% !important;
7373
}

app/data/(Data)/mobile/index.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@
177177
padding: $mobile-border-radius;
178178
border: 1px solid #003f47;
179179
overflow: hidden;
180+
padding-right: 0.2rem;
180181

181182
&::-webkit-scrollbar {
182183
width: 0.25rem;

app/info/(Info)/desktop/index.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,23 @@ export default function Desktop() {
5050
<p>前端版本號: {(ping && Object.keys(ping).length !== 0) && "v"}{ping?.Frontend?.currentVersion}</p>
5151
<p>後端版本號: {(ping && Object.keys(ping).length !== 0) && "v"}{ping?.Backend?.currentVersion}</p>
5252
<br />
53-
<p>前端運行時間:{ping?.Frontend?.uptime.replace("days,", "天").replace("hours,", "時").replace("minutes,", "分").replace("seconds", "秒").replace("day,", "天").replace("hour,", "時").replace("minute,", "分").replace("second", "秒")}</p>
54-
<p>後端運行時間:{ping?.Backend?.uptime.replace("days,", "天").replace("hours,", "時").replace("minutes,", "分").replace("seconds", "秒").replace("day,", "天").replace("hour,", "時").replace("minute,", "分").replace("second", "秒")}</p>
53+
<p>前端運行時間:{timeEn2Zh(ping?.Frontend?.uptime)}</p>
54+
<p>後端運行時間:{timeEn2Zh(ping?.Backend?.uptime)}</p>
5555
<br />
56-
<p>訪問<Link href={"https://sig-uptime.lazco.dev/status/main"} target="_blank">狀態頁面</Link>獲取更多詳細信息</p>
56+
<p>訪問<Link href={"https://status.sig.school/"} target="_blank">狀態頁面</Link>獲取更多詳細信息</p>
5757
<p className={styles.endText}><Link href={"https://sig.mingdao.edu.tw/ping"} target="_blank">前端</Link></p>
58-
<img src="https://sig-uptime.lazco.dev/api/badge/15/uptime?labelPrefix=前端+&style=for-the-badge" alt="frontend-status" className={styles.statusImg} />
58+
<img src="https://status.sig.school/api/badge/1/uptime?labelPrefix=前端+&style=for-the-badge" alt="frontend-status" className={styles.statusImg} />
5959
<p className={styles.endText}><Link href={"https://sig-api.mingdao.edu.tw/ping"} target="_blank">後端</Link></p>
60-
<img src="https://sig-uptime.lazco.dev/api/badge/5/uptime?labelPrefix=後端+&style=for-the-badge" alt="backend-status" className={styles.statusImg} />
60+
<img src="https://status.sig.school/api/badge/8/uptime?labelPrefix=後端+&style=for-the-badge" alt="backend-status" className={styles.statusImg} />
61+
<p className={styles.endText}>資料庫</p>
62+
<img src="https://status.sig.school/api/badge/6/uptime?labelPrefix=資料庫+&style=for-the-badge" alt="backend-status" className={styles.statusImg} />
6163
</div>
6264
</div>
6365
</div>
6466
</div>
6567
);
68+
}
69+
70+
function timeEn2Zh(time: string) {
71+
return time?.replace("month,", "月").replace("months,", "月").replace("days,", "天").replace("hours,", "時").replace("minutes,", "分").replace("seconds", "秒").replace("day,", "天").replace("hour,", "時").replace("minute,", "分").replace("second", "秒").replace("month", "月").replace("months", "月").replace("days", "天").replace("hours", "時").replace("minutes", "分").replace("day", "天").replace("hour", "時").replace("minute", "分");
6672
}

0 commit comments

Comments
 (0)