提交 359e0926 编写于 作者: E Eugene Pankov

include version info in issues

上级 0e9282e0
......@@ -25,6 +25,9 @@ div
span {{button.title}}
footer
.pull-right
.form-control-static Version: {{version}}
.btn-group
button.btn.btn-secondary((click)='openGitHub()')
i.fa.fa-github
......
import * as os from 'os'
import { Component, Inject } from '@angular/core'
import { ElectronService } from '../services/electron.service'
import { IToolbarButton, ToolbarButtonProvider } from '../api'
......@@ -8,10 +9,14 @@ import { IToolbarButton, ToolbarButtonProvider } from '../api'
styles: [require('./startPage.component.scss')],
})
export class StartPageComponent {
version: string
constructor (
private electron: ElectronService,
@Inject(ToolbarButtonProvider) private toolbarButtonProviders: ToolbarButtonProvider[],
) { }
) {
this.version = electron.app.getVersion()
}
getButtons (): IToolbarButton[] {
return this.toolbarButtonProviders
......@@ -25,6 +30,13 @@ export class StartPageComponent {
}
reportBug () {
this.electron.shell.openExternal('https://github.com/eugeny/terminus/issues/new')
let body = `Version: ${this.version}\n`
body += `Platform: ${os.platform()} ${os.release()}\n\n`
let label = {
darwin: 'macOS',
windows: 'Windows',
linux: 'Linux',
}[os.platform()]
this.electron.shell.openExternal(`https://github.com/eugeny/terminus/issues/new?body=${encodeURIComponent(body)}&labels=${label}`)
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册