mirror of
https://github.com/Eugeny/tabby.git
synced 2025-10-04 22:14:55 +00:00
added config file editor
This commit is contained in:
@@ -13,7 +13,7 @@ export class StartPageComponent {
|
||||
|
||||
constructor (
|
||||
private config: ConfigService,
|
||||
private homeBase: HomeBaseService,
|
||||
public homeBase: HomeBaseService,
|
||||
@Inject(ToolbarButtonProvider) private toolbarButtonProviders: ToolbarButtonProvider[],
|
||||
) {
|
||||
}
|
||||
|
@@ -9,3 +9,4 @@ appearance:
|
||||
css: '/* * { color: blue !important; } */'
|
||||
opacity: 1.0
|
||||
vibrancy: false
|
||||
enableAnalytics: true
|
||||
|
@@ -80,6 +80,10 @@ export class ConfigService {
|
||||
this.load()
|
||||
}
|
||||
|
||||
getDefaults () {
|
||||
return this.defaults
|
||||
}
|
||||
|
||||
load (): void {
|
||||
if (fs.existsSync(this.path)) {
|
||||
this._store = yaml.safeLoad(fs.readFileSync(this.path, 'utf8'))
|
||||
@@ -94,6 +98,17 @@ export class ConfigService {
|
||||
this.emitChange()
|
||||
}
|
||||
|
||||
readRaw (): string {
|
||||
return yaml.safeDump(this._store)
|
||||
}
|
||||
|
||||
writeRaw (data: string): void {
|
||||
this._store = yaml.safeLoad(data)
|
||||
this.save()
|
||||
this.load()
|
||||
this.emitChange()
|
||||
}
|
||||
|
||||
emitChange (): void {
|
||||
this.changed.next()
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
import * as os from 'os'
|
||||
import { Inject, Injectable } from '@angular/core'
|
||||
import { Injectable } from '@angular/core'
|
||||
import { ElectronService } from './electron.service'
|
||||
import { ConfigService } from './config.service'
|
||||
import ua = require('universal-analytics')
|
||||
|
||||
@Injectable()
|
||||
export class HomeBaseService {
|
||||
@@ -8,8 +10,13 @@ export class HomeBaseService {
|
||||
|
||||
constructor (
|
||||
private electron: ElectronService,
|
||||
private config: ConfigService,
|
||||
) {
|
||||
this.appVersion = electron.app.getVersion()
|
||||
|
||||
if (this.config.store.enableAnalytics) {
|
||||
this.enableAnalytics()
|
||||
}
|
||||
}
|
||||
|
||||
openGitHub () {
|
||||
@@ -26,4 +33,11 @@ export class HomeBaseService {
|
||||
}[os.platform()]
|
||||
this.electron.shell.openExternal(`https://github.com/eugeny/terminus/issues/new?body=${encodeURIComponent(body)}&labels=${label}`)
|
||||
}
|
||||
|
||||
enableAnalytics () {
|
||||
const session = ua('UA-3278102-20')
|
||||
session.set('cd1', this.appVersion)
|
||||
session.set('cd2', process.platform)
|
||||
session.pageview('/').send()
|
||||
}
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@ $nav-tabs-active-link-hover-border-color: darken($blue, 30%);
|
||||
$nav-pills-border-radius: 0;
|
||||
|
||||
$input-bg: #111;
|
||||
$input-bg-disabled: #333;
|
||||
$input-disabled-bg: #333;
|
||||
|
||||
$input-color: $body-color;
|
||||
$input-color-placeholder: #333;
|
||||
|
Reference in New Issue
Block a user