mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-06-16 21:03:58 +08:00
refactor: remove unused fields and streamline auth file editor logic
This commit is contained in:
@@ -10,6 +10,13 @@ import { parseTimestampMs } from '@/utils/timestamp';
|
||||
type StatusError = { status?: number };
|
||||
type AuthFileStatusResponse = { status: string; disabled: boolean };
|
||||
type AuthFileEntry = AuthFilesResponse['files'][number];
|
||||
export type AuthFileFieldsPatch = {
|
||||
prefix?: string;
|
||||
proxy_url?: string;
|
||||
headers?: Record<string, string>;
|
||||
priority?: number;
|
||||
note?: string;
|
||||
};
|
||||
type AuthFileBatchFailure = { name: string; error: string };
|
||||
type AuthFileBatchUploadResponse = {
|
||||
status?: string;
|
||||
@@ -401,6 +408,9 @@ export const authFilesApi = {
|
||||
setStatus: (name: string, disabled: boolean) =>
|
||||
apiClient.patch<AuthFileStatusResponse>('/auth-files/status', { name, disabled }),
|
||||
|
||||
patchFields: (name: string, fields: AuthFileFieldsPatch) =>
|
||||
apiClient.patch('/auth-files/fields', { name, ...fields }),
|
||||
|
||||
uploadFiles: async (files: File[]): Promise<AuthFileBatchUploadResult> => {
|
||||
const requestedNames = files.map((file) => file.name);
|
||||
if (requestedNames.length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user