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>
|
||||
|
||||
@@ -29,12 +29,18 @@
|
||||
<meta property="og:description" content="<%= server.description %>
|
||||
|
||||
🟢 <%= global.bsl.guilds.cache.get(server.id).members.cache.filter(a => a.presence?.status).size %> onlineᅠᅠᅠᅠ⚫ <%= global.bsl.guilds.cache.get(server.id).memberCount %> members">
|
||||
<% } %>
|
||||
<meta property="og:title" content="BotsCord.xyz" />
|
||||
<% } else if(typeof bota !="undefined" ) { %>
|
||||
<meta property="og:url" content="http://botscord.xyz/server/<%=bota.id %>" />
|
||||
<meta property="og:image" content="https://cdn.discordapp.com/avatars/<%=bota.id %>/<%=bota.avatar %>.png" />
|
||||
<meta property="og:description" content="<%= bot.description %>">
|
||||
<% }else{ %>
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="http://botscord.xyz" />
|
||||
<meta property="og:image" content="http://botscord.xyz/img/logo.png" />
|
||||
<meta property="og:description" content="Botscord is a place where you can promote and vote for your favorite bot/server!" />
|
||||
<% } %>
|
||||
<meta property="og:title" content="BotsCord.xyz" />
|
||||
|
||||
<meta name="theme-color" content="#FF0000">
|
||||
<meta name="author" content="BotsCord">
|
||||
<meta name="robots" content="index, follow">
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<%- include('../includes/header.ejs', { title: server.name, server: server}) %>
|
||||
<br><br><br><br>
|
||||
<div class="flex space-x-4 py-2 lg:h-5/6 sm:min-h-min">
|
||||
<div class="p-10 bg-blue-color w-2/3 text-white h-full m-4 mx-14 text-ellipsis">
|
||||
<div class="lg:flex space-x-4 py-2 lg:h-5/6 sm:min-h-min">
|
||||
<div class="p-10 bg-blue-color w-full text-white h-full m-4 lg:mx-14 text-ellipsis lg:w-2/3">
|
||||
<p class="text-white text-clip">
|
||||
<pre style="white-space: pre-wrap;" class="text-clip break-words w-full h-full"><br><%= server.long_description %></pre>
|
||||
<pre style="white-space: pre-wrap;" class="text-clip break-wordsw-full h-full"><br><%= server.long_description %></pre>
|
||||
</p>
|
||||
</div>
|
||||
<div class="bg-blue-color w-1/4 p-10 text-white h-full m-4 ">
|
||||
<img class="w-full rounded-full" src="<%= serverr.icon %>" alt="<%= server.name %>" onerror="this.src='/img/logo.png'">
|
||||
<div class="bg-blue-color w-full p-10 text-white h-full lg:w-1/4 lg:m-4">
|
||||
<img class="w-full rounded-full max-w-xs" src="https://cdn.discordapp.com/avatars/<%=server.id %>/<%=serverr.icon %>.png" alt="<%= server.name %>" onerror="this.src='/img/logo.png'">
|
||||
<h1 class="text-3xl">
|
||||
<%= server.name %>
|
||||
</h1>
|
||||
@@ -17,7 +17,7 @@
|
||||
Join</a>
|
||||
<br>
|
||||
<% if(user) { if(serverr.members.cache.get(user.id)) {
|
||||
if(serverr.members.cache.get(user.id).permissions.has('ADMINISTRATOR')) { %>
|
||||
if(serverr.members.cache.get(user.id).permissions.has(global.discord.PermissionsBitField.adminstrator)) { %>
|
||||
<div class="h6 mt-4">
|
||||
<i class="fa user-crown"></i>Owner Options
|
||||
</div>
|
||||
@@ -37,7 +37,7 @@
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
<div class="box-2-p"><i class="mt-1 fa fa-users"></i></div>
|
||||
<p class="box-2">Members: <%= serverr.memberCount.toLocaleString().replace(',', '.' ) %>/ <%= global.bsl.guilds.cache.get(server.id).members.cache.filter(a => a.presence?.status).size %> online
|
||||
<p class="box-2">Members: <%= serverr.memberCount.toLocaleString().replace(',', '.' ) %>/ <%= serverr.members.cache.filter(a => a.presence?.status).size %> online
|
||||
</p>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
|
||||
@@ -1 +1 @@
|
||||
<%- include('../../includes/header.ejs', {title: 'User' + user.username}) %>
|
||||
<%- include('../../includes/header.ejs', {title: 'User' + user.username}) %>
|
||||
Reference in new issue
Block a user