mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-17 22:44:21 +01:00
added version information in welcome component
This commit is contained in:
@@ -3,7 +3,7 @@ import os from 'os'
|
|||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { spawn } from 'child_process'
|
import { spawn } from 'child_process'
|
||||||
import { config } from 'pear'
|
import { config, versions } from 'pear'
|
||||||
|
|
||||||
const BIN = path.join(config.pearDir, 'bin')
|
const BIN = path.join(config.pearDir, 'bin')
|
||||||
const isWin = process.platform === 'win32'
|
const isWin = process.platform === 'win32'
|
||||||
@@ -27,6 +27,13 @@ customElements.define('pear-welcome', class extends HTMLElement {
|
|||||||
font-family: 'overpass-mono';
|
font-family: 'overpass-mono';
|
||||||
border-radius: 1px;
|
border-radius: 1px;
|
||||||
}
|
}
|
||||||
|
#version {
|
||||||
|
position: fixed;
|
||||||
|
top: 90vh;
|
||||||
|
font-size: 75%;
|
||||||
|
color: #efeaea;
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p> Pear is in the system PATH and ready to go .</p>
|
<p> Pear is in the system PATH and ready to go .</p>
|
||||||
@@ -40,11 +47,22 @@ customElements.define('pear-welcome', class extends HTMLElement {
|
|||||||
<video width="420" height="390" autoplay muted>
|
<video width="420" height="390" autoplay muted>
|
||||||
<source src="./assets/usage.mp4" type="video/mp4">
|
<source src="./assets/usage.mp4" type="video/mp4">
|
||||||
</video>
|
</video>
|
||||||
|
<section id="version">
|
||||||
|
<p id="pear-version"></p>
|
||||||
|
<p id="pear-pulse-version"></p>
|
||||||
|
</section>
|
||||||
`
|
`
|
||||||
this.root = this.attachShadow({ mode: 'open' })
|
this.root = this.attachShadow({ mode: 'open' })
|
||||||
|
|
||||||
this.root.appendChild(this.template.content.cloneNode(true))
|
this.root.appendChild(this.template.content.cloneNode(true))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connectedCallback () {
|
||||||
|
versions().then(({ app, platform }) => {
|
||||||
|
this.root.querySelector('#pear-version').innerText = 'Pear version: ' + platform.key + '_' + platform.length
|
||||||
|
this.root.querySelector('#pear-pulse-version').innerText = 'App version: ' + app.key + '_' + app.length
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
customElements.define('system-status', class extends HTMLElement {
|
customElements.define('system-status', class extends HTMLElement {
|
||||||
|
|||||||
Reference in New Issue
Block a user