Ejemplo n.º 1
0
def mobile_html_head(title, ready_code=""):
    html.mobile = True
    html.write(
        """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">"""
    )
    html.open_html()
    html.open_head()
    html.meta(content="text/html;",
              charset="utf-8",
              **{"http-equiv": "Content-Type"})
    html.meta(name="viewport", content="initial-scale=1.0")
    html.meta(name="apple-mobile-web-app-capable", content="yes")
    html.meta(name="apple-mobile-web-app-title", content="Check_MK")
    html.title(title)
    html.stylesheet(href="jquery/jquery.mobile-1.0.css")
    html.stylesheet(href="check_mk.css")
    html.stylesheet(href="status.css")
    html.stylesheet(href="mobile.css")

    if metrics.cmk_graphs_possible():
        html.stylesheet(href="graphs.css")

    html.write(
        html._render_opening_tag("link",
                                 rel="apple-touch-icon",
                                 href="images/ios_logo.png",
                                 close_tag=True))
    html.javascript_file(src='jquery/jquery-1.6.4.min.js')
    html.javascript_file(src='js/mobile.js')
    html.javascript_file(src='jquery/jquery.mobile-1.0.min.js')
    html.javascript_file(src='js/checkmk.js')

    if metrics.cmk_graphs_possible():
        html.javascript_file(src='js/graphs.js')

    # Never allow the mobile page to be opened in a frameset. Redirect top page to the current content page.
    # This will result in a full screen mobile interface page.
    html.javascript(
        '''if(top != self) { window.top.location.href = location; }''')

    html.javascript("""
      $(document).ready(function() { %s });
      $(document).ready(function() {
          $("a").click(function (event) {
            event.preventDefault();
            window.location = $(this).attr("href");
          });
      });""" % ready_code)

    html.close_head()
    html.open_body(class_="mobile")
