mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-04 23:16:37 +08:00
prettier
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
// ——— Challenge / Redeem API types ———
|
||||
|
||||
import {readApiData} from '@/lib/api-envelope';
|
||||
import { readApiData } from '@/lib/api-envelope';
|
||||
|
||||
export interface ChallengeResponse {
|
||||
challenge: { c: number; s: number; d: number };
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import {BaseService} from '@/lib/services/core';
|
||||
import type {AuthSource, AuthSourceRequest, ToggleAuthSourceRequest,} from './types';
|
||||
import { BaseService } from '@/lib/services/core';
|
||||
import type {
|
||||
AuthSource,
|
||||
AuthSourceRequest,
|
||||
ToggleAuthSourceRequest,
|
||||
} from './types';
|
||||
|
||||
export class AdminAuthSourceService extends BaseService {
|
||||
protected static readonly basePath = '/api/v1/admin';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {BaseService} from '@/lib/services/core';
|
||||
import type {CacheConfig, CacheStatus} from './types';
|
||||
import { BaseService } from '@/lib/services/core';
|
||||
import type { CacheConfig, CacheStatus } from './types';
|
||||
|
||||
export class AdminCacheService extends BaseService {
|
||||
protected static readonly basePath = '/api/v1/admin';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type {InternalAxiosRequestConfig} from 'axios';
|
||||
import {BaseService} from '@/lib/services/core';
|
||||
import type { InternalAxiosRequestConfig } from 'axios';
|
||||
import { BaseService } from '@/lib/services/core';
|
||||
import type {
|
||||
AuthSource,
|
||||
ChangePasswordRequest,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {BaseService} from '@/lib/services/core';
|
||||
import type {PublicConfigResponse} from './types';
|
||||
import { BaseService } from '@/lib/services/core';
|
||||
import type { PublicConfigResponse } from './types';
|
||||
|
||||
/**
|
||||
* 配置服务
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import axios, {AxiosError, AxiosResponse, CancelTokenSource, InternalAxiosRequestConfig,} from 'axios';
|
||||
import {toast} from 'sonner';
|
||||
import {apiConfig, getApiBaseUrl} from './config';
|
||||
import axios, {
|
||||
AxiosError,
|
||||
AxiosResponse,
|
||||
CancelTokenSource,
|
||||
InternalAxiosRequestConfig,
|
||||
} from 'axios';
|
||||
import { toast } from 'sonner';
|
||||
import { apiConfig, getApiBaseUrl } from './config';
|
||||
import {
|
||||
ApiErrorBase,
|
||||
ForbiddenError,
|
||||
@@ -11,7 +16,7 @@ import {
|
||||
UnauthorizedError,
|
||||
ValidationError,
|
||||
} from './errors';
|
||||
import {ApiError, ApiResponse} from './types';
|
||||
import { ApiError, ApiResponse } from './types';
|
||||
|
||||
/**
|
||||
* API 客户端实例
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import apiClient from './api-client';
|
||||
import {ApiResponse} from './types';
|
||||
import {InternalAxiosRequestConfig} from 'axios';
|
||||
import { ApiResponse } from './types';
|
||||
import { InternalAxiosRequestConfig } from 'axios';
|
||||
|
||||
/**
|
||||
* 服务基类
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
import type {InternalAxiosRequestConfig} from 'axios';
|
||||
import type { InternalAxiosRequestConfig } from 'axios';
|
||||
|
||||
import apiClient from '@/lib/services/core/api-client';
|
||||
import {BaseService} from '@/lib/services/core';
|
||||
import type {DBOverview, ExecuteSQLResponse, TableDataResponse,} from './types';
|
||||
import { BaseService } from '@/lib/services/core';
|
||||
import type {
|
||||
DBOverview,
|
||||
ExecuteSQLResponse,
|
||||
TableDataResponse,
|
||||
} from './types';
|
||||
|
||||
/**
|
||||
* 数据库管理服务类
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {OpenFlareBaseService} from './base.service';
|
||||
import { OpenFlareBaseService } from './base.service';
|
||||
import type {
|
||||
AccessLogCleanupPayload,
|
||||
AccessLogCleanupResult,
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import {OpenFlareBaseService} from './base.service';
|
||||
import type {ApplyLogCleanupPayload, ApplyLogCleanupResult, ApplyLogList, ApplyLogListQuery,} from './types';
|
||||
import { OpenFlareBaseService } from './base.service';
|
||||
import type {
|
||||
ApplyLogCleanupPayload,
|
||||
ApplyLogCleanupResult,
|
||||
ApplyLogList,
|
||||
ApplyLogListQuery,
|
||||
} from './types';
|
||||
|
||||
export class ApplyLogService extends OpenFlareBaseService {
|
||||
protected static override readonly basePath: string = '/api/v1/d/apply-logs';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {BaseService} from '@/lib/services/core';
|
||||
import { BaseService } from '@/lib/services/core';
|
||||
|
||||
export class OpenFlareBaseService extends BaseService {
|
||||
protected static override readonly basePath: string = '/api/v1/d';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type {InternalAxiosRequestConfig} from 'axios';
|
||||
import type { InternalAxiosRequestConfig } from 'axios';
|
||||
|
||||
import {OpenFlareBaseService} from './base.service';
|
||||
import { OpenFlareBaseService } from './base.service';
|
||||
import type {
|
||||
ConfigDiffResult,
|
||||
ConfigPreviewResult,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {OpenFlareBaseService} from './base.service';
|
||||
import { OpenFlareBaseService } from './base.service';
|
||||
import type {
|
||||
CompactCapacityTrendPoint,
|
||||
CompactDashboardNodeHealth,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {OpenFlareBaseService} from './base.service';
|
||||
import type {DnsAccountItem, DnsAccountMutationPayload} from './types';
|
||||
import { OpenFlareBaseService } from './base.service';
|
||||
import type { DnsAccountItem, DnsAccountMutationPayload } from './types';
|
||||
|
||||
export class DnsAccountService extends OpenFlareBaseService {
|
||||
protected static override readonly basePath: string =
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type {InternalAxiosRequestConfig} from 'axios';
|
||||
import type { InternalAxiosRequestConfig } from 'axios';
|
||||
|
||||
import {BaseService} from '../core/base.service';
|
||||
import type {FileStatsResponse, ListUploadsResponse} from './types';
|
||||
import { BaseService } from '../core/base.service';
|
||||
import type { FileStatsResponse, ListUploadsResponse } from './types';
|
||||
|
||||
export class AdminUploadService extends BaseService {
|
||||
protected static readonly basePath = '/api/v1/admin/uploads';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type {ThemeConfig} from './types';
|
||||
import type { ThemeConfig } from './types';
|
||||
|
||||
/**
|
||||
* 主题系统配置
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
'use client';
|
||||
|
||||
import React, {createContext, useCallback, useContext, useEffect, useState,} from 'react';
|
||||
import {useTheme as useNextTheme} from 'next-themes';
|
||||
import type {Theme} from './types';
|
||||
import {getStoredThemeId, setStoredThemeId} from './storage';
|
||||
import {getAvailableThemes} from './parser';
|
||||
import React, {
|
||||
createContext,
|
||||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { useTheme as useNextTheme } from 'next-themes';
|
||||
import type { Theme } from './types';
|
||||
import { getStoredThemeId, setStoredThemeId } from './storage';
|
||||
import { getAvailableThemes } from './parser';
|
||||
|
||||
/**
|
||||
* 主题上下文类型定义
|
||||
|
||||
@@ -4559,4 +4559,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {isCancelError} from '@/lib/services/core';
|
||||
import {toast} from 'sonner';
|
||||
import { isCancelError } from '@/lib/services/core';
|
||||
import { toast } from 'sonner';
|
||||
|
||||
/**
|
||||
* 错误处理选项
|
||||
|
||||
Reference in New Issue
Block a user