70 lines
2.9 KiB
HTML
70 lines
2.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Module Settings Test</title>
|
|
<style>
|
|
body { font-family: Arial; padding: 20px; }
|
|
.success { color: green; }
|
|
.error { color: red; }
|
|
.info { color: blue; }
|
|
pre { background: #f5f5f5; padding: 10px; border-radius: 4px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Module Settings API Test</h1>
|
|
<button onclick="testAPI()">Test API Endpoint</button>
|
|
<div id="result"></div>
|
|
|
|
<script>
|
|
async function testAPI() {
|
|
const resultDiv = document.getElementById('result');
|
|
resultDiv.innerHTML = '<p class="info">Testing...</p>';
|
|
|
|
try {
|
|
const response = await fetch('https://api.igny8.com/v1/system/settings/modules/enable/', {
|
|
headers: {
|
|
'Authorization': 'Bearer YOUR_TOKEN_HERE' // Replace with actual token
|
|
}
|
|
});
|
|
|
|
if (!response.ok) {
|
|
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
}
|
|
|
|
const data = await response.json();
|
|
|
|
resultDiv.innerHTML = `
|
|
<h2 class="success">✓ Success!</h2>
|
|
<h3>Raw Response:</h3>
|
|
<pre>${JSON.stringify(data, null, 2)}</pre>
|
|
|
|
<h3>Module Status:</h3>
|
|
<ul>
|
|
<li>Planner: ${data.data?.planner_enabled ? '✅ Enabled' : '❌ Disabled'}</li>
|
|
<li>Writer: ${data.data?.writer_enabled ? '✅ Enabled' : '❌ Disabled'}</li>
|
|
<li>Thinker: ${data.data?.thinker_enabled ? '✅ Enabled' : '❌ Disabled'}</li>
|
|
<li>Automation: ${data.data?.automation_enabled ? '✅ Enabled' : '❌ Disabled'}</li>
|
|
<li>Site Builder: ${data.data?.site_builder_enabled ? '✅ Enabled' : '❌ Disabled'}</li>
|
|
<li>Linker: ${data.data?.linker_enabled ? '✅ Enabled' : '❌ Disabled'}</li>
|
|
<li>Optimizer: ${data.data?.optimizer_enabled ? '✅ Enabled' : '❌ Disabled'}</li>
|
|
<li>Publisher: ${data.data?.publisher_enabled ? '✅ Enabled' : '❌ Disabled'}</li>
|
|
</ul>
|
|
`;
|
|
} catch (error) {
|
|
resultDiv.innerHTML = `
|
|
<h2 class="error">✗ Error</h2>
|
|
<p>${error.message}</p>
|
|
<p class="info">Note: This test requires authentication. Open browser console in your app and run:</p>
|
|
<pre>
|
|
// In browser console on your app:
|
|
fetch('/v1/system/settings/modules/enable/')
|
|
.then(r => r.json())
|
|
.then(data => console.log(data))
|
|
</pre>
|
|
`;
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|