Prepare for Alpha.10 (#1272)

* Update Changelog for Alpha.10

* Address lgtm findings

* Correct some texts

* Improve Password handling

* search for turbojpeg only if MF is enabled

* Chnagelog updates

* Fix LED layout overwrite for previously save LEDs

* LED Device- Fix default selection for selected network devices

* Sreengrabber - Select default fps

* Update database migration steps

Co-authored-by: Markus <16664240+Paulchen-Panther@users.noreply.github.com>
This commit is contained in:
LordGrey
2021-07-17 20:55:16 +02:00
committed by GitHub
parent a25f0698d7
commit 10b6317777
23 changed files with 278 additions and 95 deletions

View File

@@ -8,12 +8,12 @@
<div class="panel-body">
<form>
<div class="form-group">
<input type="hidden" name="username" class="form-control" type="text" id="username" value="hyperion"/>
<input name="password" class="form-control" type="password" id="password" placeholder="Password" autocomplete="off" />
<input type="name="username" class="form-control" type="text" id="username" value="Hyperion" disabled/></br>
<input name="password" class="form-control" type="password" id="password" placeholder="Password" autocomplete="off"/>
<input name="show_pw" type="checkbox" id="show_pw" /><label for="show_pw">Show/Hide Password</label>
</div>
<div class="form-group">
<button type="submit" class="btn btn-sm btn-success" id="btn_password" onclick="requestAuthorization(document.getElementById('password').value); return false;" disabled><i class="fa fa-fw fa-unlock"></i>Login</button>
<button type="submit" class="btn btn-sm btn-success" id="btn_password" onclick="requestAuthorization(document.getElementById('password').value); return false;"><i class="fa fa-fw fa-unlock"></i>Login</button>
</div>
</form>
</div>
@@ -26,8 +26,12 @@
removeOverlay();
$('#password').off().on('input', function (e) {
if (e.currentTarget.value.length >= 8)
$('#btn_password').removeAttr('disabled');
if (e.currentTarget.value.length >= 8) {
$('#btn_password').prop('disabled', false);
}
else {
$('#btn_password').prop('disabled', true);
}
});
$('#show_pw').off().on('change', function (e) {

View File

@@ -11,7 +11,9 @@
"InfoDialog_nowrite_text": "Hyperion can't write to your current loaded configuration file. Please repair the file permissions to proceed.",
"InfoDialog_nowrite_title": "write permission error!",
"infoDialog_password_current_text": "Current password",
"infoDialog_password_minimum_length": "Passwords must be minimum 8 characters.",
"infoDialog_password_new_text": "New password",
"infoDialog_username_text": "Username",
"about_3rd_party_licenses": "3rd party licenses",
"about_3rd_party_licenses_error": "We had trouble collecting 3rd party licenses information from web. <br />Please follow this link to the GitHub Resource.",
"about_build": "Build",
@@ -464,17 +466,17 @@
"edt_conf_v4l2_flip_expl": "This allows you to flip the image horizontally, vertically, or both.",
"edt_conf_v4l2_flip_title": "Image flip",
"edt_conf_v4l2_fpsSoftwareDecimation_title": "Software frame skipping",
"edt_conf_v4l2_fpsSoftwareDecimation_expl": "To save resources every n'th frame will be processed only. For ex. if grabber is set to 30FPS with this option set to 5 the final result will be around 6FPS (1 - disabled)",
"edt_conf_v4l2_fpsSoftwareDecimation_expl": "To save resources every n'th frame will be processed only. For ex. if grabber is set to 30fps with this option set to 5 the final result will be around 6fps",
"edt_conf_v4l2_encoding_title": "Encoding format",
"edt_conf_v4l2_encoding_expl": "Force video encoding for multiformat capable grabbers",
"edt_conf_v4l2_hardware_brightness_title": "Hardware brightness control",
"edt_conf_v4l2_hardware_brightness_expl": "Set hardware brightness if device supports it, check logs (0=disabled)",
"edt_conf_v4l2_hardware_brightness_expl": "Set hardware brightness",
"edt_conf_v4l2_hardware_contrast_title": "Hardware contrast control",
"edt_conf_v4l2_hardware_contrast_expl": "Set hardware contrast if device supports it, check logs (0=disabled)",
"edt_conf_v4l2_hardware_contrast_expl": "Set hardware contrast",
"edt_conf_v4l2_hardware_hue_title": "Hardware hue control",
"edt_conf_v4l2_hardware_hue_expl": "Set hardware hue if device supports it, check logs (0=disabled)",
"edt_conf_v4l2_hardware_hue_expl": "Set hardware hue",
"edt_conf_v4l2_hardware_saturation_title": "Hardware saturation control",
"edt_conf_v4l2_hardware_saturation_expl": "Set hardware saturation if device supports it, check logs (0=disabled)",
"edt_conf_v4l2_hardware_saturation_expl": "Set hardware saturation",
"edt_conf_v4l2_hardware_set_defaults": "Default hardware controls",
"edt_conf_v4l2_hardware_set_defaults_tip": "Set device's default values for brightness, contrast, hue and saturation",
"edt_conf_v4l2_noSignalCounterThreshold_title": "Signal Counter Threshold",

View File

@@ -22,7 +22,7 @@ $(document).ready(function () {
//blackborder
$('#conf_cont').append(createRow('conf_cont_blackborder'));
$('#conf_cont_blackborder').append(createOptPanel('fa-photo', $.i18n("edt_conf_bb_heading_title"), 'editor_container_blackborder', 'btn_submit_blackborder'));
$('#conf_cont_blackborder').append(createHelpTable(window.schema.blackborderdetector.properties, $.i18n("edt_conf_bb_heading_title"), "blackborderHelpPanelId"))
$('#conf_cont_blackborder').append(createHelpTable(window.schema.blackborderdetector.properties, $.i18n("edt_conf_bb_heading_title"), "blackborderHelpPanelId"));
}
else {
$('#conf_cont').addClass('row');

View File

@@ -10,7 +10,7 @@ $(document).ready(function () {
instances_html += '<a id="active_instance_dropdown" class="dropdown-toggle" data-toggle="dropdown" href="#" style="text-decoration:none;display:flex;align-items:center;">';
instances_html += '<div id="active_instance_friendly_name"></div>';
instances_html += '<div id="btn_hypinstanceswitch" style="white-space:nowrap;"><span class="mdi mdi-lightbulb-group mdi-24px" style="margin-right:0;margin-left:5px;"></span><span class="mdi mdi-menu-down mdi-24px"></span></div>';
instances_html += '</a><ul id="hyp_inst_listing" class="dropdown-menu dropdown-alerts" style="cursor:pointer;"></ul>'
instances_html += '</a><ul id="hyp_inst_listing" class="dropdown-menu dropdown-alerts" style="cursor:pointer;"></ul>';
instances_html += '</div></div>';
instances_html += '<div class="panel-body">';
@@ -114,7 +114,7 @@ $(document).ready(function () {
var jsonPort = window.serverConfig.jsonServer.port;
$('#dash_jsonPort').html(jsonPort);
var wsPorts = window.serverConfig.webConfig.port + ' | ' + window.serverConfig.webConfig.sslPort
var wsPorts = window.serverConfig.webConfig.port + ' | ' + window.serverConfig.webConfig.sslPort;
$('#dash_wsPorts').html(wsPorts);
$('#dash_currv').html(window.currentVersion);

View File

@@ -205,7 +205,7 @@ $(document).ready(function () {
if (enumVals.length > 0) {
if (deviceSelected === configuredDevice) {
var configuredResolutionText = window.serverConfig.framegrabber.width + "x" + window.serverConfig.framegrabber.height;
var idx = $.inArray(configuredResolutionText, enumTitelVals)
var idx = $.inArray(configuredResolutionText, enumTitelVals);
if (idx != -1) {
enumDefaultVal = idx.toString();
}
@@ -266,6 +266,10 @@ $(document).ready(function () {
if ($.inArray(configuredFps, enumVals) != -1) {
enumDefaultVal = configuredFps;
}
} else if (deviceProperties.hasOwnProperty('default') && !jQuery.isEmptyObject(deviceProperties.default.video_input)) {
if (deviceProperties.default.video_input.resolution.fps) {
enumDefaultVal = deviceProperties.default.video_input.resolution.fps;
}
}
updateJsonEditorSelection(conf_editor_screen, 'root.framegrabber',
'framerates', addSchemaElements, enumVals, [], enumDefaultVal, false);
@@ -413,7 +417,7 @@ $(document).ready(function () {
contrast: { current: window.serverConfig.grabberV4L2.hardware_contrast },
saturation: { current: window.serverConfig.grabberV4L2.hardware_saturation },
hue: { current: window.serverConfig.grabberV4L2.hardware_hue }
}
};
deviceProperties.properties = properties;
}
}
@@ -551,7 +555,7 @@ $(document).ready(function () {
if (enumVals.length > 0) {
if (deviceSelected === configuredDevice) {
var configuredResolutionText = window.serverConfig.grabberV4L2.width + "x" + window.serverConfig.grabberV4L2.height;
var idx = $.inArray(configuredResolutionText, enumTitelVals)
var idx = $.inArray(configuredResolutionText, enumTitelVals);
if (idx != -1) {
enumDefaultVal = idx.toString();
}
@@ -719,7 +723,7 @@ $(document).ready(function () {
updateJsonEditorSelection(conf_editor_screen, 'root.framegrabber',
'available_devices', {}, enumVals, enumTitelVals, enumDefaultVal, addSelect, false);
}
}
};
// build dynamic video input enum
var updateVideoSourcesList = function (type, discoveryInfo) {
@@ -763,7 +767,7 @@ $(document).ready(function () {
else {
discoveryResult = {
"video_sources": []
}
};
}
switch (type) {

View File

@@ -884,6 +884,8 @@ $(document).ready(function () {
break;
default:
conf_editor.getEditor(specOptPath + "host").disable();
//Reset host value, to trigger getProperties via host value
conf_editor.getEditor(specOptPath + "host").setValue("");
conf_editor.getEditor(specOptPath + "host").setValue(val);
break;
}
@@ -1199,7 +1201,8 @@ function saveLedConfig(genDefLayout = false) {
result.smoothing = { enable: false };
if (genDefLayout === true) {
if (devicesProperties[ledType][host].modelType === "Strip") {
if (!jQuery.isEmptyObject(devicesProperties) && devicesProperties[ledType][host].modelType === "Strip") {
ledConfig = {
"classic": {
"top": hardwareLedCount / 2,
@@ -1269,8 +1272,6 @@ function saveLedConfig(genDefLayout = false) {
break;
}
//Rewrite whole LED & Layout configuration, in case changes were done accross tabs and no default layout
if (genDefLayout !== true) {
result.ledConfig = getLedConfig();
@@ -1283,7 +1284,6 @@ function saveLedConfig(genDefLayout = false) {
// build dynamic enum
var updateSelectList = function (ledType, discoveryInfo) {
// Only update, if ledType is equal of selected controller type and discovery info exists
if (ledType !== $("#leddevices").val() || !discoveryInfo.devices) {
return;
@@ -1369,19 +1369,18 @@ var updateSelectList = function (ledType, discoveryInfo) {
else {
enumTitelVals.push(host);
}
}
addCustom = true;
// Select configured device
var configuredDeviceType = window.serverConfig.device.type;
var configuredHost = window.serverConfig.device.hostList;
if (ledType === configuredDeviceType && $.inArray(configuredHost, enumVals) != -1) {
enumDefaultVal = configuredHost;
}
else {
addSelect = true;
addCustom = true;
}
//Always allow to add custom configuration
addCustom = true;
// Select configured device
var configuredDeviceType = window.serverConfig.device.type;
var configuredHost = window.serverConfig.device.hostList;
if (ledType === configuredDeviceType && $.inArray(configuredHost, enumVals) != -1) {
enumDefaultVal = configuredHost;
}
else {
addSelect = true;
}
}
break;

View File

@@ -17,8 +17,8 @@ $(document).ready(function () {
var activeComponent = "";
const image = new Image()
image.src = "img/hyperion/logo_negativ.png",
const image = new Image();
image.src = "img/hyperion/logo_negativ.png";
/// add prototype for simple canvas clear() method
CanvasRenderingContext2D.prototype.clear = function () {

View File

@@ -7,17 +7,18 @@ function changePassword(){
// fill default pw if default is set
if(window.defaultPasswordIsSet)
$('#oldPw').val('hyperion')
$('#current-password').val('hyperion')
$('#id_btn_ok').off().on('click',function() {
var oldPw = $('#oldPw').val();
var newPw = $('#newPw').val();
var oldPw = $('#current-password').val();
var newPw = $('#new-password').val();
requestChangePassword(oldPw, newPw)
requestChangePassword(oldPw, newPw);
history.pushState({}, "New password");
});
$('#newPw, #oldPw').off().on('input',function(e) {
($('#oldPw').val().length >= 8 && $('#newPw').val().length >= 8) && !window.readOnlyMode ? $('#id_btn_ok').attr('disabled', false) : $('#id_btn_ok').attr('disabled', true);
$('#new-password, #current-password').off().on('input',function(e) {
($('#current-password').val().length >= 8 && $('#new-password').val().length >= 8) && !window.readOnlyMode ? $('#id_btn_ok').attr('disabled', false) : $('#id_btn_ok').attr('disabled', true);
});
}

View File

@@ -288,11 +288,14 @@ function showInfoDialog(type, header, message) {
else if (type == "changePassword") {
$('#id_body_rename').html('<i style="margin-bottom:20px" class="fa fa-key modal-icon-edit"><br>');
$('#id_body_rename').append('<h4>' + header + '</h4><br>');
$('#id_body_rename').append('<div class="row"><div class="col-md-3"><p class="text-left">' + $.i18n('infoDialog_password_current_text') +
'</p></div><div class="col-md-8"><input class="form-control" id="oldPw" placeholder="Old" type="password"></div></div><br>');
$('#id_body_rename').append('<div class="row"><div class="col-md-3"><p class="text-left">' + $.i18n('infoDialog_password_new_text')+
'</p></div><div class="col-md-8"><input class="form-control" id="newPw" placeholder="New" type="password"></div></div>');
$('#id_footer_rename').html('<button type="button" id="id_btn_ok" class="btn btn-success" data-dismiss-modal="#modal_dialog_rename" disabled><i class="fa fa-fw fa-save"></ul>' + $.i18n('general_btn_ok') + '</button>');
$('#id_body_rename').append('<div class="row"><div class="col-md-4"><p class="text-left">' + $.i18n('infoDialog_username_text') +
'</p></div><div class="col-md-8"><input class="form-control" id="username" type="text" value="Hyperion" disabled></div></div><br>');
$('#id_body_rename').append('<div class="row"><div class="col-md-4"><p class="text-left">' + $.i18n('infoDialog_password_current_text') +
'</p></div><div class="col-md-8"><input class="form-control" id="current-password" placeholder="Old" type="password" autocomplete="current-password"></div></div><br>');
$('#id_body_rename').append('<div class="row"><div class="col-md-4"><p class="text-left">' + $.i18n('infoDialog_password_new_text')+
'</p></div><div class="col-md-8"><input class="form-control" id="new-password" placeholder="New" type="password" autocomplete="new-password"></div></div>');
$('#id_body_rename').append('<div class="bs-callout bs-callout-info"><span>' + $.i18n('infoDialog_password_minimum_length') + '</span></div>');
$('#id_footer_rename').html('<button type="button" id="id_btn_ok" class="btn btn-success" data-dismiss-modal="#modal_dialog_rename" disabled><i class="fa fa-fw fa-save"></i>' + $.i18n('general_btn_ok') + '</button></div>');
$('#id_footer_rename').append('<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>' + $.i18n('general_btn_cancel') + '</button>');
}
else if (type == "checklist") {