|
|
|
@ -82,3 +82,16 @@ export const fieldRequiredValidator = {
|
|
|
|
|
required: true, |
|
|
|
|
message: 'Field is required', |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const importUrlValidator = { |
|
|
|
|
validator: (rule: any, value: any, callback: (errMsg?: string) => void) => { |
|
|
|
|
if ( |
|
|
|
|
/(10)(\.([2]([0-5][0-5]|[01234][6-9])|[1][0-9][0-9]|[1-9][0-9]|[0-9])){3}|(172)\.(1[6-9]|2[0-9]|3[0-1])(\.(2[0-4][0-9]|25[0-5]|[1][0-9][0-9]|[1-9][0-9]|[0-9])){2}|(192)\.(168)(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){2}|(0.0.0.0)|localhost?/g.test( |
|
|
|
|
value, |
|
|
|
|
) |
|
|
|
|
) { |
|
|
|
|
callback('IP Not allowed!') |
|
|
|
|
} |
|
|
|
|
callback() |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|