mrfakename commited on
Commit
a660b0d
·
1 Parent(s): 2bfaee6

update dash

Browse files
Files changed (1) hide show
  1. templates/dashboard.html +168 -99
templates/dashboard.html CHANGED
@@ -26,8 +26,10 @@
26
  display: flex;
27
  justify-content: space-between;
28
  align-items: center;
29
- position: sticky;
30
  top: 0;
 
 
31
  background: #0a0a0a;
32
  z-index: 100;
33
  }
@@ -59,13 +61,90 @@
59
  .logout-btn:hover {
60
  color: #e5e5e5;
61
  }
62
- .main {
63
- max-width: 700px;
64
- margin: 0 auto;
65
- padding: 2rem 1.5rem 4rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
67
- .section {
68
- margin-bottom: 3rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  }
70
  .section-header {
71
  display: flex;
@@ -86,21 +165,42 @@
86
  font-size: 0.75rem;
87
  color: #444;
88
  }
89
- .spaces-grid {
90
  display: flex;
91
- flex-wrap: wrap;
 
 
 
 
 
92
  gap: 0.5rem;
93
  }
94
- .space-chip {
95
- font-size: 0.8125rem;
96
- padding: 0.375rem 0.75rem;
97
- background: #141414;
 
 
 
 
 
 
 
 
 
 
98
  border: 1px solid #222;
99
  border-radius: 4px;
 
 
 
 
 
 
100
  color: #999;
101
- transition: border-color 0.2s, color 0.2s;
102
  }
103
- .space-chip:hover {
 
104
  border-color: #333;
105
  color: #e5e5e5;
106
  }
@@ -112,7 +212,7 @@
112
  padding: 1rem 0;
113
  border-bottom: 1px solid #141414;
114
  display: block;
115
- transition: background 0.2s;
116
  }
117
  .feed-item:first-child {
118
  padding-top: 0;
@@ -126,6 +226,29 @@
126
  padding-left: 1rem;
127
  padding-right: 1rem;
128
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  .feed-meta {
130
  display: flex;
131
  align-items: center;
@@ -191,74 +314,6 @@
191
  height: 16px;
192
  border-radius: 50%;
193
  }
194
- .empty {
195
- text-align: center;
196
- padding: 3rem 1rem;
197
- color: #444;
198
- font-size: 0.875rem;
199
- }
200
- .controls {
201
- display: flex;
202
- gap: 1.5rem;
203
- margin-bottom: 1rem;
204
- }
205
- .control-group {
206
- display: flex;
207
- align-items: center;
208
- gap: 0.5rem;
209
- }
210
- .control-label {
211
- font-size: 0.6875rem;
212
- color: #555;
213
- text-transform: uppercase;
214
- letter-spacing: 0.03em;
215
- }
216
- .control-options {
217
- display: flex;
218
- gap: 0.25rem;
219
- }
220
- .control-btn {
221
- font-size: 0.75rem;
222
- padding: 0.25rem 0.5rem;
223
- background: transparent;
224
- border: 1px solid #222;
225
- border-radius: 4px;
226
- color: #666;
227
- cursor: pointer;
228
- transition: all 0.15s;
229
- }
230
- .control-btn:hover {
231
- border-color: #333;
232
- color: #999;
233
- }
234
- .control-btn.active {
235
- background: #1a1a1a;
236
- border-color: #333;
237
- color: #e5e5e5;
238
- }
239
- .feed-item.status-open {
240
- border-left: 2px solid #22c55e;
241
- padding-left: 1rem;
242
- margin-left: -1rem;
243
- }
244
- .feed-item.status-closed,
245
- .feed-item.status-merged {
246
- border-left: 2px solid #333;
247
- padding-left: 1rem;
248
- margin-left: -1rem;
249
- }
250
- .feed-item.is-report {
251
- border-left-color: #ef4444;
252
- }
253
- .feed-item.is-report .feed-title {
254
- color: #ef4444;
255
- }
256
- .feed-item.responded {
257
- opacity: 0.5;
258
- }
259
- .feed-item.is-own {
260
- opacity: 0.35;
261
- }
262
  .responded-badge,
263
  .own-badge {
264
  font-size: 0.625rem;
@@ -270,6 +325,12 @@
270
  color: #444;
271
  margin-left: auto;
272
  }
 
 
 
 
 
 
273
  </style>
274
  </head>
275
  <body>
@@ -284,28 +345,36 @@
284
  </div>
285
  </nav>
286
 
287
- <main class="main">
288
- <section class="section">
289
- <div class="section-header">
290
- <h2 class="section-title">Your Spaces</h2>
291
- <span class="section-count">{{ spaces|length }}</span>
292
  </div>
293
  {% if spaces %}
294
- <div class="spaces-grid">
295
  {% for space in spaces %}
296
- <a href="https://huggingface.co/spaces/{{ space.id }}" target="_blank" class="space-chip">
297
- {{ space.id.split('/')[-1] }}
 
 
 
 
 
 
 
 
298
  </a>
299
  {% endfor %}
300
  </div>
301
  {% else %}
302
- <div class="empty">No spaces found</div>
303
  {% endif %}
304
- </section>
305
 
306
- <section class="section">
307
  <div class="section-header">
308
- <h2 class="section-title">Discussions Feed</h2>
309
  <span class="section-count">{{ discussions|length }}</span>
310
  </div>
311
  <div class="controls">
@@ -363,9 +432,9 @@
363
  {% endfor %}
364
  </div>
365
  {% else %}
366
- <div class="empty">No discussions yet</div>
367
  {% endif %}
368
- </section>
369
- </main>
370
  </body>
371
  </html>
 
26
  display: flex;
27
  justify-content: space-between;
28
  align-items: center;
29
+ position: fixed;
30
  top: 0;
31
+ left: 0;
32
+ right: 0;
33
  background: #0a0a0a;
34
  z-index: 100;
35
  }
 
