mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 21:14:21 +08:00
合并冲突
This commit is contained in:
+2
-7
@@ -250,9 +250,7 @@ function MainContent(): React.JSX.Element {
|
|||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleOAuthUserUpdated = (
|
const handleOAuthUserUpdated = (event: Event) => {
|
||||||
event: Event
|
|
||||||
) => {
|
|
||||||
const customEvent = event as CustomEvent<{
|
const customEvent = event as CustomEvent<{
|
||||||
user?: { name?: string } | null
|
user?: { name?: string } | null
|
||||||
}>
|
}>
|
||||||
@@ -267,10 +265,7 @@ function MainContent(): React.JSX.Element {
|
|||||||
|
|
||||||
window.addEventListener("ss:oauth-user-updated", handleOAuthUserUpdated as EventListener)
|
window.addEventListener("ss:oauth-user-updated", handleOAuthUserUpdated as EventListener)
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener(
|
window.removeEventListener("ss:oauth-user-updated", handleOAuthUserUpdated as EventListener)
|
||||||
"ss:oauth-user-updated",
|
|
||||||
handleOAuthUserUpdated as EventListener
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}, [refreshPermissionFromAuth])
|
}, [refreshPermissionFromAuth])
|
||||||
|
|
||||||
|
|||||||
@@ -1108,9 +1108,7 @@ ORDER BY reward_points DESC, score DESC`,
|
|||||||
fontSize: 28,
|
fontSize: 28,
|
||||||
lineHeight: 1,
|
lineHeight: 1,
|
||||||
color:
|
color:
|
||||||
primaryMetric && primaryMetric.value >= 0
|
primaryMetric && primaryMetric.value >= 0 ? "#52c41a" : "#ff4d4f",
|
||||||
? "#52c41a"
|
|
||||||
: "#ff4d4f",
|
|
||||||
background: "rgba(255,255,255,0.62)",
|
background: "rgba(255,255,255,0.62)",
|
||||||
border: "1px solid rgba(255,255,255,0.82)",
|
border: "1px solid rgba(255,255,255,0.82)",
|
||||||
borderRadius: 8,
|
borderRadius: 8,
|
||||||
|
|||||||
@@ -371,7 +371,9 @@ export function ContentArea({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div style={{ fontSize: "12px", color: "var(--ss-text-secondary)" }}>最近同步时间</div>
|
<div style={{ fontSize: "12px", color: "var(--ss-text-secondary)" }}>最近同步时间</div>
|
||||||
<div style={{ fontSize: "12px", color: "var(--ss-text-main)" }}>{formattedLastSyncTime}</div>
|
<div style={{ fontSize: "12px", color: "var(--ss-text-main)" }}>
|
||||||
|
{formattedLastSyncTime}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ fontSize: "13px", color: "var(--ss-text-secondary)" }}>云空间用量</div>
|
<div style={{ fontSize: "13px", color: "var(--ss-text-secondary)" }}>云空间用量</div>
|
||||||
{storageUsageLoading ? (
|
{storageUsageLoading ? (
|
||||||
|
|||||||
+20
-8
@@ -13,7 +13,13 @@ import {
|
|||||||
Divider,
|
Divider,
|
||||||
Dropdown,
|
Dropdown,
|
||||||
} from "antd"
|
} from "antd"
|
||||||
import { SearchOutlined, DeleteOutlined, UndoOutlined, UploadOutlined, CopyOutlined } from "@ant-design/icons"
|
import {
|
||||||
|
SearchOutlined,
|
||||||
|
DeleteOutlined,
|
||||||
|
UndoOutlined,
|
||||||
|
UploadOutlined,
|
||||||
|
CopyOutlined,
|
||||||
|
} from "@ant-design/icons"
|
||||||
import { useTranslation } from "react-i18next"
|
import { useTranslation } from "react-i18next"
|
||||||
import { match, pinyin } from "pinyin-pro"
|
import { match, pinyin } from "pinyin-pro"
|
||||||
import { getAvatarFromExtraJson, setAvatarInExtraJson } from "../utils/studentAvatar"
|
import { getAvatarFromExtraJson, setAvatarInExtraJson } from "../utils/studentAvatar"
|
||||||
@@ -651,7 +657,8 @@ export const Home: React.FC<HomeProps> = ({
|
|||||||
setOperationVisible(true)
|
setOperationVisible(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const playOperationMorph = useCallback((attempt = 0) => {
|
const playOperationMorph = useCallback(
|
||||||
|
(attempt = 0) => {
|
||||||
if (isPortraitMode || !operationOriginRect) return false
|
if (isPortraitMode || !operationOriginRect) return false
|
||||||
const modalEl = document.querySelector(`.${operationModalClass}`) as HTMLElement | null
|
const modalEl = document.querySelector(`.${operationModalClass}`) as HTMLElement | null
|
||||||
if (!modalEl) {
|
if (!modalEl) {
|
||||||
@@ -677,9 +684,9 @@ export const Home: React.FC<HomeProps> = ({
|
|||||||
modalEl.style.transform = ""
|
modalEl.style.transform = ""
|
||||||
modalEl.style.opacity = ""
|
modalEl.style.opacity = ""
|
||||||
modalEl.style.visibility = ""
|
modalEl.style.visibility = ""
|
||||||
const maskEl = document.querySelector(`.${operationModalRootClass} .ant-modal-mask`) as
|
const maskEl = document.querySelector(
|
||||||
| HTMLElement
|
`.${operationModalRootClass} .ant-modal-mask`
|
||||||
| null
|
) as HTMLElement | null
|
||||||
if (maskEl) {
|
if (maskEl) {
|
||||||
operationMaskAnimationRef.current?.cancel()
|
operationMaskAnimationRef.current?.cancel()
|
||||||
maskEl.style.opacity = ""
|
maskEl.style.opacity = ""
|
||||||
@@ -755,7 +762,9 @@ export const Home: React.FC<HomeProps> = ({
|
|||||||
logHome("operation:morph:animation-cancel")
|
logHome("operation:morph:animation-cancel")
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}, [isPortraitMode, operationOriginRect, operationModalClass, operationModalRootClass])
|
},
|
||||||
|
[isPortraitMode, operationOriginRect, operationModalClass, operationModalRootClass]
|
||||||
|
)
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (isPortraitMode || !operationVisible) return
|
if (isPortraitMode || !operationVisible) return
|
||||||
@@ -787,7 +796,8 @@ export const Home: React.FC<HomeProps> = ({
|
|||||||
}
|
}
|
||||||
}, [isPortraitMode, operationVisible, operationOriginRect, playOperationMorph])
|
}, [isPortraitMode, operationVisible, operationOriginRect, playOperationMorph])
|
||||||
|
|
||||||
const finishCloseOperationModal = useCallback((skipCancelMorph = false, skipCancelMask = false) => {
|
const finishCloseOperationModal = useCallback(
|
||||||
|
(skipCancelMorph = false, skipCancelMask = false) => {
|
||||||
if (!skipCancelMorph) {
|
if (!skipCancelMorph) {
|
||||||
operationMorphAnimationRef.current?.cancel()
|
operationMorphAnimationRef.current?.cancel()
|
||||||
}
|
}
|
||||||
@@ -803,7 +813,9 @@ export const Home: React.FC<HomeProps> = ({
|
|||||||
operationClosingRef.current = false
|
operationClosingRef.current = false
|
||||||
setOperationVisible(false)
|
setOperationVisible(false)
|
||||||
setOperationOriginRect(null)
|
setOperationOriginRect(null)
|
||||||
}, [])
|
},
|
||||||
|
[]
|
||||||
|
)
|
||||||
|
|
||||||
const closeOperationModal = useCallback(() => {
|
const closeOperationModal = useCallback(() => {
|
||||||
logHome("operation:morph:close", {
|
logHome("operation:morph:close", {
|
||||||
|
|||||||
@@ -120,7 +120,9 @@ export const RewardExchange: React.FC<{ canEdit: boolean }> = ({ canEdit }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const frame = window.requestAnimationFrame(() => {
|
const frame = window.requestAnimationFrame(() => {
|
||||||
const modalEl = document.querySelector(".ss-reward-morph-modal.ant-modal") as HTMLElement | null
|
const modalEl = document.querySelector(
|
||||||
|
".ss-reward-morph-modal.ant-modal"
|
||||||
|
) as HTMLElement | null
|
||||||
if (!modalEl) {
|
if (!modalEl) {
|
||||||
setModalMorphStage("idle")
|
setModalMorphStage("idle")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -416,15 +416,13 @@ export const Settings: React.FC<{
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleOAuthUserUpdated = (event: Event) => {
|
const handleOAuthUserUpdated = (event: Event) => {
|
||||||
const customEvent = event as CustomEvent<{
|
const customEvent = event as CustomEvent<{
|
||||||
user?:
|
user?: {
|
||||||
| {
|
|
||||||
user_id?: string
|
user_id?: string
|
||||||
email?: string
|
email?: string
|
||||||
name?: string
|
name?: string
|
||||||
github_username?: string
|
github_username?: string
|
||||||
permission?: number
|
permission?: number
|
||||||
}
|
} | null
|
||||||
| null
|
|
||||||
}>
|
}>
|
||||||
const user = customEvent?.detail?.user
|
const user = customEvent?.detail?.user
|
||||||
if (user?.user_id && user.email && user.name && typeof user.permission === "number") {
|
if (user?.user_id && user.email && user.name && typeof user.permission === "number") {
|
||||||
@@ -442,10 +440,7 @@ export const Settings: React.FC<{
|
|||||||
|
|
||||||
window.addEventListener("ss:oauth-user-updated", handleOAuthUserUpdated as EventListener)
|
window.addEventListener("ss:oauth-user-updated", handleOAuthUserUpdated as EventListener)
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener(
|
window.removeEventListener("ss:oauth-user-updated", handleOAuthUserUpdated as EventListener)
|
||||||
"ss:oauth-user-updated",
|
|
||||||
handleOAuthUserUpdated as EventListener
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user