-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
213 lines (198 loc) · 6.62 KB
/
index.html
File metadata and controls
213 lines (198 loc) · 6.62 KB
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>
<title>.:: GhzhHost Desktop APP ::.</title>
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
background-color: #f8f9fa;
height: 100vh;
display: flex;
flex-direction: column;
}
.tabs {
display: flex;
background-color: #000a20;
padding: 10px;
position: relative;
}
.tab {
padding: 10px 20px;
cursor: pointer;
border: 1px solid #00233f;
margin-right: 5px;
background-color: #00233f;
transition: all 0.3s ease;
position: relative;
flex: 1;
text-align: center;
min-width: 0;
color: #ffffff;
font-weight: 500;
}
.tab:hover {
background-color: #00547f;
border-color: #00b2e8;
}
.tab.active {
background-color: #00b2e8;
color: #000a20;
opacity: 0;
pointer-events: none;
position: absolute;
width: 0;
padding: 0;
margin: 0;
border: none;
}
.close-tab {
margin-left: 10px;
cursor: pointer;
font-weight: bold;
}
.status-indicator {
width: 10px;
height: 10px;
border-radius: 50%;
margin-right: 10px;
flex-shrink: 0;
}
.online {
background-color: #00b2e8;
}
.offline {
background-color: #ff0000;
}
.content-container {
flex: 1;
background-color: #fff;
position: relative;
}
.dialog-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 10, 32, 0.8);
z-index: 1000;
justify-content: center;
align-items: center;
}
.dialog-box {
background-color: #00233f;
border: 2px solid #00b2e8;
border-radius: 8px;
padding: 20px;
color: white;
text-align: center;
max-width: 400px;
width: 90%;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.dialog-title {
color: #00b2e8;
margin-bottom: 15px;
font-size: 1.5em;
}
.dialog-message {
margin-bottom: 20px;
line-height: 1.5;
}
.dialog-button {
background-color: #00b2e8;
color: #000a20;
border: none;
padding: 10px 20px;
border-radius: 4px;
cursor: pointer;
font-weight: bold;
transition: background-color 0.3s ease;
}
.dialog-button:hover {
background-color: #00547f;
color: white;
}
</style>
</head>
<body>
<div class="tabs" id="tabsContainer">
<div class="status-indicator" id="statusIndicator"></div>
<div class="tab active" data-url="https://ghzhost.com/" onclick="switchTab(this)">Home</div>
<div class="tab" data-url="https://mcp.ghzhost.com/" onclick="switchTab(this)">MCP</div>
<div class="tab" data-url="https://gcp.ghzhost.com/" onclick="switchTab(this)">GCP</div>
<div class="tab" data-url="https://wcp-s1br.ghzhost.com/" onclick="switchTab(this)">WCP</div>
</div>
<div class="content-container" id="contentContainer">
</div>
<div class="dialog-overlay" id="dialogOverlay">
<div class="dialog-box">
<div class="dialog-title">Sem Conexão com a Internet</div>
<div class="dialog-message">
Não foi possível conectar à internet. Por favor, verifique sua conexão e tente novamente.
</div>
<button class="dialog-button" onclick="hideDialog()">OK</button>
</div>
</div>
<script>
const statusIndicator = document.getElementById('statusIndicator');
const contentContainer = document.getElementById('contentContainer');
const dialogOverlay = document.getElementById('dialogOverlay');
let currentTab = null;
function showDialog() {
dialogOverlay.style.display = 'flex';
}
function hideDialog() {
dialogOverlay.style.display = 'none';
}
// Função para carregar a página inicial
async function loadHomePage() {
const homeTab = document.querySelector('.tab[data-url="https://ghzhost.com/"]');
await switchTab(homeTab);
}
// Carregar a página inicial assim que o documento estiver pronto
document.addEventListener('DOMContentLoaded', loadHomePage);
// Também tentar carregar imediatamente
loadHomePage();
async function switchTab(tabElement) {
// Se clicou na mesma aba, não faz nada
if (currentTab === tabElement) return;
// Restaurar a aba anterior se existir
if (currentTab) {
currentTab.classList.remove('active');
}
// Atualizar a aba atual
currentTab = tabElement;
currentTab.classList.add('active');
// Load the new tab content
const url = tabElement.getAttribute('data-url');
await window.electronAPI.loadTab(url);
}
// Listen for internet status updates
window.electronAPI.onInternetStatus((event, isOnline) => {
statusIndicator.className = `status-indicator ${isOnline ? 'online' : 'offline'}`;
if (!isOnline) {
showDialog();
}
});
// Initial internet check
window.electronAPI.checkInternet().then(isOnline => {
statusIndicator.className = `status-indicator ${isOnline ? 'online' : 'offline'}`;
if (!isOnline) {
showDialog();
}
});
// Listen for title updates
window.electronAPI.onTitleUpdate((event, title) => {
document.title = title;
// Update the active tab text
if (currentTab) {
currentTab.textContent = title;
}
});
</script>
</body>
</html>