mirror of
https://github.com/thomasnordquist/MQTT-Explorer.git
synced 2026-09-11 17:13:53 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
758c151e4f | ||
|
|
73d678bdc0 |
@@ -44,7 +44,6 @@ interface GithubAsset {
|
||||
id: number
|
||||
node_id: string
|
||||
url: string
|
||||
browser_download_url: string
|
||||
name: string
|
||||
label: string
|
||||
}
|
||||
@@ -171,7 +170,7 @@ class UpdateNotifier extends React.Component<Props, State> {
|
||||
{this.renderDownloads()}
|
||||
<Button
|
||||
className={this.props.classes.download}
|
||||
onClick={this.openHomePage}
|
||||
onClick={this.openGithub}
|
||||
>
|
||||
Github Page
|
||||
</Button>
|
||||
@@ -181,8 +180,8 @@ class UpdateNotifier extends React.Component<Props, State> {
|
||||
)
|
||||
}
|
||||
|
||||
private openHomePage = () => {
|
||||
this.openUrl('https://mqtt-explorer.com')
|
||||
private openGithub = () => {
|
||||
this.openUrl('https://github.com/thomasnordquist/MQTT-Explorer')
|
||||
}
|
||||
|
||||
private openUrl = (url: string) => {
|
||||
@@ -214,7 +213,7 @@ class UpdateNotifier extends React.Component<Props, State> {
|
||||
<div>
|
||||
<Button
|
||||
className={this.props.classes.download}
|
||||
onClick={() => this.openUrl(asset.browser_download_url)}
|
||||
onClick={() => this.openUrl(asset.url)}
|
||||
>
|
||||
<CloudDownload /> {asset.name}
|
||||
</Button>
|
||||
|
||||
@@ -47,7 +47,7 @@ class ConnectionHealthIndicator extends React.Component<Props, {}> {
|
||||
|
||||
return (
|
||||
<Tooltip title={`Connection health "${health}"`}>
|
||||
<div style={{ display: 'inherit' }}>
|
||||
<div>
|
||||
<DeviceHubOutlined className={`${[classes[health]]} ${this.props.withBackground ? classes.icon : ''}`} />
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
import { Base64Message } from './Model/Base64Message'
|
||||
import { DataSource, MqttSource } from './DataSource'
|
||||
import { UpdateInfo } from 'builder-util-runtime'
|
||||
import {
|
||||
AddMqttConnection,
|
||||
EventDispatcher,
|
||||
MqttMessage,
|
||||
addMqttConnectionEvent,
|
||||
backendEvents,
|
||||
checkForUpdates,
|
||||
makeConnectionMessageEvent,
|
||||
makeConnectionStateEvent,
|
||||
makePublishEvent,
|
||||
removeConnection,
|
||||
updateAvailable
|
||||
} from '../../events'
|
||||
|
||||
export class ConnectionManager {
|
||||
@@ -72,3 +76,17 @@ export class ConnectionManager {
|
||||
.forEach(conenctionId => this.removeConnection(conenctionId))
|
||||
}
|
||||
}
|
||||
|
||||
class UpdateNotifier {
|
||||
public onCheckUpdateRequest = new EventDispatcher<void, UpdateNotifier>()
|
||||
constructor() {
|
||||
backendEvents.subscribe(checkForUpdates, () => {
|
||||
this.onCheckUpdateRequest.dispatch()
|
||||
})
|
||||
}
|
||||
public notify(updateInfo: UpdateInfo) {
|
||||
backendEvents.emit(updateAvailable, updateInfo)
|
||||
}
|
||||
}
|
||||
|
||||
export const updateNotifier = new UpdateNotifier()
|
||||
|
||||
@@ -28,6 +28,10 @@ export function makeConnectionStateEvent(connectionId: string): Event<DataSource
|
||||
}
|
||||
}
|
||||
|
||||
export const checkForUpdates: Event<void> = {
|
||||
topic: 'app/update/check',
|
||||
}
|
||||
|
||||
export const updateAvailable: Event<UpdateInfo> = {
|
||||
topic: 'app/update/available',
|
||||
}
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@
|
||||
"test-backend": "cd backend && yarn run test && cd ..",
|
||||
"prepare-release": "ts-node scripts/prepare-release.ts",
|
||||
"package": "ts-node package.ts",
|
||||
"ui-test": "./scripts/uiTests.sh",
|
||||
"upload-video-artifacts": "./scripts/uploadVideoAsset.ts ui-test.mp4 ui-test.gif",
|
||||
"ui-test": "./scripts/uiTests.sh 1920x1080",
|
||||
"upload-video-artifacts": "./scripts/uploadVideoAsset.ts ui-test*.mp4 ui-test*.gif",
|
||||
"package-with-docker": "./scripts/package-with-docker.sh"
|
||||
},
|
||||
"repository": {
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
#!/bin/bash
|
||||
DIMENSIONS="1024x720"
|
||||
DIMENSIONS=$1
|
||||
GIF_SCALE="1024"
|
||||
|
||||
ffmpeg -s:v $DIMENSIONS -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv app2.mp4
|
||||
#ffmpeg -s:v $DIMENSIONS -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv app2.mp4
|
||||
|
||||
# The video starts with a few blank frames, we want to know when the stop
|
||||
ffprobe -f lavfi -i "movie=app2.mp4,blackdetect[out0]" -show_entries tags=lavfi.black_start,lavfi.black_end -of default=nw=1 -v quiet > ffmpeg_info
|
||||
ffprobe -f lavfi -i "movie=app.mp4,blackdetect[out0]" -show_entries tags=lavfi.black_start,lavfi.black_end -of default=nw=1 -v quiet > ffmpeg_info
|
||||
END_OF_BLACK=`cat ffmpeg_info | grep end | head -n1 | cut -d'=' -f2`
|
||||
|
||||
# Remove grey frames at the beginning (app start and splash screen)
|
||||
END_OF_BLACK=`awk "BEGIN {print $END_OF_BLACK+0.8; exit}"`
|
||||
|
||||
# Trim black frames at start
|
||||
ffmpeg -s:v $DIMENSIONS -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv -ss $END_OF_BLACK app.mp4
|
||||
ffmpeg -s:v $DIMENSIONS -r 20 -i app.mp4 -ss $END_OF_BLACK app.mp4
|
||||
|
||||
# Generate gif palette
|
||||
ffmpeg -y -s:v $DIMENSIONS -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv -vf "fps=10,scale=$GIF_SCALE:-1:flags=lanczos,palettegen" palette1024.png
|
||||
ffmpeg -y -s:v $DIMENSIONS -r 20 -i app.mp4 -vf "fps=10,scale=$GIF_SCALE:-1:flags=lanczos,palettegen" palette1024.png
|
||||
|
||||
# Create gif
|
||||
ffmpeg -s:v $DIMENSIONS -r 20 -f rawvideo -pix_fmt yuv420p -i qrawvideorgb24.yuv -i palette1024.png -ss $END_OF_BLACK -filter_complex "fps=10,scale=$GIF_SCALE:-1:flags=lanczos[x];[x][1:v]paletteuse" app720.gif
|
||||
ffmpeg -s:v $DIMENSIONS -r 20 -i app.mp4 -i palette1024.png -ss $END_OF_BLACK -filter_complex "fps=10,scale=$GIF_SCALE:-1:flags=lanczos[x];[x][1:v]paletteuse" app.gif
|
||||
|
||||
# Clean up
|
||||
rm ffmpeg_info palette*.png qrawvideorgb24.yuv
|
||||
|
||||
mv app.mp4 ui-test.mp4
|
||||
mv app720.gif ui-test.gif
|
||||
mv app.mp4 ui-test_$DIMENSIONS.mp4
|
||||
mv app.gif ui-test_$DIMENSIONS.gif
|
||||
|
||||
+4
-4
@@ -9,7 +9,7 @@ function finish {
|
||||
|
||||
trap finish EXIT
|
||||
|
||||
DIMENSIONS="1024x720"
|
||||
DIMENSIONS=$1
|
||||
SCR=99
|
||||
# Start new window manager
|
||||
Xvfb :$SCR -screen 0 "$DIMENSIONS"x24 -ac &
|
||||
@@ -32,8 +32,8 @@ sleep 2
|
||||
rm ./app.mp4 || echo no need to delete ./app.mp4
|
||||
|
||||
# Start recoring in tmux
|
||||
#tmux new-session -d -s record ffmpeg -f x11grab -draw_mouse 0 -video_size $DIMENSIONS -i :$SCR -codec:v libx264 -r 20 ./app.mp4
|
||||
tmux new-session -d -s record ffmpeg -f x11grab -draw_mouse 0 -video_size $DIMENSIONS -i :$SCR -r 20 -vcodec rawvideo -pix_fmt yuv420p qrawvideorgb24.yuv
|
||||
tmux new-session -d -s record ffmpeg -f x11grab -draw_mouse 0 -video_size $DIMENSIONS -i :$SCR -codec:v libx264 -r 20 ./app.mp4
|
||||
#tmux new-session -d -s record ffmpeg -f x11grab -draw_mouse 0 -video_size $DIMENSIONS -i :$SCR -r 20 -vcodec rawvideo -pix_fmt yuv420p qrawvideorgb24.yuv
|
||||
|
||||
# Start tests
|
||||
node dist/src/spec/demoVideo.js
|
||||
@@ -47,6 +47,6 @@ tmux send-keys -t record q
|
||||
sleep 5
|
||||
|
||||
# Process the video
|
||||
./scripts/prepareVideo.sh
|
||||
./scripts/prepareVideo.sh $DIMENSIONS
|
||||
|
||||
exit $TEST_EXIT_CODE
|
||||
|
||||
+11
-8
@@ -1,9 +1,10 @@
|
||||
import { autoUpdater } from 'electron-updater'
|
||||
import { BuildInfo } from 'electron-telemetry/build/Model'
|
||||
import { UpdateInfo } from '../events'
|
||||
import { updateNotifier } from '../backend/src/index'
|
||||
|
||||
export function shouldAutoUpdate(build: BuildInfo) {
|
||||
return build.package !== 'portable' && build.platform !== 'mac'
|
||||
return build.package !== 'portable'
|
||||
}
|
||||
|
||||
export function handleAutoUpdate() {
|
||||
@@ -11,13 +12,15 @@ export function handleAutoUpdate() {
|
||||
console.log('There is an update available')
|
||||
})
|
||||
|
||||
autoUpdater.on('error', (error) => {
|
||||
console.error('could not update due to error', error)
|
||||
autoUpdater.on('error', () => {
|
||||
console.log('could not update due to error')
|
||||
})
|
||||
|
||||
try {
|
||||
autoUpdater.checkForUpdatesAndNotify()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
updateNotifier.onCheckUpdateRequest.subscribe(() => {
|
||||
try {
|
||||
autoUpdater.checkForUpdatesAndNotify()
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+2
-2
@@ -38,8 +38,8 @@ async function createWindow() {
|
||||
const iconPath = path.join(__dirname, '..', '..', 'icon.png')
|
||||
// Create the browser window.
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 1024,
|
||||
height: 720,
|
||||
width: 1920 / 2,
|
||||
height: 1080 / 2 + 22,
|
||||
show: false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
|
||||
@@ -41,7 +41,7 @@ const options = {
|
||||
browserName: 'electron',
|
||||
chromeOptions: {
|
||||
binary: `${__dirname}/../../../node_modules/.bin/electron`,
|
||||
args: [`--app=${__dirname}/../../..`, '--force-device-scale-factor=1', '--no-sandbox', '--disable-dev-shm-usage', '--disable-extensions'].concat(runningUiTestOnCi),
|
||||
args: [`--app=${__dirname}/../../..`, '--force-device-scale-factor=2', '--no-sandbox', '--disable-dev-shm-usage', '--disable-extensions'].concat(runningUiTestOnCi),
|
||||
},
|
||||
windowTypes: ['app', 'webview'],
|
||||
},
|
||||
@@ -152,6 +152,7 @@ async function doStuff() {
|
||||
stopMqtt()
|
||||
|
||||
fs.writeFileSync('scenes.json', JSON.stringify(scenes.scenes, undefined, ' '))
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
doStuff()
|
||||
|
||||
Reference in New Issue
Block a user