</div>
<small class="text-info">{{'UPLOADCONFIGLABEL' | translate}}</small>
</div>
+ <div class="col-sm-3">
+ <label>{{'PAGE.K8S.CREDENTIALS' | translate}}</label>
+ </div>
+ <div class="col-sm-3 form-group">
+ <div class="custom-file">
+ <input [disabled]="!selectedVimType" type="file" #fileInputcreds class="fileupload custom-file-input"
+ (change)="onFileSelected($event)" id="customcredsFile">
+ </div>
+ <small class="text-info">{{'UPLOADCREDSLABEL' | translate}}</small>
+ </div>
</div>
<div class="row" [hidden]="!selectedVimType">
<div class="d-grid col-12">
/** Element ref for fileInput @public */
@ViewChild('fileInputLabel', { static: true }) public fileInputLabel: ElementRef;
+ /** Element ref for filecredsInput @public */
+ @ViewChild('fileInputcreds', { static: true }) public fileInputcreds: ElementRef;
+
+ /** Element ref for filecredsInput @public */
+ @ViewChild('fileInputcredsLabel', { static: true }) public fileInputcredsLabel: ElementRef;
+
/** Contains all methods related to shared @private */
public sharedService: SharedService;
/** Contains longitude value @public */
public longitude: string;
+ /** Contains credentials value in base64 @public */
+ public credentialsAs64: string;
+
/** Contains location value @public */
public locationName: string;
this.vimNewAccountForm.value.latitude;
}
+ if (!isNullOrUndefined(this.credentialsAs64)) {
+ this.vimNewAccountForm.value.config.credentials_base64 = this.credentialsAs64;
+ }
+
if (isNullOrUndefined(this.vimNewAccountForm.value.config.location)) {
delete this.vimNewAccountForm.value.config.location;
}
this.fileInput.nativeElement.value = null;
}
+ /** Drag and drop feature and fetchind the details of credential files @private */
+ public onFileSelected(event: Event): void {
+ const input = event.target as HTMLInputElement;
+ if (input && input.files && input.files.length > 0) {
+ const file: File = input.files[0];
+ const reader: FileReader = new FileReader();
+ reader.onload = (e: ProgressEvent<FileReader>) => {
+ const tomlContent = e.target?.result as string;
+ this.credentialsAs64 = btoa(tomlContent);
+ };
+ reader.readAsText(file);
+ }
+ this.fileInputcredsLabel.nativeElement.innerText = input.files[0].name;
+ this.fileInputcreds.nativeElement.value = null;
+ }
+
/** Check data is empty or not to load config @public */
public checkData(): void {
if (this.data !== '' && this.data.length > this.configLength) {
"NODATE": "Keine Datumsinformationen gefunden",
"TYPEINFO": "Um einen neuen TYPW hinzuzufügen, geben Sie oben die Eingabe ein",
"UPLOADCONFIGLABEL": "Bitte laden Sie eine Datei im .yaml- oder .yml-Format hoch",
+ "UPLOADCREDSLABEL": "Bitte laden Sie bei Bedarf die Anmeldedatendatei hoch",
"CONFIGFILEUPLOADLABEL": "Oder geben Sie Konfigurationsparameter ein",
"NEWVERSIONTAG": "Hier ist die neue Version {{appVersion}} von OSM!",
"SCALEOUT": "Scale Out",
"NODATE": "No date information found",
"TYPEINFO": "To add a new TYPE, Please enter input above",
"UPLOADCONFIGLABEL": "Please upload file with .yaml or .yml format",
+ "UPLOADCREDSLABEL": "Please upload credentials file if required",
"CONFIGFILEUPLOADLABEL": "Or enter config parameters",
"NEWVERSIONTAG": "Here is the new version {{appVersion}} of OSM!",
"SCALEOUT": "Scale Out",
"NODATE": "No se encontró información de fecha",
"TYPEINFO": "Para agregar un nuevo TIPO, ingrese la entrada de arriba",
"UPLOADCONFIGLABEL": "Cargue el archivo con formato .yaml o .yml",
+ "UPLOADCREDSLABEL": "Cargue el archivo de credenciales si es necesario",
"CONFIGFILEUPLOADLABEL": "O ingrese los parámetros de configuración",
"NEWVERSIONTAG": "¡Aquí está la nueva versión {{appVersion}} de OSM!",
"SCALEOUT": "Desescalar",
"NODATE": "Nenhuma informação de data encontrada",
"TYPEINFO": "Para adicionar um novo TIPO, insira a entrada acima",
"UPLOADCONFIGLABEL": "Faça o upload do arquivo no formato .yaml ou .yml",
+ "UPLOADCREDSLABEL": "Faça upload do arquivo de credenciais, se necessário",
"CONFIGFILEUPLOADLABEL": "Ou insira os parâmetros de configuração",
"NEWVERSIONTAG": "Aqui está a nova versão {{appVersion}} do OSM!",
"SCALEOUT": "Dimensionar",