mirror of
https://github.com/thomasnordquist/MQTT-Explorer.git
synced 2026-09-11 09:03:33 +00:00
Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7617430a3f | ||
|
|
a346c48d3e | ||
|
|
8a2c39ba8e | ||
|
|
65b86ac5f6 | ||
|
|
4ead740982 | ||
|
|
ddaf06b682 | ||
|
|
9e18c4db4e | ||
|
|
ee783f15c0 | ||
|
|
0c31843ed5 | ||
|
|
ffc93d20d8 | ||
|
|
3c62da7e19 | ||
|
|
6846dbbb28 | ||
|
|
270e3e3ead | ||
|
|
0d73b0f519 | ||
|
|
ee83022d19 | ||
|
|
f27467ed97 | ||
|
|
ddbf3d9f1f | ||
|
|
60bbbc54d7 | ||
|
|
538aa7dc29 | ||
|
|
b37af291cc | ||
|
|
333a1bcabe |
@@ -1,42 +0,0 @@
|
|||||||
name: Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- release
|
|
||||||
- beta
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.ref }}
|
|
||||||
cancel-in-progress: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
platform_matrix:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
build:
|
|
||||||
- os: ubuntu-latest
|
|
||||||
task: linux
|
|
||||||
- os: windows-latest
|
|
||||||
task: win
|
|
||||||
# - os: macos-latest
|
|
||||||
# task: mac
|
|
||||||
runs-on: ${{ matrix.build.os }}
|
|
||||||
steps:
|
|
||||||
- if: matrix.build.os == 'ubuntu-latest'
|
|
||||||
run: sudo snap install snapcraft --classic
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
- run: npm install -g yarn
|
|
||||||
- run: yarn
|
|
||||||
- run: npx semantic-release
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- run: yarn build
|
|
||||||
- run: yarn prepare-release
|
|
||||||
# - run: yarn package ${{ matrix.build.task }}
|
|
||||||
# env:
|
|
||||||
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
# SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
|
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- release
|
||||||
|
- beta
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
build:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
task: linux
|
||||||
|
- os: windows-latest
|
||||||
|
task: win
|
||||||
|
- os: macos-latest
|
||||||
|
task: mac
|
||||||
|
runs-on: ${{ matrix.build.os }}
|
||||||
|
steps:
|
||||||
|
- if: matrix.build.os == 'ubuntu-latest'
|
||||||
|
run: sudo snap install snapcraft --classic
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
- run: npm install -g yarn
|
||||||
|
- run: yarn
|
||||||
|
- id: create_token # get ReleaseBot access token
|
||||||
|
uses: tibdex/github-app-token@v2
|
||||||
|
with:
|
||||||
|
app_id: ${{ secrets.RELEASE_BOT_APP_ID }}
|
||||||
|
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
|
||||||
|
- name: Semantic Release
|
||||||
|
uses: cycjimmy/semantic-release-action@v4
|
||||||
|
id: semantic # Need an `id` for output variables
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }}
|
||||||
|
- run: yarn build
|
||||||
|
if: steps.semantic.outputs.new_release_published == 'true'
|
||||||
|
- run: yarn prepare-release
|
||||||
|
if: steps.semantic.outputs.new_release_published == 'true'
|
||||||
|
- run: yarn package ${{ matrix.build.task }}
|
||||||
|
if: steps.semantic.outputs.new_release_published == 'true'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
name: Update Website
|
||||||
|
|
||||||
|
on: [release, workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-website:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: gh-pages
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
- run: npm install
|
||||||
|
- run: npm run readme
|
||||||
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
"prerelease": true
|
"prerelease": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
repositoryUrl: "git@github.com:thomasnordquist/MQTT-Explorer.git",
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@semantic-release/commit-analyzer",
|
"@semantic-release/commit-analyzer",
|
||||||
"semantic-release-export-data",
|
"semantic-release-export-data",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const root = protobuf.parse(protocol).root
|
|||||||
export let SparkplugPayload = root.lookupType('com.cirruslink.sparkplug.protobuf.Payload')
|
export let SparkplugPayload = root.lookupType('com.cirruslink.sparkplug.protobuf.Payload')
|
||||||
|
|
||||||
export const SparkplugDecoder = {
|
export const SparkplugDecoder = {
|
||||||
decode(input: Buffer): Base64Message | undefined {
|
decode(input: Buffer): Base64Message {
|
||||||
try {
|
try {
|
||||||
const message = Base64Message.fromString(
|
const message = Base64Message.fromString(
|
||||||
JSON.stringify(SparkplugPayload.toObject(SparkplugPayload.decode(new Uint8Array(input))))
|
JSON.stringify(SparkplugPayload.toObject(SparkplugPayload.decode(new Uint8Array(input))))
|
||||||
@@ -17,8 +17,9 @@ export const SparkplugDecoder = {
|
|||||||
message.decoder = Decoder.SPARKPLUG
|
message.decoder = Decoder.SPARKPLUG
|
||||||
return message
|
return message
|
||||||
} catch {
|
} catch {
|
||||||
// ignore
|
const message = Base64Message.fromString("Failed to decode sparkplugb payload")
|
||||||
|
message.decoder = Decoder.NONE
|
||||||
|
return message
|
||||||
}
|
}
|
||||||
return undefined
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,9 +47,17 @@ export class ConnectionManager {
|
|||||||
buffer = buffer.slice(0, 20000)
|
buffer = buffer.slice(0, 20000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let decoded_payload = null
|
||||||
|
// spell-checker: disable-next-line
|
||||||
|
if (topic.match(/^spBv1\.0\/[^/]+\/[ND](DATA|CMD|DEATH|BIRTH)\/[^/]+(\/[^/]+)?$/u)) {
|
||||||
|
decoded_payload = SparkplugDecoder.decode(buffer)
|
||||||
|
} else {
|
||||||
|
decoded_payload = Base64Message.fromBuffer(buffer)
|
||||||
|
}
|
||||||
|
|
||||||
backendEvents.emit(messageEvent, {
|
backendEvents.emit(messageEvent, {
|
||||||
topic,
|
topic,
|
||||||
payload: SparkplugDecoder.decode(buffer) ?? Base64Message.fromBuffer(buffer),
|
payload: decoded_payload,
|
||||||
qos: packet.qos,
|
qos: packet.qos,
|
||||||
retain: packet.retain,
|
retain: packet.retain,
|
||||||
messageId: packet.messageId,
|
messageId: packet.messageId,
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "MQTT-Explorer",
|
"name": "MQTT-Explorer",
|
||||||
"version": "0.4.0-beta.2",
|
"version": "0.4.0-beta.5",
|
||||||
"description": "Explore your message queues",
|
"description": "Explore your message queues",
|
||||||
"main": "dist/src/electron.js",
|
"main": "dist/src/electron.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
+24
-14
@@ -7,12 +7,30 @@ const linuxAppImage: builder.CliOptions = {
|
|||||||
x64: true,
|
x64: true,
|
||||||
ia32: false,
|
ia32: false,
|
||||||
armv7l: true,
|
armv7l: true,
|
||||||
arm64: false,
|
arm64: true,
|
||||||
projectDir: './build/clean',
|
projectDir: './build/clean',
|
||||||
publish: 'always',
|
publish: 'always',
|
||||||
}
|
}
|
||||||
|
|
||||||
const linuxSnap: builder.CliOptions = {
|
const linuxSnap: builder.CliOptions = {
|
||||||
|
x64: true,
|
||||||
|
ia32: false,
|
||||||
|
armv7l: false, // not supported to build on x64
|
||||||
|
arm64: false, // not supported to build on x64
|
||||||
|
projectDir: './build/clean',
|
||||||
|
publish: 'always',
|
||||||
|
}
|
||||||
|
|
||||||
|
const linuxDeb: builder.CliOptions = {
|
||||||
|
x64: true,
|
||||||
|
ia32: false,
|
||||||
|
armv7l: true,
|
||||||
|
arm64: true,
|
||||||
|
projectDir: './build/clean',
|
||||||
|
publish: 'always',
|
||||||
|
}
|
||||||
|
|
||||||
|
const winPortable: builder.CliOptions = {
|
||||||
x64: true,
|
x64: true,
|
||||||
ia32: false,
|
ia32: false,
|
||||||
armv7l: false,
|
armv7l: false,
|
||||||
@@ -21,18 +39,9 @@ const linuxSnap: builder.CliOptions = {
|
|||||||
publish: 'always',
|
publish: 'always',
|
||||||
}
|
}
|
||||||
|
|
||||||
const winPortable: builder.CliOptions = {
|
|
||||||
x64: true,
|
|
||||||
ia32: true,
|
|
||||||
armv7l: false,
|
|
||||||
arm64: false,
|
|
||||||
projectDir: './build/clean',
|
|
||||||
publish: 'always',
|
|
||||||
}
|
|
||||||
|
|
||||||
const winNsis: builder.CliOptions = {
|
const winNsis: builder.CliOptions = {
|
||||||
x64: true,
|
x64: true,
|
||||||
ia32: true,
|
ia32: false,
|
||||||
armv7l: false,
|
armv7l: false,
|
||||||
arm64: false,
|
arm64: false,
|
||||||
projectDir: './build/clean',
|
projectDir: './build/clean',
|
||||||
@@ -41,7 +50,7 @@ const winNsis: builder.CliOptions = {
|
|||||||
|
|
||||||
const winAppx: builder.CliOptions = {
|
const winAppx: builder.CliOptions = {
|
||||||
x64: true,
|
x64: true,
|
||||||
ia32: true,
|
ia32: false,
|
||||||
armv7l: false,
|
armv7l: false,
|
||||||
arm64: false,
|
arm64: false,
|
||||||
projectDir: './build/clean',
|
projectDir: './build/clean',
|
||||||
@@ -69,11 +78,12 @@ async function executeBuild() {
|
|||||||
case 'linux':
|
case 'linux':
|
||||||
await buildWithOptions(linuxAppImage, { platform: 'linux', package: 'AppImage' })
|
await buildWithOptions(linuxAppImage, { platform: 'linux', package: 'AppImage' })
|
||||||
await buildWithOptions(linuxSnap, { platform: 'linux', package: 'snap' })
|
await buildWithOptions(linuxSnap, { platform: 'linux', package: 'snap' })
|
||||||
|
await buildWithOptions(linuxDeb, { platform: 'linux', package: 'deb' })
|
||||||
break
|
break
|
||||||
case 'mac':
|
case 'mac':
|
||||||
await buildWithOptions(mac, { platform: 'mac', package: 'dmg' })
|
await buildWithOptions(mac, { platform: 'mac', package: 'dmg' })
|
||||||
await buildWithOptions(mac, { platform: 'mac', package: 'mas' })
|
// await buildWithOptions(mac, { platform: 'mac', package: 'mas' })
|
||||||
await buildWithOptions(mac, { platform: 'mac', package: 'zip' })
|
// await buildWithOptions(mac, { platform: 'mac', package: 'zip' })
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
await buildWithOptions({ ...mac, projectDir: '' }, { platform: 'mac', package: 'mas-dev' })
|
await buildWithOptions({ ...mac, projectDir: '' }, { platform: 'mac', package: 'mas-dev' })
|
||||||
|
|||||||
@@ -21,14 +21,6 @@ export function sleep(ms: number, required = false) {
|
|||||||
|
|
||||||
export async function writeText(text: string, element: Locator, delay = 0) {
|
export async function writeText(text: string, element: Locator, delay = 0) {
|
||||||
return element.fill(text)
|
return element.fill(text)
|
||||||
if (fast) {
|
|
||||||
return element.fill(text)
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const c of text.split('')) {
|
|
||||||
await element.press(c)
|
|
||||||
await sleep(delay)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteTextWithBackspaces(element: Locator, delay = 0, count = 0) {
|
export async function deleteTextWithBackspaces(element: Locator, delay = 0, count = 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user