Added basic control panel
This commit is contained in:
34
dist/CameraRunner.js
vendored
34
dist/CameraRunner.js
vendored
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
||||
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
@@ -36,9 +36,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
}
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CameraRunner = void 0;
|
||||
exports.CameraProcessStateColors = exports.CameraPCStateColors = exports.CameraRunner = void 0;
|
||||
var socket_io_client_1 = require("socket.io-client");
|
||||
var Utils_1 = require("./Utils");
|
||||
var Status_1 = require("./Status");
|
||||
var PREFIX = "[CameraRunner]";
|
||||
var CameraRunner = /** @class */ (function () {
|
||||
function CameraRunner(Main) {
|
||||
@@ -93,6 +94,11 @@ var CameraRunner = /** @class */ (function () {
|
||||
this.message = message;
|
||||
this.error = error;
|
||||
this.state = state;
|
||||
this._Main.Status.update(Status_1.StatusType.CameraPC, exports.CameraPCStateColors[this.state], message, {
|
||||
reboot: state === 'FAILED' ||
|
||||
state === 'DISCONNECTED' ||
|
||||
state == 'CONNECTED',
|
||||
});
|
||||
this.broadcastState();
|
||||
if (error != null &&
|
||||
Date.now() - this.bootTime > this.errorTriggerStartupDelay)
|
||||
@@ -117,6 +123,11 @@ var CameraRunner = /** @class */ (function () {
|
||||
case 1:
|
||||
data = _a.sent();
|
||||
this.processStatus = data;
|
||||
this._Main.Status.update(Status_1.StatusType.CameraProcess, exports.CameraProcessStateColors[this.processStatus.state], this.processStatus.message, {
|
||||
reboot: this.processStatus.state === 'PROBLEM' ||
|
||||
this.processStatus.state === 'STOPPED' ||
|
||||
this.processStatus.state === 'RUNNING',
|
||||
});
|
||||
this.broadcastState();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
@@ -126,6 +137,11 @@ var CameraRunner = /** @class */ (function () {
|
||||
_this.processStatus.state = simpleStatus.state;
|
||||
_this.processStatus.message = simpleStatus.message;
|
||||
_this.processStatus.error = simpleStatus.error;
|
||||
_this._Main.Status.update(Status_1.StatusType.CameraProcess, exports.CameraProcessStateColors[_this.processStatus.state], _this.processStatus.message, {
|
||||
reboot: _this.processStatus.state === 'PROBLEM' ||
|
||||
_this.processStatus.state === 'STOPPED' ||
|
||||
_this.processStatus.state === 'RUNNING',
|
||||
});
|
||||
_this.broadcastState();
|
||||
});
|
||||
clearInterval(this.pollClock);
|
||||
@@ -218,4 +234,16 @@ var CameraRunner = /** @class */ (function () {
|
||||
return CameraRunner;
|
||||
}());
|
||||
exports.CameraRunner = CameraRunner;
|
||||
exports.CameraPCStateColors = {
|
||||
CONNECTED: Status_1.State.Green,
|
||||
DISCONNECTED: Status_1.State.Gray,
|
||||
CONNECTING: Status_1.State.Yellow,
|
||||
FAILED: Status_1.State.Red,
|
||||
};
|
||||
exports.CameraProcessStateColors = {
|
||||
RUNNING: Status_1.State.Green,
|
||||
STOPPED: Status_1.State.Gray,
|
||||
STARTING: Status_1.State.Yellow,
|
||||
PROBLEM: Status_1.State.Red,
|
||||
};
|
||||
//# sourceMappingURL=CameraRunner.js.map
|
||||
Reference in New Issue
Block a user