61
  .logout-btn:hover {
62
  color: #e5e5e5;
63
  }
64
+ .layout {
65
+ display: flex;
66
+ padding-top: 57px;
67
+ min-height: 100vh;
68
+ }
69
+ .sidebar {
70
+ width: 280px;
71
+ border-right: 1px solid #1a1a1a;
72
+ padding: 1.5rem;
73
+ position: fixed;
74
+ top: 57px;
75
+ bottom: 0;
76
+ overflow-y: auto;
77
+ }
78
+ .sidebar-header {
79
+ display: flex;
80
+ justify-content: space-between;
81
+ align-items: center;
82
+ margin-bottom: 1rem;
83
+ padding-bottom: 0.75rem;
84
+ border-bottom: 1px solid #1a1a1a;
85
+ }
86
+ .sidebar-title {
87
+ font-size: 0.75rem;
88
+ font-weight: 500;
89
+ color: #666;
90
+ text-transform: uppercase;
91
+ letter-spacing: 0.05em;
92
+ }
93
+ .sidebar-count {
94
+ font-size: 0.75rem;
95
+ color: #444;
96
+ }
97
+ .spaces-list {
98
+ display: flex;
99
+ flex-direction: column;
100
+ gap: 2px;
101
  }
102
+ .space-item {
103
+ display: flex;
104
+ align-items: center;
105
+ justify-content: space-between;
106
+ padding: 0.5rem 0.75rem;
107
+ border-radius: 6px;
108
+ transition: background 0.15s;
109
+ }
110
+ .space-item:hover {
111
+ background: #141414;
112
+ }
113
+ .space-name {
114
+ font-size: 0.8125rem;
115
+ color: #999;
116
+ }
117
+ .space-item:hover .space-name {
118
+ color: #e5e5e5;
119
+ }
120
+ .space-status {
121
+ font-size: 0.625rem;
122
+ padding: 0.125rem 0.375rem;
123
+ border-radius: 3px;
124
+ text-transform: uppercase;
125
+ letter-spacing: 0.03em;
126
+ }
127
+ .space-status.running {
128
+ background: #0a2a0a;
129
+ color: #22c55e;
130
+ }
131
+ .space-status.building {
132
+ background: #2a2a0a;
133
+ color: #eab308;
134
+ }
135
+ .space-status.stopped, .space-status.paused {
136
+ background: #1a1a1a;
137
+ color: #666;
138
+ }
139
+ .space-status.error, .space-status.runtime_error, .space-status.build_error {
140
+ background: #2a0a0a;
141
+ color: #ef4444;
142
+ }
143
+ .main {
144
+ flex: 1;
145
+ margin-left: 280px;
146
+ max-width: 800px;
147
+ padding: 1.5rem 2rem 4rem;
148
  }
149
  .section-header {
150
  display: flex;
 
165
  font-size: 0.75rem;
166
  color: #444;
167
  }
