-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
213 lines (206 loc) · 6.54 KB
/
index.html
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Monadic Chat Console</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
body {
display: flex;
flex-direction: column;
height: 100vh;
margin: 0;
color: #333;
background-color: #eeeeee;
}
body, input, textarea, button, pre {
font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans CJK JP", "Original Yu Gothic", "Yu Gothic", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Sans Emoji";
}
button {
color: #888;
}
.message-wrapper {
display: flex;
flex-direction: column;
height: calc(100vh - 35px); /* Subtract the height of the button group and any margins */
overflow: hidden; /* Prevents the content from overflowing */
}
#messages, #output {
overflow: auto;
margin: 0; /* Reset margins for accurate calculations */
flex-shrink: 1; /* Allows these elements to shrink if necessary */
}
.divider {
flex: 0 0 auto; /* The divider should not grow or shrink */
height: 10px;
cursor: row-resize;
}
#messages {
font-size: 13px;
padding: 5px;
margin: 10px;
margin-top: 5px;
margin-bottom: 0px;
background-color: #fff;
color: #555;
}
#messages p {
margin-top: 0.8em;
margin-bottom: 0.8em;
padding: 0;
}
#output {
font-size: 13px;
padding: 5px;
margin: 10px;
margin-top: 2px;
margin-bottom: 2px;
background-color: #DCDCDC;
}
.status-wrapper {
text-align: left;
font-size: 16px;
margin: 10px;
margin-bottom: 5px;
}
.status-wrapper .status{
font-weight: normal;
}
.button-group {
height: 35px;
margin: 10px;
}
.button-group button {
background-color: #ffc107;
color: #000;
border: none;
border-radius: 5px;
padding: 5px 10px;
margin-right: 5px;
cursor: pointer;
font-size: 14px;
}
.button-group button:hover {
background-color: #e0ac07;
}
.status.running, .status.active {
color: limegreen;
}
.status.stopped, .status.inactive {
color: orange;
}
button:disabled {
background-color: #ccc;
cursor: not-allowed;
}
button:disabled:hover {
background-color: #ccc;
}
hr {
border: 0;
height: 1px;
padding:0;
background: #777;
}
button#start, button#browser {
color: #000;
}
div#messages ul {
list-style-type: none;
margin-left: 10px;
padding: 0;
}
div#messages ul li{
line-height: 1.5;
}
div#messages i {
display: inline-block;
margin-right: 5px;
}
div#messages i.fa-copy {
cursor: pointer;
color: #777;
}
a {
color: #007bff;
text-decoration: none;
}
#status, #dockerStatus {
display: inline-block;
background-color: #555555;
padding: 2px 5px;
border-radius: 5px;
text-align: center;
margin-right: 5px;
margin-left: 5px;
font-size: 14px;
}
</style>
</head>
<body>
<div class="status-wrapper">
<span><i class="fa-solid fa-robot"></i> Monadic Chat </span>
<span id="version"></span>
<span> </span>
<span id="status" class="status"></span>
<span> <i class="fa-brands fa-docker"></i> Docker Desktop </span>
<span id="dockerStatus" class="status"></span>
</div>
<div class="message-wrapper">
<div id="messages"></div>
<div id="divider" class="divider"></div>
<pre id="output"></pre>
</div>
<div class="button-group">
<button id="start"><i class="fa-solid fa-play"></i> <span>Start</span></button>
<button id="stop" disabled><i class="fa-solid fa-stop"></i> Stop</button>
<button id="restart" disabled><i class="fa-solid fa-rotate-right"></i> Restart</button>
<button id="browser" disabled><i class="fa-solid fa-window-maximize"></i> Open Browser</button>
<button id="folder" ><i class="fas fa-folder-open"></i> Shared Folder</button>
<button id="settings" ><i class="fa-solid fa-sliders"></i> Settings</button>
<button id="exit"><i class="fa-solid fa-xmark"></i> Quit</button>
</div>
<script>
const messageWrapper = document.querySelector('.message-wrapper');
const messages = document.getElementById('messages');
const output = document.getElementById('output');
const divider = document.getElementById('divider');
let isDragging = false;
// Function to set initial heights based on a ratio
function setInitialHeights(ratio) {
const wrapperHeight = messageWrapper.clientHeight - divider.offsetHeight;
const messagesHeight = wrapperHeight * ratio;
const outputHeight = wrapperHeight - messagesHeight;
messages.style.height = `${messagesHeight}px`;
output.style.height = `${outputHeight}px`;
}
// Set the initial ratio
setInitialHeights(0.75); // Adjust this value to your preferred starting ratio
// Add the draggable functionality
divider.addEventListener('mousedown', function(e) {
isDragging = true;
e.preventDefault(); // Prevent text selection during drag
});
document.addEventListener('mousemove', function(e) {
if (!isDragging) return;
const totalHeight = messageWrapper.clientHeight - divider.offsetHeight;
const messagesHeight = e.clientY - messageWrapper.offsetTop - divider.offsetHeight / 2;
const outputHeight = totalHeight - messagesHeight;
messages.style.height = `${messagesHeight}px`;
output.style.height = `${outputHeight}px`;
});
document.addEventListener('mouseup', function(e) {
isDragging = false;
});
// Adjust the heights on window resize
window.addEventListener('resize', function() {
const currentRatio = messages.offsetHeight / (messages.offsetHeight + output.offsetHeight);
setInitialHeights(currentRatio);
});
</script>
<script src="mainScreen.js"></script>
</body>
</html>