Update index.html
Browse files- index.html +10 -22
index.html
CHANGED
|
@@ -5,6 +5,7 @@
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Test /add_points_and_refresh_fn API</title>
|
| 7 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.js"></script>
|
|
|
|
| 8 |
</head>
|
| 9 |
<body class="bg-gray-100 p-8">
|
| 10 |
<div class="max-w-2xl mx-auto bg-white rounded-lg shadow-lg p-6">
|
|
@@ -71,31 +72,18 @@
|
|
| 71 |
log(`μ΄λ©μΌ μ
λ ₯κ°: ${email}`);
|
| 72 |
|
| 73 |
try {
|
| 74 |
-
|
| 75 |
-
|
|
|
|
| 76 |
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
'Content-Type': 'application/json',
|
| 81 |
-
},
|
| 82 |
-
body: JSON.stringify({
|
| 83 |
-
data: [email],
|
| 84 |
-
fn_index: 0
|
| 85 |
-
})
|
| 86 |
});
|
|
|
|
| 87 |
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
if (!response.ok) {
|
| 91 |
-
throw new Error(`HTTP error! status: ${response.status}`);
|
| 92 |
-
}
|
| 93 |
-
|
| 94 |
-
const data = await response.json();
|
| 95 |
-
log(`μλ΅ λ°μ΄ν°: ${JSON.stringify(data, null, 2)}`);
|
| 96 |
-
|
| 97 |
-
statusElement.textContent = data[0] || 'μλ΅ μμ';
|
| 98 |
-
valueElement.innerHTML = data[1] || 'μλ΅ μμ';
|
| 99 |
|
| 100 |
} catch (error) {
|
| 101 |
log(`μλ¬ λ°μ: ${error.message}`);
|
|
|
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Test /add_points_and_refresh_fn API</title>
|
| 7 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.js"></script>
|
| 8 |
+
<script src="https://cdn.jsdelivr.net/npm/@gradio/client@2.2.0/dist/index.min.js"></script>
|
| 9 |
</head>
|
| 10 |
<body class="bg-gray-100 p-8">
|
| 11 |
<div class="max-w-2xl mx-auto bg-white rounded-lg shadow-lg p-6">
|
|
|
|
| 72 |
log(`μ΄λ©μΌ μ
λ ₯κ°: ${email}`);
|
| 73 |
|
| 74 |
try {
|
| 75 |
+
log('Gradio ν΄λΌμ΄μΈνΈ μ°κ²° μλ...');
|
| 76 |
+
const client = await window.client.connect("ginipick/Dokdo-pay");
|
| 77 |
+
log('ν΄λΌμ΄μΈνΈ μ°κ²° μ±κ³΅');
|
| 78 |
|
| 79 |
+
log('API νΈμΆ μμ...');
|
| 80 |
+
const result = await client.predict("/add_points_and_refresh_fn", {
|
| 81 |
+
email: email
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
});
|
| 83 |
+
log(`μλ΅ λ°μ΄ν°: ${JSON.stringify(result.data, null, 2)}`);
|
| 84 |
|
| 85 |
+
statusElement.textContent = result.data[0] || 'μλ΅ μμ';
|
| 86 |
+
valueElement.innerHTML = result.data[1] || 'μλ΅ μμ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
} catch (error) {
|
| 89 |
log(`μλ¬ λ°μ: ${error.message}`);
|