mirror of
https://github.com/Eugeny/tabby.git
synced 2025-04-24 16:30:55 +08:00
config sync ui updates
This commit is contained in:
parent
c5dbccf807
commit
61ea2c77c8
tabby-settings/src/components
@ -8,11 +8,15 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
|
||||
.header
|
||||
.title Sync host
|
||||
|
||||
input.form-control(
|
||||
type='text',
|
||||
[(ngModel)]='config.store.configSync.host',
|
||||
(ngModelChange)='config.save()',
|
||||
)
|
||||
.input-group.w-50
|
||||
input.form-control(
|
||||
type='text',
|
||||
[(ngModel)]='config.store.configSync.host',
|
||||
(ngModelChange)='config.save()',
|
||||
)
|
||||
.input-group-append(*ngIf='config.store.configSync.host')
|
||||
button.btn.btn-secondary((click)='platform.openExternal("http://" + config.store.configSync.host)')
|
||||
i.fas.fa-external-link-alt
|
||||
|
||||
.form-line
|
||||
.header
|
||||
@ -49,23 +53,24 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
|
||||
.list-group-light
|
||||
.list-group-item.d-flex.align-items-center(
|
||||
*ngFor='let cfg of configs',
|
||||
[class.active]='cfg.id === config.store.configSync.configID',
|
||||
[class.active]='isActiveConfig(cfg)',
|
||||
)
|
||||
i.fas.fa-fw.fa-file
|
||||
.ml-2.d-flex.flex-column.align-items-start
|
||||
div {{cfg.name}}
|
||||
small.text-muted Modified on {{cfg.modified_at|date:'medium'}}
|
||||
.badge.badge-info(*ngIf='cfg.id === config.store.configSync.configID') ACTIVE
|
||||
.badge.badge-info(*ngIf='isActiveConfig(cfg)') ACTIVE
|
||||
.mr-auto
|
||||
button.btn.btn-link.ml-1(
|
||||
(click)='uploadAndSync(cfg)',
|
||||
[class.hover-reveal]='cfg.id !== config.store.configSync.configID'
|
||||
[class.hover-reveal]='!isActiveConfig(cfg)'
|
||||
)
|
||||
i.fas.fa-arrow-up
|
||||
span.ml-2 Upload
|
||||
span.ml-2(*ngIf='isActiveConfig(cfg)') Upload
|
||||
span.ml-2(*ngIf='!isActiveConfig(cfg)') Replace
|
||||
button.btn.btn-link.ml-1(
|
||||
(click)='downloadAndSync(cfg)',
|
||||
[class.hover-reveal]='cfg.id !== config.store.configSync.configID'
|
||||
[class.hover-reveal]='!isActiveConfig(cfg)'
|
||||
)
|
||||
i.fas.fa-arrow-down
|
||||
span.ml-2 Download
|
||||
@ -76,7 +81,7 @@ ul.nav-tabs(ngbNav, #nav='ngbNav')
|
||||
i.fas.fa-fw.fa-cloud-upload-alt
|
||||
.ml-2 Upload as a new config
|
||||
|
||||
ng-container(*ngIf='config.store.configSync.configID')
|
||||
ng-container(*ngIf='hasMatchingRemoteConfig()')
|
||||
.form-line
|
||||
.header
|
||||
.title Sync automatically
|
||||
|
@ -17,10 +17,10 @@ export class ConfigSyncSettingsTabComponent extends BaseComponent {
|
||||
|
||||
constructor (
|
||||
public config: ConfigService,
|
||||
public platform: PlatformService,
|
||||
private configSync: ConfigSyncService,
|
||||
private hostApp: HostAppService,
|
||||
private ngbModal: NgbModal,
|
||||
private platform: PlatformService,
|
||||
private notifications: NotificationsService,
|
||||
) {
|
||||
super()
|
||||
@ -96,4 +96,12 @@ export class ConfigSyncSettingsTabComponent extends BaseComponent {
|
||||
await this.configSync.download()
|
||||
this.notifications.info('Config downloaded')
|
||||
}
|
||||
|
||||
hasMatchingRemoteConfig () {
|
||||
return !!this.configs?.find(c => this.isActiveConfig(c))
|
||||
}
|
||||
|
||||
isActiveConfig (c: Config) {
|
||||
return c.id === this.config.store.configSync.configID
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ button.btn.btn-warning.btn-block(*ngIf='config.restartRequested', '(click)'='res
|
||||
i.fas.fa-book
|
||||
span What's new
|
||||
|
||||
button.btn.btn-secondary(
|
||||
button.btn.btn-secondary.mr-3.mb-2(
|
||||
*ngIf='!updateAvailable && hostApp.platform !== Platform.Web',
|
||||
(click)='checkForUpdates()',
|
||||
[disabled]='checkingForUpdate'
|
||||
@ -39,7 +39,7 @@ button.btn.btn-warning.btn-block(*ngIf='config.restartRequested', '(click)'='res
|
||||
)
|
||||
span Check for updates
|
||||
|
||||
button.btn.btn-info(
|
||||
button.btn.btn-info.mr-3.mb-2(
|
||||
*ngIf='updateAvailable',
|
||||
(click)='updater.update()',
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user