feat(api, web): интеграция Macloud и VDSina через унифицированный UserAPI
Docker / build (push) Has been cancelled
Docker / build (push) Has been cancelled
Один модуль userapi для идентичного API обоих хостеров: синк VPS, баланса, тарифов и пополнений. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { isSyncApiType } from '@cfdm/shared/contracts/provider'
|
||||
import { isSyncApiType, isUserApiType } from '@cfdm/shared/contracts/provider'
|
||||
|
||||
import type { ProviderAccount, Provider } from '@/types/entities'
|
||||
|
||||
export { isSyncApiType }
|
||||
export { isSyncApiType, isUserApiType }
|
||||
|
||||
export function providerByIdMap(providers: Provider[]): Map<string, Provider> {
|
||||
return new Map(providers.map((p) => [p.id, p]))
|
||||
@@ -69,6 +69,13 @@ export function accountCredentialLabels(apiType?: string | null): {
|
||||
loginPlaceholder: '1',
|
||||
}
|
||||
}
|
||||
if (isUserApiType(apiType)) {
|
||||
return {
|
||||
loginLabel: '',
|
||||
passwordLabel: 'API Token',
|
||||
loginPlaceholder: '',
|
||||
}
|
||||
}
|
||||
return {
|
||||
loginLabel: 'Логин API',
|
||||
passwordLabel: 'Пароль API',
|
||||
|
||||
Reference in New Issue
Block a user