Ejemplo n.º 2
0
def mobile_html_head(title, ready_code=""):
    html.mobile = True
    html.write(
        """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="initial-scale=1.0">
  <meta content="yes" name="apple-mobile-web-app-capable" />
  <meta name="apple-mobile-web-app-title" content="Check_MK" />
  <title>%s</title>
  <link rel="stylesheet" type="text/css" href="jquery/jquery.mobile-1.0.css">
  <link rel="stylesheet" type="text/css" href="check_mk.css">
  <link rel="stylesheet" type="text/css" href="status.css">
  <link rel="stylesheet" type="text/css" href="mobile.css">""" % title)

    if metrics.cmk_graphs_possible():
        html.write(
            '  <link rel="stylesheet" type="text/css" href="graphs.css">\n')

    html.write("""<link rel="apple-touch-icon" href="images/ios_logo.png"/>
  <script type='text/javascript' src='jquery/jquery-1.6.4.min.js'></script>
  <script type='text/javascript' src='js/mobile.js'></script>
  <script type='text/javascript' src='jquery/jquery.mobile-1.0.min.js'></script>
  <script type='text/javascript' src='js/checkmk.js'></script>\n""")

    if metrics.cmk_graphs_possible():
        html.write(
            " <script type='text/javascript' src='js/graphs.js'></script>\n")

    # Never allow the mobile page to be opened in a frameset. Redirect top page to the current content page.
    # This will result in a full screen mobile interface page.
    html.javascript('''if(top != self) {
    window.top.location.href = location;
}''')

    html.write("""<script type='text/javascript'>
      $(document).ready(function() { %s });
      $(document).ready(function() {
          $("a").click(function (event) {
            event.preventDefault();
            window.location = $(this).attr("href");
          });
      });
  </script>
</head>
<body class=mobile>
""" % (ready_code))
Ejemplo n.º 3
0
def mobile_html_head(title, ready_code=""):
    html.mobile = True
    html.write("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="initial-scale=1.0">
  <meta content="yes" name="apple-mobile-web-app-capable" />
  <meta name="apple-mobile-web-app-title" content="Check_MK" />
  <title>%s</title>
  <link rel="stylesheet" type="text/css" href="jquery/jquery.mobile-1.0.css">
  <link rel="stylesheet" type="text/css" href="check_mk.css">
  <link rel="stylesheet" type="text/css" href="status.css">
  <link rel="stylesheet" type="text/css" href="mobile.css">""" % title)

    if metrics.cmk_graphs_possible():
        html.write('  <link rel="stylesheet" type="text/css" href="graphs.css">\n')

    html.write("""<link rel="apple-touch-icon" href="images/ios_logo.png"/>
  <script type='text/javascript' src='jquery/jquery-1.6.4.min.js'></script>
  <script type='text/javascript' src='js/mobile.js'></script>
  <script type='text/javascript' src='jquery/jquery.mobile-1.0.min.js'></script>
  <script type='text/javascript' src='js/checkmk.js'></script>\n""")

    if metrics.cmk_graphs_possible():
        html.write(" <script type='text/javascript' src='js/graphs.js'></script>\n")

    # Never allow the mobile page to be opened in a frameset. Redirect top page to the current content page.
    # This will result in a full screen mobile interface page.
    html.javascript('''if(top != self) {
    window.top.location.href = location;
}''')

    html.write("""<script type='text/javascript'>
      $(document).ready(function() { %s });
      $(document).ready(function() {
          $("a").click(function (event) {
            event.preventDefault();
            window.location = $(this).attr("href");
          });
      });
  </script>
</head>
<body class=mobile>
""" % (ready_code))
Ejemplo n.º 4
0
            if config.debug:
                title = '{ ' + title + ' }'

    except Exception, e:
        if config.debug:
            raise
        return "perfometer", ("invalid data: %s" % e)

    content =  '<div class=content>%s</div>' % h
    content += '<div class=title>%s</div>' % title
    content += '<img class=glass src="images/perfometer-bg.png">'

    # pnpgraph_present: -1 means unknown (path not configured), 0: no, 1: yes
    if DisplayOptions.enabled(DisplayOptions.X) \
       and row["service_pnpgraph_present"] != 0:
        if metrics.cmk_graphs_possible():
            url = new_graphing_url(row, "service")
        else:
            url = pnp_url(row, "service")
        return "perfometer" + stale_css, ('<a href="%s">%s</a>' % (url, content))
    else:
        return "perfometer" + stale_css, content


#.
#   .--New Style--(Metric-O-Meters)----------------------------------------.
#   |            _   _                 ____  _         _                   |
#   |           | \ | | _____      __ / ___|| |_ _   _| | ___              |
#   |           |  \| |/ _ \ \ /\ / / \___ \| __| | | | |/ _ \             |
#   |           | |\  |  __/\ V  V /   ___) | |_| |_| | |  __/             |
#   |           |_| \_|\___| \_/\_/   |____/ \__|\__, |_|\___|             |
Ejemplo n.º 5
0
            if config.debug:
                title = '{ ' + title + ' }'

    except Exception, e:
        if config.debug:
            raise
        return "perfometer", ("invalid data: %s" % e)

    content =  '<div class=content>%s</div>' % h
    content += '<div class=title>%s</div>' % title
    content += '<img class=glass src="images/perfometer-bg.png">'

    # pnpgraph_present: -1 means unknown (path not configured), 0: no, 1: yes
    if 'X' in html.display_options and \
        row["service_pnpgraph_present"] != 0:
        if metrics.cmk_graphs_possible():
            url = new_graphing_url(row, "service")
        else:
            url = pnp_url(row, "service")
        return "perfometer" + stale_css, ('<a href="%s">%s</a>' % (url, content))
    else:
        return "perfometer" + stale_css, content


#.
#   .--New Style--(Metric-O-Meters)----------------------------------------.
#   |            _   _                 ____  _         _                   |
#   |           | \ | | _____      __ / ___|| |_ _   _| | ___              |
#   |           |  \| |/ _ \ \ /\ / / \___ \| __| | | | |/ _ \             |
#   |           | |\  |  __/\ V  V /   ___) | |_| |_| | |  __/             |
#   |           |_| \_|\___| \_/\_/   |____/ \__|\__, |_|\___|             |