Skip to content

Commit

Permalink
v1.1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
seydx committed Apr 24, 2022
1 parent 4ff4198 commit a673835
Show file tree
Hide file tree
Showing 36 changed files with 842 additions and 293 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Changelog
All notable changes to this project will be documented in this file.

# v1.1.16 - 2022-04-24

## Notable Changes
- **API:**
- New endpoint `/api/system/disk`
- **Charts:**
- Added new chart `disk load`
- **Widgets:**
- Added new widget to view the available and used disk space

## Other Changes
- Added disk space information to `Settings > Recordings`
- Added check of storage space for motion events to avoid recording when storage space is low
- Simplified `Add Camera` through UI
- Minor UI improvements

## Bugfixes
- Fixed an issue where removing a camera via the user interface did not destroy the camera controller
- Minor bugfixes

# v1.1.15 - 2022-04-24

## Notable Changes
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ sudo npm install -g camera.ui@latest
- [Browser](#browser)
- [Supported Cameras](#supported-cameras)
- [Camera Settings](#camera-settings)
- [API](#api)
- [FAQ](#faq)
- [Contributing](#contributing)
- [Troubleshooting](#troubleshooting)
Expand Down Expand Up @@ -366,6 +367,14 @@ You should make the following configuration for your camera via the camera's own
* 25 FPS (30 FPS prefered).
* Keyframe interval is 4 seconds. Frame Interval = FPS * 4 => 30 * 4 = 120

## API

camera.ui has a REST API that is primarily used by the web client (i.e. the UI), but can also be consumed by other apps or personal scripts.

You can access the API reference via your local instance by going to /swagger

For example http://[IP]:8081/swagger

## FAQ

Please check our [FAQ](https://github.com/SeydX/camera.ui/wiki/FAQ) before you open an issue.
Expand Down
51 changes: 49 additions & 2 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "camera.ui",
"version": "1.1.15",
"version": "1.1.16",
"description": "NVR like user interface for RTSP capable cameras.",
"author": "SeydX (https://github.com/SeydX/camera.ui)",
"scripts": {
Expand All @@ -22,6 +22,7 @@
"axios": "^0.26.1",
"bunyan": "^1.8.15",
"chalk": "4.1.2",
"check-disk-space": "^3.3.0",
"commander": "6.2.1",
"compare-versions": "^4.1.3",
"connect-history-api-fallback": "^1.6.0",
Expand All @@ -30,6 +31,7 @@
"ffmpeg-for-homebridge": "0.0.9",
"fs-extra": "^10.1.0",
"ftp-srv": "^4.6.0",
"get-folder-size": "^3.1.0",
"got": "^12.0.3",
"helmet": "^5.0.2",
"ip": "^1.1.5",
Expand Down
12 changes: 12 additions & 0 deletions src/api/components/system/system.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,18 @@ export const getChangelog = async (req, res) => {
}
};

export const getDiskLoad = async (req, res) => {
try {
await Socket.handleDiskUsage();
res.status(200).send(Socket.diskSpace);
} catch (error) {
res.status(500).send({
statusCode: 500,
message: error.message,
});
}
};

export const getFtpServerStatus = async (req, res) => {
try {
const status = MotionController.ftpServer.server.listening;
Expand Down
22 changes: 22 additions & 0 deletions src/api/components/system/system.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,28 @@ export const routesConfig = (app) => {
SystemController.getChangelog,
]);

/**
* @swagger
* /api/system/disk:
* get:
* tags: [System]
* security:
* - bearerAuth: []
* summary: Get system disk load
* responses:
* 200:
* description: Successfull
* 401:
* description: Unauthorized
* 500:
* description: Internal server error
*/
app.get('/api/system/disk', [
ValidationMiddleware.validJWTNeeded,
PermissionMiddleware.onlyMasterCanDoThisAction,
SystemController.getDiskLoad,
]);

/**
* @swagger
* /api/system/npm:
Expand Down
4 changes: 4 additions & 0 deletions src/api/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import piexif from 'piexifjs';
import webpush from 'web-push';
import { Low, JSONFile, MemorySync } from '@seydx/lowdb';

import Socket from './socket.js';

import Cleartimer from '../common/cleartimer.js';

import ConfigService from '../services/config/config.service.js';
Expand Down Expand Up @@ -212,6 +214,8 @@ export default class Database {

LoggerService.notificationsDB = Database.notificationsDB;

Socket.watchSystem();

return {
interface: Database.interfaceDB,
tokens: Database.tokensDB,
Expand Down
Loading

0 comments on commit a673835

Please sign in to comment.