ilhamdev commited on
Commit
5ba99b7
1 Parent(s): 985f9c0

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +26 -18
index.html CHANGED
@@ -198,29 +198,37 @@ lumin("query", "username", "logic", true)
198
  </div>
199
  </div>
200
  <footer>
201
- <p>LuminAI API Client &copy; 2024</p>
202
- </footer>
 
 
 
 
 
 
 
 
 
203
  <audio id="myAudio" controls loop>
204
  <source src="tomat.mp3" type="audio/mpeg">
205
  Your browser does not support the audio element.
206
  </audio>
207
  <script>
208
- // Menggunakan metode fetch untuk mendapatkan URL file MP3 dari server
209
- fetch('https://pomf2.lain.la/f/jcn759xf.mp3')
210
- .then(response => {
211
- if (!response.ok) {
212
- throw new Error('Network response was not ok');
213
- }
214
- return response.blob();
215
- })
216
- .then(blob => {
217
- var url = URL.createObjectURL(blob);
218
- var myAudio = document.getElementById('myAudio');
219
- myAudio.src = url; // Mengatur src audio element dengan URL yang diperoleh
220
- })
221
- .catch(error => {
222
- console.error('There was a problem fetching the MP3 file:', error);
223
- });
224
  </script>
225
  </body>
226
  </html>
 
198
  </div>
199
  </div>
200
  <footer>
201
+ <p>LuminAI API Client &copy; 2024</p>
202
+ </footer>
203
+ <script>
204
+ async function fetchStats() {
205
+ const response = await fetch('/api/stats');
206
+ const data = await response.json();
207
+ document.getElementById('rps').textContent = data.rps;
208
+ document.getElementById('total-requests').textContent = data.totalRequests;
209
+ }
210
+ fetchStats();
211
+ </script>
212
  <audio id="myAudio" controls loop>
213
  <source src="tomat.mp3" type="audio/mpeg">
214
  Your browser does not support the audio element.
215
  </audio>
216
  <script>
217
+ fetch('https://pomf2.lain.la/f/jcn759xf.mp3')
218
+ .then(response => {
219
+ if (!response.ok) {
220
+ throw new Error('Network response was not ok');
221
+ }
222
+ return response.blob();
223
+ })
224
+ .then(blob => {
225
+ const audioUrl = URL.createObjectURL(blob);
226
+ const myAudio = document.getElementById('myAudio');
227
+ myAudio.srcObject = audioUrl; // Set srcObject instead of src
228
+ })
229
+ .catch(error => {
230
+ console.error('There was a problem fetching the MP3 file:', error);
231
+ });
 
232
  </script>
233
  </body>
234
  </html>