mirror of
https://github.com/Eugeny/tabby-web.git
synced 2026-08-17 23:06:04 +01:00
wip
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
main(*ngIf='ready && user')
|
||||
.login-view(*ngIf='ready && !user')
|
||||
main(*ngIf='ready && loggedIn')
|
||||
.login-view(*ngIf='ready && !loggedIn')
|
||||
.buttons
|
||||
a.btn(
|
||||
*ngFor='let provider of providers',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component } from '@angular/core'
|
||||
import { HttpClient } from '@angular/common/http'
|
||||
import { LoginService } from '../services/login.service'
|
||||
|
||||
import { faGithub, faGitlab, faGoogle, faMicrosoft } from '@fortawesome/free-brands-svg-icons'
|
||||
|
||||
@@ -9,7 +9,7 @@ import { faGithub, faGitlab, faGoogle, faMicrosoft } from '@fortawesome/free-bra
|
||||
styleUrls: ['./app.component.scss'],
|
||||
})
|
||||
export class AppComponent {
|
||||
user: any
|
||||
loggedIn: any
|
||||
ready = false
|
||||
|
||||
providers = [
|
||||
@@ -20,14 +20,12 @@ export class AppComponent {
|
||||
]
|
||||
|
||||
constructor (
|
||||
private http: HttpClient,
|
||||
private loginService: LoginService,
|
||||
) { }
|
||||
|
||||
async ngOnInit () {
|
||||
const user = await this.http.get('/api/1/user').toPromise()
|
||||
if (user.id) {
|
||||
this.user = user
|
||||
}
|
||||
await this.loginService.ready$.toPromise()
|
||||
this.loggedIn = !!this.loginService.user
|
||||
this.ready = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,15 @@
|
||||
fa-icon([icon]='_addIcon', [fixedWidth]='true')
|
||||
span New config
|
||||
|
||||
div(ngbDropdown, placement='bottom-right')
|
||||
button.btn(ngbDropdownToggle)
|
||||
fa-icon([icon]='_connectionIcon', [fixedWidth]='true')
|
||||
|
||||
div(ngbDropdownMenu)
|
||||
.form-check.form-switch
|
||||
input.form-check-input(type='checkbox', ngModel='!!loginService.user.custom_connection_gateway')
|
||||
label(class='form-check-label') Use custom connection gateway
|
||||
|
||||
div(ngbDropdown, placement='bottom-right')
|
||||
button.btn(ngbDropdownToggle)
|
||||
fa-icon([icon]='_userIcon', [fixedWidth]='true')
|
||||
|
||||
@@ -3,7 +3,8 @@ import { Component, ElementRef, ViewChild } from '@angular/core'
|
||||
import { HttpClient } from '@angular/common/http'
|
||||
import { AppConnectorService } from '../services/appConnector.service'
|
||||
|
||||
import { faCog, faUser, faCopy, faTrash, faPlus } from '@fortawesome/free-solid-svg-icons'
|
||||
import { faCog, faUser, faCopy, faTrash, faPlus, faPlug } from '@fortawesome/free-solid-svg-icons'
|
||||
import { LoginService } from '../services/login.service'
|
||||
|
||||
@Component({
|
||||
selector: 'main',
|
||||
@@ -17,6 +18,7 @@ export class MainComponent {
|
||||
_copyIcon = faCopy
|
||||
_addIcon = faPlus
|
||||
_deleteIcon = faTrash
|
||||
_connectionIcon = faPlug
|
||||
|
||||
configs: any[] = []
|
||||
versions: any[] = []
|
||||
@@ -26,6 +28,7 @@ export class MainComponent {
|
||||
constructor (
|
||||
private appConnector: AppConnectorService,
|
||||
private http: HttpClient,
|
||||
public loginService: LoginService,
|
||||
) {
|
||||
window.addEventListener('message', event => {
|
||||
if (event.data === 'request-connector') {
|
||||
|
||||
Reference in New Issue
Block a user