fix: show required fields for provider

This commit is contained in:
jialin
2026-03-20 17:23:55 +08:00
committed by jialin
parent 0a0e03dc68
commit f873d4e245
12 changed files with 400 additions and 42 deletions
@@ -1,12 +1,14 @@
import { PageActionType } from '@/config/types';
import { createContext, useContext } from 'react';
import { maasProviderType } from '.';
import { RequiredFields } from './types';
interface FormContextProps {
providerType?: maasProviderType;
action: PageActionType;
currentData?: any;
id?: number;
providerFields?: RequiredFields[];
getCustomConfig?: () => Record<string, any>;
}
+16
View File
@@ -40,3 +40,19 @@ export interface MaasProviderItem {
api_token_count: number;
api_tokens: { hash: string }[];
}
export interface RequiredFields {
type: 'Input' | 'Select' | 'Password';
name: string;
label: {
text: string;
locale?: boolean;
};
required?: boolean;
placeholder?: string;
description?: {
text: string;
locale?: boolean;
};
rules?: any[];
}