mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2
.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
383 lines
12 KiB
JavaScript
Executable File
383 lines
12 KiB
JavaScript
Executable File
var instNameInit = false
|
|
|
|
$(document).ready(function () {
|
|
var darkModeOverwrite = getStorage("darkModeOverwrite", true);
|
|
|
|
if (darkModeOverwrite == "false" || darkModeOverwrite == null) {
|
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
handleDarkMode();
|
|
}
|
|
|
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches) {
|
|
setStorage("darkMode", "off", false);
|
|
}
|
|
}
|
|
|
|
if (getStorage("darkMode", false) == "on") {
|
|
handleDarkMode();
|
|
}
|
|
|
|
loadContentTo("#container_connection_lost", "connection_lost");
|
|
loadContentTo("#container_restart", "restart");
|
|
initWebSocket();
|
|
|
|
$(window.hyperion).on("cmd-serverinfo", function (event) {
|
|
window.serverInfo = event.response.info;
|
|
|
|
// comps
|
|
window.comps = event.response.info.components
|
|
|
|
$(window.hyperion).trigger("ready");
|
|
|
|
window.comps.forEach(function (obj) {
|
|
if (obj.name == "ALL") {
|
|
if (obj.enabled)
|
|
$("#hyperion_disabled_notify").fadeOut("fast");
|
|
else
|
|
$("#hyperion_disabled_notify").fadeIn("fast");
|
|
}
|
|
});
|
|
|
|
// determine button visibility
|
|
var running = window.serverInfo.instance.filter(entry => entry.running);
|
|
if (running.length > 1)
|
|
$('#btn_hypinstanceswitch').toggle(true)
|
|
else
|
|
$('#btn_hypinstanceswitch').toggle(false)
|
|
// update listing at button
|
|
updateHyperionInstanceListing()
|
|
if (!instNameInit) {
|
|
window.currentHyperionInstanceName = getInstanceNameByIndex(0);
|
|
instNameInit = true;
|
|
}
|
|
|
|
updateSessions();
|
|
}); // end cmd-serverinfo
|
|
|
|
// Update language selection
|
|
$("#language-select").on('changed.bs.select', function (e, clickedIndex, isSelected, previousValue) {
|
|
var newLang = availLang[clickedIndex - 1];
|
|
if (newLang !== storedLang) {
|
|
setStorage("langcode", newLang);
|
|
reload();
|
|
}
|
|
});
|
|
|
|
$("#language-select").selectpicker(
|
|
{
|
|
container: 'body'
|
|
});
|
|
|
|
$(".bootstrap-select").click(function () {
|
|
$(this).addClass("open");
|
|
});
|
|
|
|
$(document).click(function () {
|
|
$(".bootstrap-select").removeClass("open");
|
|
});
|
|
|
|
$(".bootstrap-select").click(function (e) {
|
|
e.stopPropagation();
|
|
});
|
|
|
|
//End language selection
|
|
|
|
$(window.hyperion).on("cmd-sessions-update", function (event) {
|
|
window.serverInfo.sessions = event.response.data;
|
|
updateSessions();
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-authorize-tokenRequest cmd-authorize-getPendingTokenRequests", function (event) {
|
|
var val = event.response.info;
|
|
if (Array.isArray(event.response.info)) {
|
|
if (event.response.info.length == 0) {
|
|
return
|
|
}
|
|
val = event.response.info[0]
|
|
if (val.comment == '')
|
|
$('#modal_dialog').modal('hide');
|
|
}
|
|
|
|
showInfoDialog("grantToken", $.i18n('conf_network_tok_grantT'), $.i18n('conf_network_tok_grantMsg') + '<br><span style="font-weight:bold">App: ' + val.comment + '</span><br><span style="font-weight:bold">Code: ' + val.id + '</span>')
|
|
$("#tok_grant_acc").off().on('click', function () {
|
|
tokenList.push(val)
|
|
// forward event, in case we need to rebuild the list now
|
|
$(window.hyperion).trigger({ type: "build-token-list" });
|
|
requestHandleTokenRequest(val.id, true)
|
|
});
|
|
$("#tok_deny_acc").off().on('click', function () {
|
|
requestHandleTokenRequest(val.id, false)
|
|
});
|
|
});
|
|
|
|
$(window.hyperion).one("cmd-authorize-getTokenList", function (event) {
|
|
tokenList = event.response.info;
|
|
requestServerInfo();
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-sysinfo", function (event) {
|
|
requestServerInfo();
|
|
window.sysInfo = event.response.info;
|
|
|
|
window.currentVersion = window.sysInfo.hyperion.version;
|
|
window.currentChannel = window.sysInfo.hyperion.channel;
|
|
window.readOnlyMode = window.sysInfo.hyperion.readOnlyMode;
|
|
});
|
|
|
|
$(window.hyperion).one("cmd-config-getschema", function (event) {
|
|
window.serverSchema = event.response.info;
|
|
requestServerConfig();
|
|
requestTokenInfo();
|
|
requestGetPendingTokenRequests();
|
|
|
|
window.schema = window.serverSchema.properties;
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-config-getconfig", function (event) {
|
|
window.serverConfig = event.response.info;
|
|
requestSysInfo();
|
|
|
|
window.showOptHelp = window.serverConfig.general.showOptHelp;
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-config-setconfig", function (event) {
|
|
if (event.response.success === true) {
|
|
showNotification('success', $.i18n('dashboard_alert_message_confsave_success'), $.i18n('dashboard_alert_message_confsave_success_t'))
|
|
}
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-authorize-login", function (event) {
|
|
$("#main-nav").removeAttr('style')
|
|
$("#top-navbar").removeAttr('style')
|
|
|
|
if (window.defaultPasswordIsSet === true && getStorage("suppressDefaultPwWarning") !== "true") {
|
|
var supprPwWarnCheckbox = '<div class="text-right">' + $.i18n('dashboard_message_do_not_show_again')
|
|
+ ' <input id="chk_suppressDefaultPw" type="checkbox" onChange="suppressDefaultPwWarning()"> </div>'
|
|
showNotification('warning', $.i18n('dashboard_message_default_password'), $.i18n('dashboard_message_default_password_t'), '<a style="cursor:pointer" onClick="changePassword()">'
|
|
+ $.i18n('InfoDialog_changePassword_title') + '</a>' + supprPwWarnCheckbox)
|
|
}
|
|
else
|
|
//if logged on and pw != default show option to lock ui
|
|
$("#btn_lock_ui").removeAttr('style')
|
|
|
|
if (event.response.hasOwnProperty('info'))
|
|
setStorage("loginToken", event.response.info.token, true);
|
|
|
|
requestServerConfigSchema();
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-authorize-newPassword", function (event) {
|
|
if (event.response.success === true) {
|
|
showInfoDialog("success", $.i18n('InfoDialog_changePassword_success'));
|
|
// not necessarily true, but better than nothing
|
|
window.defaultPasswordIsSet = false;
|
|
}
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-authorize-newPasswordRequired", function (event) {
|
|
var loginToken = getStorage("loginToken", true)
|
|
|
|
if (event.response.info.newPasswordRequired == true) {
|
|
window.defaultPasswordIsSet = true;
|
|
|
|
if (loginToken)
|
|
requestTokenAuthorization(loginToken)
|
|
else
|
|
requestAuthorization('hyperion');
|
|
}
|
|
else {
|
|
$("#main-nav").attr('style', 'display:none')
|
|
$("#top-navbar").attr('style', 'display:none')
|
|
|
|
if (loginToken)
|
|
requestTokenAuthorization(loginToken)
|
|
else
|
|
loadContentTo("#page-content", "login")
|
|
}
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-authorize-adminRequired", function (event) {
|
|
//Check if a admin login is required.
|
|
//If yes: check if default pw is set. If no: go ahead to get server config and render page
|
|
if (event.response.info.adminRequired === true)
|
|
requestRequiresDefaultPasswortChange();
|
|
else
|
|
requestServerConfigSchema();
|
|
});
|
|
|
|
$(window.hyperion).on("error", function (event) {
|
|
//If we are getting an error "No Authorization" back with a set loginToken we will forward to new Login (Token is expired.
|
|
//e.g.: hyperiond was started new in the meantime)
|
|
if (event.reason == "No Authorization" && getStorage("loginToken", true)) {
|
|
removeStorage("loginToken", true);
|
|
requestRequiresAdminAuth();
|
|
}
|
|
else {
|
|
showInfoDialog("error", "Error", event.reason);
|
|
}
|
|
});
|
|
|
|
$(window.hyperion).on("open", function (event) {
|
|
requestRequiresAdminAuth();
|
|
});
|
|
|
|
$(window.hyperion).one("ready", function (event) {
|
|
loadContent();
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-adjustment-update", function (event) {
|
|
window.serverInfo.adjustment = event.response.data
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-videomode-update", function (event) {
|
|
window.serverInfo.videomode = event.response.data.videomode
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-components-update", function (event) {
|
|
let obj = event.response.data
|
|
|
|
// notfication in index
|
|
if (obj.name == "ALL") {
|
|
if (obj.enabled)
|
|
$("#hyperion_disabled_notify").fadeOut("fast");
|
|
else
|
|
$("#hyperion_disabled_notify").fadeIn("fast");
|
|
}
|
|
|
|
window.comps.forEach((entry, index) => {
|
|
if (entry.name === obj.name) {
|
|
window.comps[index] = obj;
|
|
}
|
|
});
|
|
// notify the update
|
|
$(window.hyperion).trigger("components-updated", event.response.data);
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-instance-update", function (event) {
|
|
window.serverInfo.instance = event.response.data
|
|
var avail = event.response.data;
|
|
// notify the update
|
|
$(window.hyperion).trigger("instance-updated");
|
|
|
|
// if our current instance is no longer available we are at instance 0 again.
|
|
var isInData = false;
|
|
for (var key in avail) {
|
|
if (avail[key].instance == currentHyperionInstance && avail[key].running) {
|
|
isInData = true;
|
|
}
|
|
}
|
|
|
|
if (!isInData) {
|
|
//Delete Storage information about the last used but now stopped instance
|
|
if (getStorage('lastSelectedInstance', false))
|
|
removeStorage('lastSelectedInstance', false)
|
|
|
|
currentHyperionInstance = 0;
|
|
currentHyperionInstanceName = getInstanceNameByIndex(0);
|
|
requestServerConfig();
|
|
setTimeout(requestServerInfo, 100)
|
|
setTimeout(requestTokenInfo, 200)
|
|
setTimeout(loadContent, 300, undefined, true)
|
|
}
|
|
|
|
// determine button visibility
|
|
var running = serverInfo.instance.filter(entry => entry.running);
|
|
if (running.length > 1)
|
|
$('#btn_hypinstanceswitch').toggle(true)
|
|
else
|
|
$('#btn_hypinstanceswitch').toggle(false)
|
|
|
|
// update listing for button
|
|
updateHyperionInstanceListing()
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-instance-switchTo", function (event) {
|
|
requestServerConfig();
|
|
setTimeout(requestServerInfo, 200)
|
|
setTimeout(requestTokenInfo, 400)
|
|
setTimeout(loadContent, 400, undefined, true)
|
|
});
|
|
|
|
$(window.hyperion).on("cmd-effects-update", function (event) {
|
|
window.serverInfo.effects = event.response.data.effects
|
|
});
|
|
|
|
$(".mnava").bind('click.menu', function (e) {
|
|
loadContent(e);
|
|
window.scrollTo(0, 0);
|
|
});
|
|
|
|
$(window).scroll(function() {
|
|
if ($(window).scrollTop() > 65)
|
|
$("#navbar_brand_logo").css("display", "none");
|
|
else
|
|
$("#navbar_brand_logo").css("display", "");
|
|
});
|
|
|
|
$('#side-menu li a, #side-menu li ul li a').click(function() {
|
|
$('#side-menu').find('.active').toggleClass('inactive'); // find all active classes and set inactive;
|
|
$(this).addClass('active');
|
|
});
|
|
});
|
|
|
|
function suppressDefaultPwWarning() {
|
|
if (document.getElementById('chk_suppressDefaultPw').checked)
|
|
setStorage("suppressDefaultPwWarning", "true");
|
|
else
|
|
setStorage("suppressDefaultPwWarning", "false");
|
|
}
|
|
|
|
$(function () {
|
|
var sidebar = $('#side-menu'); // cache sidebar to a variable for performance
|
|
sidebar.delegate('a.inactive', 'click', function () {
|
|
sidebar.find('.active').toggleClass('active inactive');
|
|
$(this).toggleClass('active inactive');
|
|
});
|
|
});
|
|
|
|
// hotfix body padding when bs modals overlap
|
|
$(document.body).on('hide.bs.modal,hidden.bs.modal', function () {
|
|
$('body').css('padding-right', '0');
|
|
});
|
|
|
|
//Dark Mode
|
|
$("#btn_darkmode").off().on("click", function (e) {
|
|
if (getStorage("darkMode", false) != "on") {
|
|
handleDarkMode();
|
|
setStorage("darkModeOverwrite", true, true);
|
|
}
|
|
else {
|
|
setStorage("darkMode", "off", false);
|
|
setStorage("darkModeOverwrite", true, true);
|
|
location.reload();
|
|
}
|
|
});
|
|
|
|
// Menuitem toggle;
|
|
function SwitchToMenuItem(target, item) {
|
|
document.getElementById(target).click(); // Get <a href menu item;
|
|
let sidebar = $('#side-menu'); // Get sidebar menu;
|
|
sidebar.find('.active').toggleClass('inactive'); // find all active classes and set inactive;
|
|
sidebar.find('.in').removeClass("in"); // Find all collapsed menu items and close it by remove "in" class;
|
|
$('#' + target).removeClass('inactive'); // Remove inactive state by classname;
|
|
$('#' + target).addClass('active'); // Add active state by classname;
|
|
let cl_object = $('#' + target).closest('ul'); // Find closest ul sidemenu header;
|
|
cl_object.addClass('in'); // Add class "in" to expand header in sidebar menu;
|
|
if (item) { // Jump to div "item" if available. Time limit 3 seconds
|
|
function scrollTo(counter) {
|
|
if(counter < 30) {
|
|
setTimeout(function() {
|
|
counter++;
|
|
if ($('#' + item).length)
|
|
$('#' + item)[0].scrollIntoView();
|
|
else
|
|
scrollTo(counter);
|
|
}, 100);
|
|
}
|
|
}
|
|
|
|
scrollTo(0);
|
|
}
|
|
};
|
|
|