extrememicro commited on
Commit
0e1e93d
·
verified ·
1 Parent(s): 9d35f63

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +347 -19
index.html CHANGED
@@ -1,19 +1,347 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Latest Odoo Version Checker</title>
7
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
8
+ <style>
9
+ :root {
10
+ --primary-color: #714B67;
11
+ --secondary-color: #F5E6E8;
12
+ --accent-color: #A076F9;
13
+ --text-color: #333;
14
+ --light-text: #666;
15
+ --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
16
+ --border-radius: 12px;
17
+ }
18
+
19
+ * {
20
+ margin: 0;
21
+ padding: 0;
22
+ box-sizing: border-box;
23
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
24
+ }
25
+
26
+ body {
27
+ background-color: var(--secondary-color);
28
+ color: var(--text-color);
29
+ line-height: 1.6;
30
+ min-height: 100vh;
31
+ display: flex;
32
+ flex-direction: column;
33
+ }
34
+
35
+ header {
36
+ background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
37
+ color: white;
38
+ padding: 1.5rem;
39
+ text-align: center;
40
+ box-shadow: var(--shadow);
41
+ }
42
+
43
+ .container {
44
+ max-width: 800px;
45
+ margin: 2rem auto;
46
+ padding: 0 1rem;
47
+ flex: 1;
48
+ }
49
+
50
+ .version-card {
51
+ background: white;
52
+ border-radius: var(--border-radius);
53
+ padding: 2rem;
54
+ box-shadow: var(--shadow);
55
+ text-align: center;
56
+ margin-bottom: 2rem;
57
+ transition: transform 0.3s ease, box-shadow 0.3s ease;
58
+ }
59
+
60
+ .version-card:hover {
61
+ transform: translateY(-5px);
62
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
63
+ }
64
+
65
+ .version-number {
66
+ font-size: 3rem;
67
+ font-weight: 700;
68
+ margin: 1rem 0;
69
+ color: var(--primary-color);
70
+ background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
71
+ -webkit-background-clip: text;
72
+ -webkit-text-fill-color: transparent;
73
+ background-clip: text;
74
+ }
75
+
76
+ .version-info {
77
+ display: flex;
78
+ justify-content: space-around;
79
+ margin: 2rem 0;
80
+ flex-wrap: wrap;
81
+ gap: 1rem;
82
+ }
83
+
84
+ .info-item {
85
+ text-align: center;
86
+ padding: 1rem;
87
+ background: rgba(113, 75, 103, 0.1);
88
+ border-radius: var(--border-radius);
89
+ flex: 1;
90
+ min-width: 150px;
91
+ }
92
+
93
+ .info-item i {
94
+ font-size: 2rem;
95
+ color: var(--accent-color);
96
+ margin-bottom: 0.5rem;
97
+ }
98
+
99
+ .loading {
100
+ display: inline-block;
101
+ width: 50px;
102
+ height: 50px;
103
+ border: 5px solid rgba(255, 255, 255, 0.3);
104
+ border-radius: 50%;
105
+ border-top-color: white;
106
+ animation: spin 1s ease-in-out infinite;
107
+ }
108
+
109
+ @keyframes spin {
110
+ to { transform: rotate(360deg); }
111
+ }
112
+
113
+ .btn {
114
+ display: inline-block;
115
+ background: var(--primary-color);
116
+ color: white;
117
+ padding: 0.8rem 1.5rem;
118
+ border-radius: var(--border-radius);
119
+ text-decoration: none;
120
+ font-weight: 600;
121
+ transition: all 0.3s ease;
122
+ border: none;
123
+ cursor: pointer;
124
+ margin-top: 1rem;
125
+ }
126
+
127
+ .btn:hover {
128
+ background: var(--accent-color);
129
+ transform: translateY(-2px);
130
+ }
131
+
132
+ .error {
133
+ color: #e74c3c;
134
+ font-weight: 600;
135
+ }
136
+
137
+ footer {
138
+ text-align: center;
139
+ padding: 1.5rem;
140
+ background: white;
141
+ color: var(--light-text);
142
+ font-size: 0.9rem;
143
+ }
144
+
145
+ .anycoder-link {
146
+ color: var(--primary-color);
147
+ text-decoration: none;
148
+ font-weight: 600;
149
+ margin-left: 0.5rem;
150
+ }
151
+
152
+ .anycoder-link:hover {
153
+ text-decoration: underline;
154
+ }
155
+
156
+ .release-notes {
157
+ background: white;
158
+ border-radius: var(--border-radius);
159
+ padding: 1.5rem;
160
+ box-shadow: var(--shadow);
161
+ margin-top: 2rem;
162
+ }
163
+
164
+ .release-notes h3 {
165
+ margin-bottom: 1rem;
166
+ color: var(--primary-color);
167
+ }
168
+
169
+ .release-notes ul {
170
+ list-style-type: none;
171
+ padding-left: 0;
172
+ }
173
+
174
+ .release-notes li {
175
+ padding: 0.5rem 0;
176
+ border-bottom: 1px solid #eee;
177
+ }
178
+
179
+ .release-notes li:last-child {
180
+ border-bottom: none;
181
+ }
182
+
183
+ @media (max-width: 768px) {
184
+ .version-number {
185
+ font-size: 2.5rem;
186
+ }
187
+
188
+ .version-info {
189
+ flex-direction: column;
190
+ }
191
+ }
192
+
193
+ @media (max-width: 480px) {
194
+ .container {
195
+ padding: 0 0.5rem;
196
+ }
197
+
198
+ .version-card {
199
+ padding: 1.5rem;
200
+ }
201
+ }
202
+ </style>
203
+ </head>
204
+ <body>
205
+ <header>
206
+ <h1><i class="fab fa-odoo"></i> Odoo Version Checker</h1>
207
+ <p>Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" class="anycoder-link" target="_blank">anycoder</a></p>
208
+ </header>
209
+
210
+ <div class="container">
211
+ <div class="version-card">
212
+ <h2>Latest Odoo Version</h2>
213
+ <div id="version-display">
214
+ <div class="loading"></div>
215
+ <p>Fetching latest version...</p>
216
+ </div>
217
+ <button id="refresh-btn" class="btn"><i class="fas fa-sync-alt"></i> Refresh</button>
218
+ </div>
219
+
220
+ <div class="version-info" id="version-info">
221
+ <!-- Will be populated by JavaScript -->
222
+ </div>
223
+
224
+ <div class="release-notes" id="release-notes">
225
+ <h3><i class="fas fa-file-alt"></i> Latest Release Notes</h3>
226
+ <p>Loading release information...</p>
227
+ </div>
228
+ </div>
229
+
230
+ <footer>
231
+ <p>Data fetched from Odoo's official GitHub repository</p>
232
+ </footer>
233
+
234
+ <script>
235
+ document.addEventListener('DOMContentLoaded', function() {
236
+ const versionDisplay = document.getElementById('version-display');
237
+ const versionInfo = document.getElementById('version-info');
238
+ const releaseNotes = document.getElementById('release-notes');
239
+ const refreshBtn = document.getElementById('refresh-btn');
240
+
241
+ // Fetch latest Odoo version from GitHub
242
+ async function fetchLatestVersion() {
243
+ try {
244
+ versionDisplay.innerHTML = '<div class="loading"></div><p>Fetching latest version...</p>';
245
+
246
+ // Fetch tags from Odoo GitHub repository
247
+ const response = await fetch('https://api.github.com/repos/odoo/odoo/tags');
248
+ const tags = await response.json();
249
+
250
+ if (tags.length === 0) {
251
+ throw new Error('No tags found');
252
+ }
253
+
254
+ // Filter out non-version tags and find the latest version
255
+ const versionTags = tags
256
+ .map(tag => tag.name)
257
+ .filter(name => /^\d+\.\d+$/.test(name))
258
+ .sort((a, b) => {
259
+ const aParts = a.split('.').map(Number);
260
+ const bParts = b.split('.').map(Number);
261
+ return bParts[0] - aParts[0] || bParts[1] - aParts[1];
262
+ });
263
+
264
+ if (versionTags.length === 0) {
265
+ throw new Error('No valid version tags found');
266
+ }
267
+
268
+ const latestVersion = versionTags[0];
269
+ const latestTag = tags.find(tag => tag.name === latestVersion);
270
+
271
+ // Display version
272
+ versionDisplay.innerHTML = `
273
+ <div class="version-number">${latestVersion}</div>
274
+ <p>Released on: ${new Date(latestTag.commit.author.date).toLocaleDateString()}</p>
275
+ `;
276
+
277
+ // Display additional info
278
+ versionInfo.innerHTML = `
279
+ <div class="info-item">
280
+ <i class="fas fa-tag"></i>
281
+ <div>Latest Tag</div>
282
+ <div>${latestTag.name}</div>
283
+ </div>
284
+ <div class="info-item">
285
+ <i class="fas fa-calendar"></i>
286
+ <div>Published At</div>
287
+ <div>${new Date(latestTag.commit.author.date).toLocaleString()}</div>
288
+ </div>
289
+ <div class="info-item">
290
+ <i class="fas fa-code-branch"></i>
291
+ <div>Commit SHA</div>
292
+ <div>${latestTag.commit.sha.substring(0, 7)}</div>
293
+ </div>
294
+ `;
295
+
296
+ // Fetch release notes (using GitHub releases API)
297
+ try {
298
+ const releasesResponse = await fetch('https://api.github.com/repos/odoo/odoo/releases');
299
+ const releases = await releasesResponse.json();
300
+
301
+ const latestRelease = releases.find(release =>
302
+ release.tag_name === latestVersion ||
303
+ release.name.includes(latestVersion)
304
+ );
305
+
306
+ if (latestRelease) {
307
+ const notes = latestRelease.body.split('\n').filter(line => line.trim() !== '');
308
+ releaseNotes.innerHTML = `
309
+ <h3><i class="fas fa-file-alt"></i> Release Notes for v${latestVersion}</h3>
310
+ <ul>
311
+ ${notes.slice(0, 5).map(note => `<li>${note}</li>`).join('')}
312
+ </ul>
313
+ <a href="${latestRelease.html_url}" class="btn" target="_blank">
314
+ <i class="fas fa-external-link-alt"></i> View Full Release
315
+ </a>
316
+ `;
317
+ } else {
318
+ releaseNotes.innerHTML = `
319
+ <h3><i class="fas fa-file-alt"></i> Release Notes</h3>
320
+ <p>No specific release notes found for this version.</p>
321
+ `;
322
+ }
323
+ } catch (error) {
324
+ releaseNotes.innerHTML = `
325
+ <h3><i class="fas fa-file-alt"></i> Release Notes</h3>
326
+ <p class="error">Could not fetch release notes: ${error.message}</p>
327
+ `;
328
+ }
329
+
330
+ } catch (error) {
331
+ versionDisplay.innerHTML = `
332
+ <p class="error">Error fetching version: ${error.message}</p>
333
+ <p>Please try again later.</p>
334
+ `;
335
+ console.error('Error:', error);
336
+ }
337
+ }
338
+
339
+ // Initial fetch
340
+ fetchLatestVersion();
341
+
342
+ // Refresh button
343
+ refreshBtn.addEventListener('click', fetchLatestVersion);
344
+ });
345
+ </script>
346
+ </body>
347
+ </html>