-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
248 lines (217 loc) · 14.4 KB
/
Copy pathindex.html
File metadata and controls
248 lines (217 loc) · 14.4 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ThingsPanel All-in-One Installer</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
</head>
<body class="bg-gray-50 text-gray-800 font-sans antialiased selection:bg-blue-100 selection:text-blue-900">
<div class="min-h-screen flex flex-col">
<!-- Header -->
<header class="bg-white shadow relative z-10">
<div class="max-w-7xl mx-auto px-4 py-5 flex items-center justify-between">
<div class="flex items-center gap-3">
<img src="https://thingspanel.io/img/dark.svg" alt="ThingsPanel Logo" class="h-8">
</div>
<div class="flex items-center gap-6">
<button onclick="toggleLang()" class="flex items-center gap-2 text-sm font-medium text-gray-600 hover:text-blue-600 transition">
<i class="fas fa-globe"></i>
<span id="lang-text">中文</span>
</button>
<a href="https://github.com/ThingsPanel/thingspanel-installer" target="_blank" class="text-gray-500 hover:text-gray-900 transition">
<i class="fab fa-github text-2xl"></i>
</a>
</div>
</div>
</header>
<!-- Main Banner -->
<main class="flex-grow">
<div class="max-w-7xl mx-auto px-4 py-16">
<div class="text-center mb-16 animate-fade-in-up">
<h2 id="main-title" class="text-4xl md:text-5xl text-gray-900 font-extrabold mb-6 tracking-tight">Deploy Enterprise IoT Platform</h2>
<p id="main-subtitle" class="text-xl text-gray-500 font-medium">Choose your system and install ThingsPanel on your computer or server in minutes.</p>
</div>
<!-- 3 Columns Grid -->
<div class="grid md:grid-cols-3 gap-8 max-w-6xl mx-auto">
<!-- Linux Card -->
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-8 flex flex-col relative overflow-hidden transition-all hover:shadow-xl hover:-translate-y-1">
<div id="badge-recommend" class="absolute top-0 right-0 bg-blue-100 text-blue-800 text-xs font-bold px-3 py-1 rounded-bl-lg tracking-wide uppercase">Server</div>
<i class="fab fa-linux text-6xl text-gray-700 mb-8 mx-auto mt-2 tracking-tighter"></i>
<h3 class="text-2xl font-bold text-center mb-3">Linux</h3>
<p id="linux-desc" class="text-gray-500 text-center mb-6 h-12 leading-relaxed">Supports CentOS, Ubuntu, Debian and macOS via SSH.</p>
<div class="mt-auto">
<div class="cmd-hint text-xs text-gray-500 mb-2 font-medium uppercase tracking-wide">Run the following command:</div>
<div class="relative group">
<pre class="bg-gray-900 text-gray-100 text-sm p-4 rounded-xl overflow-x-auto font-mono ring-1 ring-inset ring-gray-800 shadow-inner">curl -fsSL https://install.thingspanel.io/install.sh | sh</pre>
<button onclick="copyCmd('curl -fsSL https://install.thingspanel.io/install.sh | sh', this)" class="absolute top-2 right-2 text-gray-400 hover:text-white transition p-2 bg-gray-800 rounded opacity-0 group-hover:opacity-100">
<i class="far fa-copy"></i>
</button>
</div>
</div>
</div>
<!-- Windows Card -->
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-8 flex flex-col transition-all hover:shadow-xl hover:-translate-y-1 relative overflow-hidden">
<i class="fab fa-windows text-6xl text-blue-500 mb-8 mx-auto mt-2"></i>
<h3 class="text-2xl font-bold text-center mb-3">Windows</h3>
<p id="win-desc" class="text-gray-500 text-center mb-6 h-12 leading-relaxed">Provides a native GUI application installer with zero dependencies.</p>
<div class="mt-auto flex flex-col">
<div class="cmd-hint text-xs text-gray-500 mb-2 font-medium uppercase tracking-wide">Run the following command:</div>
<div class="relative group mb-4">
<pre class="bg-gray-900 text-gray-100 text-sm p-4 rounded-xl overflow-x-auto font-mono ring-1 ring-inset ring-gray-800 shadow-inner">irm https://install.thingspanel.io/install.ps1 | iex</pre>
<button onclick="copyCmd('irm https://install.thingspanel.io/install.ps1 | iex', this)" class="absolute top-2 right-2 text-gray-400 hover:text-white transition p-2 bg-gray-800 rounded opacity-0 group-hover:opacity-100">
<i class="far fa-copy"></i>
</button>
</div>
<div class="flex items-center gap-4 mb-4">
<div class="flex-grow h-px bg-gray-100"></div>
<span class="or-text text-xs text-gray-400 font-medium uppercase tracking-wider">OR</span>
<div class="flex-grow h-px bg-gray-100"></div>
</div>
<a id="btn-win" href="https://github.com/ThingsPanel/thingspanel-installer/releases/latest" target="_blank" class="w-full text-center bg-blue-600 hover:bg-blue-700 active:bg-blue-800 text-white font-semibold py-3 px-4 rounded-xl transition-colors shadow-sm flex justify-center items-center gap-2">
<i class="fas fa-download"></i> <span id="win-btn-text">Download .exe Installer</span>
</a>
</div>
</div>
<!-- macOS Card -->
<div class="bg-white rounded-2xl shadow-sm border border-gray-100 p-8 flex flex-col transition-all hover:shadow-xl hover:-translate-y-1 relative overflow-hidden">
<i class="fab fa-apple text-6xl text-gray-900 mb-8 mx-auto mt-2"></i>
<h3 class="text-2xl font-bold text-center mb-3">macOS</h3>
<p id="mac-desc" class="text-gray-500 text-center mb-6 h-12 leading-relaxed">Native support for Apple Silicon & Intel via Docker Desktop.</p>
<div class="mt-auto flex flex-col">
<div class="cmd-hint text-xs text-gray-500 mb-2 font-medium uppercase tracking-wide">Run the following command:</div>
<div class="relative group mb-4">
<pre class="bg-gray-900 text-gray-100 text-sm p-4 rounded-xl overflow-x-auto font-mono ring-1 ring-inset ring-gray-800 shadow-inner">curl -fsSL https://install.thingspanel.io/install.sh | sh</pre>
<button onclick="copyCmd('curl -fsSL https://install.thingspanel.io/install.sh | sh', this)" class="absolute top-2 right-2 text-gray-400 hover:text-white transition p-2 bg-gray-800 rounded opacity-0 group-hover:opacity-100">
<i class="far fa-copy"></i>
</button>
</div>
<div class="flex items-center gap-4 mb-4">
<div class="flex-grow h-px bg-gray-100"></div>
<span class="or-text text-xs text-gray-400 font-medium uppercase tracking-wider">OR</span>
<div class="flex-grow h-px bg-gray-100"></div>
</div>
<a id="btn-mac" href="https://github.com/ThingsPanel/thingspanel-installer/releases/latest" target="_blank" class="w-full text-center bg-gray-900 hover:bg-black active:bg-gray-800 text-white font-semibold py-3 px-4 rounded-xl transition-colors shadow-sm flex justify-center items-center gap-2">
<i class="fas fa-download"></i> <span id="mac-btn-text">Download .pkg Installer</span>
</a>
</div>
</div>
</div>
<div class="mt-20 text-center text-sm font-medium text-gray-500">
<p><span id="docs-hint">Installation issues? Check the</span> <a href="https://github.com/ThingsPanel/thingspanel-installer#readme" target="_blank" class="text-blue-600 hover:text-blue-800 hover:underline underline-offset-4 transition text-docs-link">Documentation</a></p>
</div>
</div>
</main>
<!-- Footer -->
<footer class="bg-transparent py-8">
<div class="max-w-6xl mx-auto px-4 text-center text-gray-400 text-sm">
© <span id="year"></span> ThingsPanel Open Source Community.
</div>
</footer>
</div>
<script>
document.getElementById('year').textContent = new Date().getFullYear();
const i18n = {
en: {
langBtn: "中文",
title: "Deploy Enterprise IoT Platform",
subtitle: "Choose your system and install ThingsPanel on your computer or server in minutes.",
badge: "SERVER",
linuxDesc: "Supports CentOS, Ubuntu, Debian and macOS via SSH.",
cmdHint: "Run the following command:",
winDesc: "Provides a native GUI application installer with zero dependencies.",
winBtn: "Download .exe Installer",
macDesc: "Native support for Apple Silicon & Intel via Docker Desktop.",
macBtn: "Download .pkg Installer",
docs: "Installation issues? Check the",
docsLink: "Documentation",
orText: "OR"
},
zh: {
langBtn: "English",
title: "一键部署企业级 IoT 平台",
subtitle: "选择你的系统,几分钟内把 ThingsPanel 安装到电脑或服务器上。",
badge: "推荐 (服务器)",
linuxDesc: "支持 CentOS, Ubuntu, Debian 及通过 SSH 访问的 macOS。",
cmdHint: "执行该命令一键部署:",
winDesc: "提供带界面的绿色安装程序,纯净直接运行。",
winBtn: "下载 .exe 安装包",
macDesc: "原生跨平台架构支持,基于 Docker Desktop 分发。",
macBtn: "下载 .pkg 安装包",
docs: "安装遇到问题?请参考",
docsLink: "官方文档",
orText: "或者"
}
};
let currentLang = 'en';
function toggleLang() {
currentLang = currentLang === 'en' ? 'zh' : 'en';
applyTranslations();
}
function applyTranslations() {
const t = i18n[currentLang];
document.documentElement.lang = currentLang;
document.getElementById('lang-text').innerText = t.langBtn;
document.getElementById('main-title').innerText = t.title;
document.getElementById('main-subtitle').innerText = t.subtitle;
document.getElementById('badge-recommend').innerText = t.badge;
document.getElementById('linux-desc').innerText = t.linuxDesc;
document.getElementById('win-desc').innerText = t.winDesc;
document.getElementById('mac-desc').innerText = t.macDesc;
document.getElementById('docs-hint').innerText = t.docs;
document.querySelector('.text-docs-link').innerText = t.docsLink;
document.querySelectorAll('.cmd-hint').forEach(el => el.innerText = t.cmdHint);
document.querySelectorAll('.or-text').forEach(el => el.innerText = t.orText);
if (!hasFetched) {
document.getElementById('win-btn-text').innerText = t.winBtn;
document.getElementById('mac-btn-text').innerText = t.macBtn;
} else {
updateDownloadButtonText();
}
}
let hasFetched = false;
async function fetchLatestRelease() {
try {
const response = await fetch('https://api.github.com/repos/ThingsPanel/thingspanel-installer/releases/latest');
if (!response.ok) return;
const data = await response.json();
const assets = data.assets || [];
let winUrl = null;
let macUrl = null;
assets.forEach(asset => {
if (asset.name.endsWith('.exe')) winUrl = asset.browser_download_url;
if (asset.name.endsWith('.pkg')) macUrl = asset.browser_download_url;
});
if (winUrl) {
document.getElementById('btn-win').href = winUrl;
hasFetched = true;
}
if (macUrl) {
document.getElementById('btn-mac').href = macUrl;
hasFetched = true;
}
updateDownloadButtonText();
} catch (err) {
console.error("Failed to fetch GitHub release", err);
}
}
function updateDownloadButtonText() {
if (!hasFetched) return;
document.getElementById('win-btn-text').innerText = currentLang === 'en' ? "Download Windows" : "立即下载 Windows 版本";
document.getElementById('mac-btn-text').innerText = currentLang === 'en' ? "Download macOS" : "立即下载 macOS 版本";
}
function copyCmd(text, btn) {
navigator.clipboard.writeText(text);
const icon = btn.querySelector('i');
icon.className = 'fas fa-check text-green-400';
setTimeout(() => {
icon.className = 'far fa-copy';
}, 2000);
}
fetchLatestRelease();
applyTranslations();
</script>
</body>
</html>