diff --git a/controllers/statsController.js b/controllers/statsController.js index 8ece2323..b728ede6 100644 --- a/controllers/statsController.js +++ b/controllers/statsController.js @@ -69,79 +69,6 @@ module.exports = { } }); }, - getStatsSummary (startDate) { - logger.debug('retrieving request records'); - return new Promise((resolve, reject) => { - // get the raw Requests data - db.Request - .findAll({ - where: { - createdAt: { - gt: startDate, - }, - }, - }) - .then(data => { - let resultHashTable = {}; - let totalServe = 0; - let totalPublish = 0; - let totalShow = 0; - let totalCount = 0; - let totalSuccess = 0; - let totalFailure = 0; - let percentSuccess; - // summarise the data - for (let i = 0; i < data.length; i++) { - let key = data[i].action + data[i].url; - totalCount += 1; - switch (data[i].action) { - case 'SERVE': - totalServe += 1; - break; - case 'PUBLISH': - totalPublish += 1; - break; - case 'SHOW': - totalShow += 1; - break; - default: break; - } - if (resultHashTable[key]) { - resultHashTable[key]['count'] += 1; - if (data[i].result === 'success') { - resultHashTable[key]['success'] += 1; - totalSuccess += 1; - } else { - resultHashTable[key]['failure'] += 1; - totalFailure += 1; - } - } else { - resultHashTable[key] = { - action : data[i].action, - url : data[i].url, - count : 1, - success: 0, - failure: 0, - }; - if (data[i].result === 'success') { - resultHashTable[key]['success'] += 1; - totalSuccess += 1; - } else { - resultHashTable[key]['failure'] += 1; - totalFailure += 1; - } - } - } - percentSuccess = Math.round(totalSuccess / totalCount * 100); - // return results - resolve({ records: resultHashTable, totals: { totalServe, totalPublish, totalShow, totalCount, totalSuccess, totalFailure }, percentSuccess }); - }) - .catch(error => { - logger.error('sequelize error >>', error); - reject(error); - }); - }); - }, getTrendingClaims (startDate) { logger.debug('retrieving trending requests'); return new Promise((resolve, reject) => { diff --git a/public/assets/css/general.css b/public/assets/css/general.css index bcbdc752..3deed8d8 100644 --- a/public/assets/css/general.css +++ b/public/assets/css/general.css @@ -77,7 +77,7 @@ h2 { } .h2--secondary { - color: #9b9b9b; + color: lightgrey; } .h2--top { @@ -304,7 +304,6 @@ align-content-left { /* ERROR MESSAGES */ .info-message { - font-weight: bold; font-size: medium; margin: 0px; padding: 0.3em; diff --git a/routes/api-routes.js b/routes/api-routes.js index 3d1f5c1b..0e51c70c 100644 --- a/routes/api-routes.js +++ b/routes/api-routes.js @@ -130,7 +130,6 @@ module.exports = (app) => { return publish(publishParams, fileName, fileType); }) .then(result => { - // postToStats('publish', originalUrl, ip, null, null, 'success'); res.status(200).json({ success: true, message: { diff --git a/routes/page-routes.js b/routes/page-routes.js index 9f64941e..a752c709 100644 --- a/routes/page-routes.js +++ b/routes/page-routes.js @@ -1,5 +1,5 @@ const errorHandlers = require('../helpers/errorHandlers.js'); -const { postToStats, getStatsSummary, getTrendingClaims, getRecentClaims } = require('../controllers/statsController.js'); +const { getTrendingClaims, getRecentClaims } = require('../controllers/statsController.js'); module.exports = (app) => { // route to log out @@ -52,23 +52,6 @@ module.exports = (app) => { errorHandlers.handleRequestError(null, null, null, error, res); }); }); - // route to show statistics for spee.ch - app.get('/stats', ({ ip, originalUrl, user }, res) => { - // get and render the content - const startDate = new Date(); - startDate.setDate(startDate.getDate() - 1); - getStatsSummary(startDate) - .then(result => { - postToStats('show', originalUrl, ip, null, null, 'success'); - res.status(200).render('statistics', { - user, - result, - }); - }) - .catch(error => { - errorHandlers.handleRequestError(null, null, null, error, res); - }); - }); // route to send embedable video player (for twitter) app.get('/embed/:claimId/:name', ({ params }, res) => { const claimId = params.claimId; diff --git a/views/channel.handlebars b/views/channel.handlebars index 9ae50276..0f81e08f 100644 --- a/views/channel.handlebars +++ b/views/channel.handlebars @@ -1,6 +1,6 @@ <div class="row row--padded"> <div class="row"> - <h2>{{this.channelName}}<span class="h2--secondary">:{{this.longChannelId}}</span></h2> + <p>Below are the contents for {{this.channelName}}:{{this.longChannelId}}</p> <div class="grid"> {{#each this.claims}} {{> gridItem}} @@ -13,7 +13,7 @@ {{#if this.previousPage}} <a class="link--primary" href="/{{this.channelName}}:{{this.longChannelId}}?p={{this.previousPage}}">Previous</a> {{else}} - <a disabled>Previous </a> + <a disabled>Previous</a> {{/if}} | {{#if this.nextPage}} @@ -43,4 +43,5 @@ }); }); + </script> \ No newline at end of file diff --git a/views/layouts/main.handlebars b/views/layouts/main.handlebars index 9837366c..e4a7efc5 100644 --- a/views/layouts/main.handlebars +++ b/views/layouts/main.handlebars @@ -16,6 +16,8 @@ <meta property="og:image" content="https://spee.ch/assets/img/content-freedom-64px.png"> <meta property="og:url" content="http://spee.ch/"> <meta property="og:description" content="Open-source, decentralized image and video hosting."> + <!--google font--> + <link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet"> <!-- google analytics --> {{ googleAnalytics }} </head> diff --git a/views/layouts/show.handlebars b/views/layouts/show.handlebars index b752f40d..694a4eb8 100644 --- a/views/layouts/show.handlebars +++ b/views/layouts/show.handlebars @@ -13,6 +13,8 @@ {{{addTwitterCard fileInfo.fileType openGraphInfo.source openGraphInfo.embedUrl openGraphInfo.directFileUrl}}} {{{addOpenGraph fileInfo.title fileInfo.fileType openGraphInfo.showUrl openGraphInfo.source fileInfo.description fileInfo.thumbnail}}} {{/unless}} + <!--google font--> + <link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet"> <!-- google analytics --> {{ googleAnalytics }} </head> diff --git a/views/partials/navBar.handlebars b/views/partials/navBar.handlebars index 4535c01b..cb403b2c 100644 --- a/views/partials/navBar.handlebars +++ b/views/partials/navBar.handlebars @@ -7,13 +7,13 @@ <g id="About"> <g id="Publish-Form-V2-_x28_filled_x29_" transform="translate(-42.000000, -23.000000)"> <g id="Group-17" transform="translate(42.000000, 22.000000)"> - <text transform="matrix(1 0 0 1 0 20)" font-size="27">Spee<h</text> + <text transform="matrix(1 0 0 1 0 20)" font-size="25" font-family="Roboto">Spee<h</text> <g id="Group-16" transform="translate(0.000000, 30.000000)"> - <path id="Line-8" fill="none" stroke="#09F911" stroke-linecap="square" d="M0.5,1.5h15"/> - <path id="Line-8-Copy" fill="none" stroke="#029D74" stroke-linecap="square" d="M16.5,1.5h15"/> - <path id="Line-8-Copy-2" fill="none" stroke="#E35BD8" stroke-linecap="square" d="M32.5,1.5h15"/> - <path id="Line-8-Copy-3" fill="none" stroke="#4156C5" stroke-linecap="square" d="M48.5,1.5h15"/> - <path id="Line-8-Copy-4" fill="none" stroke="#635688" stroke-linecap="square" d="M64.5,1.5h15"/> + <path id="Line-8" fill="none" stroke="#09F911" stroke-width="1" stroke-linecap="square" d="M0.5,1.5h15"/> + <path id="Line-8-Copy" fill="none" stroke="#029D74" stroke-width="1" stroke-linecap="square" d="M16.5,1.5h15"/> + <path id="Line-8-Copy-2" fill="none" stroke="#E35BD8" stroke-width="1" stroke-linecap="square" d="M32.5,1.5h15"/> + <path id="Line-8-Copy-3" fill="none" stroke="#4156C5" stroke-width="1" stroke-linecap="square" d="M48.5,1.5h15"/> + <path id="Line-8-Copy-4" fill="none" stroke="#635688" stroke-width="1" stroke-linecap="square" d="M64.5,1.5h15"/> </g> </g> </g> diff --git a/views/partials/publishForm-Thumbnail.handlebars b/views/partials/publishForm-Thumbnail.handlebars index 449c3016..3d582159 100644 --- a/views/partials/publishForm-Thumbnail.handlebars +++ b/views/partials/publishForm-Thumbnail.handlebars @@ -1,4 +1,4 @@ -<div class="row" id="publish-thumbnail" hidden="true"> +<div class="row row--padded row--wide row--no-top" id="publish-thumbnail" hidden="true"> <div class="column column--3 column--sml-10"> <label class="label">Thumbnail:</label> </div><div class="column column--6 column--sml-10"> diff --git a/views/partials/releaseBanner.handlebars b/views/partials/releaseBanner.handlebars index b3ad4d74..e23a60a5 100644 --- a/views/partials/releaseBanner.handlebars +++ b/views/partials/releaseBanner.handlebars @@ -1,3 +1,3 @@ <div id="new-release-banner" class="row row--short row--wide"> - Hi there! You've stumbled upon the new version of spee<h, launching soon! Send us your feedback in <a style="color:white; text-decoration: underline" target="_blank" href="https://discord.gg/YjYbwhS">our discord</a> + Hi there! You've stumbled upon the new version of Spee<h, launching soon! Send us your feedback in <a style="color:white; text-decoration: underline" target="_blank" href="https://discord.gg/YjYbwhS">our discord</a> </div> \ No newline at end of file