mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
feat(edge/stacks): sync EE codechanges [EE-498] (#8580)
This commit is contained in:
parent
0ec7dfce69
commit
93bf630105
53 changed files with 1572 additions and 424 deletions
|
@ -22,3 +22,27 @@ export function parseAuthResponse(
|
|||
RepositoryUsername: auth.Username,
|
||||
};
|
||||
}
|
||||
|
||||
export function transformGitAuthenticationViewModel(
|
||||
auth?: GitAuthModel
|
||||
): GitAuthenticationResponse | null {
|
||||
if (
|
||||
!auth ||
|
||||
!auth.RepositoryAuthentication ||
|
||||
typeof auth.RepositoryGitCredentialID === 'undefined' ||
|
||||
(auth.RepositoryGitCredentialID === 0 && auth.RepositoryPassword === '')
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (auth.RepositoryGitCredentialID !== 0) {
|
||||
return {
|
||||
GitCredentialID: auth.RepositoryGitCredentialID,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
Username: auth.RepositoryUsername,
|
||||
Password: auth.RepositoryPassword,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,9 +15,9 @@ export interface AutoUpdateResponse {
|
|||
}
|
||||
|
||||
export interface GitAuthenticationResponse {
|
||||
Username: string;
|
||||
Password: string;
|
||||
GitCredentialID: number;
|
||||
Username?: string;
|
||||
Password?: string;
|
||||
GitCredentialID?: number;
|
||||
}
|
||||
|
||||
export interface RepoConfigResponse {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue