luisoala commited on
Commit
b4d7111
Β·
1 Parent(s): f12a178
Files changed (1) hide show
  1. app.py +34 -5
app.py CHANGED
@@ -66,6 +66,7 @@ def create_ui():
66
  display: flex;
67
  align-items: center;
68
  cursor: pointer;
 
69
  }
70
  .step-status {
71
  margin-right: 10px;
@@ -76,7 +77,7 @@ def create_ui():
76
  align-items: center;
77
  justify-content: center;
78
  font-weight: bold;
79
- color: white;
80
  font-size: 16px;
81
  text-shadow: 0px 0px 1px rgba(0,0,0,0.5);
82
  }
@@ -106,6 +107,14 @@ def create_ui():
106
  font-weight: 500;
107
  text-align: center;
108
  }
 
 
 
 
 
 
 
 
109
  </style>
110
  """)
111
 
@@ -117,7 +126,7 @@ def create_ui():
117
 
118
  return """<div class="progress-container">
119
  <div class="progress-status">βœ… File uploaded successfully</div>
120
- </div>""", gr.update()
121
 
122
  def on_validate(file):
123
  if file is None:
@@ -136,9 +145,12 @@ def create_ui():
136
 
137
  html += f'''
138
  <div class="validation-step" id="step-{i}">
139
- <div class="step-header" onclick="document.getElementById('details-{i}').style.display = document.getElementById('details-{i}').style.display === 'none' ? 'block' : 'none'">
140
- <div class="step-status {status_class}">{status_icon}</div>
141
- <div class="step-title">{test_name}</div>
 
 
 
142
  </div>
143
  <div class="step-details" id="details-{i}" style="display: none;">
144
  {message}
@@ -148,6 +160,23 @@ def create_ui():
148
 
149
  html += '</div>'
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  return gr.update(value=html, visible=True)
152
 
153
  file_input.change(on_file_upload, inputs=file_input, outputs=[upload_progress, validation_results])
 
66
  display: flex;
67
  align-items: center;
68
  cursor: pointer;
69
+ justify-content: space-between;
70
  }
71
  .step-status {
72
  margin-right: 10px;
 
77
  align-items: center;
78
  justify-content: center;
79
  font-weight: bold;
80
+ color: white !important;
81
  font-size: 16px;
82
  text-shadow: 0px 0px 1px rgba(0,0,0,0.5);
83
  }
 
107
  font-weight: 500;
108
  text-align: center;
109
  }
110
+ .arrow-indicator {
111
+ margin-left: auto;
112
+ font-size: 16px;
113
+ transition: transform 0.3s ease;
114
+ }
115
+ .arrow-down {
116
+ transform: rotate(90deg);
117
+ }
118
  </style>
119
  """)
120
 
 
126
 
127
  return """<div class="progress-container">
128
  <div class="progress-status">βœ… File uploaded successfully</div>
129
+ </div>""", gr.update(visible=False)
130
 
131
  def on_validate(file):
132
  if file is None:
 
145
 
146
  html += f'''
147
  <div class="validation-step" id="step-{i}">
148
+ <div class="step-header" onclick="toggleDetails('{i}')">
149
+ <div class="step-left" style="display: flex; align-items: center;">
150
+ <div class="step-status {status_class}">{status_icon}</div>
151
+ <div class="step-title">{test_name}</div>
152
+ </div>
153
+ <div class="arrow-indicator" id="arrow-{i}">β–Ά</div>
154
  </div>
155
  <div class="step-details" id="details-{i}" style="display: none;">
156
  {message}
 
160
 
161
  html += '</div>'
162
 
163
+ html += '''
164
+ <script>
165
+ function toggleDetails(id) {
166
+ const details = document.getElementById('details-' + id);
167
+ const arrow = document.getElementById('arrow-' + id);
168
+
169
+ if (details.style.display === 'none') {
170
+ details.style.display = 'block';
171
+ arrow.classList.add('arrow-down');
172
+ } else {
173
+ details.style.display = 'none';
174
+ arrow.classList.remove('arrow-down');
175
+ }
176
+ }
177
+ </script>
178
+ '''
179
+
180
  return gr.update(value=html, visible=True)
181
 
182
  file_input.change(on_file_upload, inputs=file_input, outputs=[upload_progress, validation_results])