Spaces:
Running
Running
Update templates/index.html
Browse files- templates/index.html +126 -41
templates/index.html
CHANGED
@@ -1,69 +1,154 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en" data-theme="dark">
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>Sentinel TradeFlow
|
|
|
|
|
7 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
|
8 |
-
|
|
|
|
|
9 |
<script src="https://unpkg.com/htmx.org/dist/ext/sse.js"></script>
|
|
|
10 |
<style>
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
header { text-align: center; margin-bottom: 2rem; }
|
15 |
-
header h1 { color: var(--pico-primary); }
|
16 |
-
.card {
|
17 |
-
background-color: #0d1117;
|
18 |
-
border: 1px solid #30363d;
|
19 |
-
border-left-width: 6px;
|
20 |
-
margin-bottom: 1.5rem;
|
21 |
-
border-radius: 6px;
|
22 |
-
padding: 0;
|
23 |
-
overflow: hidden;
|
24 |
}
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
padding: 0.75rem 1.25rem;
|
30 |
-
font-weight: bold;
|
31 |
-
border-bottom: 1px solid #30363d;
|
32 |
}
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
display: block;
|
41 |
text-align: center;
|
42 |
-
|
43 |
-
|
44 |
-
border: 2px dashed #30363d;
|
45 |
-
border-radius: 6px;
|
46 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
</style>
|
48 |
</head>
|
|
|
|
|
49 |
<body hx-ext="sse">
|
|
|
50 |
<main class="container">
|
|
|
51 |
<header>
|
52 |
<h1>Sentinel TradeFlow Protocol</h1>
|
53 |
<p>Autonomous Low-Latency Signal Generation</p>
|
54 |
</header>
|
55 |
|
56 |
<article>
|
57 |
-
<header class="
|
58 |
-
<
|
59 |
-
|
|
|
60 |
</header>
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
</div>
|
66 |
</article>
|
|
|
67 |
</main>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
</body>
|
69 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en" data-theme="dark">
|
3 |
+
|
4 |
<head>
|
5 |
<meta charset="UTF-8">
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
7 |
+
<title>Sentinel TradeFlow Protocol</title>
|
8 |
+
|
9 |
+
<!-- Pico.css for modern styling -->
|
10 |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
|
11 |
+
|
12 |
+
<!-- HTMX Core and Server-Sent Events (SSE) Extension -->
|
13 |
+
<script src="https://unpkg.com/[email protected]"></script>
|
14 |
<script src="https://unpkg.com/htmx.org/dist/ext/sse.js"></script>
|
15 |
+
|
16 |
<style>
|
17 |
+
body {
|
18 |
+
background-color: #111927; /* A deep navy blue background */
|
19 |
+
color: #E5E7EB; /* A soft white for text */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
}
|
21 |
+
|
22 |
+
main.container {
|
23 |
+
max-width: 960px; /* A bit wider for a better dashboard feel */
|
24 |
+
margin: 2rem auto;
|
|
|
|
|
|
|
25 |
}
|
26 |
+
|
27 |
+
h1 {
|
28 |
+
color: #38BDF8; /* A vibrant light blue for the main title */
|
29 |
+
text-align: center;
|
30 |
+
}
|
31 |
+
|
32 |
+
h1+p {
|
|
|
33 |
text-align: center;
|
34 |
+
color: #9CA3AF; /* Muted gray for the subtitle */
|
35 |
+
margin-bottom: 3rem;
|
|
|
|
|
36 |
}
|
37 |
+
|
38 |
+
article {
|
39 |
+
background-color: #1F2937; /* A slightly lighter navy for cards */
|
40 |
+
border: 1px solid #374151; /* Subtle border */
|
41 |
+
border-radius: 0.5rem;
|
42 |
+
padding: 0; /* Remove default padding to use header/body structure */
|
43 |
+
}
|
44 |
+
|
45 |
+
article > header {
|
46 |
+
padding: 1rem 1.5rem;
|
47 |
+
border-bottom: 1px solid #374151;
|
48 |
+
font-weight: bold;
|
49 |
+
}
|
50 |
+
|
51 |
+
#signal-container {
|
52 |
+
padding: 1.5rem;
|
53 |
+
min-height: 200px; /* Give the container some initial height */
|
54 |
+
}
|
55 |
+
|
56 |
+
/* Styles for the dynamically loaded signal cards */
|
57 |
+
.card {
|
58 |
+
background-color: #374151; /* Darker card background for contrast */
|
59 |
+
border-radius: 0.375rem;
|
60 |
+
border-left-width: 5px;
|
61 |
+
border-left-style: solid;
|
62 |
+
margin-bottom: 1.5rem;
|
63 |
+
padding: 1rem 1.5rem;
|
64 |
+
}
|
65 |
+
|
66 |
+
blockquote {
|
67 |
+
margin: 0 0 1rem 0;
|
68 |
+
padding: 0;
|
69 |
+
border: none;
|
70 |
+
font-style: normal;
|
71 |
+
font-weight: 500;
|
72 |
+
}
|
73 |
+
|
74 |
+
blockquote a {
|
75 |
+
color: #E5E7EB;
|
76 |
+
text-decoration: none;
|
77 |
+
}
|
78 |
+
blockquote a:hover {
|
79 |
+
text-decoration: underline;
|
80 |
+
}
|
81 |
+
|
82 |
+
/* Color coding for impact */
|
83 |
+
.impact-low { border-left-color: #38BDF8; } /* Light Blue */
|
84 |
+
.impact-medium { border-left-color: #FBBF24; } /* Amber */
|
85 |
+
.impact-high { border-left-color: #F87171; } /* Red */
|
86 |
+
.impact-error { border-left-color: #4B5563; } /* Gray */
|
87 |
+
|
88 |
+
/* Color coding for sentiment */
|
89 |
+
.sentiment-positive { color: #34D399; } /* Green */
|
90 |
+
.sentiment-negative { color: #F87171; } /* Red */
|
91 |
+
.sentiment-neutral { color: #9CA3AF; } /* Gray */
|
92 |
+
.sentiment-error { color: #FBBF24; } /* Amber */
|
93 |
+
|
94 |
+
.status-online {
|
95 |
+
color: #34D399;
|
96 |
+
font-weight: bold;
|
97 |
+
}
|
98 |
+
|
99 |
</style>
|
100 |
</head>
|
101 |
+
|
102 |
+
<!-- Enable the HTMX SSE extension for the page -->
|
103 |
<body hx-ext="sse">
|
104 |
+
|
105 |
<main class="container">
|
106 |
+
|
107 |
<header>
|
108 |
<h1>Sentinel TradeFlow Protocol</h1>
|
109 |
<p>Autonomous Low-Latency Signal Generation</p>
|
110 |
</header>
|
111 |
|
112 |
<article>
|
113 |
+
<header class="grid">
|
114 |
+
<div><strong>Signal Stream</strong></div>
|
115 |
+
<!-- This div will be updated by our script when the SSE connection opens -->
|
116 |
+
<div id="signal-status" style="text-align: right;">Status: CONNECTING...</div>
|
117 |
</header>
|
118 |
+
|
119 |
+
<!-- This div is the target for our SSE stream. New signals will be added here. -->
|
120 |
+
<div
|
121 |
+
id="signal-container"
|
122 |
+
sse-connect="/api/signals/stream"
|
123 |
+
hx-swap="afterbegin">
|
124 |
+
<!--
|
125 |
+
sse-connect: Tells HTMX to connect to this endpoint.
|
126 |
+
hx-swap="afterbegin": Tells HTMX to prepend new messages to this div.
|
127 |
+
HTMX listens for the default 'message' event from the server.
|
128 |
+
-->
|
129 |
</div>
|
130 |
</article>
|
131 |
+
|
132 |
</main>
|
133 |
+
|
134 |
+
<!-- This small script provides better user feedback for the connection status -->
|
135 |
+
<script>
|
136 |
+
document.body.addEventListener('htmx:sseOpen', function(event) {
|
137 |
+
const statusDiv = document.getElementById('signal-status');
|
138 |
+
if (statusDiv) {
|
139 |
+
// Update the status text and color when the connection is live.
|
140 |
+
statusDiv.innerHTML = 'Status: <span class="status-online">ONLINE</span>';
|
141 |
+
}
|
142 |
+
});
|
143 |
+
|
144 |
+
document.body.addEventListener('htmx:sseError', function(event) {
|
145 |
+
const statusDiv = document.getElementById('signal-status');
|
146 |
+
if (statusDiv) {
|
147 |
+
// Let the user know if the connection fails.
|
148 |
+
statusDiv.innerHTML = 'Status: <span style="color: #F87171;">OFFLINE - Retrying...</span>';
|
149 |
+
}
|
150 |
+
});
|
151 |
+
</script>
|
152 |
+
|
153 |
</body>
|
154 |
</html>
|