onSubmit()

in source/frontend/src/app/pages/sftp-main/sftp-main.component.ts [160:183]


  onSubmit() {
    this.login_process = true;
    this.sftpService.checkConnection(this.ftpURL, this.username, this.password).subscribe(res => {
      this.login_error = null;
      this.isConnectionTested = true;
      this.login_process = false;
      this.ngOnInit();
    },
      error => {
        this.login_error = error.error.message;
        this.login_process = false;
        this.isConnectionTested = false;
        this.connError = true;
        this.sftpService.logout().subscribe((result) => {
          this.page = 'settings';
          this.username = '';
          this.password = '';
          this.health_ok = false;
          this.isConnected = false;
          location.reload();
        });
      }
    );
  }