fix: Reset pagination when navigating between directories in file manager
Some checks are pending
Build Action / Build-LiteLoader (push) Waiting to run
Build Action / Build-Shell (push) Waiting to run

Fix: Reset pagination when navigating between directories in file manager
This commit is contained in:
时瑾 2025-10-02 09:40:37 +08:00 committed by GitHub
commit d472eee777
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 4 deletions

View File

@ -82,6 +82,7 @@ export default function FileTable({
setPreviewImages([]) setPreviewImages([])
setPreviewIndex(0) setPreviewIndex(0)
setShowImage(false) setShowImage(false)
setPage(1)
}, [currentPath]) }, [currentPath])
const onPreviewImage = (name: string, images: PreviewImage[]) => { const onPreviewImage = (name: string, images: PreviewImage[]) => {

View File

@ -171,7 +171,8 @@ const GenericForm = <T extends keyof NetworkConfigType>({
export default GenericForm export default GenericForm
export function random_token(length: number) { export function random_token(length: number) {
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#$%^&*()-_=+[]{}|;:,.<>?' const chars =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#$%^&*()-_=+[]{}|;:,.<>?'
let result = '' let result = ''
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
result += chars.charAt(Math.floor(Math.random() * chars.length)) result += chars.charAt(Math.floor(Math.random() * chars.length))

View File

@ -1,9 +1,10 @@
import CryptoJS from 'crypto-js'
import { EventSourcePolyfill } from 'event-source-polyfill' import { EventSourcePolyfill } from 'event-source-polyfill'
import { LogLevel } from '@/const/enum' import { LogLevel } from '@/const/enum'
import { serverRequest } from '@/utils/request' import { serverRequest } from '@/utils/request'
import CryptoJS from "crypto-js";
export interface Log { export interface Log {
level: LogLevel level: LogLevel
message: string message: string
@ -17,7 +18,7 @@ export default class WebUIManager {
} }
public static async loginWithToken(token: string) { public static async loginWithToken(token: string) {
const sha256 = CryptoJS.SHA256(token + '.napcat').toString(); const sha256 = CryptoJS.SHA256(token + '.napcat').toString()
const { data } = await serverRequest.post<ServerResponse<AuthResponse>>( const { data } = await serverRequest.post<ServerResponse<AuthResponse>>(
'/auth/login', '/auth/login',
{ hash: sha256 } { hash: sha256 }

View File

@ -182,4 +182,4 @@ const ServerConfigCard = () => {
) )
} }
export default ServerConfigCard export default ServerConfigCard