Skip to content

Commit

Permalink
v5.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
seydx committed Jan 11, 2022
1 parent db241e6 commit e8395c6
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 23 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

# v5.0.4 - 2022-01-11

## Other Changes
- Interface:
- Limit max page size to 6 (camera.ui)
- Refactored Lightbox (camera.ui)
- Homebridge UI (Config UI X)
- Added link to camera.ui interface
- Bump dependencies

## Bugfixes
- Fixed an issue with pagination middleware, where the nextPage and prevPage attribute showed wrong path (camera.ui)
- Fixed an isue where opening a recording or a notification (with recording) loaded all recordings in the background and caused the interface to crash (camera.ui)
- Fixed an issue where the notification banner could not display a video (camera.ui)
- Fixed an issue where utilization could not show process cpu load / memory usage (camera.ui)
- Minor bugfixes

# v5.0.3 - 2022-01-11

## Bugfixes
Expand Down
17 changes: 17 additions & 0 deletions homebridge-ui/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class UiServer extends HomebridgePluginUiServer {

streams = {};

this.onRequest('/interfaceConfig', this.getInterfaceConfig.bind(this));
this.onRequest('/cameras', this.getCameras.bind(this));
this.onRequest('/startStream', this.startStream.bind(this));
this.onRequest('/stopStream', this.stopStream.bind(this));
Expand All @@ -21,6 +22,22 @@ class UiServer extends HomebridgePluginUiServer {
this.ready();
}

async getInterfaceConfig() {
const config = await fs.readJSON(this.homebridgeConfigPath, { throws: false });
const cameraUI = config?.platforms?.find((plugin) => plugin?.platform === 'CameraUI');

if (cameraUI?.port) {
const isHttps = Boolean(cameraUI?.ssl?.active && cameraUI?.ssl?.key && cameraUI?.ssl?.cert);

return {
protocol: isHttps ? 'https' : 'http',
port: cameraUI.port,
};
}

return false;
}

async getCameras() {
let cameras = [];
const config = await fs.readJSON(this.homebridgeConfigPath, { throws: false });
Expand Down
19 changes: 15 additions & 4 deletions homebridge-ui/ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ v-app.app.tw-p-4
v-icon.text-default.tw-mr-1(style="margin-top: -3px;") {{ icons['mdiGithub'] }}
| Github
.tw-mt-3
router-link(to="/cameras") Cameras
| |
router-link(to="/config") Config
router-link(to="/cameras") Cameras
span |
router-link(to="/config") Config
span(v-if="interfaceLink") |
a(:href="interfaceLink" target="_blank" v-if="interfaceLink") Interface
router-view
</template>

Expand All @@ -26,10 +28,11 @@ export default {
icons: {
mdiGithub,
},
interfaceLink: null,
};
},
mounted() {
async mounted() {
window.homebridge.showSpinner();
window.homebridge.addEventListener('ready', async () => {
Expand All @@ -40,6 +43,14 @@ export default {
}
document.documentElement.setAttribute('data-theme-color', 'pink');
const interfaceConfig = await window.homebridge.request('/interfaceConfig');
if (interfaceConfig) {
const { protocol, port } = interfaceConfig;
this.interfaceLink = `${protocol}://${window.location.hostname}:${port}`;
}
console.log(this.interfaceLink);
window.homebridge.hideSpinner();
});
},
Expand Down
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-camera-ui",
"version": "5.0.3",
"version": "5.0.4",
"description": "User Interface for RTSP capable cameras with HSV support.",
"author": "SeydX (https://github.com/SeydX/homebridge-camera-ui)",
"scripts": {
Expand All @@ -14,7 +14,7 @@
"main": "index.js",
"dependencies": {
"@homebridge/plugin-ui-utils": "^0.0.19",
"camera.ui": "^1.0.3",
"camera.ui": "^1.0.4",
"chalk": "4.1.2",
"ffmpeg-for-homebridge": "^0.0.9",
"fs-extra": "10.0.0",
Expand Down

0 comments on commit e8395c6

Please sign in to comment.