mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
refactor(ui/image-config): create react component [EE-5342] (#8856)
This commit is contained in:
parent
bf51f1b6c9
commit
10014ae171
34 changed files with 1464 additions and 84 deletions
15
app/react/docker/images/queries/encodeRegistryCredentials.ts
Normal file
15
app/react/docker/images/queries/encodeRegistryCredentials.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { Registry } from '@/react/portainer/registries/types/registry';
|
||||
|
||||
/**
|
||||
* Encodes the registry credentials in base64
|
||||
* @param registryId
|
||||
* @returns
|
||||
*/
|
||||
export function encodeRegistryCredentials(registryId: Registry['Id']) {
|
||||
const credentials = {
|
||||
registryId,
|
||||
};
|
||||
|
||||
const buf = Buffer.from(JSON.stringify(credentials));
|
||||
return buf.toString('base64url');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue