Fix several issues with mobile view

This commit is contained in:
José González 2022-02-24 11:04:18 +01:00
parent f6a8fdf085
commit 64ed03784b
3 changed files with 44 additions and 28 deletions

View File

@ -2713,16 +2713,15 @@ function ui_print_status_image(
$imagepath = $path; $imagepath = $path;
} }
if ($imagepath == 'images/status_sets/default') { if ($imagepath === 'images/status_sets/default') {
$image_with_css = true; $image_with_css = true;
} }
$imagepath .= '/'.$type;
if ($image_with_css === true) { if ($image_with_css === true) {
$shape_status = get_shape_status_set($type); $shape_status = get_shape_status_set($type);
return ui_print_status_sets($type, $title, $return, $shape_status, $extra_info); return ui_print_status_sets($type, $title, $return, $shape_status, $extra_info);
} else { } else {
$imagepath .= '/'.$type;
if ($options === false) { if ($options === false) {
$options = []; $options = [];
} }
@ -2869,7 +2868,7 @@ function ui_print_status_sets(
$options = []; $options = [];
} }
if (isset($options['style'])) { if (isset($options['style']) === true) {
$options['style'] .= ' display: inline-block;'; $options['style'] .= ' display: inline-block;';
} else { } else {
$options['style'] = 'display: inline-block;'; $options['style'] = 'display: inline-block;';
@ -2879,15 +2878,17 @@ function ui_print_status_sets(
$options['style'] .= ' background: '.modules_get_color_status($status).';'; $options['style'] .= ' background: '.modules_get_color_status($status).';';
} }
if (isset($options['class'])) { $options['style'] .= 'width: 100%;';
if (isset($options['class']) === true) {
$options['class'] = $options['class']; $options['class'] = $options['class'];
} }
if ($title != '') { if (empty($title) === false) {
$options['title'] = empty($extra_info) ? $title : $title.'&#10'.$extra_info; $options['title'] = (empty($extra_info) === true) ? $title : $title.'&#10'.$extra_info;
$options['data-title'] = empty($extra_info) ? $title : $title.'<br>'.$extra_info; $options['data-title'] = (empty($extra_info) === true) ? $title : $title.'<br>'.$extra_info;
$options['data-use_title_for_force_title'] = 1; $options['data-use_title_for_force_title'] = 1;
if (isset($options['class'])) { if (isset($options['class']) === true) {
$options['class'] .= ' forced_title'; $options['class'] .= ' forced_title';
} else { } else {
$options['class'] = 'forced_title'; $options['class'] = 'forced_title';
@ -2899,15 +2900,13 @@ function ui_print_status_sets(
$output .= $k.'="'.$v.'"'; $output .= $k.'="'.$v.'"';
} }
$output .= '>'; $output .= '>&nbsp;</div>';
$output .= '</div>';
if ($return === false) { if ($return === false) {
echo $output; echo $output;
} } else {
return $output; return $output;
}
} }

View File

@ -790,12 +790,11 @@ class Ui
echo ' <title>'.$this->title."</title>\n"; echo ' <title>'.$this->title."</title>\n";
echo " <meta charset='UTF-8' />\n"; echo " <meta charset='UTF-8' />\n";
echo " <meta name='viewport' content='width=device-width, initial-scale=1'>\n"; echo " <meta name='viewport' content='width=device-width, initial-scale=1'>\n";
echo ' <link rel="icon" href="'.ui_get_full_url('/').ui_get_favicon().'" type="image/ico" />'."\n";
echo ' <link rel="shortcut icon" href="'.ui_get_full_url('/').ui_get_favicon().'" type="image/x-icon" />'."\n";
echo " <link rel='stylesheet' href='include/style/main.css' />\n"; echo " <link rel='stylesheet' href='include/style/main.css' />\n";
// echo " <link rel='stylesheet' href='include/style/jquery.mobile-1.4.5.css' />\n";
echo " <link rel='stylesheet' href='include/style/jquery.mobile-1.5.0-rc1.min.css' />\n"; echo " <link rel='stylesheet' href='include/style/jquery.mobile-1.5.0-rc1.min.css' />\n";
// echo " <script src='include/javascript/jquery.js.bakc'></script>\n";
echo " <script src='include/javascript/jquery.js'></script>\n"; echo " <script src='include/javascript/jquery.js'></script>\n";
// echo " <script src='include/javascript/jquery.mobile-1.4.5.js'></script>\n";
echo " <script src='include/javascript/jquery.mobile-1.5.0-rc1.js'></script>\n"; echo " <script src='include/javascript/jquery.mobile-1.5.0-rc1.js'></script>\n";
echo " <script src='../include/javascript/pandora.js'></script>\n"; echo " <script src='../include/javascript/pandora.js'></script>\n";
echo " <script src='../include/javascript/pandora_ui.js'></script>\n"; echo " <script src='../include/javascript/pandora_ui.js'></script>\n";

View File

@ -1,15 +1,33 @@
<?php <?php
// Pandora FMS - http://pandorafms.com // phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
// ================================================== /**
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas * Alerts list view for mobile
// Please see http://pandorafms.org for full contribution list *
// This program is free software; you can redistribute it and/or * @category Mobile
// modify it under the terms of the GNU General Public License * @package Pandora FMS
// as published by the Free Software Foundation for version 2. * @subpackage Community
// This program is distributed in the hope that it will be useful, * @version 1.0.0
// but WITHOUT ANY WARRANTY; without even the implied warranty of * @license See below
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
// GNU General Public License for more details. * ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
class Alerts class Alerts
{ {