Merge branch 'ent-8676-consolas-visuales-en-consola-movil' into 'develop'
fixed CV in console mobile #8676 See merge request artica/pandorafms!4750
This commit is contained in:
commit
458fd92955
|
@ -69,8 +69,6 @@ if (is_ajax() === true) {
|
|||
if ($groups_secondary_selected === true) {
|
||||
$groups = get_parameter('groups', []);
|
||||
$groups_selected = get_parameter('groups_selected', []);
|
||||
hd($groups, true);
|
||||
hd($groups_selected, true);
|
||||
|
||||
$user_groups = users_get_groups($config['user'], 'AR', false);
|
||||
$ret = [];
|
||||
|
|
|
@ -170,7 +170,7 @@ $table->data[2][0] = __('Background');
|
|||
$table->data[2][1] = html_print_select(
|
||||
$backgrounds_list,
|
||||
'background',
|
||||
$background,
|
||||
io_safe_output($background),
|
||||
'',
|
||||
'None',
|
||||
'None.png',
|
||||
|
|
|
@ -37,6 +37,7 @@ $ajax = true;
|
|||
$render_map = (bool) get_parameter('render_map', false);
|
||||
$graph_javascript = (bool) get_parameter('graph_javascript', false);
|
||||
$force_remote_check = (bool) get_parameter('force_remote_check', false);
|
||||
$load_css_cv = (bool) get_parameter('load_css_cv', false);
|
||||
|
||||
if ($render_map) {
|
||||
$width = (int) get_parameter('width', '400');
|
||||
|
@ -89,3 +90,12 @@ if ($force_remote_check) {
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($load_css_cv === true) {
|
||||
$uniq = get_parameter('uniq', 0);
|
||||
$ratio = get_parameter('ratio', 0);
|
||||
|
||||
$output = css_label_styles_visual_console($uniq, $ratio);
|
||||
echo $output;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -4640,12 +4640,15 @@ function ui_print_page_header(
|
|||
}
|
||||
|
||||
$buffer .= '<span>';
|
||||
$buffer .= '<span class="breadcrumbs-title">';
|
||||
if (empty($alias)) {
|
||||
$buffer .= ui_print_truncate_text($title, $numChars);
|
||||
} else {
|
||||
$buffer .= ui_print_truncate_text($alias, $numChars);
|
||||
}
|
||||
|
||||
$buffer .= '</span>';
|
||||
|
||||
if ($modal && !enterprise_installed()) {
|
||||
$buffer .= "
|
||||
<div id='".$message."' class='publienterprise right mrgn_top-2px' title='Community version'><img data-title='".__('Enterprise version not installed')."' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>
|
||||
|
|
|
@ -4538,3 +4538,53 @@ function visual_map_load_client_resources()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Labels styles visual console.
|
||||
*
|
||||
* @param string $uniq Uniq str.
|
||||
* @param integer $ratio Ratio.
|
||||
*
|
||||
* @return string Css output.
|
||||
*/
|
||||
function css_label_styles_visual_console($uniq, $ratio=1)
|
||||
{
|
||||
global $config;
|
||||
$output = '';
|
||||
// Horrible trick! due to the use of tinyMCE
|
||||
// it is necessary to modify specific classes of each
|
||||
// of the visual consoles.
|
||||
$output .= '.c-'.$uniq.' a {color: #3f3f3f } ';
|
||||
$output .= '.c-'.$uniq.' .label p strong span {display: inline-block !important; line-height: normal !important} ';
|
||||
$output .= '.c-'.$uniq.' *:not(.parent_graph p table tr td span) { font-size: '.(8 * $ratio).'pt; line-height:'.(8 * ($ratio)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td { padding: 0; margin: 0; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_4pt, .c-'.$uniq.' .visual_font_size_4pt * { font-size: '.(4 * $ratio).'pt !important; line-height:'.(4 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_6pt, .c-'.$uniq.' .visual_font_size_6pt * { font-size: '.(6 * $ratio).'pt !important; line-height:'.(6 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_8pt, .c-'.$uniq.' .visual_font_size_8pt * { font-size: '.(8 * $ratio).'pt !important; line-height:'.(8 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_10pt, .c-'.$uniq.' .visual_font_size_10pt * { font-size: '.(10 * $ratio).'pt !important; line-height:'.(10 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_12pt, .c-'.$uniq.' .visual_font_size_12pt * { font-size: '.(12 * $ratio).'pt !important; line-height:'.(12 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_14pt, .c-'.$uniq.' .visual_font_size_14pt * { font-size: '.(14 * $ratio).'pt !important; line-height:'.(14 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_18pt, .c-'.$uniq.' .visual_font_size_18pt * { font-size: '.(18 * $ratio).'pt !important; line-height:'.(18 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_24pt, .c-'.$uniq.' .visual_font_size_24pt * { font-size: '.(24 * $ratio).'pt !important; line-height:'.(24 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_28pt, .c-'.$uniq.' .visual_font_size_28pt * { font-size: '.(28 * $ratio).'pt !important; line-height:'.(28 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_36pt, .c-'.$uniq.' .visual_font_size_36pt * { font-size: '.(36 * $ratio).'pt !important; line-height:'.(36 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_48pt, .c-'.$uniq.' .visual_font_size_48pt * { font-size: '.(48 * $ratio).'pt !important; line-height:'.(48 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_60pt, .c-'.$uniq.' .visual_font_size_60pt * { font-size: '.(60 * $ratio).'pt !important; line-height:'.(60 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_72pt, .c-'.$uniq.' .visual_font_size_72pt * { font-size: '.(72 * $ratio).'pt !important; line-height:'.(72 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_84pt, .c-'.$uniq.' .visual_font_size_84pt * { font-size: '.(84 * $ratio).'pt !important; line-height:'.(84 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_96pt, .c-'.$uniq.' .visual_font_size_96pt * { font-size: '.(96 * $ratio).'pt !important; line-height:'.(96 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_116pt, .c-'.$uniq.' .visual_font_size_116pt * { font-size: '.(116 * $ratio).'pt !important; line-height:'.(116 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_128pt, .c-'.$uniq.' .visual_font_size_128pt * { font-size: '.(128 * $ratio).'pt !important; line-height:'.(128 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_140pt, .c-'.$uniq.' .visual_font_size_140pt * { font-size: '.(140 * $ratio).'pt !important; line-height:'.(140 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_154pt, .c-'.$uniq.' .visual_font_size_154pt * { font-size: '.(154 * $ratio).'pt !important; line-height:'.(154 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_196pt, .c-'.$uniq.' .visual_font_size_196pt * { font-size: '.(196 * $ratio).'pt !important; line-height:'.(196 * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .flot-text, .c-'.$uniq.' .flot-text * { font-size: '.(($config['font_size'] - 2) * $ratio).'pt !important; line-height:'.(($config['font_size'] - 2) * ($ratio)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .digital-clock span.time {font-size: '.(50 * $ratio).'px !important; line-height: '.(50 * $ratio).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .digital-clock span.date {font-size: '.(25 * $ratio).'px !important; line-height: '.(25 * $ratio).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .digital-clock span.timezone {font-size: '.(25 * $ratio).'px !important; line-height: '.(25 * $ratio).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .donut-graph * {font-size: '.(8 * $ratio).'px !important; line-height: '.(8 * $ratio).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .donut-graph g rect {width:'.(25 * $ratio).' !important; height: '.(15 * $ratio).' !important;}';
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
|
|
@ -1208,68 +1208,121 @@ function refresh_pagination_callback(
|
|||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function dashboardLoadVC(settings) {
|
||||
var headerMobileFix = 40;
|
||||
|
||||
var container = document.getElementById(
|
||||
"visual-console-container-" + settings.cellId
|
||||
);
|
||||
|
||||
var interval = 300 * 1000;
|
||||
|
||||
// Add the datetime when the item was received.
|
||||
var receivedAt = new Date();
|
||||
|
||||
var beforeUpdate = function(items, visualConsole, props) {
|
||||
// Add the datetime when the item was received.
|
||||
items.map(function(item) {
|
||||
item["receivedAt"] = receivedAt;
|
||||
return item;
|
||||
});
|
||||
|
||||
var beforeUpdate = function(items, visualConsole, props, size) {
|
||||
var ratio_visualconsole = props.height / props.width;
|
||||
var ratio_w = size.width / props.width;
|
||||
var ratio_h = size.height / props.height;
|
||||
|
||||
props.width = settings.size.width;
|
||||
props.height = settings.size.width * ratio_visualconsole;
|
||||
props.width = size.width;
|
||||
props.height = size.width * ratio_visualconsole;
|
||||
|
||||
if (props.height > settings.size.height) {
|
||||
props.height = settings.size.height;
|
||||
props.width = settings.size.height / ratio_visualconsole;
|
||||
var ratio = ratio_w;
|
||||
if (settings.mobile != undefined && settings.mobile === true) {
|
||||
if (props.height < props.width) {
|
||||
if (props.height > size.height) {
|
||||
ratio = ratio_h;
|
||||
props.height = size.height;
|
||||
props.width = size.height / ratio_visualconsole;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (props.height > size.height) {
|
||||
ratio = ratio_h;
|
||||
props.height = size.height;
|
||||
props.width = size.height / ratio_visualconsole;
|
||||
}
|
||||
}
|
||||
|
||||
// Update the data structure.
|
||||
visualConsole.props = props;
|
||||
// Update the items.
|
||||
visualConsole.updateElements(items);
|
||||
$.ajax({
|
||||
method: "post",
|
||||
url: settings.baseUrl + "ajax.php",
|
||||
data: {
|
||||
page: settings.page,
|
||||
load_css_cv: 1,
|
||||
uniq: settings.uniq,
|
||||
ratio: ratio
|
||||
},
|
||||
dataType: "html",
|
||||
success: function(css) {
|
||||
$("#css_cv_" + settings.uniq)
|
||||
.empty()
|
||||
.append(css);
|
||||
|
||||
// Add the datetime when the item was received.
|
||||
items.map(function(item) {
|
||||
item["receivedAt"] = receivedAt;
|
||||
return item;
|
||||
});
|
||||
|
||||
// Update the data structure.
|
||||
visualConsole.props = props;
|
||||
|
||||
// Update the items.
|
||||
visualConsole.updateElements(items);
|
||||
|
||||
//Remove spinner change VC.
|
||||
container.classList.remove("is-updating");
|
||||
var div = container.querySelector(".div-visual-console-spinner");
|
||||
|
||||
if (div !== null) {
|
||||
var parent = div.parentElement;
|
||||
if (parent !== null) {
|
||||
parent.removeChild(div);
|
||||
}
|
||||
}
|
||||
|
||||
if (settings.mobile != undefined && settings.mobile === true) {
|
||||
// Update Url.
|
||||
var regex = /(id=|id_visual_console=|id_layout=|id_visualmap=)\d+(&?)/gi;
|
||||
var replacement = "$1" + props.id + "$2";
|
||||
|
||||
var regex_hash = /(hash=)[^&]+(&?)/gi;
|
||||
var replacement_hash = "$1" + props.hash + "$2";
|
||||
|
||||
var regex_width = /(width=)[^&]+(&?)/gi;
|
||||
var replacement_width = "$1" + size.width + "$2";
|
||||
|
||||
var regex_height = /(height=)[^&]+(&?)/gi;
|
||||
var replacement_height =
|
||||
"$1" + (size.height + headerMobileFix) + "$2";
|
||||
|
||||
// Change the URL (if the browser has support).
|
||||
if ("history" in window) {
|
||||
var href = window.location.href.replace(regex, replacement);
|
||||
href = href.replace(regex_hash, replacement_hash);
|
||||
href = href.replace(regex_width, replacement_width);
|
||||
href = href.replace(regex_height, replacement_height);
|
||||
window.history.replaceState({}, document.title, href);
|
||||
}
|
||||
|
||||
container.classList.remove("cv-overflow");
|
||||
|
||||
// View title.
|
||||
var title = document.querySelector(".ui-title");
|
||||
if (title !== null) {
|
||||
title.textContent = visualConsole.props.name;
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var handleUpdate = function(prevProps, newProps) {
|
||||
if (!newProps) return;
|
||||
|
||||
//Remove spinner change VC.
|
||||
document
|
||||
.getElementById("visual-console-container" + settings.cellId)
|
||||
.classList.remove("is-updating");
|
||||
|
||||
var div = document
|
||||
.getElementById("visual-console-container" + settings.cellId)
|
||||
.querySelector(".div-visual-console-spinner");
|
||||
|
||||
if (div !== null) {
|
||||
var parent = div.parentElement;
|
||||
if (parent !== null) {
|
||||
parent.removeChild(div);
|
||||
}
|
||||
}
|
||||
|
||||
// Change the links.
|
||||
if (prevProps && prevProps.id !== newProps.id) {
|
||||
var regex = /(id=|id_visual_console=|id_layout=|id_visualmap=)\d+(&?)/gi;
|
||||
var replacement = "$1" + newProps.id + "$2";
|
||||
|
||||
// Tab links.
|
||||
var menuLinks = document.querySelectorAll("div#menu_tab a");
|
||||
if (menuLinks !== null) {
|
||||
menuLinks.forEach(function(menuLink) {
|
||||
menuLink.href = menuLink.href.replace(regex, replacement);
|
||||
});
|
||||
}
|
||||
}
|
||||
var handleUpdate = function() {
|
||||
return;
|
||||
};
|
||||
|
||||
settings.items.map(function(item) {
|
||||
|
@ -1282,18 +1335,56 @@ function dashboardLoadVC(settings) {
|
|||
return item;
|
||||
});
|
||||
|
||||
createVisualConsole(
|
||||
var visualConsoleManager = createVisualConsole(
|
||||
container,
|
||||
settings.props,
|
||||
settings.items,
|
||||
settings.baseUrl,
|
||||
300 * 1000,
|
||||
interval,
|
||||
handleUpdate,
|
||||
beforeUpdate,
|
||||
settings.size,
|
||||
settings.id_user,
|
||||
settings.hash
|
||||
settings.hash,
|
||||
settings.mobile != undefined && settings.mobile === true
|
||||
? "mobile"
|
||||
: "dashboard"
|
||||
);
|
||||
|
||||
$(window).on("orientationchange", function() {
|
||||
$(container).width($(window).height());
|
||||
$(container).height($(window).width() - headerMobileFix);
|
||||
//Remove spinner change VC.
|
||||
container.classList.remove("is-updating");
|
||||
container.classList.remove("cv-overflow");
|
||||
|
||||
var div = container.querySelector(".div-visual-console-spinner");
|
||||
|
||||
if (div !== null) {
|
||||
var parent = div.parentElement;
|
||||
if (parent !== null) {
|
||||
parent.removeChild(div);
|
||||
}
|
||||
}
|
||||
|
||||
container.classList.add("is-updating");
|
||||
container.classList.add("cv-overflow");
|
||||
const divParent = document.createElement("div");
|
||||
divParent.className = "div-visual-console-spinner";
|
||||
|
||||
const divSpinner = document.createElement("div");
|
||||
divSpinner.className = "visual-console-spinner";
|
||||
|
||||
divParent.appendChild(divSpinner);
|
||||
container.appendChild(divParent);
|
||||
|
||||
var dimensions = {
|
||||
width: $(window).height(),
|
||||
height: $(window).width() - 40
|
||||
};
|
||||
|
||||
visualConsoleManager.changeDimensionsVc(dimensions, interval);
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
|
|
@ -33,7 +33,8 @@ function createVisualConsole(
|
|||
beforeUpdate,
|
||||
size,
|
||||
id_user,
|
||||
hash
|
||||
hash,
|
||||
mode = ""
|
||||
) {
|
||||
if (container == null || props == null || items == null) return null;
|
||||
if (baseUrl == null) baseUrl = "";
|
||||
|
@ -41,9 +42,18 @@ function createVisualConsole(
|
|||
var visualConsole = null;
|
||||
var asyncTaskManager = new AsyncTaskManager();
|
||||
|
||||
function updateVisualConsole(visualConsoleId, updateInterval, tts) {
|
||||
function updateVisualConsole(
|
||||
visualConsoleId,
|
||||
updateInterval,
|
||||
tts,
|
||||
dimensions
|
||||
) {
|
||||
if (tts == null) tts = 0; // Time to start.
|
||||
|
||||
if (dimensions != undefined && dimensions != null && dimensions != "") {
|
||||
size = dimensions;
|
||||
}
|
||||
|
||||
asyncTaskManager.add(
|
||||
"visual-console",
|
||||
function(done) {
|
||||
|
@ -53,16 +63,13 @@ function createVisualConsole(
|
|||
size,
|
||||
id_user,
|
||||
hash,
|
||||
mode,
|
||||
function(error, data) {
|
||||
if (error) {
|
||||
//Remove spinner change VC.
|
||||
document
|
||||
.getElementById("visual-console-container")
|
||||
.classList.remove("is-updating");
|
||||
container.classList.remove("is-updating");
|
||||
|
||||
var div = document
|
||||
.getElementById("visual-console-container")
|
||||
.querySelector(".div-visual-console-spinner");
|
||||
var div = container.querySelector(".div-visual-console-spinner");
|
||||
|
||||
if (div !== null) {
|
||||
var parent = div.parentElement;
|
||||
|
@ -95,7 +102,7 @@ function createVisualConsole(
|
|||
var receivedAt = new Date();
|
||||
var prevProps = visualConsole.props;
|
||||
if (beforeUpdate) {
|
||||
beforeUpdate(items, visualConsole, props);
|
||||
beforeUpdate(items, visualConsole, props, size);
|
||||
} else {
|
||||
// Add the datetime when the item was received.
|
||||
items.map(function(item) {
|
||||
|
@ -105,6 +112,7 @@ function createVisualConsole(
|
|||
|
||||
// Update the data structure.
|
||||
visualConsole.props = props;
|
||||
|
||||
// Update the items.
|
||||
visualConsole.updateElements(items);
|
||||
}
|
||||
|
@ -460,6 +468,11 @@ function createVisualConsole(
|
|||
asyncTaskManager.cancel("visual-console-start");
|
||||
}
|
||||
},
|
||||
changeDimensionsVc: function(dimensions, interval) {
|
||||
if (dimensions != null) {
|
||||
updateVisualConsole(visualConsole.props.id, interval, null, dimensions);
|
||||
}
|
||||
},
|
||||
createItem: function(typeString) {
|
||||
var type;
|
||||
switch (typeString) {
|
||||
|
@ -673,7 +686,15 @@ function createVisualConsole(
|
|||
* @return {Object} Cancellable. Object which include and .abort([statusText]) function.
|
||||
*/
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function loadVisualConsoleData(baseUrl, vcId, size, id_user, hash, callback) {
|
||||
function loadVisualConsoleData(
|
||||
baseUrl,
|
||||
vcId,
|
||||
size,
|
||||
id_user,
|
||||
hash,
|
||||
mode,
|
||||
callback
|
||||
) {
|
||||
// var apiPath = baseUrl + "/include/rest-api";
|
||||
var apiPath = baseUrl + "/ajax.php";
|
||||
var vcJqXHR = null;
|
||||
|
@ -762,6 +783,7 @@ function loadVisualConsoleData(baseUrl, vcId, size, id_user, hash, callback) {
|
|||
visualConsoleId: vcId,
|
||||
id_user: typeof id_user == undefined ? id_user : null,
|
||||
auth_hash: typeof hash == undefined ? hash : null,
|
||||
mode: mode,
|
||||
widthScreen: widthScreen
|
||||
},
|
||||
"json"
|
||||
|
|
|
@ -379,23 +379,8 @@ class MapsMadeByUser extends Widget
|
|||
|
||||
$size['width'] = ($size['width'] + 30);
|
||||
|
||||
$ratio = $visualConsole->adjustToViewport($size, 'dashboard');
|
||||
$visualConsoleData = $visualConsole->toArray();
|
||||
$ratio_visualconsole = ($visualConsoleData['height'] / $visualConsoleData['width']);
|
||||
$ratio_t = ($size['width'] / $visualConsoleData['width']);
|
||||
$radio_h = ($size['height'] / $visualConsoleData['height']);
|
||||
|
||||
$visualConsoleData['width'] = $size['width'];
|
||||
$visualConsoleData['height'] = ($size['width'] * $ratio_visualconsole);
|
||||
|
||||
if ($visualConsoleData['height'] > $size['height']) {
|
||||
$ratio_t = $radio_h;
|
||||
|
||||
$visualConsoleData['height'] = $size['height'];
|
||||
$visualConsoleData['width'] = ($size['height'] / $ratio_visualconsole);
|
||||
}
|
||||
|
||||
$groupId = $visualConsoleData['groupId'];
|
||||
$visualConsoleName = $visualConsoleData['name'];
|
||||
|
||||
$uniq = uniqid();
|
||||
|
||||
|
@ -435,68 +420,16 @@ class MapsMadeByUser extends Widget
|
|||
$visualConsoleItems = VisualConsole::getItemsFromDB(
|
||||
$this->values['vcId'],
|
||||
$aclUserGroups,
|
||||
$ratio_t
|
||||
$ratio
|
||||
);
|
||||
|
||||
// Horrible trick! due to the use of tinyMCE
|
||||
// it is necessary to modify specific classes of each
|
||||
// of the visual consoles.
|
||||
$output .= '<style type="text/css">';
|
||||
// $output .= '.c-'.$uniq.', .c-'.$uniq.' *:not(.parent_graph p table tr td span) { font-size: '.(8 * $ratio_t).'pt; line-height:'.(8 * ($ratio_t) * 1.5).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item div.label > strong { font-size: '.(8 * $ratio_t).'pt; line-height:'.(8 * ($ratio_t) * 1.5).'pt;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item div.label > strong > span { font-size: '.(10 * $ratio_t).'pt;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item div.label p { overflow:initial !important; margin:0px;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item div.label img { height: 100%; width: 100%; object-fit: contain;}';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_4pt, .c-'.$uniq.' .visual_font_size_4pt * { font-size: '.(4 * $ratio_t).'pt !important; line-height:'.(4 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_6pt, .c-'.$uniq.' .visual_font_size_6pt * { font-size: '.(6 * $ratio_t).'pt !important; line-height:'.(6 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_8pt, .c-'.$uniq.' .visual_font_size_8pt * { font-size: '.(8 * $ratio_t).'pt !important; line-height:'.(8 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_10pt, .c-'.$uniq.' .visual_font_size_10pt * { font-size: '.(10 * $ratio_t).'pt !important; line-height:'.(10 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_12pt, .c-'.$uniq.' .visual_font_size_12pt * { font-size: '.(12 * $ratio_t).'pt !important; line-height:'.(12 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_14pt, .c-'.$uniq.' .visual_font_size_14pt * { font-size: '.(14 * $ratio_t).'pt !important; line-height:'.(14 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_18pt, .c-'.$uniq.' .visual_font_size_18pt * { font-size: '.(18 * $ratio_t).'pt !important; line-height:'.(18 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_24pt, .c-'.$uniq.' .visual_font_size_24pt * { font-size: '.(24 * $ratio_t).'pt !important; line-height:'.(24 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_28pt, .c-'.$uniq.' .visual_font_size_28pt * { font-size: '.(28 * $ratio_t).'pt !important; line-height:'.(28 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_36pt, .c-'.$uniq.' .visual_font_size_36pt * { font-size: '.(36 * $ratio_t).'pt !important; line-height:'.(36 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_48pt, .c-'.$uniq.' .visual_font_size_48pt * { font-size: '.(48 * $ratio_t).'pt !important; line-height:'.(48 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_60pt, .c-'.$uniq.' .visual_font_size_60pt * { font-size: '.(60 * $ratio_t).'pt !important; line-height:'.(60 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_72pt, .c-'.$uniq.' .visual_font_size_72pt * { font-size: '.(72 * $ratio_t).'pt !important; line-height:'.(72 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_84pt, .c-'.$uniq.' .visual_font_size_84pt * { font-size: '.(84 * $ratio_t).'pt !important; line-height:'.(84 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_96pt, .c-'.$uniq.' .visual_font_size_96pt * { font-size: '.(96 * $ratio_t).'pt !important; line-height:'.(96 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_116pt, .c-'.$uniq.' .visual_font_size_116pt * { font-size: '.(116 * $ratio_t).'pt !important; line-height:'.(116 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_128pt, .c-'.$uniq.' .visual_font_size_128pt * { font-size: '.(128 * $ratio_t).'pt !important; line-height:'.(128 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_140pt, .c-'.$uniq.' .visual_font_size_140pt * { font-size: '.(140 * $ratio_t).'pt !important; line-height:'.(140 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_154pt, .c-'.$uniq.' .visual_font_size_154pt * { font-size: '.(154 * $ratio_t).'pt !important; line-height:'.(154 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_196pt, .c-'.$uniq.' .visual_font_size_196pt * { font-size: '.(196 * $ratio_t).'pt !important; line-height:'.(196 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td p { overflow:initial !important; margin:0px; font-size: '.(10 * $ratio_t).'pt !important; line-height:'.(10 * $ratio_t * 1.5).'pt !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span { font-size: '.(10 * $ratio_t).'pt !important; line-height:'.(10 * $ratio_t * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_4pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_4pt * { font-size: '.(4 * $ratio_t).'pt !important; line-height:'.(4 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_6pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_6pt * { font-size: '.(6 * $ratio_t).'pt !important; line-height:'.(6 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_8pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_8pt * { font-size: '.(8 * $ratio_t).'pt !important; line-height:'.(8 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_10pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_10pt * { font-size: '.(10 * $ratio_t).'pt !important; line-height:'.(10 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_12pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_12pt * { font-size: '.(12 * $ratio_t).'pt !important; line-height:'.(12 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_14pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_14pt * { font-size: '.(14 * $ratio_t).'pt !important; line-height:'.(14 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_18pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_18pt * { font-size: '.(18 * $ratio_t).'pt !important; line-height:'.(18 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_24pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_24pt * { font-size: '.(24 * $ratio_t).'pt !important; line-height:'.(24 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_28pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_28pt * { font-size: '.(28 * $ratio_t).'pt !important; line-height:'.(28 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_36pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_36pt * { font-size: '.(36 * $ratio_t).'pt !important; line-height:'.(36 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_48pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_48pt * { font-size: '.(48 * $ratio_t).'pt !important; line-height:'.(48 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_60pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_60pt * { font-size: '.(60 * $ratio_t).'pt !important; line-height:'.(60 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_72pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_72pt * { font-size: '.(72 * $ratio_t).'pt !important; line-height:'.(72 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_84pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_84pt * { font-size: '.(84 * $ratio_t).'pt !important; line-height:'.(84 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_96pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_96pt * { font-size: '.(96 * $ratio_t).'pt !important; line-height:'.(96 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_116pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_116pt * { font-size: '.(116 * $ratio_t).'pt !important; line-height:'.(116 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_128pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_128pt * { font-size: '.(128 * $ratio_t).'pt !important; line-height:'.(128 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_140pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_140pt * { font-size: '.(140 * $ratio_t).'pt !important; line-height:'.(140 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_154pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_154pt * { font-size: '.(154 * $ratio_t).'pt !important; line-height:'.(154 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_196pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_196pt * { font-size: '.(196 * $ratio_t).'pt !important; line-height:'.(196 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .flot-text, .c-'.$uniq.' .flot-text * { font-size: '.(8 * $ratio_t).'pt !important; line-height:'.(8 * ($ratio_t)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .donut-graph * {font-size: '.(8 * $ratio_t).'px !important; line-height: '.(8 * $ratio_t).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .donut-graph g rect {width:'.(25 * $ratio_t).' !important; height: '.(15 * $ratio_t).' !important;}';
|
||||
$output .= '<style id="css_cv_'.$uniq.'" type="text/css">';
|
||||
$output .= css_label_styles_visual_console($uniq, $ratio);
|
||||
$output .= '</style>';
|
||||
|
||||
$visualConsoleItems = array_reduce(
|
||||
$visualConsoleItems,
|
||||
function ($carry, $item) use ($ratio_t) {
|
||||
function ($carry, $item) {
|
||||
$carry[] = $item->toArray();
|
||||
return $carry;
|
||||
},
|
||||
|
@ -508,11 +441,13 @@ class MapsMadeByUser extends Widget
|
|||
'props' => $visualConsoleData,
|
||||
'items' => $visualConsoleItems,
|
||||
'baseUrl' => ui_get_full_url('/', false, false, false),
|
||||
'ratio' => $ratio_t,
|
||||
'ratio' => $ratio,
|
||||
'size' => $size,
|
||||
'cellId' => $this->cellId,
|
||||
'hash' => User::generatePublicHash(),
|
||||
'id_user' => $config['id_user'],
|
||||
'page' => 'include/ajax/visual_console.ajax',
|
||||
'uniq' => $uniq,
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -88,25 +88,15 @@ if ($getVisualConsole === true) {
|
|||
|
||||
$width = get_parameter('widthScreen', 0);
|
||||
|
||||
$mode = get_parameter('mode', '');
|
||||
|
||||
$ratio = 0;
|
||||
if (isset($size) === true
|
||||
&& is_array($size) === true
|
||||
&& empty($size) === false
|
||||
) {
|
||||
$ratio = $visualConsole->adjustToViewport($size, $mode);
|
||||
$visualConsoleData = $visualConsole->toArray();
|
||||
$ratio_visualconsole = ($visualConsoleData['height'] / $visualConsoleData['width']);
|
||||
$ratio = ($size['width'] / $visualConsoleData['width']);
|
||||
$radio_h = ($size['height'] / $visualConsoleData['height']);
|
||||
|
||||
$visualConsoleData['width'] = $size['width'];
|
||||
$visualConsoleData['height'] = ($size['width'] * $ratio_visualconsole);
|
||||
|
||||
if ($visualConsoleData['height'] > $size['height']) {
|
||||
$ratio = $radio_h;
|
||||
|
||||
$visualConsoleData['height'] = $size['height'];
|
||||
$visualConsoleData['width'] = ($size['height'] / $ratio_visualconsole);
|
||||
}
|
||||
}
|
||||
|
||||
$widthRatio = 0;
|
||||
|
|
|
@ -213,6 +213,61 @@ abstract class Model
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calculate ratio for mobile.
|
||||
*
|
||||
* @param array $size Size viewport.
|
||||
* @param string $mode Mode calculate (dashboard or mobile).
|
||||
*
|
||||
* @return float Ratio.
|
||||
*/
|
||||
public function adjustToViewport($size, $mode='')
|
||||
{
|
||||
$ratio_visualconsole = $this->getRatio();
|
||||
$ratio_w = ($size['width'] / $this->data['width']);
|
||||
$ratio_h = ($size['height'] / $this->data['height']);
|
||||
|
||||
$this->data['width'] = $size['width'];
|
||||
$this->data['height'] = ($size['width'] * $ratio_visualconsole);
|
||||
|
||||
$ratio = $ratio_w;
|
||||
if ($mode === 'mobile') {
|
||||
if ($this->data['height'] < $this->data['width']) {
|
||||
if ($this->data['height'] > $size['height']) {
|
||||
$ratio = $ratio_h;
|
||||
$this->data['height'] = $size['height'];
|
||||
$this->data['width'] = ($size['height'] / $ratio_visualconsole);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($this->data['height'] > $size['height']) {
|
||||
$ratio = $ratio_h;
|
||||
$this->data['height'] = $size['height'];
|
||||
$this->data['width'] = ($size['height'] / $ratio_visualconsole);
|
||||
}
|
||||
}
|
||||
|
||||
return $ratio;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calculate ratio
|
||||
*
|
||||
* @return float Ratio.
|
||||
*/
|
||||
public function getRatio()
|
||||
{
|
||||
if (isset($this->data['width']) === false
|
||||
|| empty($this->data['width']) === true
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ($this->data['height'] / $this->data['width']);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* -------------
|
||||
* - UTILITIES -
|
||||
|
|
|
@ -1197,7 +1197,12 @@ class Item extends CachedModel
|
|||
'operation/visual_console/view',
|
||||
['id' => $vcId],
|
||||
// No autologin from the public view.
|
||||
!$config['public_view']
|
||||
!$config['public_view'],
|
||||
$mobile_navigation,
|
||||
[
|
||||
'page' => 'visualmap',
|
||||
'id' => $vcId,
|
||||
]
|
||||
);
|
||||
} catch (\Throwable $ignored) {
|
||||
return null;
|
||||
|
@ -1244,15 +1249,15 @@ class Item extends CachedModel
|
|||
'sec2' => 'operation/agentes/status_monitor',
|
||||
'id_module' => $moduleId,
|
||||
];
|
||||
}
|
||||
|
||||
if ($mobile_navigation === true) {
|
||||
return $mobileUrl.'?'.http_build_query(
|
||||
[
|
||||
'page' => 'module_graph',
|
||||
'id' => $moduleId,
|
||||
]
|
||||
);
|
||||
if ($mobile_navigation === true) {
|
||||
return $mobileUrl.'?'.http_build_query(
|
||||
[
|
||||
'page' => 'module_graph',
|
||||
'id' => $moduleId,
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $baseUrl.'?'.http_build_query($queryParams);
|
||||
|
@ -1308,7 +1313,12 @@ class Item extends CachedModel
|
|||
'operation/agentes/status_monitor',
|
||||
['id_module' => $moduleId],
|
||||
// No autologin from the public view.
|
||||
!$config['public_view']
|
||||
!$config['public_view'],
|
||||
$mobile_navigation,
|
||||
[
|
||||
'id' => $moduleId,
|
||||
'page' => 'module_graph',
|
||||
]
|
||||
);
|
||||
}
|
||||
} catch (\Throwable $ignored) {
|
||||
|
@ -1368,7 +1378,12 @@ class Item extends CachedModel
|
|||
'operation/agentes/ver_agente',
|
||||
['id_agente' => $agentId],
|
||||
// No autologin from the public view.
|
||||
!$config['public_view']
|
||||
!$config['public_view'],
|
||||
$mobile_navigation,
|
||||
[
|
||||
'id' => $agentId,
|
||||
'page' => 'agent',
|
||||
]
|
||||
);
|
||||
} catch (\Throwable $ignored) {
|
||||
return null;
|
||||
|
|
|
@ -562,12 +562,12 @@ div#main_pure {
|
|||
}
|
||||
|
||||
/* Mobile trick */
|
||||
.ui-mobile-viewport.ui-overlay-c > #main_page > .ui-content {
|
||||
#main_page > .ui-content {
|
||||
overflow: visible;
|
||||
overflow-x: visible;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
.ui-mobile-viewport.ui-overlay-c > #main_page > .ui-content div.label > p {
|
||||
#main_page > .ui-content div.label > p {
|
||||
margin: 0;
|
||||
}
|
||||
|
|
|
@ -458,6 +458,312 @@ div.label strong span {
|
|||
z-index: 999;
|
||||
}
|
||||
|
||||
/*.termframe{
|
||||
background-color: #82b92e;
|
||||
}*/
|
||||
.visual_font_size_4pt,
|
||||
.visual_font_size_4pt > em,
|
||||
.visual_font_size_4pt > strong,
|
||||
.visual_font_size_4pt > strong > span,
|
||||
.visual_font_size_4pt > span,
|
||||
.visual_font_size_4pt > strong > em,
|
||||
.visual_font_size_4pt > em > strong,
|
||||
.visual_font_size_4pt em span,
|
||||
.visual_font_size_4pt span em {
|
||||
font-size: 4pt;
|
||||
line-height: 4pt;
|
||||
}
|
||||
.visual_font_size_6pt,
|
||||
.visual_font_size_6pt > em,
|
||||
.visual_font_size_6pt > strong,
|
||||
.visual_font_size_6pt > strong > span,
|
||||
.visual_font_size_6pt > span,
|
||||
.visual_font_size_6pt > strong > em,
|
||||
.visual_font_size_6pt > em > strong,
|
||||
.visual_font_size_6pt em span,
|
||||
.visual_font_size_6pt span em {
|
||||
font-size: 6pt;
|
||||
line-height: 6pt;
|
||||
}
|
||||
.visual_font_size_8pt,
|
||||
.visual_font_size_8pt > em,
|
||||
.visual_font_size_8pt > strong,
|
||||
.visual_font_size_8pt > strong > span,
|
||||
.visual_font_size_8pt > span,
|
||||
.visual_font_size_8pt > strong > em,
|
||||
.visual_font_size_8pt > em > strong,
|
||||
.visual_font_size_8pt em span,
|
||||
.visual_font_size_8pt span em {
|
||||
font-size: 8pt;
|
||||
line-height: 8pt;
|
||||
}
|
||||
.visual_font_size_10pt,
|
||||
.visual_font_size_10pt > em,
|
||||
.visual_font_size_10pt > strong,
|
||||
.visual_font_size_10pt > strong > span,
|
||||
.visual_font_size_10pt > span,
|
||||
.visual_font_size_10pt > strong > em,
|
||||
.visual_font_size_10pt > em > strong,
|
||||
.visual_font_size_10pt em span,
|
||||
.visual_font_size_10pt span em {
|
||||
font-size: 10pt;
|
||||
line-height: 10pt;
|
||||
}
|
||||
.visual_font_size_12pt,
|
||||
.visual_font_size_12pt > em,
|
||||
.visual_font_size_12pt > strong,
|
||||
.visual_font_size_12pt > strong > span,
|
||||
.visual_font_size_12pt > span,
|
||||
.visual_font_size_12pt > strong > em,
|
||||
.visual_font_size_12pt > em > strong,
|
||||
.visual_font_size_12pt em span,
|
||||
.visual_font_size_12pt span em {
|
||||
font-size: 12pt;
|
||||
line-height: 12pt;
|
||||
}
|
||||
.visual_font_size_14pt,
|
||||
.visual_font_size_14pt > em,
|
||||
.visual_font_size_14pt > strong,
|
||||
.visual_font_size_14pt > strong > span,
|
||||
.visual_font_size_14pt > span,
|
||||
.visual_font_size_14pt > strong > em,
|
||||
.visual_font_size_14pt > em > strong,
|
||||
.visual_font_size_14pt em span,
|
||||
.visual_font_size_14pt span em {
|
||||
font-size: 14pt;
|
||||
line-height: 14pt;
|
||||
}
|
||||
.visual_font_size_18pt,
|
||||
.visual_font_size_18pt > em,
|
||||
.visual_font_size_18pt > strong,
|
||||
.visual_font_size_18pt > strong > span,
|
||||
.visual_font_size_18pt > span,
|
||||
.visual_font_size_18pt > strong > em,
|
||||
.visual_font_size_18pt > em > strong,
|
||||
.visual_font_size_18pt em span,
|
||||
.visual_font_size_18pt span em {
|
||||
font-size: 18pt;
|
||||
line-height: 18pt;
|
||||
}
|
||||
|
||||
.visual_font_size_24pt,
|
||||
.visual_font_size_24pt > em,
|
||||
.visual_font_size_24pt > strong,
|
||||
.visual_font_size_24pt > strong > span,
|
||||
.visual_font_size_24pt > span,
|
||||
.visual_font_size_24pt > strong > em,
|
||||
.visual_font_size_24pt > em > strong,
|
||||
.visual_font_size_24pt em span,
|
||||
.visual_font_size_24pt span em {
|
||||
font-size: 24pt;
|
||||
line-height: 24pt;
|
||||
}
|
||||
.visual_font_size_28pt,
|
||||
.visual_font_size_28pt > em,
|
||||
.visual_font_size_28pt > strong,
|
||||
.visual_font_size_28pt > strong > span,
|
||||
.visual_font_size_28pt > span,
|
||||
.visual_font_size_28pt > strong > em,
|
||||
.visual_font_size_28pt > em > strong,
|
||||
.visual_font_size_28pt em span,
|
||||
.visual_font_size_28pt span em {
|
||||
font-size: 28pt;
|
||||
line-height: 28pt;
|
||||
}
|
||||
.visual_font_size_36pt,
|
||||
.visual_font_size_36pt > em,
|
||||
.visual_font_size_36pt > strong,
|
||||
.visual_font_size_36pt > strong > span,
|
||||
.visual_font_size_36pt > span,
|
||||
.visual_font_size_36pt > strong > em,
|
||||
.visual_font_size_36pt > em > strong,
|
||||
.visual_font_size_36pt em span,
|
||||
.visual_font_size_36pt span em {
|
||||
font-size: 36pt;
|
||||
line-height: 36pt;
|
||||
}
|
||||
.visual_font_size_48pt,
|
||||
.visual_font_size_48pt > em,
|
||||
.visual_font_size_48pt > strong,
|
||||
.visual_font_size_48pt > strong > span,
|
||||
.visual_font_size_48pt > span,
|
||||
.visual_font_size_48pt > strong > em,
|
||||
.visual_font_size_48pt > em > strong,
|
||||
.visual_font_size_48pt em span,
|
||||
.visual_font_size_48pt span em {
|
||||
font-size: 48pt;
|
||||
line-height: 48pt;
|
||||
}
|
||||
.visual_font_size_60pt,
|
||||
.visual_font_size_60pt > em,
|
||||
.visual_font_size_60pt > strong,
|
||||
.visual_font_size_60pt > strong > span,
|
||||
.visual_font_size_60pt > span,
|
||||
.visual_font_size_60pt > strong > em,
|
||||
.visual_font_size_60pt > em > strong,
|
||||
.visual_font_size_60pt em span,
|
||||
.visual_font_size_60pt span em {
|
||||
font-size: 60pt;
|
||||
line-height: 60pt;
|
||||
}
|
||||
.visual_font_size_72pt,
|
||||
.visual_font_size_72pt > em,
|
||||
.visual_font_size_72pt > strong,
|
||||
.visual_font_size_72pt > strong > span,
|
||||
.visual_font_size_72pt > span,
|
||||
.visual_font_size_72pt > strong > em,
|
||||
.visual_font_size_72pt > em > strong,
|
||||
.visual_font_size_72pt em span,
|
||||
.visual_font_size_72pt span em {
|
||||
font-size: 72pt;
|
||||
line-height: 72pt;
|
||||
}
|
||||
|
||||
.visual_font_size_84pt,
|
||||
.visual_font_size_84pt > em,
|
||||
.visual_font_size_84pt > strong,
|
||||
.visual_font_size_84pt > strong > span,
|
||||
.visual_font_size_84pt > span,
|
||||
.visual_font_size_84pt > strong > em,
|
||||
.visual_font_size_84pt > em > strong,
|
||||
.visual_font_size_84pt em span,
|
||||
.visual_font_size_84pt span em {
|
||||
font-size: 84pt;
|
||||
line-height: 84pt;
|
||||
}
|
||||
|
||||
.visual_font_size_96pt,
|
||||
.visual_font_size_96pt > em,
|
||||
.visual_font_size_96pt > strong,
|
||||
.visual_font_size_96pt > strong > span,
|
||||
.visual_font_size_96pt > span,
|
||||
.visual_font_size_96pt > strong > em,
|
||||
.visual_font_size_96pt > em > strong,
|
||||
.visual_font_size_96pt em span,
|
||||
.visual_font_size_96pt span em {
|
||||
font-size: 96pt;
|
||||
line-height: 96pt;
|
||||
}
|
||||
|
||||
.visual_font_size_116pt,
|
||||
.visual_font_size_116pt > em,
|
||||
.visual_font_size_116pt > strong,
|
||||
.visual_font_size_116pt > strong > span,
|
||||
.visual_font_size_116pt > span,
|
||||
.visual_font_size_116pt > strong > em,
|
||||
.visual_font_size_116pt > em > strong,
|
||||
.visual_font_size_116pt em span,
|
||||
.visual_font_size_116pt span em {
|
||||
font-size: 116pt;
|
||||
line-height: 116pt;
|
||||
}
|
||||
|
||||
.visual_font_size_128pt,
|
||||
.visual_font_size_128pt > em,
|
||||
.visual_font_size_128pt > strong,
|
||||
.visual_font_size_128pt > strong > span,
|
||||
.visual_font_size_128pt > span,
|
||||
.visual_font_size_128pt > strong > em,
|
||||
.visual_font_size_128pt > em > strong,
|
||||
.visual_font_size_128pt em span,
|
||||
.visual_font_size_128pt span em {
|
||||
font-size: 128pt;
|
||||
line-height: 128pt;
|
||||
}
|
||||
|
||||
.visual_font_size_140pt,
|
||||
.visual_font_size_140pt > em,
|
||||
.visual_font_size_140pt > strong,
|
||||
.visual_font_size_140pt > strong > span,
|
||||
.visual_font_size_140pt > span,
|
||||
.visual_font_size_140pt > strong > em,
|
||||
.visual_font_size_140pt > em > strong,
|
||||
.visual_font_size_140pt em span,
|
||||
.visual_font_size_140pt span em {
|
||||
font-size: 140pt;
|
||||
line-height: 140pt;
|
||||
}
|
||||
|
||||
.visual_font_size_154pt,
|
||||
.visual_font_size_154pt > em,
|
||||
.visual_font_size_154pt > strong,
|
||||
.visual_font_size_154pt > strong > span,
|
||||
.visual_font_size_154pt > span,
|
||||
.visual_font_size_154pt > strong > em,
|
||||
.visual_font_size_154pt > em > strong,
|
||||
.visual_font_size_154pt em span,
|
||||
.visual_font_size_154pt span em {
|
||||
font-size: 154pt;
|
||||
line-height: 154pt;
|
||||
}
|
||||
|
||||
.visual_font_size_196pt,
|
||||
.visual_font_size_196pt > em,
|
||||
.visual_font_size_196pt > strong,
|
||||
.visual_font_size_196pt > strong > span,
|
||||
.visual_font_size_196pt > span,
|
||||
.visual_font_size_196pt > strong > em,
|
||||
.visual_font_size_196pt > em > strong,
|
||||
.visual_font_size_196pt em span,
|
||||
.visual_font_size_196pt span em {
|
||||
font-size: 196pt;
|
||||
line-height: 196pt;
|
||||
}
|
||||
|
||||
.resize_visual_font_size_8pt,
|
||||
.resize_visual_font_size_8pt > em,
|
||||
.resize_visual_font_size_8pt > strong,
|
||||
.resize_visual_font_size_8pt > strong > span,
|
||||
.resize_visual_font_size_8pt > span,
|
||||
.resize_visual_font_size_8pt > strong > em,
|
||||
.resize_visual_font_size_8pt > em > strong,
|
||||
.visual_font_size_8pt em span,
|
||||
.visual_font_size_8pt span em {
|
||||
font-size: 4pt;
|
||||
line-height: 4pt;
|
||||
}
|
||||
.resize_visual_font_size_14pt,
|
||||
.resize_visual_font_size_14pt > em,
|
||||
.resize_visual_font_size_14pt > strong,
|
||||
.resize_visual_font_size_14pt > strong > span,
|
||||
.resize_visual_font_size_14pt > span,
|
||||
.resize_visual_font_size_14pt > strong > em,
|
||||
.resize_visual_font_size_14pt > em > strong,
|
||||
.visual_font_size_14pt em span,
|
||||
.visual_font_size_14pt span em {
|
||||
font-size: 7pt;
|
||||
line-height: 7pt;
|
||||
}
|
||||
.resize_visual_font_size_24pt,
|
||||
.resize_visual_font_size_24pt > em,
|
||||
.resize_visual_font_size_24pt > strong,
|
||||
.resize_visual_font_size_24pt > strong > span,
|
||||
.resize_visual_font_size_24pt > span,
|
||||
.resize_visual_font_size_24pt > strong > em,
|
||||
.resize_visual_font_size_24pt > em > strong,
|
||||
.visual_font_size_14pt em span,
|
||||
.visual_font_size_14pt span em {
|
||||
font-size: 12pt;
|
||||
line-height: 12pt;
|
||||
}
|
||||
.resize_visual_font_size_36pt,
|
||||
.resize_visual_font_size_36pt > em,
|
||||
.resize_visual_font_size_36pt > strong,
|
||||
.resize_visual_font_size_36pt > strong > span,
|
||||
.resize_visual_font_size_36pt > span,
|
||||
.resize_visual_font_size_36pt > strong > em,
|
||||
.resize_visual_font_size_36pt > em > strong,
|
||||
.visual_font_size_36pt em span,
|
||||
.visual_font_size_36pt span em {
|
||||
font-size: 18pt;
|
||||
line-height: 18pt;
|
||||
}
|
||||
.resize_visual_font_size_72pt,
|
||||
.resize_visual_font_size_72pt > em,
|
||||
.resize_visual_font_size_72pt > strong,
|
||||
.resize_visual_font_size_72pt > strong > span,
|
||||
.resize_visual_font_size_72pt > span,
|
||||
.resize_visual_font_size_72pt > strong > em,
|
||||
.resize_visual_font_size_72pt > em > strong,
|
||||
.visual_font_size_72pt em span,
|
||||
.visual_font_size_72pt span em {
|
||||
font-size: 36pt;
|
||||
line-height: 36pt;
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1396,6 +1396,7 @@ div.ui-mobile-viewport {
|
|||
overflow: visible;
|
||||
overflow-x: hidden;
|
||||
padding: 1em;
|
||||
min-height: calc(100vh - 60px);
|
||||
}
|
||||
.ui-corner-all > .ui-toolbar-header:first-child,
|
||||
.ui-corner-all > .ui-content:first-child,
|
||||
|
|
|
@ -1102,7 +1102,7 @@ li.ui-btn {
|
|||
}
|
||||
|
||||
.ui-header .ui-title {
|
||||
font-size: 18px !important;
|
||||
font-size: 14px;
|
||||
min-height: 1.1em;
|
||||
text-align: center;
|
||||
display: block;
|
||||
|
@ -1114,10 +1114,6 @@ li.ui-btn {
|
|||
outline: 0 !important;
|
||||
}
|
||||
|
||||
* {
|
||||
font-size: 18px !important;
|
||||
}
|
||||
|
||||
.event_name {
|
||||
font-size: 15px !important;
|
||||
}
|
||||
|
@ -1450,7 +1446,7 @@ div.nodata_container {
|
|||
}
|
||||
|
||||
.ui-page-active {
|
||||
padding-top: 2.8em !important;
|
||||
padding-top: 3.2em !important;
|
||||
}
|
||||
|
||||
.ui-header-fixed {
|
||||
|
@ -1497,3 +1493,15 @@ div.nodata_container {
|
|||
padding: 0;
|
||||
margin: 0.5em 0 !important;
|
||||
}
|
||||
|
||||
.div-visual-console-spinner {
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
.cv-overflow {
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.visual-console-container-dashboard a:visited {
|
||||
color: inherit !important;
|
||||
}
|
||||
|
|
|
@ -985,6 +985,30 @@ class Ui
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load VC.
|
||||
*
|
||||
* @param string $settings Json object.
|
||||
* @param integer $visualConsoleId Id.
|
||||
*
|
||||
* @return void Output script.
|
||||
*/
|
||||
public function loadVc($settings, $visualConsoleId)
|
||||
{
|
||||
$this->contentAddHtml(
|
||||
'<script type="text/javascript">
|
||||
var settings = '.$settings.';
|
||||
var fullUrl = "'.ui_get_full_url('/', false, false, false).'";
|
||||
var visualConsoleId = '.$visualConsoleId.';
|
||||
|
||||
$(document).ready(function () {
|
||||
dashboardLoadVC(settings);
|
||||
});
|
||||
</script>'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Table
|
||||
|
|
|
@ -83,22 +83,60 @@ class User
|
|||
{
|
||||
$system = System::getInstance();
|
||||
|
||||
$loginhash = $system->getRequest('loginhash', null);
|
||||
$autologin = $system->getRequest('autologin', false);
|
||||
if ($autologin) {
|
||||
if ($autologin !== false) {
|
||||
$user = $system->getRequest('user', null);
|
||||
$password = $system->getRequest('password', null);
|
||||
|
||||
$this->login($user, $password);
|
||||
} else {
|
||||
if (empty($loginhash) === false) {
|
||||
// Hash login process.
|
||||
$loginhash_data = $system->getRequest('loginhash_data', null);
|
||||
$loginhash_user = str_rot13($system->getRequest('loginhash_user', null));
|
||||
$this->login($loginhash_user, null, $loginhash_data);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->logged;
|
||||
}
|
||||
|
||||
|
||||
public function login($user=null, $password=null)
|
||||
public function login($user=null, $password=null, $loginhash_data='')
|
||||
{
|
||||
global $config;
|
||||
$system = System::getInstance();
|
||||
|
||||
if (empty($loginhash_data) === false) {
|
||||
if ($config['loginhash_pwd'] != ''
|
||||
&& $loginhash_data == md5(
|
||||
$user.io_output_password(
|
||||
$config['loginhash_pwd']
|
||||
)
|
||||
)
|
||||
) {
|
||||
$this->logged = true;
|
||||
$this->user = $user;
|
||||
$this->loginTime = time();
|
||||
$this->errorLogin = false;
|
||||
$this->saveLogin();
|
||||
} else {
|
||||
include_once 'general/login_page.php';
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_USER_REGISTRATION,
|
||||
'Loginhash failed',
|
||||
'system'
|
||||
);
|
||||
while (ob_get_length() > 0) {
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
exit('</html>');
|
||||
}
|
||||
|
||||
return $this->logged;
|
||||
}
|
||||
|
||||
if ($system->getConfig('auth', 'mysql') === 'saml') {
|
||||
if ((bool) $system->getRequest('saml', false) === true) {
|
||||
\enterprise_include_once('include/auth/saml.php');
|
||||
|
|
|
@ -170,6 +170,8 @@ switch ($action) {
|
|||
case 'visualmap':
|
||||
$visualmap = new Visualmap();
|
||||
$visualmap->ajax($parameter2);
|
||||
break;
|
||||
|
||||
case 'tactical':
|
||||
$tactical = new Tactical();
|
||||
$tactical->ajax($parameter2);
|
||||
|
|
|
@ -734,23 +734,29 @@ class Events
|
|||
// --------------Fill the SQL POST-------------------------------
|
||||
$sql_post = ' WHERE 1=1 ';
|
||||
|
||||
switch ($this->status) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
$sql_post .= ' AND estado = '.$this->status;
|
||||
break;
|
||||
if ($this->status != null) {
|
||||
switch ($this->status) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
$sql_post .= ' AND estado = '.$this->status;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
$sql_post .= ' AND (estado = 0 OR estado = 2)';
|
||||
break;
|
||||
case 3:
|
||||
$sql_post .= ' AND (estado = 0 OR estado = 2)';
|
||||
break;
|
||||
|
||||
default:
|
||||
// Not posible.
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->free_search != '') {
|
||||
$sql_post .= " AND evento LIKE '%".io_safe_input($this->free_search)."%'";
|
||||
}
|
||||
|
||||
if ($this->severity != -1) {
|
||||
if ($this->severity != null && $this->severity != -1) {
|
||||
switch ($this->severity) {
|
||||
case EVENT_CRIT_WARNING_OR_CRITICAL:
|
||||
$sql_post .= ' AND (criticity = '.EVENT_CRIT_WARNING.' OR
|
||||
|
|
|
@ -126,13 +126,6 @@ class Visualmap
|
|||
$this->id = (int) $system->getRequest('id', 0);
|
||||
$this->width = (int) $system->getRequest('width', 0);
|
||||
$this->height = (int) $system->getRequest('height', 0);
|
||||
|
||||
if ($this->width < $this->height) {
|
||||
$w = $this->width;
|
||||
$this->width = $this->height;
|
||||
$this->height = $w;
|
||||
$this->rotate = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -153,7 +146,8 @@ class Visualmap
|
|||
$ui->retrieveViewPort();
|
||||
}
|
||||
|
||||
$this->height -= 39;
|
||||
// Header.
|
||||
$this->height -= 40;
|
||||
|
||||
$this->visualmap = db_get_row(
|
||||
'tlayout',
|
||||
|
@ -211,29 +205,7 @@ class Visualmap
|
|||
*/
|
||||
public function ajax(string $parameter2='')
|
||||
{
|
||||
$system = System::getInstance();
|
||||
$this->checkVisualmapACL($this->visualmap['id_group']);
|
||||
if ((bool) $this->validAcl === false) {
|
||||
$this->show_fail_acl();
|
||||
} else {
|
||||
switch ($parameter2) {
|
||||
case 'render_map':
|
||||
$map_id = $system->getRequest('map_id', '0');
|
||||
$width = $system->getRequest('width', '400');
|
||||
$height = $system->getRequest('height', '400');
|
||||
visual_map_print_visual_map(
|
||||
$map_id,
|
||||
false,
|
||||
true,
|
||||
$width,
|
||||
$height
|
||||
);
|
||||
exit;
|
||||
|
||||
default:
|
||||
exit;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@ -307,20 +279,8 @@ class Visualmap
|
|||
'height' => $this->height,
|
||||
];
|
||||
|
||||
$ratio_t = $visualConsole->adjustToViewport($size, 'mobile');
|
||||
$visualConsoleData = $visualConsole->toArray();
|
||||
$ratio_visualconsole = ($visualConsoleData['height'] / $visualConsoleData['width']);
|
||||
$ratio_t = ($size['width'] / $visualConsoleData['width']);
|
||||
$radio_h = ($size['height'] / $visualConsoleData['height']);
|
||||
|
||||
$visualConsoleData['width'] = $size['width'];
|
||||
$visualConsoleData['height'] = ($size['width'] * $ratio_visualconsole);
|
||||
|
||||
if ($visualConsoleData['height'] > $size['height']) {
|
||||
$ratio_t = $radio_h;
|
||||
|
||||
$visualConsoleData['height'] = $size['height'];
|
||||
$visualConsoleData['width'] = ($size['height'] / $ratio_visualconsole);
|
||||
}
|
||||
|
||||
$uniq = uniqid();
|
||||
|
||||
|
@ -328,7 +288,6 @@ class Visualmap
|
|||
// Style.
|
||||
$style = 'width:'.$visualConsoleData['width'].'px;';
|
||||
$style .= 'height:'.$visualConsoleData['height'].'px;';
|
||||
$style .= 'background-size: cover;';
|
||||
|
||||
// Class.
|
||||
$class = 'visual-console-container-dashboard c-'.$uniq;
|
||||
|
@ -366,42 +325,13 @@ class Visualmap
|
|||
$ratio_t
|
||||
);
|
||||
|
||||
// Horrible trick! due to the use of tinyMCE
|
||||
// it is necessary to modify specific classes of each
|
||||
// of the visual consoles.
|
||||
$output .= '<style type="text/css">';
|
||||
$output .= '.c-'.$uniq.', .c-'.$uniq.' *:not(.parent_graph p table tr td span) { font-size: '.(8 * $ratio_t).'pt; line-height:'.(8 * ($ratio_t) * 1.5).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_4pt, .c-'.$uniq.' .visual_font_size_4pt * { font-size: '.(4 * $ratio_t).'pt; line-height:'.(4 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_6pt, .c-'.$uniq.' .visual_font_size_6pt * { font-size: '.(6 * $ratio_t).'pt; line-height:'.(6 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_8pt, .c-'.$uniq.' .visual_font_size_8pt * { font-size: '.(8 * $ratio_t).'pt; line-height:'.(8 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_10pt, .c-'.$uniq.' .visual_font_size_10pt * { font-size: '.(10 * $ratio_t).'pt; line-height:'.(10 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_12pt, .c-'.$uniq.' .visual_font_size_12pt * { font-size: '.(12 * $ratio_t).'pt; line-height:'.(12 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_14pt, .c-'.$uniq.' .visual_font_size_14pt * { font-size: '.(14 * $ratio_t).'pt; line-height:'.(14 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_18pt, .c-'.$uniq.' .visual_font_size_18pt * { font-size: '.(18 * $ratio_t).'pt; line-height:'.(18 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_24pt, .c-'.$uniq.' .visual_font_size_24pt * { font-size: '.(24 * $ratio_t).'pt; line-height:'.(24 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_28pt, .c-'.$uniq.' .visual_font_size_28pt * { font-size: '.(28 * $ratio_t).'pt; line-height:'.(28 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_36pt, .c-'.$uniq.' .visual_font_size_36pt * { font-size: '.(36 * $ratio_t).'pt; line-height:'.(36 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_48pt, .c-'.$uniq.' .visual_font_size_48pt * { font-size: '.(48 * $ratio_t).'pt; line-height:'.(48 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_60pt, .c-'.$uniq.' .visual_font_size_60pt * { font-size: '.(60 * $ratio_t).'pt; line-height:'.(60 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_72pt, .c-'.$uniq.' .visual_font_size_72pt * { font-size: '.(72 * $ratio_t).'pt; line-height:'.(72 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_84pt, .c-'.$uniq.' .visual_font_size_84pt * { font-size: '.(84 * $ratio_t).'pt; line-height:'.(84 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_96pt, .c-'.$uniq.' .visual_font_size_96pt * { font-size: '.(96 * $ratio_t).'pt; line-height:'.(96 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_116pt, .c-'.$uniq.' .visual_font_size_116pt * { font-size: '.(116 * $ratio_t).'pt; line-height:'.(116 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_128pt, .c-'.$uniq.' .visual_font_size_128pt * { font-size: '.(128 * $ratio_t).'pt; line-height:'.(128 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_140pt, .c-'.$uniq.' .visual_font_size_140pt * { font-size: '.(140 * $ratio_t).'pt; line-height:'.(140 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_154pt, .c-'.$uniq.' .visual_font_size_154pt * { font-size: '.(154 * $ratio_t).'pt; line-height:'.(154 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_196pt, .c-'.$uniq.' .visual_font_size_196pt * { font-size: '.(196 * $ratio_t).'pt; line-height:'.(196 * ($ratio_t)).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .flot-text, .c-'.$uniq.' .flot-text * { font-size: '.(8 * $ratio_t).'pt !important; line-height:'.(8 * ($ratio_t)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .digital-clock span.time {font-size: '.(50 * $ratio_t).'px !important; line-height: '.(50 * $ratio_t).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .digital-clock span.date {font-size: '.(25 * $ratio_t).'px !important; line-height: '.(25 * $ratio_t).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .digital-clock span.timezone {font-size: '.(25 * $ratio_t).'px !important; line-height: '.(25 * $ratio_t).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .donut-graph * {font-size: '.(8 * $ratio_t).'px !important; line-height: '.(8 * $ratio_t).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .donut-graph g rect {width:'.(25 * $ratio_t).' !important; height: '.(15 * $ratio_t).' !important;}';
|
||||
$output .= '<style id="css_cv_'.$uniq.'" type="text/css">';
|
||||
$output .= css_label_styles_visual_console($uniq, $ratio_t);
|
||||
$output .= '</style>';
|
||||
|
||||
$visualConsoleItems = array_reduce(
|
||||
$visualConsoleItems,
|
||||
function ($carry, $item) use ($ratio_t) {
|
||||
function ($carry, $item) {
|
||||
$carry[] = $item->toArray();
|
||||
return $carry;
|
||||
},
|
||||
|
@ -413,36 +343,18 @@ class Visualmap
|
|||
'props' => $visualConsoleData,
|
||||
'items' => $visualConsoleItems,
|
||||
'baseUrl' => ui_get_full_url('/', false, false, false),
|
||||
'page' => 'include/ajax/visual_console.ajax',
|
||||
'ratio' => $ratio_t,
|
||||
'size' => $size,
|
||||
'cellId' => $uniq,
|
||||
'uniq' => $uniq,
|
||||
'mobile' => true,
|
||||
'vcId' => $visualConsoleId,
|
||||
]
|
||||
);
|
||||
|
||||
$output .= '<script type="text/javascript">';
|
||||
$output .= '$(document).ready(function () {';
|
||||
$output .= 'dashboardLoadVC('.$settings.')';
|
||||
$output .= '});';
|
||||
if ($this->rotate === true) {
|
||||
$output .= "$('.container-center').css('transform', 'rotate(90deg)');";
|
||||
}
|
||||
|
||||
$output .= '$( window ).on( "orientationchange", function( event )';
|
||||
$output .= ' { window.location.href = "';
|
||||
$output .= ui_get_full_url(
|
||||
'/mobile/index.php?page=visualmap&id='.$visualConsoleId
|
||||
);
|
||||
$output .= '" });';
|
||||
|
||||
$output .= '</script>';
|
||||
|
||||
$ui->contentAddHtml($output);
|
||||
|
||||
// Load Visual Console Items.
|
||||
$visualConsoleItems = VisualConsole::getItemsFromDB(
|
||||
$visualConsoleId,
|
||||
$aclUserGroups
|
||||
);
|
||||
$ui->loadVc($settings, $visualConsoleId);
|
||||
|
||||
$javascript = ob_get_clean();
|
||||
$ui->contentAddHtml($javascript);
|
||||
|
|
|
@ -74,6 +74,13 @@ class Visualmaps
|
|||
*/
|
||||
private $type = 0;
|
||||
|
||||
/**
|
||||
* CV favourites.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
private $favourite = true;
|
||||
|
||||
|
||||
/**
|
||||
* Builder.
|
||||
|
@ -188,6 +195,20 @@ class Visualmaps
|
|||
$ui->showFooter(false);
|
||||
$ui->beginContent();
|
||||
$this->listVisualmapsHtml();
|
||||
|
||||
$output = '<script type="text/javascript">';
|
||||
$output .= 'function loadVisualConsole(id) {';
|
||||
$output .= ' var dimensions = "&width="+$(window).width();';
|
||||
$output .= ' dimensions += "&height="+$(window).height();';
|
||||
$output .= ' window.location.href = "';
|
||||
$output .= ui_get_full_url('/', false, false, false);
|
||||
$output .= 'mobile/index.php?page=visualmap&id="';
|
||||
$output .= '+id+dimensions;';
|
||||
$output .= '};';
|
||||
$output .= '</script>';
|
||||
|
||||
$ui->contentAddHtml($output);
|
||||
|
||||
$ui->endContent();
|
||||
$ui->showPage();
|
||||
}
|
||||
|
@ -201,9 +222,42 @@ class Visualmaps
|
|||
private function listVisualmapsHtml()
|
||||
{
|
||||
$system = System::getInstance();
|
||||
$this->favourite = (bool) $system->getRequest('favourite', true);
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$visualmaps = visual_map_get_user_layouts();
|
||||
$visualmaps = visual_map_get_user_layouts(
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
$this->favourite
|
||||
);
|
||||
|
||||
if ($this->favourite === true) {
|
||||
$ui->contentAddHtml(
|
||||
$ui->createButton(
|
||||
[
|
||||
'icon' => '',
|
||||
'pos' => 'right',
|
||||
'text' => __('All visual consoles'),
|
||||
'href' => 'index.php?page=visualmaps&favourite=0',
|
||||
'class' => '',
|
||||
]
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$ui->contentAddHtml(
|
||||
$ui->createButton(
|
||||
[
|
||||
'icon' => '',
|
||||
'pos' => 'right',
|
||||
'text' => __('Favourite visual consoles'),
|
||||
'href' => 'index.php?page=visualmaps&favourite=1',
|
||||
'class' => '',
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($visualmaps) === true) {
|
||||
$ui->contentAddHtml('<p style="color: #ff0000;">'.__('No maps defined').'</p>');
|
||||
|
@ -214,8 +268,8 @@ class Visualmaps
|
|||
$table->id = 'list_visualmaps';
|
||||
foreach ($visualmaps as $map) {
|
||||
$link = '<a class="ui-link" data-ajax="false" ';
|
||||
$link .= ' href="index.php?page=visualmap&id=';
|
||||
$link .= $map['id'].'">'.io_safe_output($map['name']).'</a>';
|
||||
$link .= ' href="#" onclick="loadVisualConsole(';
|
||||
$link .= $map['id'].')">'.io_safe_output($map['name']).'</a>';
|
||||
|
||||
$row = $link;
|
||||
$row .= ui_print_group_icon(
|
||||
|
|
|
@ -221,6 +221,12 @@ $visualConsoleItems = VisualConsole::getItemsFromDB(
|
|||
if (title !== null) {
|
||||
title.textContent = newProps.name;
|
||||
}
|
||||
|
||||
// Fullscreen Meta view title.
|
||||
var titleMeta = document.querySelector("div.vc-title-meta");
|
||||
if (titleMeta !== null) {
|
||||
titleMeta.textContent = newProps.name;
|
||||
}
|
||||
}
|
||||
|
||||
// Change the links.
|
||||
|
|
|
@ -611,7 +611,7 @@ ui_require_css_file('form');
|
|||
if (prevProps && prevProps.name != newProps.name) {
|
||||
// View title.
|
||||
var title = document.querySelector(
|
||||
"div#menu_tab_frame_view > div#menu_tab_left span"
|
||||
".breadcrumbs-title"
|
||||
);
|
||||
if (title !== null) {
|
||||
title.textContent = newProps.name;
|
||||
|
@ -621,7 +621,12 @@ ui_require_css_file('form');
|
|||
if (fullscreenTitle !== null) {
|
||||
fullscreenTitle.textContent = newProps.name;
|
||||
}
|
||||
// TODO: Change the metaconsole title.
|
||||
|
||||
// Fullscreen Meta view title.
|
||||
var fullscreenTitleMeta = document.querySelector("div.vc-title-meta");
|
||||
if (fullscreenTitleMeta !== null) {
|
||||
fullscreenTitleMeta.textContent = newProps.name;
|
||||
}
|
||||
}
|
||||
|
||||
// Change the links.
|
||||
|
|
|
@ -558,9 +558,23 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
|||
const divSpinner = document.createElement("div");
|
||||
divSpinner.className = "visual-console-spinner";
|
||||
divParent.appendChild(divSpinner);
|
||||
const containerVC = document.getElementById(
|
||||
"visual-console-container"
|
||||
);
|
||||
let path = e.composedPath();
|
||||
let containerId = "visual-console-container";
|
||||
for (let index = 0; index < path.length; index++) {
|
||||
const element = path[index] as HTMLInputElement;
|
||||
if (
|
||||
element.id != undefined &&
|
||||
element.id != null &&
|
||||
element.id != ""
|
||||
) {
|
||||
if (element.id.includes(containerId) === true) {
|
||||
containerId = element.id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const containerVC = document.getElementById(containerId);
|
||||
if (containerVC != null) {
|
||||
containerVC.classList.add("is-updating");
|
||||
containerVC.appendChild(divParent);
|
||||
|
|
Loading…
Reference in New Issue