From bb8c717e59ad2331d1b98984611872a4d3cf60ec Mon Sep 17 00:00:00 2001 From: rafapaezbas Date: Fri, 26 Jan 2024 12:55:17 +0100 Subject: [PATCH 1/2] added version information in welcome component --- lib/system-status.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/system-status.js b/lib/system-status.js index 2530872..14bca34 100644 --- a/lib/system-status.js +++ b/lib/system-status.js @@ -3,7 +3,7 @@ import os from 'os' import fs from 'fs' import path from 'path' import { spawn } from 'child_process' -import { config } from 'pear' +import { config, versions } from 'pear' const BIN = path.join(config.pearDir, 'bin') const isWin = process.platform === 'win32' @@ -27,6 +27,13 @@ customElements.define('pear-welcome', class extends HTMLElement { font-family: 'overpass-mono'; border-radius: 1px; } + #version { + position: fixed; + top: 90vh; + font-size: 75%; + color: #efeaea; + opacity: 0.5; + }

Pear is in the system PATH and ready to go .

@@ -40,11 +47,22 @@ customElements.define('pear-welcome', class extends HTMLElement { +
+

+

+
` this.root = this.attachShadow({ mode: 'open' }) 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 { From aa907dd1f9b812013b17195ee95e57f7bfd17126 Mon Sep 17 00:00:00 2001 From: rafapaezbas Date: Fri, 26 Jan 2024 18:33:01 +0100 Subject: [PATCH 2/2] renamed pear-pulse id to app --- lib/system-status.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/system-status.js b/lib/system-status.js index 14bca34..9c0a313 100644 --- a/lib/system-status.js +++ b/lib/system-status.js @@ -48,8 +48,8 @@ customElements.define('pear-welcome', class extends HTMLElement {
-

-

+

+

` this.root = this.attachShadow({ mode: 'open' }) @@ -59,8 +59,8 @@ customElements.define('pear-welcome', class extends HTMLElement { 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 + this.root.querySelector('#platform-version').innerText = 'Pear version: ' + platform.key + '_' + platform.length + this.root.querySelector('#app-version').innerText = 'App version: ' + app.key + '_' + app.length }) } })