alex n commited on
Commit
2fce877
·
1 Parent(s): e2ec4cf

added background

Browse files
Files changed (2) hide show
  1. app.py +15 -89
  2. assets/background.jpg +0 -0
app.py CHANGED
@@ -4,83 +4,14 @@ import requests
4
  import pandas as pd
5
  from apscheduler.schedulers.background import BackgroundScheduler
6
 
 
 
7
  # Enhanced Custom CSS
8
- custom_css = """
9
- .gradio-container {
10
- max-width: 1200px !important;
11
- margin: auto;
12
- background-color: #1a1a1a;
13
- }
14
-
15
- .title {
16
- text-align: center;
17
- margin-bottom: 2rem;
18
- padding: 2rem 0;
19
- background: linear-gradient(90deg, #FF4B1F 0%, #FF9068 100%);
20
- border-radius: 10px;
21
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
22
- }
23
-
24
- .title h1 {
25
- color: white;
26
- font-size: 2.5rem;
27
- margin: 0;
28
- text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
29
- }
30
-
31
- .title p {
32
- color: rgba(255, 255, 255, 0.9);
33
- font-size: 1.1rem;
34
- margin: 0.5rem 0 0 0;
35
- }
36
-
37
- /* Style the tabs */
38
- .tabs {
39
- margin-top: 1rem;
40
- }
41
-
42
- /* Style the DataFrame */
43
- .dataframe {
44
- border-radius: 8px;
45
- overflow: hidden;
46
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
47
- }
48
-
49
- /* Style the refresh button */
50
- .refresh-btn {
51
- background: linear-gradient(90deg, #FF4B1F 0%, #FF9068 100%);
52
- border: none;
53
- padding: 10px 20px;
54
- border-radius: 5px;
55
- color: white;
56
- font-weight: bold;
57
- cursor: pointer;
58
- transition: transform 0.2s;
59
- }
60
-
61
- .refresh-btn:hover {
62
- transform: translateY(-2px);
63
- }
64
-
65
- /* Status message styling */
66
- .status-msg {
67
- color: #888;
68
- font-style: italic;
69
- margin-top: 1rem;
70
- }
71
-
72
- /* Custom styling for API status indicators */
73
- .api-status {
74
- font-size: 1.2em;
75
- }
76
-
77
- .api-up {
78
- color: #00ff00;
79
- }
80
-
81
- .api-down {
82
- color: #ff0000;
83
- }
84
  """
85
 
86
  # Add error handling for bittensor initialization
@@ -173,23 +104,16 @@ def get_validator_data() -> pd.DataFrame:
173
  df['VTrust'] = df['VTrust'].round(4)
174
  return df.sort_values('Step', ascending=False)[['Name', 'UID', 'Axon', 'API', 'Step', 'Recent Bits', 'Updated', 'VTrust']]
175
 
176
- # Create the Gradio interface
177
  app = gr.Blocks(
178
  title="SN36 Validator Leaderboard",
179
- css="""
180
- #component-0 { height: 100vh !important; }
181
- .gradio-container { height: 100vh !important; }
182
- .contain { height: 100vh !important; }
183
- .main { height: 100% !important; }
184
- .tabs { height: calc(100% - 100px) !important; }
185
- .tab-panel { height: 100% !important; }
186
- #leaderboard-table { height: calc(100% - 80px) !important; }
187
- """
188
  )
189
 
190
  # Update the HTML template
191
  header_html = """
192
- <div style="text-align: center; max-width: 100%; padding: 1rem; background-color: #FF5733; border-radius: 1rem;">
193
  <h1 style="color: white;">SN36 Validator Leaderboard</h1>
194
  <p style="color: white;">Real-time tracking of validator performance and bits</p>
195
  </div>
@@ -266,5 +190,7 @@ with app:
266
 
267
  setup_auto_refresh()
268
 
269
- # Launch the interface
270
- app.launch()
 
 
 
4
  import pandas as pd
5
  from apscheduler.schedulers.background import BackgroundScheduler
6
 
7
+ background_url2 = 'https://media.discordapp.net/attachments/1294437373773484093/1305702292774719569/80-_.png?ex=6733fd85&is=6732ac05&hm=f94d26610cc6c9d39318a102fb2484eae6ab83a64226eba3af81fbe305245fc2&=&format=webp&quality=lossless&width=717&height=414'
8
+ background_url = 'https://media.discordapp.net/attachments/1294437373773484093/1299205237877510184/p7zQRQMPb8W1qitaFl_C9_c6ef80e2981d4a27a53c3708de43bb44.jpg?ex=67336cea&is=67321b6a&hm=aaa1d39210d631d9f800802da8a869c71e395802574ae61bee6030671f53ef3c&=&format=webp'
9
  # Enhanced Custom CSS
10
+ custom_css = f"""
11
+ .gradio-container {{
12
+ background: url('{background_url2}') no-repeat center center fixed !important;
13
+ background-size: cover !important;
14
+ }}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  """
16
 
17
  # Add error handling for bittensor initialization
 
104
  df['VTrust'] = df['VTrust'].round(4)
105
  return df.sort_values('Step', ascending=False)[['Name', 'UID', 'Axon', 'API', 'Step', 'Recent Bits', 'Updated', 'VTrust']]
106
 
107
+ # Create the Gradio interface with custom theme
108
  app = gr.Blocks(
109
  title="SN36 Validator Leaderboard",
110
+ css=custom_css,
111
+ theme=gr.themes.Default()
 
 
 
 
 
 
 
112
  )
113
 
114
  # Update the HTML template
115
  header_html = """
116
+ <div style="text-align: center; max-width: 100%; padding: 1rem; background-color: #1f2937; border-radius: 1rem;">
117
  <h1 style="color: white;">SN36 Validator Leaderboard</h1>
118
  <p style="color: white;">Real-time tracking of validator performance and bits</p>
119
  </div>
 
190
 
191
  setup_auto_refresh()
192
 
193
+ # Launch the interface with file serving enabled
194
+ app.launch(
195
+ share=False
196
+ )
assets/background.jpg ADDED