sysmonk/templates/
error.rs

1/// Get the HTML content to render the session unauthorized page.
2///
3/// # See Also
4///
5/// This page is served as a response, when the user tries to access a page without valid authentication.
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    <title>RuStream - Self-hosted Streaming Engine - v{{ version }}</title>
16    <meta property="og:type" content="MediaStreaming">
17    <meta name="keywords" content="Python, streaming, fastapi, JavaScript, HTML, CSS">
18    <meta name="author" content="Vignesh Rao">
19    <meta content="width=device-width, initial-scale=1" name="viewport">
20    <!-- Favicon.ico and Apple Touch Icon -->
21    <link rel="icon" href="https://thevickypedia.github.io/open-source/images/logo/actix.ico">
22    <link rel="apple-touch-icon" href="https://thevickypedia.github.io/open-source/images/logo/actix.png">
23    <style>
24        /* Google fonts with a backup alternative */
25        @import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap');
26        * {
27            font-family: 'Ubuntu', 'PT Serif', sans-serif;
28        }
29
30        img {
31            display: block;
32            margin-left: auto;
33            margin-right: auto;
34        }
35
36        :is(h1, h2, h3, h4, h5, h6)
37        {
38            text-align: center;
39            color: #F0F0F0;
40        }
41
42        button {
43            width: 100px;
44            margin: 0 auto;
45            display: block;
46        }
47
48        body {
49            background-color: #151515;
50        }
51
52        footer {
53            width: 100%;
54            color: #fff;
55            text-align: center;
56            align-content: center;
57            font-size: 14px;
58            font-style: italic;
59        }
60    </style>
61    <noscript>
62        <style>
63            body {
64                width: 100%;
65                height: 100%;
66                overflow: hidden;
67            }
68        </style>
69        <div style="position: fixed; text-align:center; height: 100%; width: 100%; background-color: #151515;">
70            <h2 style="margin-top:5%">This page requires JavaScript
71                to be enabled.
72                <br><br>
73                Please refer <a href="https://www.enable-javascript.com/">enable-javascript</a> for how to.
74            </h2>
75            <form>
76                <button type="submit" onClick="<meta httpEquiv='refresh' content='0'>">RETRY</button>
77            </form>
78        </div>
79    </noscript>
80</head>
81<body>
82<h2 style="margin-top:5%">{{ title }}</h2>
83<h3>{{ description }}</h3>
84<p>
85    <img src="https://thevickypedia.github.io/open-source/images/gif/lockscape.gif"
86        onerror="this.src='https://vigneshrao.com/open-source/images/gif/lockscape.gif'"
87        width="200" height="170" alt="Image" class="center">
88</p>
89<button style="text-align:center" onClick="window.location.href = '{{ button_link }}';">{{ button_text }}</button>
90<br>
91<button style="text-align:center" onClick="alert('{{ help }}');">HELP
92</button>
93<h4>Click <a href="https://vigneshrao.com/contact">HERE</a> to reach out.</h4>
94</body>
95<footer>
96    Generated by <a href="https://github.com/thevickypedia/SysMonk/releases/tag/v{{ version }}">SysMonk - v{{ version }}</a>
97</footer>
98{% if block_navigation %}
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{% endif %}
109</html>
110"###.to_string()
111}