Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Countly/countly-server
Browse files Browse the repository at this point in the history
  • Loading branch information
iartem committed Apr 12, 2016
2 parents 2e79259 + aed3b0e commit 65918b4
Show file tree
Hide file tree
Showing 35 changed files with 3,468 additions and 50 deletions.
7 changes: 4 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ module.exports = function(grunt) {
stylesheets = path.join(pluginPath, 'frontend/public/stylesheets'),
images = path.join(pluginPath, 'frontend/public/images', plugin);

if (fs.statSync(javascripts).isDirectory()) {
if (fs.existsSync(javascripts) && fs.statSync(javascripts).isDirectory()) {
files = fs.readdirSync(javascripts);
if (files.length) {
// move models to the top, then all dependencies, then views
Expand All @@ -182,7 +182,7 @@ module.exports = function(grunt) {
}
}

if (fs.statSync(stylesheets).isDirectory()) {
if (fs.existsSync(stylesheets) && fs.statSync(stylesheets).isDirectory()) {
files = fs.readdirSync(stylesheets);
files.forEach(function(name){
var file = path.join(stylesheets, name);
Expand All @@ -193,7 +193,7 @@ module.exports = function(grunt) {
}

try {
if (fs.statSync(images).isDirectory()) {
if (fs.existsSync(images) && fs.statSync(images).isDirectory()) {
img.push({expand: true, cwd:'plugins/' + plugin + '/frontend/public/images/' + plugin + '/', filter:'isFile', src:'**', dest: 'frontend/express/public/images/' + plugin + '/'});
}
} catch(err) {
Expand Down Expand Up @@ -236,6 +236,7 @@ module.exports = function(grunt) {
};

[path.join(__dirname, 'frontend/express/public/localization/dashboard'), path.join(__dirname, 'frontend/express/public/localization/help'), path.join(__dirname, 'frontend/express/public/localization/mail')].forEach(function(dir){
if (!fs.existsSync(dir)) return;
fs.readdirSync(dir).forEach(function(name){
var file = path.join(dir, name);
if (fs.statSync(file).isFile()) {
Expand Down
7 changes: 4 additions & 3 deletions api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ var http = require('http'),
cluster = require('cluster'),
formidable = require('formidable'),
os = require('os'),
countlyConfig = require('./config'),
countlyConfig = require('./config', 'dont-enclose'),
plugins = require('../plugins/pluginManager.js'),
jobsWorker,
jobsWorkerName, jobsWorker,
workers = [];

plugins.setConfigs("api", {
Expand Down Expand Up @@ -61,7 +61,8 @@ if (cluster.isMaster) {
});
};

jobsWorker = require('child_process').fork(__dirname + '/parts/mgmt/jobsRunner.js');
jobsWorkerName = process.enclose ? 'jobsRunner.compiled.js' : 'jobsRunner.js';
jobsWorker = require('child_process').fork(__dirname + '/parts/mgmt/' + jobsWorkerName);

workers.forEach(passToMaster);
passToMaster(jobsWorker);
Expand Down
14 changes: 8 additions & 6 deletions api/lib/countly.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -986,14 +986,20 @@ var countlyCommon = {},
break;
}
}

if(isSpecialPeriod){
_currMoment.subtract('days', daysInPeriod-1);
startTimestamp = _currMoment.unix();
_currMoment.add('days', daysInPeriod-1);
}

// Check whether period object is array
if (Object.prototype.toString.call(_period) === '[object Array]' && _period.length == 2) {
var fromDate = new Date(_period[0]),
toDate = new Date(_period[1]);

startTimestamp = fromDate.getTime();
endTimestamp = toDate.getTime();
startTimestamp = fromDate.getTime()/1000;
endTimestamp = toDate.getTime()/1000;
fromDate.setTimezone(_appTimezone);
toDate.setTimezone(_appTimezone);

Expand Down Expand Up @@ -1024,10 +1030,6 @@ var countlyCommon = {},
if (isSpecialPeriod) {
var yearChanged = false,
currentYear = 0;

_currMoment.subtract('days', daysInPeriod-1);
startTimestamp = _currMoment.unix();
_currMoment.add('days', daysInPeriod-1);

for (var i = (daysInPeriod - 1); i > -1; i--) {

Expand Down
2 changes: 1 addition & 1 deletion api/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var common = {},
mongo = require('mongoskin'),
logger = require('./log.js'),
plugins = require('../../plugins/pluginManager.js'),
countlyConfig = require('./../config');
countlyConfig = require('./../config', 'dont-enclose');

(function (common) {

Expand Down
2 changes: 1 addition & 1 deletion api/utils/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* - if error happened, arg1 is a first argument AFTER error, it's not an error
*/

var prefs = require('../config.js').logging,
var prefs = require('../config.js', 'dont-enclose').logging,
colors = require('colors'),
deflt = (prefs && prefs.default) ? prefs.default : 'error';

Expand Down
6 changes: 3 additions & 3 deletions bin/commands/scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ if [ "$1" = "translations" ]; then
elif [ "$1" = "geoip" ]; then
(cd $DIR/../../../node_modules/geoip-lite ; npm run-script updatedb ;)
elif [ "$1" = "devices" ]; then
wget -nv https://raw.githubusercontent.com/Countly/countly-localization/master/data/countly.device.list.js -O $DIR/../../../frontend/express/public/javascripts/countly/countly.device.list.js
wget -nv --no-check-certificate https://raw.githubusercontent.com/Countly/countly-localization/master/data/countly.device.list.js -O $DIR/../../../frontend/express/public/javascripts/countly/countly.device.list.js
elif [ "$1" = "sdk-web" ]; then
mkdir -p $DIR/../../../frontend/express/public/sdk/web;
wget -nv https://raw.githubusercontent.com/Countly/countly-sdk-web/master/lib/countly.min.js -O $DIR/../../../frontend/express/public/sdk/web/countly.min.js
wget -nv https://raw.githubusercontent.com/Countly/countly-sdk-web/master/lib/countly.js -O $DIR/../../../frontend/express/public/sdk/web/countly.js
wget -nv --no-check-certificate https://raw.githubusercontent.com/Countly/countly-sdk-web/master/lib/countly.min.js -O $DIR/../../../frontend/express/public/sdk/web/countly.min.js
wget -nv --no-check-certificate https://raw.githubusercontent.com/Countly/countly-sdk-web/master/lib/countly.js -O $DIR/../../../frontend/express/public/sdk/web/countly.js
else
usage ;
fi
2 changes: 1 addition & 1 deletion frontend/express/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var versionInfo = require('./version.info'),
countlyMail = require('../../api/parts/mgmt/mail.js'),
countlyStats = require('../../api/parts/data/stats.js'),
plugins = require('../../plugins/pluginManager.js'),
countlyConfig = require('./config');
countlyConfig = require('./config', 'dont-enclose');

var COUNTLY_NAMED_TYPE = "Countly Community Edition v"+COUNTLY_VERSION;
var COUNTLY_TYPE_CE = true;
Expand Down
2 changes: 2 additions & 0 deletions frontend/express/public/javascripts/countly/countly.device.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
{ "name":"u" },
{ "name":"n" }
]);

chartData.chartData = countlyCommon.mergeMetricsByName(chartData.chartData, "device");

var deviceNames = _.pluck(chartData.chartData, 'device'),
deviceTotal = _.pluck(chartData.chartData, 'u'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,13 @@
max : null,
min : 0,
width : 120,//$(this).parent().outerWidth() - (($(this).parent().outerWidth()) * 0.2),
maxBars : 10,
maxBars : 16,
padding : 10,
borderBottom : 2
borderBottom : 1
},
function (opts) {
opts.width = 120//$(this).parent().outerWidth() - (($(this).parent().outerWidth()) * 0.2)
opts.height = 25;

var $this = $(this)
var values = $this.text().split(opts.delimeter)
Expand Down Expand Up @@ -274,7 +275,7 @@
}

if (opts.borderBottom) {
context.fillRect(0, (height - opts.borderBottom), width + opts.padding, opts.borderBottom);
context.fillRect(0 + (opts.padding / 2), (height - opts.borderBottom), width, opts.borderBottom);
}

$this.wrapInner($("<span>").hide()).append(canvas)
Expand Down
25 changes: 24 additions & 1 deletion frontend/express/public/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
}


body { margin:0; padding:0; overflow:auto; /*background-image:url('../images/dashboard/bg.png');*/ background-color:#F5F5F5; user-select:text; }
body { margin:0; padding:0; overflow:auto; /*background-image:url('../images/dashboard/bg.png');*/ background-color:#F5F5F5; user-select:text; font-family: Ubuntu,Helvetica,sans-serif; }
#content-container { margin-left:224px; min-width:768px; min-height: 400px; padding:16px; padding-bottom:35px; overflow:auto;}
#content {padding-bottom: 50px; }
a { color:inherit; text-decoration:none; }
Expand Down Expand Up @@ -331,6 +331,29 @@ a:active { color:inherit; }
.pie-overlay.one.platforms { background-image:url('../images/dashboard/platforms.png'); }
.pie-overlay.two.platforms { background-image:url('../images/dashboard/platform-versions.png'); }
.pieLabel div { font-size:11px !important; }

.big-numbers.top .inner { height:170px; cursor:pointer; }
.big-numbers.top .select { bottom:1px; cursor:pointer; padding-top:7px; font-size:12px; line-height:111%; color:#969696; position:absolute; height:23px; width:100%; background-color: transparent !important; background-image: none !important; box-shadow: none; border:none; }
.big-numbers.top.active .select { border-bottom:1px solid #FFF; bottom:0; }
.big-numbers.top .inner .logo { background-image:url('../images/dashboard/dashboard_icons.png'); margin:0 auto; font-size: 30px; line-height: 30px; width: 30px; height: 30px; padding-top: 15px; margin-bottom: 10px; }
.big-numbers.top .inner .logo.ion { background-image:none; font-size: 30px; line-height: 30px; color: #969696; }
.big-numbers.top.active .inner .logo.ion { color: #535353; }
.big-numbers.top .inner .logo.material { background-image:none; }
.big-numbers.top .inner .logo.material .material-icons { font-size: 30px; line-height: 30px; color: #969696; }
.big-numbers.top.active .inner .logo.material .material-icons { color: #535353; }
.big-numbers.top .number { font:30px Oswald; color:#666; margin: 0; }
.big-numbers.top.active .number { color:#333; }
.big-numbers.top .title { padding-top:3px; padding-bottom:3px; font-size:10px; color:#666666; }
.big-numbers.top .spark { margin-top:14px; }
.big-numbers.top.active .spark { display: none; }
.big-numbers.top .trend { display: none; font-size:11px; margin-top:20px; position: relative; top:inherit; right: inherit; width: auto; height: auto; }
.big-numbers.top .trend .material-icons { font-size: 16px; vertical-align: middle; margin-right:5px; }
.big-numbers.top .trend.u,
.big-numbers.top .trend.u .change { color:#6BB96E !important; }
.big-numbers.top .trend.d,
.big-numbers.top .trend.d .change { color:#C94C4C !important; }
.big-numbers.top.active .trend { display: block; }
.big-numbers.top .change { display:inline-block; vertical-align: middle; position: relative; top:inherit; right: inherit; }
/* DASHBOARD END */

/* APP NAVIGATION */
Expand Down
Binary file not shown.

Large diffs are not rendered by default.

0 comments on commit 65918b4

Please sign in to comment.