Update plugins/index.ejs
Browse files- plugins/index.ejs +144 -227
plugins/index.ejs
CHANGED
|
@@ -1,228 +1,145 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="UTF-8">
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>API
|
| 7 |
-
<
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
-
|
| 12 |
-
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
-
|
| 16 |
-
}
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
<input type="text" id="url-<%= index %>" class="test-input" placeholder="Paste image URL...">
|
| 146 |
-
<div style="text-align: center; margin: 5px 0; font-size: 11px; color: #8b949e;">OR</div>
|
| 147 |
-
<input type="file" id="file-<%= index %>" class="test-input" accept="image/*">
|
| 148 |
-
<% } else { %>
|
| 149 |
-
<input type="text" id="input-<%= index %>" class="test-input"
|
| 150 |
-
placeholder="<%= plugin.path.includes('bonsai') ? 'Tanya sesuatu...' : 'Masukkan prompt gambar...' %>">
|
| 151 |
-
<% } %>
|
| 152 |
-
|
| 153 |
-
<button class="btn-run" onclick="runTest('<%= plugin.path %>', <%= index %>)">Run Plugin</button>
|
| 154 |
-
</div>
|
| 155 |
-
|
| 156 |
-
<div class="result-box" id="result-container-<%= index %>">
|
| 157 |
-
<div id="status-<%= index %>" class="status"></div>
|
| 158 |
-
<pre id="json-<%= index %>"></pre>
|
| 159 |
-
<div id="media-<%= index %>"></div>
|
| 160 |
-
</div>
|
| 161 |
-
</div>
|
| 162 |
-
<% }) %>
|
| 163 |
-
</div>
|
| 164 |
-
|
| 165 |
-
<script>
|
| 166 |
-
async function runTest(path, id) {
|
| 167 |
-
const container = document.getElementById(`result-container-${id}`);
|
| 168 |
-
const status = document.getElementById(`status-${id}`);
|
| 169 |
-
const jsonPre = document.getElementById(`json-${id}`);
|
| 170 |
-
const media = document.getElementById(`media-${id}`);
|
| 171 |
-
|
| 172 |
-
// Reset UI
|
| 173 |
-
container.style.display = 'block';
|
| 174 |
-
status.innerHTML = '⏳ Processing...';
|
| 175 |
-
jsonPre.innerText = '';
|
| 176 |
-
media.innerHTML = '';
|
| 177 |
-
|
| 178 |
-
try {
|
| 179 |
-
let response;
|
| 180 |
-
|
| 181 |
-
// Logika khusus OCR (DeepSeek)
|
| 182 |
-
if (path.includes('ocr')) {
|
| 183 |
-
const urlVal = document.getElementById(`url-${id}`).value;
|
| 184 |
-
const fileInput = document.getElementById(`file-${id}`).files[0];
|
| 185 |
-
|
| 186 |
-
if (fileInput) {
|
| 187 |
-
// POST: Kirim file lokal
|
| 188 |
-
const formData = new FormData();
|
| 189 |
-
formData.append('file', fileInput);
|
| 190 |
-
response = await fetch(path, { method: 'POST', body: formData });
|
| 191 |
-
} else if (urlVal) {
|
| 192 |
-
// GET: Kirim URL gambar
|
| 193 |
-
response = await fetch(`${path}?image=${encodeURIComponent(urlVal)}`);
|
| 194 |
-
} else {
|
| 195 |
-
throw new Error("Pilih file atau masukkan URL gambar!");
|
| 196 |
-
}
|
| 197 |
-
}
|
| 198 |
-
// Logika untuk plugin lainnya
|
| 199 |
-
else {
|
| 200 |
-
const val = document.getElementById(`input-${id}`).value;
|
| 201 |
-
// Pilih param 'q' untuk bonsai/chat, 'prompt' untuk gen image
|
| 202 |
-
const param = (path.includes('bonsai') || path.includes('chat')) ? 'q' : 'prompt';
|
| 203 |
-
response = await fetch(`${path}?${param}=${encodeURIComponent(val)}`);
|
| 204 |
-
}
|
| 205 |
-
|
| 206 |
-
const data = await response.json();
|
| 207 |
-
status.innerHTML = response.ok ? '✅ Success' : '❌ Failed';
|
| 208 |
-
jsonPre.innerText = JSON.stringify(data, null, 2);
|
| 209 |
-
|
| 210 |
-
// Preview Gambar jika ada (Illustrious/NSFW)
|
| 211 |
-
const imgs = data.images || (data.result && Array.isArray(data.result) ? data.result : null);
|
| 212 |
-
if (imgs && Array.isArray(imgs)) {
|
| 213 |
-
imgs.forEach(url => {
|
| 214 |
-
const img = document.createElement('img');
|
| 215 |
-
img.src = url;
|
| 216 |
-
img.className = 'preview-img';
|
| 217 |
-
media.appendChild(img);
|
| 218 |
-
});
|
| 219 |
-
}
|
| 220 |
-
|
| 221 |
-
} catch (err) {
|
| 222 |
-
status.innerHTML = '❌ Error';
|
| 223 |
-
jsonPre.innerText = err.message;
|
| 224 |
-
}
|
| 225 |
-
}
|
| 226 |
-
</script>
|
| 227 |
-
</body>
|
| 228 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>API DASHBOARD — SWISS EDITION</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<style>
|
| 9 |
+
/* Tipografi Khas Swiss Design */
|
| 10 |
+
body {
|
| 11 |
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
|
| 12 |
+
letter-spacing: -0.02em;
|
| 13 |
+
}
|
| 14 |
+
.swiss-border {
|
| 15 |
+
border-top: 4px solid black;
|
| 16 |
+
}
|
| 17 |
+
</style>
|
| 18 |
+
</head>
|
| 19 |
+
<body class="bg-[#F0F0F0] text-black antialiased p-6 md:p-12">
|
| 20 |
+
|
| 21 |
+
<header class="max-w-7xl mx-auto mb-16 border-b-2 border-black pb-4">
|
| 22 |
+
<h1 class="text-6xl md:text-8xl font-black uppercase leading-none tracking-tighter">
|
| 23 |
+
System<br>Interface
|
| 24 |
+
</h1>
|
| 25 |
+
<div class="flex justify-between items-end mt-4">
|
| 26 |
+
<p class="text-sm font-bold uppercase tracking-widest">Automated API Management</p>
|
| 27 |
+
<p class="text-sm font-mono">v4.0.26</p>
|
| 28 |
+
</div>
|
| 29 |
+
</header>
|
| 30 |
+
|
| 31 |
+
<main class="max-w-7xl mx-auto">
|
| 32 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-0 border-l border-t border-black">
|
| 33 |
+
<% plugins.forEach((plugin, index) => { %>
|
| 34 |
+
<div class="card bg-white p-8 border-r border-b border-black flex flex-col justify-between hover:bg-black hover:text-white transition-colors duration-300 group">
|
| 35 |
+
<div>
|
| 36 |
+
<div class="flex items-center space-x-2 mb-8">
|
| 37 |
+
<span class="bg-black text-white group-hover:bg-white group-hover:text-black px-2 py-0.5 text-[10px] font-bold uppercase tracking-tighter">
|
| 38 |
+
<%= Array.isArray(plugin.method) ? plugin.method.join('/') : plugin.method %>
|
| 39 |
+
</span>
|
| 40 |
+
<span class="text-[10px] font-mono opacity-60"><%= plugin.path %></span>
|
| 41 |
+
</div>
|
| 42 |
+
|
| 43 |
+
<h2 class="text-3xl font-bold uppercase leading-tight mb-4 tracking-tighter">
|
| 44 |
+
<%= plugin.name.replace(/_/g, ' ') %>
|
| 45 |
+
</h2>
|
| 46 |
+
|
| 47 |
+
<p class="text-sm leading-relaxed mb-12 opacity-80 min-h-[3rem]">
|
| 48 |
+
<%= plugin.description %>
|
| 49 |
+
</p>
|
| 50 |
+
</div>
|
| 51 |
+
|
| 52 |
+
<div class="space-y-4">
|
| 53 |
+
<% if (plugin.path.includes('ocr')) { %>
|
| 54 |
+
<div class="space-y-2">
|
| 55 |
+
<input type="text" id="url-<%= index %>"
|
| 56 |
+
class="w-full bg-transparent border-b-2 border-black group-hover:border-white py-2 px-1 text-sm focus:outline-none placeholder:text-gray-400"
|
| 57 |
+
placeholder="PASTE IMAGE URL">
|
| 58 |
+
<div class="text-[10px] font-bold text-center">OR</div>
|
| 59 |
+
<label class="block cursor-pointer border-2 border-dashed border-black group-hover:border-white p-4 text-center text-[10px] font-black uppercase">
|
| 60 |
+
Upload Local File
|
| 61 |
+
<input type="file" id="file-<%= index %>" class="hidden" accept="image/*">
|
| 62 |
+
</label>
|
| 63 |
+
</div>
|
| 64 |
+
<% } else { %>
|
| 65 |
+
<input type="text" id="input-<%= index %>"
|
| 66 |
+
class="w-full bg-transparent border-b-2 border-black group-hover:border-white py-2 px-1 text-sm focus:outline-none placeholder:text-gray-400"
|
| 67 |
+
placeholder="<%= plugin.path.includes('bonsai') ? 'ASK SOMETHING...' : 'ENTER PROMPT...' %>">
|
| 68 |
+
<% } %>
|
| 69 |
+
|
| 70 |
+
<button onclick="runTest('<%= plugin.path %>', <%= index %>)"
|
| 71 |
+
class="w-full bg-black text-white group-hover:bg-white group-hover:text-black py-4 text-xs font-black uppercase tracking-[0.2em] transition-transform active:scale-95">
|
| 72 |
+
Execute Module
|
| 73 |
+
</button>
|
| 74 |
+
</div>
|
| 75 |
+
|
| 76 |
+
<div id="result-container-<%= index %>" class="hidden mt-8 pt-8 border-t border-black group-hover:border-white">
|
| 77 |
+
<div id="status-<%= index %>" class="text-[10px] font-bold uppercase mb-4 tracking-widest"></div>
|
| 78 |
+
<div id="media-<%= index %>" class="mb-4"></div>
|
| 79 |
+
<pre id="json-<%= index %>" class="text-[10px] font-mono overflow-x-auto p-4 bg-gray-100 text-black"></pre>
|
| 80 |
+
</div>
|
| 81 |
+
</div>
|
| 82 |
+
<% }) %>
|
| 83 |
+
</div>
|
| 84 |
+
</main>
|
| 85 |
+
|
| 86 |
+
<footer class="max-w-7xl mx-auto mt-24 border-t-4 border-black pt-4 flex justify-between text-[10px] font-black uppercase tracking-widest">
|
| 87 |
+
<span>RIEL AFRONIA AUGUSTUS</span>
|
| 88 |
+
<span>JAKARTA / 2026</span>
|
| 89 |
+
</footer>
|
| 90 |
+
|
| 91 |
+
<script>
|
| 92 |
+
async function runTest(path, id) {
|
| 93 |
+
const container = document.getElementById(`result-container-${id}`);
|
| 94 |
+
const status = document.getElementById(`status-${id}`);
|
| 95 |
+
const jsonPre = document.getElementById(`json-${id}`);
|
| 96 |
+
const media = document.getElementById(`media-${id}`);
|
| 97 |
+
|
| 98 |
+
container.classList.remove('hidden');
|
| 99 |
+
status.innerHTML = '⏳ LOADING_DATA...';
|
| 100 |
+
jsonPre.innerText = '';
|
| 101 |
+
media.innerHTML = '';
|
| 102 |
+
|
| 103 |
+
try {
|
| 104 |
+
let response;
|
| 105 |
+
|
| 106 |
+
if (path.includes('ocr')) {
|
| 107 |
+
const urlVal = document.getElementById(`url-${id}`).value;
|
| 108 |
+
const fileInput = document.getElementById(`file-${id}`).files[0];
|
| 109 |
+
|
| 110 |
+
if (fileInput) {
|
| 111 |
+
const formData = new FormData();
|
| 112 |
+
formData.append('file', fileInput);
|
| 113 |
+
response = await fetch(path, { method: 'POST', body: formData });
|
| 114 |
+
} else if (urlVal) {
|
| 115 |
+
response = await fetch(`${path}?image=${encodeURIComponent(urlVal)}`);
|
| 116 |
+
} else {
|
| 117 |
+
throw new Error("INPUT_REQUIRED: URL_OR_FILE");
|
| 118 |
+
}
|
| 119 |
+
} else {
|
| 120 |
+
const val = document.getElementById(`input-${id}`).value;
|
| 121 |
+
const param = (path.includes('bonsai') || path.includes('chat')) ? 'q' : 'prompt';
|
| 122 |
+
response = await fetch(`${path}?${param}=${encodeURIComponent(val)}`);
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
const data = await response.json();
|
| 126 |
+
status.innerHTML = response.ok ? '✅ STATUS_OK' : '❌ STATUS_FAILED';
|
| 127 |
+
jsonPre.innerText = JSON.stringify(data, null, 2);
|
| 128 |
+
|
| 129 |
+
const imgs = data.images || (data.result && Array.isArray(data.result) ? data.result : null);
|
| 130 |
+
if (imgs && Array.isArray(imgs)) {
|
| 131 |
+
imgs.forEach(url => {
|
| 132 |
+
const img = document.createElement('img');
|
| 133 |
+
img.src = url;
|
| 134 |
+
img.className = 'w-full grayscale hover:grayscale-0 transition-all duration-500 border border-black mb-2';
|
| 135 |
+
media.appendChild(img);
|
| 136 |
+
});
|
| 137 |
+
}
|
| 138 |
+
} catch (err) {
|
| 139 |
+
status.innerHTML = '❌ SYSTEM_ERROR';
|
| 140 |
+
jsonPre.innerText = err.message;
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
</script>
|
| 144 |
+
</body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
</html>
|