mirror of
https://github.com/clearml/clearml-web
synced 2025-01-30 22:17:22 +00:00
parent
e54d8ebb99
commit
e449a6c436
@ -19,6 +19,7 @@ export interface Credentials {
|
||||
Endpoint?: string;
|
||||
Key?: string;
|
||||
Secret?: string;
|
||||
Token?: string;
|
||||
Region?: string;
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,11 @@
|
||||
[placeholder]="isAzure ? 'Shared access signature (SAS)' : 'Secret'">
|
||||
<mat-error *ngIf="secretInput.errors?.required">*Required</mat-error>
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="!isAzure" class="w-100">
|
||||
<mat-label>Token</mat-label>
|
||||
<input matInput [(ngModel)]="S3Form.Token" type="text" name="Token" placeholder="Token" [(ngModel)]="S3Form.Token" #keyInput="ngModel"
|
||||
autocomplete="off">
|
||||
</mat-form-field>
|
||||
<mat-form-field *ngIf="!isAzure" class="w-100">
|
||||
<mat-label>Region</mat-label>
|
||||
<input matInput [(ngModel)]="S3Form.Region" type="text" name="Region" placeholder="AWS Region (e.g. us-east-2)"
|
||||
|
@ -16,6 +16,7 @@ export class S3AccessDialogComponent implements OnChanges {
|
||||
@Input() key;
|
||||
@Input() secret = '';
|
||||
@Input() region = '';
|
||||
@Input() token = '';
|
||||
@Input() bucket;
|
||||
@Input() endpoint;
|
||||
@Input() editMode = false;
|
||||
@ -36,6 +37,7 @@ export class S3AccessDialogComponent implements OnChanges {
|
||||
this.S3Form= {
|
||||
Key : changes.isAzure.currentValue ? 'azure' : changes.key.currentValue,
|
||||
Secret : changes.secret.currentValue,
|
||||
Token : changes.token.currentValue,
|
||||
Region : changes.region.currentValue,
|
||||
Bucket : changes.bucket.currentValue,
|
||||
Endpoint: (changes.endpoint.currentValue === null || changes.endpoint.currentValue?.startsWith('http')) ?
|
||||
|
@ -6,6 +6,7 @@
|
||||
[region]="region"
|
||||
[secret]="secret"
|
||||
[key]="key"
|
||||
[token]="token"
|
||||
[editMode]="editMode"
|
||||
[isAzure]="isAzure"
|
||||
(closeSave)="saveS3Credentials($event)"
|
||||
|
@ -16,6 +16,7 @@ export class S3AccessResolverComponent {
|
||||
endpoint: any;
|
||||
key: any;
|
||||
secret: any;
|
||||
token: any;
|
||||
region: any;
|
||||
header: any;
|
||||
editMode: any;
|
||||
@ -32,6 +33,7 @@ export class S3AccessResolverComponent {
|
||||
this.endpoint = s3Credentials.Endpoint;
|
||||
this.key = s3Credentials.Key;
|
||||
this.secret = s3Credentials.Secret;
|
||||
this.token = s3Credentials.Token;
|
||||
this.region = s3Credentials.Region;
|
||||
this.isAzure = data.isAzure;
|
||||
if (data.credentialsError) {
|
||||
|
@ -138,7 +138,8 @@ export class BaseAdminService {
|
||||
region: set.Region || DEFAULT_REGION,
|
||||
credentials: {
|
||||
accessKeyId: set.Key,
|
||||
secretAccessKey: set.Secret
|
||||
secretAccessKey: set.Secret,
|
||||
sessionToken: set.Token
|
||||
},
|
||||
...(set.Endpoint && {
|
||||
endpoint: {
|
||||
|
@ -3,6 +3,7 @@
|
||||
<div class="col-6">Bucket</div>
|
||||
<div class="col-4">Key</div>
|
||||
<div class="col-6">Secret / SAS</div>
|
||||
<div class="col-6">Token</div>
|
||||
<div class="col-2">AWS Region</div>
|
||||
<div class="col-6">Host (Endpoint)</div>
|
||||
</div>
|
||||
@ -18,6 +19,9 @@
|
||||
<div class="col-6">
|
||||
<input matInput class="form-control" formControlName="Secret">
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<input matInput class="form-control" formControlName="Token">
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<input matInput class="form-control" formControlName="Region" placeholder="us-east-2">
|
||||
</div>
|
||||
|
@ -37,10 +37,11 @@ export class S3AccessComponent implements OnDestroy, OnInit {
|
||||
return this.S3Form.get(this.BUCKET_CREDENTIALS) as UntypedFormArray;
|
||||
}
|
||||
|
||||
addBucket({Key = '', Secret = '', Region = '', Bucket = '', Endpoint = null} = {}) {
|
||||
addBucket({Key = '', Secret = '', Token='', Region = '', Bucket = '', Endpoint = null} = {}) {
|
||||
this.bucketCredentials.push(this.formBuilder.group({
|
||||
Key,
|
||||
Secret,
|
||||
Token,
|
||||
Region,
|
||||
Bucket,
|
||||
Endpoint: (Endpoint?.startsWith('http') || Endpoint === null)? Endpoint : `http${Endpoint?.endsWith('443') ? 's' : ''}://${Endpoint}`
|
||||
|
Loading…
Reference in New Issue
Block a user