File: map1.html

package info (click to toggle)
simplemonitor 1.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,520 kB
  • sloc: python: 8,725; sh: 258; makefile: 74; javascript: 69
file content (117 lines) | stat: -rw-r--r-- 3,744 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html lang="en" data-bs-theme="light">
  <head>
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, shrink-to-fit=no"
    />
    <link rel="shortcut icon" href="data:,">

    <title>FAIL@fake_hostname.local monitor</title>

    <script src="main.bundle.js"></script><script src="maps.bundle.js"></script>
    <meta http-equiv="refresh" content="30" />
    </head>

    <body>
      <div
        class="navbar navbar-light border-bottom border-danger"
        id="summary"
      >
      <div class="container-fluid">
        <div class="navbar-brand">SimpleMonitor</div>
        <div class="navbar-text d-none d-lg-block" id="updated">
          Updated at 2020-04-18 12:00:00+00:00 by fake_hostname.local (__VERSION__)
        </div>
        <div class="navbar-text" id="refresh_status">
          <span class="badge bg-warning d-none" id="refresh_badge"
            >OUT OF DATE</span
          >
        </div>
        <div class="navbar-text"><span class="badge bg-success">1 OK</span>  <span class="badge bg-danger">1 FAIL</span>  <span class="badge bg-secondary">1 DISABLED</span>   </div>
        </div>
      </div><div id="mapid" style="fill: 1440px; height: 960px;"></div>
      <script>
        var mymap = L.map('mapid', {
          center: [52, 1],
          zoom: 12
        });
        L.tileLayer(
          'https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
            maxZoom: 18,
            attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
          }).addTo(mymap);


L.marker([52.02,1.02], {
icon: markerIconDown,title: 'fail',
        }).addTo(mymap).bindPopup("fail (FAIL) This monitor always fails.");

L.marker([52.03,1.03], {

            icon: markerIconUp,title: 'disabled',
        }).addTo(mymap).bindPopup("disabled (DISABLED) ");

L.marker([52.01,1.01], {

            icon: markerIconUp,title: 'unnamed',
        }).addTo(mymap).bindPopup("unnamed (OK) ");
</script>
    <div class="navbar-text d-block d-lg-none" id="updatedfooter">
      Updated at 2020-04-18 12:00:00+00:00<br />by fake_hostname.local (__VERSION__)
    </div>
    <div class="container-fluid">
      <div class="text-end text-muted">
        SimpleMonitor __VERSION__
        <a
          href="https://simplemonitor.readthedocs.io/en/latest/index.html"
          target="_blank"
          >&raquo; Documentation</a
        >
        |
        <a href="https://github.com/jamesoff/simplemonitor" target="_blank"
          >&raquo; Code</a
        >
      </div>
    </div>
    <script language="javascript" type="text/javascript">

      function check_age() {
        const generated = 1587211200;
        const now = Math.floor(Date.now() / 1000);
        const diff = now - generated;
        if (diff > (30 * 2)) {
          too_old();
        }
      }

      $(function () {
        const tooltip_trigger_list = document.querySelectorAll('[data-toggle="tooltip"]');
        tooltip_trigger_list.forEach(tooltip_trigger_el => {
          new bootstrap.Tooltip(tooltip_trigger_el);
        });

        const update_props = {
          timestamp: 1587211200,
          host: "fake_hostname.local",
          version: "__VERSION__",
          updated: "2020-04-18 12:00:00+00:00",
        };

	if (document.readyState === "loading") {
          document.addEventListener('DOMContentLoaded', (event) => {
            check_age();
            update_age(update_props);
          });
        } else {
          check_age();
          update_age(update_props);
        }

        setTimeout(too_old, (30 * 2000));
        setInterval(update_age, 5000, update_props);
      });
    </script>
  </body>
</html>