sysmonk/templates/
session.rs

1/// Get the HTML content to render the session expired/invalid page.
2///
3/// # See Also
4///
5/// This page is served as a response when the user's `session_token` is invalid or expired.
6///
7/// # Returns
8///
9/// A `String` version of the HTML, CSS and JS content.
10pub fn get_content() -> String {
11    r###"<!DOCTYPE html>
12<html lang="en">
13<head>
14    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
15    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
16    <meta http-equiv="Pragma" content="no-cache">
17    <meta http-equiv="Expires" content="0">
18    <title>SysMonk - System Monitor - v{{ version }}</title>
19    <meta property="og:type" content="SystemMonitor">
20    <meta name="keywords" content="Rust, Monitor, actix, JavaScript, HTML, CSS">
21    <meta name="author" content="Vignesh Rao">
22    <meta content="width=device-width, initial-scale=1" name="viewport">
23    <!-- Favicon.ico and Apple Touch Icon -->
24    <link rel="icon" href="https://thevickypedia.github.io/open-source/images/logo/actix.ico">
25    <link rel="apple-touch-icon" href="https://thevickypedia.github.io/open-source/images/logo/actix.png">
26    <style>
27        /* Google fonts with a backup alternative */
28        @import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap');
29        * {
30            font-family: 'Ubuntu', 'PT Serif', sans-serif;
31        }
32        img {
33            display: block;
34            margin-left: auto;
35            margin-right: auto;
36        }
37
38        :is(h1, h2, h3, h4, h5, h6) {
39            text-align: center;
40            color: #F0F0F0;
41        }
42
43        button {
44            width: 100px;
45            margin: 0 auto;
46            display: block;
47        }
48
49        body {
50            background-color: #151515;
51        }
52
53        footer {
54            width: 100%;
55            color: #fff;
56            text-align: center;
57            align-content: center;
58            font-size: 14px;
59            font-style: italic;
60        }
61    </style>
62    <noscript>
63        <style>
64            body {
65                width: 100%;
66                height: 100%;
67                overflow: hidden;
68            }
69        </style>
70        <div style="position: fixed; text-align:center; height: 100%; width: 100%; background-color: #151515">
71            <h2 style="margin-top:5%">This page requires JavaScript
72                to be enabled.
73                <br><br>
74                Please refer <a href="https://www.enable-javascript.com/">enable-javascript</a> for how to.
75            </h2>
76            <form>
77                <button type="submit" onClick="<meta httpEquiv='refresh' content='0'>">RETRY</button>
78            </form>
79        </div>
80    </noscript>
81</head>
82<body>
83<h2 style="margin-top:5%">{{ reason }}</h2>
84<h3>Authentication doesn't last forever ¯\_(ツ)_/¯ </h3>
85<p>
86    <img src="https://thevickypedia.github.io/open-source/images/gif/shattered_fusion.gif"
87        onerror="this.src='https://vigneshrao.com/open-source/images/gif/shattered_fusion.gif'"
88        width="200" height="200" alt="Image" class="center">
89</p>
90<button style="text-align:center" onClick="window.location.href = '/';">LOGIN</button>
91<br>
92<button style="text-align:center" onClick="alert('Forgot Password?\n\nRelax and try to remember your password.');">HELP
93</button>
94<h4>Click <a href="https://vigneshrao.com/contact">HERE</a> to reach out.</h4>
95</body>
96<footer>
97    Generated by <a href="https://github.com/thevickypedia/SysMonk/releases/tag/v{{ version }}">SysMonk - v{{ version }}</a>
98</footer>
99<!-- control the behavior of the browser's navigation without triggering a full page reload -->
100<script>
101    document.addEventListener('DOMContentLoaded', function() {
102        history.pushState(null, document.title, location.href);
103        window.addEventListener('popstate', function (event) {
104            history.pushState(null, document.title, location.href);
105        });
106    });
107</script>
108</html>
109"###.to_string()
110}