Added analystics
This commit is contained in:
1 parent
0130b3c9af
commit
bd91cf9697
14 files changed
+255
-26
No files matched your search
@@ -0,0 +1,104 @@
|
||||
<%- include('../includes/header.ejs', {title: 'Analytics' + bot.name}) %>
|
||||
<br>
|
||||
<div class="p-10 ">
|
||||
<h2 style="margin-top: -10px;" class="text-white"><i class="fa fa-chart-bar"></i> Analytics</h2>
|
||||
<br>
|
||||
<div class="flex flex-wrap gap-10">
|
||||
<div class="mb-4 w-fit">
|
||||
<div class="bg-dark-200 border-left-primary shadow h-100 py-2">
|
||||
<div class="col-auto">
|
||||
<i class="fa fa-chevron-up fa-2x text-white"></i>
|
||||
</div>
|
||||
<div class="col mr-2">
|
||||
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1 text-white">Votes</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-white"><%= bot.votes || 0 %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4 w-fit">
|
||||
<div class="bg-dark-200 border-left-success shadow h-100 py-2">
|
||||
<div class="col-auto">
|
||||
<i class="fa fa-plus fa-2x text-white"></i>
|
||||
</div>
|
||||
<div class="col mr-2">
|
||||
<div class="text-xs font-weight-bold text-success text-uppercase mb-1 text-white">Invites
|
||||
</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-white"><%= bot.analytics_invites || 0 %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class=" mb-4 w-fit">
|
||||
<div class="card bg-dark-200 border-left-info shadow h-100 py-2">
|
||||
<div class="col-auto">
|
||||
<i class="fa fa-eye fa-2x text-white"></i>
|
||||
</div>
|
||||
<div class="col mr-2">
|
||||
<div class="text-xs font-weight-bold text-info text-uppercase mb-1 text-white">Visitors
|
||||
<!-- small style="opacity: 75%" class="text-white">/week</small -->
|
||||
</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-white"><%= bot.analytics_visitors || 0%></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4 w-fit">
|
||||
<div class="bg-dark-200 border-left-warning shadow h-100 py-2">
|
||||
<div class="col-auto">
|
||||
<i class="fa fa-circle status-<%= bota.presence.status %> fa-2x"></i>
|
||||
</div>
|
||||
<div class="col mr-2">
|
||||
<div class="text-xs font-weight-bold text-warning text-uppercase mb-1 text-white">Status</div>
|
||||
<div class="h5 mb-0 font-weight-bold text-white"><%= bota.presence.status.toUpperCase() %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2 font-italic">
|
||||
<h3 style="color: #5f79da" class="text-uppercase">Referrers</h3>
|
||||
<p style="color: rgb(126, 126, 126)">The domain names of the sites that most redirect to your bot's page.</p>
|
||||
</div>
|
||||
<table id="analytics_referring" class="table table-hover" style="width:100%; color: #fff">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Referring Url</th>
|
||||
<th>Total referrers</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if(bot.analytics) { %>
|
||||
<% Object.keys(bot.analytics).sort((a,b) => bot.analytics[b] - bot.analytics[a]).forEach(b => { %>
|
||||
<tr>
|
||||
<td translate="no"><span style="display: flex; align-items: center;"><%= b.split(",").join(".") %></span></td>
|
||||
<td><span style="display: flex; align-items: center;"><%= bot.analytics[b] %></span></td>
|
||||
</tr>
|
||||
<% }) %>
|
||||
<% } %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="mt-2 font-italic">
|
||||
<h3 style="color: #5f79da" class="text-uppercase">Countries</h3>
|
||||
<p style="color: rgb(126, 126, 126)">These are the countries that enter your bot's page.</p>
|
||||
</div>
|
||||
<table id="analytics_country" class="table table-hover" style="width:100%; color: #fff">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Country</th>
|
||||
<th>Total viewers</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
if(bot.country) {
|
||||
Object.keys(bot.country).sort((a,b) => bot.country[b] - bot.country[a]).forEach(b => {
|
||||
%>
|
||||
<tr>
|
||||
<td translate="no"><span style="display: flex; align-items: center;"><img src="https://www.countryflags.io/<%= b %>/flat/32.png"> <%= b %></span></td>
|
||||
<td><span style="display: flex; align-items: center;"><%= bot.country[b] %></span></td>
|
||||
</tr>
|
||||
<%
|
||||
})
|
||||
}
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -1,6 +1,12 @@
|
||||
<%- include("../includes/header.ejs", {title: "Edit " + bot.name}) %>
|
||||
<!-- create form -->
|
||||
<div class="container-sm p-10">
|
||||
<!-- button with redirect to /analystics -->
|
||||
<a href="/bot/<%= bot.id %>/analytics" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm w-full sm:w-auto px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800">
|
||||
<i class="fas fa-chart-bar"></i>
|
||||
<span>Analytics</span>
|
||||
</a>
|
||||
<br><br>
|
||||
<form method="post" action="">
|
||||
<div class="relative z-0 mb-6 w-full group">
|
||||
<textarea type="text" name="bot_description" id="bot_name" class="block py-2.5 px-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer" placeholder=" " required rows="5"><%= bot.long_description %></textarea>
|
||||
|
||||
Reference in new issue
Block a user