This commit is contained in:
Eugene Pankov
2021-07-25 16:36:45 +02:00
parent 6a78032849
commit c8ee6832f3
57 changed files with 53 additions and 1003 deletions

View File

@@ -0,0 +1,43 @@
import { Component } from '@angular/core'
import { LoginService } from '../services/login.service'
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
import { User } from '../api'
import { AppConnectorService } from '../services/appConnector.service'
import { faGithub } from '@fortawesome/free-brands-svg-icons'
import { faCheck, faCopy } from '@fortawesome/free-solid-svg-icons'
@Component({
selector: 'settings-modal',
templateUrl: './settingsModal.component.pug',
// styleUrls: ['./settingsModal.component.scss'],
})
export class SettingsModalComponent {
user: User
customGatewayEnabled = false
_githubIcon = faGithub
_copyIcon = faCopy
_okIcon = faCheck
constructor (
public appConnector: AppConnectorService,
private modalInstance: NgbActiveModal,
private loginService: LoginService,
) {
this.user = { ...loginService.user }
this.customGatewayEnabled = !!this.user.custom_connection_gateway
}
async ngOnInit () {
}
async apply () {
Object.assign(this.loginService.user, this.user)
this.modalInstance.close()
await this.loginService.updateUser()
}
cancel () {
this.modalInstance.dismiss()
}
}