168
+ .controls {
169
  display: flex;
170
+ gap: 1.5rem;
171
+ margin-bottom: 1.5rem;
172
+ }
173
+ .control-group {
174
+ display: flex;
175
+ align-items: center;
176
  gap: 0.5rem;
177
  }
178
+ .control-label {
179
+ font-size: 0.6875rem;
180
+ color: #555;
181
+ text-transform: uppercase;
182
+ letter-spacing: 0.03em;
183
+ }
184
+ .control-options {
185
+ display: flex;
186
+ gap: 0.25rem;
187
+ }
188
+ .control-btn {
189
+ font-size: 0.75rem;
190
+ padding: 0.25rem 0.5rem;
191
+ background: transparent;
192
  border: 1px solid #222;
193
  border-radius: 4px;
194
+ color: #666;
195
+ cursor: pointer;
196
+ transition: all 0.15s;
197
+ }
198
+ .control-btn:hover {
199
+ border-color: #333;
200
  color: #999;
 
201
  }
202
+ .control-btn.active {
203
+ background: #1a1a1a;
204
  border-color: #333;
205
  color: #e5e5e5;
206
  }
 
212
  padding: 1rem 0;
213
  border-bottom: 1px solid #141414;
214
  display: block;
215
+ transition: background 0.15s;
216
  }
217
  .feed-item:first-child {
218
  padding-top: 0;
 
226
  padding-left: 1rem;
227
  padding-right: 1rem;
228
  }
229
+ .feed-item.status-open {
230
+ border-left: 2px solid #22c55e;
231
+ padding-left: 1rem;
232
+ margin-left: -1rem;
233
+ }
234
+ .feed-item.status-closed,
235
+ .feed-item.status-merged {
236
+ border-left: 2px solid #333;
237
+ padding-left: 1rem;
238
+ margin-left: -1rem;
239
+ }
240
+ .feed-item.is-report {
241
+ border-left-color: #ef4444;
242
+ }
243
+ .feed-item.is-report .feed-title {
244
+ color: #ef4444;
245
+ }
246
+ .feed-item.responded {
247
+ opacity: 0.5;
248
+ }
249
+ .feed-item.is-own {
250
+ opacity: 0.35;
251
+ }
252
  .feed-meta {
253
  display: flex;
254
  align-items: center;
 
314
  height: 16px;
315
  border-radius: 50%;
316
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  .responded-badge,
318
  .own-badge {
319
  font-size: 0.625rem;
 
325
  color: #444;
326
  margin-left: auto;
327
  }
328
+ .empty {
329
+ text-align: center;
330
+ padding: 3rem 1rem;
331
+ color: #444;
332
+ font-size: 0.875rem;
333
+ }
334
  </style>
335
  </head>
336
  <body>
 
345
  </div>
346
  </nav>
347
 
348
+ <div class="layout">
349
+ <aside class="sidebar">
350
+ <div class="sidebar-header">
351
+ <h2 class="sidebar-title">Spaces</h2>
352
+ <span class="sidebar-count">{{ spaces|length }}</span>
353
  </div>
354
  {% if spaces %}
355
+ <div class="spaces-list">
356
  {% for space in spaces %}
357
+ <a href="https://huggingface.co/spaces/{{ space.id }}" target="_blank" class="space-item">
358
+ <span class="space-name">{{ space.id.split('/')[-1] }}</span>
359
+ {% set status = space.runtime.stage|default('stopped')|lower if space.runtime else 'stopped' %}
360
+ <span class="space-status {{ status }}">
361
+ {% if status == 'running' %}running
362
+ {% elif status == 'building' %}building
363
+ {% elif status == 'runtime_error' or status == 'build_error' %}error
364
+ {% elif status == 'paused' %}paused
365
+ {% else %}stopped{% endif %}
366
+ </span>
367
  </a>
368
  {% endfor %}
369
  </div>
370
  {% else %}
371
+ <div class="empty">No spaces</div>
372
  {% endif %}
373
+ </aside>
374
 
375
+ <main class="main">
376
  <div class="section-header">
377
+ <h2 class="section-title">Discussions</h2>
378
  <span class="section-count">{{ discussions|length }}</span>
379
  </div>
380
  <div class="controls">
 
432
  {% endfor %}
433
  </div>
434
  {% else %}
435
+ <div class="empty">No discussions</div>
436
  {% endif %}
437
+ </main>
438
+ </div>
439
  </body>
440
  </html>