mirror of
https://github.com/Eugeny/tabby-web.git
synced 2026-08-17 14:56:03 +01:00
.
This commit is contained in:
43
frontend/src/components/settingsModal.component.ts
Normal file
43
frontend/src/components/settingsModal.component.ts
Normal 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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user