changed get-installedApps to get-startApps
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,3 +4,4 @@ out
|
||||
.DS_Store
|
||||
*.log*
|
||||
electron.vite.config.1716830836044.mjs
|
||||
.eslintrc.cjs
|
||||
|
||||
22
package-lock.json
generated
22
package-lock.json
generated
@@ -12,6 +12,8 @@
|
||||
"@electron-toolkit/preload": "^3.0.0",
|
||||
"@electron-toolkit/utils": "^3.0.0",
|
||||
"get-installed-apps": "^1.1.0",
|
||||
"get-startapps": "^1.0.4",
|
||||
"node-fetch": "^2.6.1",
|
||||
"serialport": "^12.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -4282,6 +4284,18 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-startapps": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/get-startapps/-/get-startapps-1.0.4.tgz",
|
||||
"integrity": "sha512-xog+hIeyWCVP/9yriROL346qyqHIR0telniu7ukUypH2dE3KFt4xPriRcCkcMnbfpjUCOVWRivrAJRABN1QlWg==",
|
||||
"deprecated": "This package is no longer maintained",
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
}
|
||||
},
|
||||
"node_modules/get-stream": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
|
||||
@@ -5233,6 +5247,14 @@
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-gyp-build": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.0.tgz",
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
"@electron-toolkit/preload": "^3.0.0",
|
||||
"@electron-toolkit/utils": "^3.0.0",
|
||||
"get-installed-apps": "^1.1.0",
|
||||
"get-startapps": "^1.0.4",
|
||||
"node-fetch": "^2.6.1",
|
||||
"serialport": "^12.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -3,7 +3,9 @@ import { join } from 'path'
|
||||
import { electronApp, optimizer, is } from '@electron-toolkit/utils'
|
||||
import icon from '../../resources/icon.png?asset'
|
||||
import fs from 'node:fs/promises'
|
||||
import {getInstalledApps} from 'get-installed-apps'
|
||||
// import {getInstalledApps} from 'get-installed-apps'
|
||||
import getapps from 'get-startapps'
|
||||
|
||||
import { SerialPort } from 'serialport'
|
||||
import * as logTimestamp from 'log-timestamp'
|
||||
|
||||
@@ -23,7 +25,12 @@ async function getSerialPorts() {
|
||||
}
|
||||
|
||||
async function getApps() {
|
||||
return await getInstalledApps()
|
||||
// return await getInstalledApps()
|
||||
let appCollection = await getapps()
|
||||
let filters = [(a) => a.appid.includes('.exe'), (a) => a.appid.includes('steam')]
|
||||
console.log(` Total apps ${appCollection.length}`)
|
||||
// return appCollection.filter((app) => app.appid.includes('.exe'))
|
||||
return appCollection.filter((app) => filters.some((fn) => fn(app)))
|
||||
}
|
||||
|
||||
function createWindow() {
|
||||
|
||||
@@ -8,7 +8,7 @@ const movies = ref([])
|
||||
const apiKey = 'a0eb411ca9c81896004dce1d27a7245b'
|
||||
const configuration = ref('Loading....')
|
||||
const serialPorts = ref('Loading Serial ports.... ')
|
||||
const insatlledApps = ref({});
|
||||
const insatlledApps = ref({})
|
||||
|
||||
const ipcHandle = () => window.electron.ipcRenderer.send('ping')
|
||||
// const getConfigFileContents = async () => {
|
||||
@@ -51,7 +51,6 @@ onMounted(() => {
|
||||
<div class="row">
|
||||
<button type="button" class="col-auto" @click="ipcHandle">Send Ping</button>
|
||||
<button type="button" class="col-auto" @click="getSerialPorts">Load config</button>
|
||||
|
||||
</div>
|
||||
<div>{{ configuration }}</div>
|
||||
<!--
|
||||
|
||||
@@ -7,7 +7,12 @@
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<select v-model="com_port" class="form-select">
|
||||
<option v-for="(serialport, i) in props.serialports" :key="i" :value="serialport.path" class="form-option">
|
||||
<option
|
||||
v-for="(serialport, i) in props.serialports"
|
||||
:key="i"
|
||||
:value="serialport.path"
|
||||
class="form-option"
|
||||
>
|
||||
{{ serialport.friendlyName }}
|
||||
</option>
|
||||
</select>
|
||||
@@ -37,7 +42,7 @@ function generateAppSelector() {
|
||||
let optionsString = ''
|
||||
|
||||
for (let app in props.installedApps) {
|
||||
optionsString += `<option value=${props.installedApps[app].appName}> ${props.installedApps[app].appName} </option>`
|
||||
optionsString += `<option value=${props.installedApps[app].name}> ${props.installedApps[app].name} </option>`
|
||||
}
|
||||
return `<div class="row mt-3"><select class="form-select"> ${optionsString} </select></div>`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user