Merge branch 'ent-9662-second-round' into 'develop'

Ent 9662 second round

See merge request artica/pandorafms!5628
This commit is contained in:
daniel 2023-03-24 13:11:35 +00:00
commit d95aef3778
5 changed files with 78 additions and 95 deletions

View File

@ -367,69 +367,65 @@ $(document).ready (function () {
$("#button-getsize").click(function(event){ $("#button-getsize").click(function(event){
event.preventDefault(); event.preventDefault();
if ($('#imagen').attr('src') != '') { if ($('#imagen').attr('src') != '') {
if (parseInt($('#imagen').width()) < 1024){ if (parseInt($('#imagen').width()) < 1024){
alert('Default width is '+$('#imagen').width()+'px, smaller than minimum -> 1024px'); alert('Default width is '+$('#imagen').width()+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024'); $('input[name=width]').val('1024');
$('#preimagew').html(1024); $('#preimagew').html(1024);
} else{
$('input[name=width]').val($('#imagen').width());
$('#preimagew').html($('#imagen').width());
}
if (parseInt($('#imagen').height()) < 768){
alert('Default height is '+$('#imagen').height()+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
} else{
$('input[name=height]').val($('#imagen').height());
$('#preimageh').html($('#imagen').height());
}
} else {
original_image=new Image();
url_hack_metaconsole = metaconsole_url();
original_image.src= url_hack_metaconsole + 'images/console/background/'+$('#background').val();
if (parseInt(original_image.width) < 1024){
alert('Default width is '+original_image.width+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
$('#preimagew').html(1024);
} else {
$('input[name=width]').val(original_image.height);
$('#preimagew').html(original_image.height);
}
if (parseInt(original_image.height) < 768){
alert('Default height is '+original_image.height+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
} else {
$('input[name=height]').val(original_image.height);
$('#preimageh').html(original_image.height);
}
} }
else{
$('input[name=width]').val($('#imagen').width());
$('#preimagew').html($('#imagen').width());
}
if (parseInt($('#imagen').height()) < 768){
alert('Default height is '+$('#imagen').height()+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
}
else{
$('input[name=height]').val($('#imagen').height());
$('#preimageh').html($('#imagen').height());
}
}
else{
original_image=new Image();
url_hack_metaconsole = metaconsole_url();
original_image.src= url_hack_metaconsole + 'images/console/background/'+$('#background').val();
if (parseInt(original_image.width) < 1024){
alert('Default width is '+original_image.width+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
$('#preimagew').html(1024);
}
else{
$('input[name=width]').val(original_image.height);
$('#preimagew').html(original_image.height);
}
if (parseInt(original_image.height) < 768){
alert('Default height is '+original_image.height+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
}
else{
$('input[name=height]').val(original_image.height);
$('#preimageh').html(original_image.height);
}
}
}); });
$( "input[type=submit]" ).click(function( event ) { $( "button[type=submit]" ).click(function( event ) {
if (parseInt($('input[name=width]').val()) < 1024){ console.log('aaaaaaaaaaa');
alert('Default width is '+$('input[name=width]').val()+'px, smaller than minimum -> 1024px'); if (parseInt($('input[name=width]').val()) < 1024){
$('input[name=width]').val('1024'); alert('Default width is '+$('input[name=width]').val()+'px, smaller than minimum -> 1024px');
$('#preimagew').html('1024'); $('input[name=width]').val('1024');
var x = 1; $('#preimagew').html('1024');
} var x = 1;
}
if (parseInt($('input[name=height]').val()) < 768){ if (parseInt($('input[name=height]').val()) < 768){
alert('Default height is '+$('input[name=height]').val()+'px, smaller than minimum -> 768px'); alert('Default height is '+$('input[name=height]').val()+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768'); $('input[name=height]').val('768');
$('#preimageh').html('768'); $('#preimageh').html('768');
var y = 1; var y = 1;
} }
if (x || y){
return false;
}
if (x || y){
return false;
}
}); });
//Preload image size and activate auto image size changer when user click over a image in the selector //Preload image size and activate auto image size changer when user click over a image in the selector

View File

@ -784,7 +784,7 @@ if (isset($config['vc_refr']) and $config['vc_refr'] != 0) {
$view_refresh = '300'; $view_refresh = '300';
} }
if (!defined('METACONSOLE')) { if (is_metaconsole() === false) {
$url_base = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&action='; $url_base = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&action=';
$url_view = 'index.php?sec=network&sec2=operation/visual_console/render_view&id='.$idVisualConsole.'&refr='.$view_refresh; $url_view = 'index.php?sec=network&sec2=operation/visual_console/render_view&id='.$idVisualConsole.'&refr='.$view_refresh;
} else { } else {
@ -841,7 +841,7 @@ $buttons['view'] = [
'text' => '<a href="'.$url_view.'">'.html_print_image('images/enable.svg', true, ['title' => __('View'), 'class' => 'main_menu_icon invert_filter']).'</a>', 'text' => '<a href="'.$url_view.'">'.html_print_image('images/enable.svg', true, ['title' => __('View'), 'class' => 'main_menu_icon invert_filter']).'</a>',
]; ];
if ($idVisualConsole === false) { if (empty($idVisualConsole) === true) {
$buttons = ['data' => $buttons['data']]; $buttons = ['data' => $buttons['data']];
// Show only the data tab // Show only the data tab
// If it is a fail try, reset the values // If it is a fail try, reset the values
@ -852,9 +852,8 @@ if ($idVisualConsole === false) {
$buttons[$activeTab]['active'] = true; $buttons[$activeTab]['active'] = true;
$tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : ''; $tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : '';
ui_print_standard_header( ui_print_standard_header(
$visualConsoleName, ($visualConsoleName ?? ''),
'images/visual_console.png', 'images/visual_console.png',
false, false,
$tab_builder, $tab_builder,

View File

@ -269,6 +269,7 @@
$(this).change(function() { $(this).change(function() {
var id_os = this.value; var id_os = this.value;
$("select#id_os").select2("close");
var home_url; var home_url;
if (typeof settings == "undefined") home_url = "./"; if (typeof settings == "undefined") home_url = "./";

View File

@ -230,10 +230,15 @@ if ((bool) check_acl($config['id_user'], $id_group, 'LW') === true || (bool) che
'title' => __('Standby'), 'title' => __('Standby'),
'text' => __('Standby'), 'text' => __('Standby'),
], ],
[
'title' => __('Operations'),
'text' => __('Operations'),
],
); );
$columns = array_merge( $columns = array_merge(
['standby'], ['standby'],
['force'],
$columns $columns
); );
@ -270,7 +275,11 @@ if ((bool) check_acl($config['id_user'], $id_group, 'AW') === true || (bool) che
$column_names, $column_names,
['text' => 'Module'], ['text' => 'Module'],
['text' => 'Template'], ['text' => 'Template'],
['text' => 'Operation'], [
'title' => __('Actions'),
'text' => __('Actions'),
'style' => 'min-width: 15%;',
],
['text' => 'Last fired'], ['text' => 'Last fired'],
['text' => 'Status'] ['text' => 'Status']
); );
@ -279,25 +288,12 @@ if ((bool) check_acl($config['id_user'], $id_group, 'AW') === true || (bool) che
$columns, $columns,
['agent_module_name'], ['agent_module_name'],
['template_name'], ['template_name'],
['operation'], ['actions'],
['last_fired'], ['last_fired'],
['status'] ['status']
); );
} }
if ($print_agent === true) {
array_push(
$column_names,
['text' => 'Agent']
);
$columns = array_merge(
$columns,
['agent_name']
);
}
if (is_metaconsole() === false) { if (is_metaconsole() === false) {
if ((bool) check_acl($config['id_user'], $id_group, 'LW') === true || (bool) check_acl($config['id_user'], $id_group, 'LM') === true) { if ((bool) check_acl($config['id_user'], $id_group, 'LW') === true || (bool) check_acl($config['id_user'], $id_group, 'LM') === true) {
array_unshift( array_unshift(
@ -315,22 +311,6 @@ if (is_metaconsole() === false) {
$columns $columns
); );
} }
if ((bool) check_acl($config['id_user'], $id_group, 'AW') === true || (bool) check_acl($config['id_user'], $id_group, 'LM') === true) {
array_push(
$column_names,
[
'title' => __('Actions'),
'text' => __('Actions'),
'style' => 'min-width: 15%;',
]
);
$columns = array_merge(
$columns,
['actions']
);
}
} }
if (is_metaconsole() === true) { if (is_metaconsole() === true) {

View File

@ -118,8 +118,12 @@ if ($aclRead === false && $aclWrite === false && $aclManage === false) {
// Render map. // Render map.
$options = []; $options = [];
$baseUrlList = 'index.php?sec=network&sec2=godmode/reporting/map_builder';
if (is_metaconsole() === true) {
$baseUrlList = 'index.php?sec=screen&sec2=screens/screens&action=visualmap';
}
$options['consoles_list']['text'] = '<a href="index.php?sec=network&sec2=godmode/reporting/map_builder">'.html_print_image( $options['consoles_list']['text'] = '<a href="'.$baseUrlList.'">'.html_print_image(
'images/logs@svg.svg', 'images/logs@svg.svg',
true, true,
[ [
@ -141,7 +145,10 @@ if ($aclWrite === true || $aclManage === true) {
'edit' 'edit'
); );
$baseUrl = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&'.((is_metaconsole() === true) ? 'action2' : 'action').'='.$action; $baseUrl = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&action='.$action;
if (is_metaconsole() === true) {
$baseUrl = 'index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&action2='.$action;
}
$hash = md5($config['dbpass'].$visualConsoleId.$config['id_user']); $hash = md5($config['dbpass'].$visualConsoleId.$config['id_user']);