Initial commit: Miku Discord Bot
This commit is contained in:
65
bot/static/dm_analysis_section.html
Normal file
65
bot/static/dm_analysis_section.html
Normal file
@@ -0,0 +1,65 @@
|
||||
<div class="section">
|
||||
<h3>DM Analysis</h3>
|
||||
<p>Analyze Direct Message interactions from the past 7 days.</p>
|
||||
<button onclick="analyzeDMs()" id="analyze-button">Run 7-Day Analysis</button>
|
||||
<div id="analysis-results" class="analysis-results">
|
||||
<h4>Analysis Results</h4>
|
||||
<div class="analysis-stat">
|
||||
<span>Total Users Analyzed:</span>
|
||||
<span id="total-users">0</span>
|
||||
</div>
|
||||
<div class="analysis-stat">
|
||||
<span>Users with Activity:</span>
|
||||
<span id="active-users">0</span>
|
||||
</div>
|
||||
<div class="analysis-stat">
|
||||
<span>Total Messages:</span>
|
||||
<span id="total-messages">0</span>
|
||||
</div>
|
||||
<div class="analysis-stat">
|
||||
<span>Reports Generated:</span>
|
||||
<span id="reports-generated">0</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
async function analyzeDMs() {
|
||||
const button = document.getElementById('analyze-button');
|
||||
const results = document.getElementById('analysis-results');
|
||||
|
||||
// Disable button and show loading state
|
||||
button.disabled = true;
|
||||
button.textContent = 'Analyzing...';
|
||||
|
||||
try {
|
||||
const response = await fetch('/api/analyze-seven-days', {
|
||||
method: 'POST'
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
// Update results display
|
||||
document.getElementById('total-users').textContent = data.total_users_analyzed;
|
||||
document.getElementById('active-users').textContent = data.users_with_activity;
|
||||
document.getElementById('total-messages').textContent = data.total_messages;
|
||||
document.getElementById('reports-generated').textContent = data.reports_generated;
|
||||
|
||||
// Show results section
|
||||
results.style.display = 'block';
|
||||
|
||||
showNotification('DM Analysis completed successfully!');
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
showNotification('Error running DM analysis: ' + error.message);
|
||||
} finally {
|
||||
// Reset button state
|
||||
button.disabled = false;
|
||||
button.textContent = 'Run 7-Day Analysis';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
3222
bot/static/index.html
Normal file
3222
bot/static/index.html
Normal file
File diff suppressed because it is too large
Load Diff
8
bot/static/miku-discord.code-workspace
Normal file
8
bot/static/miku-discord.code-workspace
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "../.."
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
||||
Reference in New Issue
Block a user