a button to show config file location

This commit is contained in:
Eugene Pankov
2019-02-13 22:58:47 +01:00
parent 59d1a2fc23
commit db54f4af13
3 changed files with 9 additions and 2 deletions

View File

@@ -78,9 +78,9 @@ export class ConfigProxy {
export class ConfigService { export class ConfigService {
store: any store: any
restartRequested: boolean restartRequested: boolean
path: string
private changed = new Subject<void>() private changed = new Subject<void>()
private _store: any private _store: any
private path: string
private defaults: any private defaults: any
private servicesCache: { [id: string]: Function[] } = null private servicesCache: { [id: string]: Function[] } = null

View File

@@ -300,10 +300,13 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab')
[(ngModel)]='configDefaults', [(ngModel)]='configDefaults',
readonly readonly
) )
.mt-3 .mt-2.mb-2.d-flex
button.btn.btn-primary((click)='saveConfigFile()', *ngIf='isConfigFileValid()') button.btn.btn-primary((click)='saveConfigFile()', *ngIf='isConfigFileValid()')
i.fas.fa-check.mr-2 i.fas.fa-check.mr-2
| Save and apply | Save and apply
button.btn.btn-primary(disabled, *ngIf='!isConfigFileValid()') button.btn.btn-primary(disabled, *ngIf='!isConfigFileValid()')
i.fas.fa-exclamation-triangle.mr-2 i.fas.fa-exclamation-triangle.mr-2
| Invalid syntax | Invalid syntax
button.btn.btn-secondary.ml-auto((click)='showConfigFile()')
i.fas.fa-external-link-square-alt.mr-2
| Show config file

View File

@@ -100,6 +100,10 @@ export class SettingsTabComponent extends BaseTabComponent {
} }
} }
showConfigFile () {
this.electron.shell.showItemInFolder(this.config.path)
}
isConfigFileValid () { isConfigFileValid () {
try { try {
yaml.safeLoad(this.configFile) yaml.safeLoad(this.configFile)