Debian Codegraph @

src/common/fail.html

raw
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>@@message@@</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <meta name="viewport" content="width=device-width, initial-scale=1.0">
7 <style>
8 :root {
9 --pf-t--global--background--color--secondary--default: #f2f2f2;
10 --pf-v6-c-page__main-container--BackgroundColor: #ffffff;
11 --pf-v6-c-empty-state__icon--Color: #707070;
12 --pf-t--global--text--color--regular: #151515;
13 }
14 :root:where(.pf-v6-theme-dark) {
15 --pf-t--global--background--color--secondary--default: #151515;
16 --pf-v6-c-page__main-container--BackgroundColor: #292929;
17 --pf-v6-c-empty-state__icon--Color: #a3a3a3;
18 --pf-t--global--text--color--regular: #ffffff;
19 }
20 html {
21 height: 100%;
22 display: block;
23 }
24 body {
25 margin: 0;
26 font-family: "Red Hat Display", "RedHatDisplay", "Noto Sans Arabic", "Noto Sans Hebrew", "Noto Sans JP", "Noto Sans KR", "Noto Sans Malayalam", "Noto Sans SC", "Noto Sans TC", "Noto Sans Thai", Helvetica, Arial, sans-serif;
27 line-height: 1.3;
28 color: var(--pf-t--global--text--color--regular);
29 background: var(--pf-t--global--background--color--secondary--default);
30
31 }
32 img {
33 border: 0;
34 vertical-align: middle;
35 }
36 h1 {
37 font-size: 1.25rem;
38 font-weight: 500;
39 }
40 @font-face {
41 font-family: "Red Hat Display";
42 font-style: normal;
43 font-weight: 400 700;
44 src: url("fonts/RedHatDisplay/RedHatDisplayVF.woff2") format("woff2-variations");
45 font-display: fallback;
46 }
47 .blank-slate-pf {
48 text-align: center;
49 padding: 90px 120px;
50 }
51 .pf-v6-svg {
52 width: 1em;
53 height: 1em;
54 vertical-align: -0.125em;
55 font-size: 3.5rem;
56 color: var(--pf-v6-c-empty-state__icon--Color);
57 margin-block-end: 1.5rem;
58 }
59 .pf-v6-c-page__main-container {
60 border-radius: 16px;
61 background: var(--pf-v6-c-page__main-container--BackgroundColor);
62 margin-inline: 1.5rem;
63 block-size: 100%;
64 }
65 </style>
66 <script>
67 /*
68 * Copyright (C) 2022 Red Hat, Inc.
69 * SPDX-License-Identifier: LGPL-2.1-or-later
70 */
71
72 function debug(...args) {
73 if (window.debugging == "all" || window.debugging?.includes("style")) {
74 console.debug([`cockpit-dark-theme: ${document.documentElement.id}:`, ...args].join(" "));
75 }
76 }
77
78 function changeDarkThemeClass(documentElement, dark_mode) {
79 debug(`Setting cockpit theme to ${dark_mode ? "dark" : "light"}`);
80
81 if (dark_mode) {
82 documentElement.classList.add('pf-v6-theme-dark');
83 } else {
84 documentElement.classList.remove('pf-v6-theme-dark');
85 }
86 }
87
88 function _setDarkMode(_style) {
89 const style = _style || localStorage.getItem('shell:style') || 'auto';
90 let dark_mode;
91 // If a user set's an explicit theme, ignore system changes.
92 if ((window.matchMedia?.('(prefers-color-scheme: dark)').matches && style === "auto") || style === "dark") {
93 dark_mode = true;
94 } else {
95 dark_mode = false;
96 }
97 changeDarkThemeClass(document.documentElement, dark_mode);
98 }
99
100 window.addEventListener("storage", event => {
101 if (event.key === "shell:style") {
102 debug(`Storage element 'shell:style' changed from ${event.oldValue} to ${event.newValue}`);
103
104 _setDarkMode();
105 }
106 });
107
108 // When changing the theme from the shell switcher the localstorage change will not fire for the same page (aka shell)
109 // so we need to listen for the event on the window object.
110 window.addEventListener("cockpit-style", event => {
111 if (event instanceof CustomEvent) {
112 const style = event.detail.style;
113 debug(`Event received from shell with 'cockpit-style' ${style}`);
114
115 _setDarkMode(style);
116 }
117 });
118
119 window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
120 debug(`Operating system theme preference changed to ${window.matchMedia?.('(prefers-color-scheme: dark)').matches ? "dark" : "light"}`);
121 _setDarkMode();
122 });
123
124 _setDarkMode();
125 </script>
126 </head>
127 <body>
128 <div class="pf-v6-c-page__main-container">
129 <div class="blank-slate-pf">
130 <svg class="pf-v6-svg" viewBox="0 0 512 512" fill="currentColor" aria-hidden="true" role="img" width="1em" height="1em"><path d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"></path></svg>
131 <h1>@@message@@</h1>
132 </div>
133 </div>
134 </body>
135 </html>