Skip to content

Commit 9f54c41

Browse files
authored
Merge pull request #3238 from Countly/next
Next
2 parents 8185211 + 05f4608 commit 9f54c41

File tree

73 files changed

+2081
-3313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2081
-3313
lines changed

Gruntfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ module.exports = function(grunt) {
126126
'frontend/express/public/javascripts/countly/countly.carrier.js',
127127
'frontend/express/public/javascripts/countly/countly.total.users.js',
128128
'frontend/express/public/javascripts/countly/countly.app.users.js',
129-
'frontend/express/public/javascripts/countly/countly.template.js',
129+
'frontend/express/public/javascripts/countly/countly.view.js',
130130
'frontend/express/public/javascripts/countly/vue/core.js',
131131
'frontend/express/public/javascripts/countly/vue/container.js',
132+
'frontend/express/public/javascripts/countly/countly.template.js',
132133
'frontend/express/public/javascripts/countly/vue/helpers.js',
133134
'frontend/express/public/javascripts/countly/vue/data/vuex.js',
134135
'frontend/express/public/javascripts/countly/countly.task.manager.js',

api/configextender.js

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,81 @@ const OVERRIDES = {
2626
REPLSETSERVERS: 'replSetServers',
2727
REPLICANAME: 'replicaName',
2828
MAX_POOL_SIZE: 'max_pool_size',
29-
DBOPTIONS: 'dbOptions',
30-
SERVEROPTIONS: 'serverOptions'
29+
DBOPTIONS: {
30+
__name: "dbOptions",
31+
AUTHMECHANISM: 'authMechanism',
32+
AUTHMECHANISMPROPERTIES: 'authMechanismProperties',
33+
AUTHSOURCE: 'authSource',
34+
AUTOENCRYPTION: 'autoEncryption',
35+
BSONREGEXP: 'bsonRegExp',
36+
CHECKKEYS: 'checkKeys',
37+
CHECKSERVERIDENTITY: 'checkServerIdentity',
38+
CONNECTTIMEOUTMS: 'connectTimeoutMS',
39+
DIRECTCONNECTION: 'directConnection',
40+
DRIVERINFO: 'driverInfo',
41+
ECDHCURVE: 'ecdhCurve',
42+
ENABLEUTF8VALIDATION: 'enableUtf8Validation',
43+
FIELDSASRAW: 'fieldsAsRaw',
44+
FORCESERVEROBJECTID: 'forceServerObjectId',
45+
HEARTBEATFREQUENCYMS: 'heartbeatFrequencyMS',
46+
IGNOREUNDEFINED: 'ignoreUndefined',
47+
KEEPALIVE: 'keepAlive',
48+
KEEPALIVEINITIALDELAY: 'keepAliveInitialDelay',
49+
LOADBALANCED: 'loadBalanced',
50+
LOCALADDRESS: 'localAddress',
51+
LOCALPORT: 'localPort',
52+
LOCALTHRESHOLDMS: 'localThresholdMS',
53+
LOGGERLEVEL: 'loggerLevel',
54+
MAXIDLETIMEMS: 'maxIdleTimeMS',
55+
MAXPOOLSIZE: 'maxPoolSize',
56+
MAXSTALENESSSECONDS: 'maxStalenessSeconds',
57+
MINDHSIZE: 'minDHSize',
58+
MINHEARTBEATFREQUENCYMS: 'minHeartbeatFrequencyMS',
59+
MINPOOLSIZE: 'minPoolSize',
60+
MONITORCOMMANDS: 'monitorCommands',
61+
NODELAY: 'noDelay',
62+
PKFACTORY: 'pkFactory',
63+
PROMISELIBRARY: 'promiseLibrary',
64+
PROMOTEBUFFERS: 'promoteBuffers',
65+
PROMOTELONGS: 'promoteLongs',
66+
PROMOTEVALUES: 'promoteValues',
67+
PROXYHOST: 'proxyHost',
68+
PROXYPASSWORD: 'proxyPassword',
69+
PROXYPORT: 'proxyPort',
70+
PROXYUSERNAME: 'proxyUsername',
71+
READCONCERN: 'readConcern',
72+
READCONCERNLEVEL: 'readConcernLevel',
73+
READPREFERENCE: 'readPreference',
74+
READPREFERENCETAGS: 'readPreferenceTags',
75+
REJECTUNAUTHORIZED: 'rejectUnauthorized',
76+
REPLICASET: 'replicaSet',
77+
RETRYREADS: 'retryReads',
78+
RETRYWRITES: 'retryWrites',
79+
SECURECONTEXT: 'secureContext',
80+
SECUREPROTOCOL: 'secureProtocol',
81+
SERIALIZEFUNCTIONS: 'serializeFunctions',
82+
SERVERAPI: 'serverApi',
83+
SERVERSELECTIONTIMEOUTMS: 'serverSelectionTimeoutMS',
84+
SOCKETTIMEOUTMS: 'socketTimeoutMS',
85+
SRVMAXHOSTS: 'srvMaxHosts',
86+
SRVSERVICENAME: 'srvServiceName',
87+
SSLCA: 'sslCA',
88+
SSLCRL: 'sslCRL',
89+
SSLCERT: 'sslCert',
90+
SSLKEY: 'sslKey',
91+
SSLPASS: 'sslPass',
92+
SSLVALIDATE: 'sslValidate',
93+
TLSALLOWINVALIDCERTIFICATES: 'tlsAllowInvalidCertificates',
94+
TLSALLOWINVALIDHOSTNAMES: 'tlsAllowInvalidHostnames',
95+
TLSCAFILE: 'tlsCAFile',
96+
TLSCERTIFICATEFILE: 'tlsCertificateFile',
97+
TLSCERTIFICATEKEYFILE: 'tlsCertificateKeyFile',
98+
TLSCERTIFICATEKEYFILEPASSWORD: 'tlsCertificateKeyFilePassword',
99+
TLSINSECURE: 'tlsInsecure',
100+
WAITQUEUETIMEOUTMS: 'waitQueueTimeoutMS',
101+
WTIMEOUTMS: 'wtimeoutMS',
102+
ZLIBCOMPRESSIONLEVEL: 'zlibCompressionLevel',
103+
},
31104
},
32105

33106
API: {
@@ -66,6 +139,9 @@ function dig(config, over, name, value) {
66139
sub = over[n];
67140
over[n] = {};
68141
}
142+
else if (over[n] && over[n].__name) {
143+
sub = over[n].__name;
144+
}
69145
else {
70146
sub = Object.keys(config).filter(k => k.toUpperCase() === n)[0];
71147
}

api/parts/data/cache.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class DataStore {
5454
constructor(size, age, dispose, Cls) {
5555
this.size = size;
5656
this.age = age;
57-
this.lru = new LRU({max: size || Number.MAX_SAFE_INTEGER, maxAge: age || Number.MAX_SAFE_INTEGER, dispose: dispose, noDisposeOnSet: true, updateAgeOnGet: true});
57+
this.lru = new LRU({max: size || 10000, ttl: age || Number.MAX_SAFE_INTEGER, dispose: dispose, noDisposeOnSet: true, updateAgeOnGet: true});
5858
if (Cls) {
5959
this.Cls = Cls;
6060
this.Clas = require('../../../' + Cls[0])[Cls[1]];
@@ -588,7 +588,7 @@ class CacheMaster {
588588
this.operators[group] = {init, Cls, read, write, update, remove};
589589

590590
if (!size && size !== 0) {
591-
size = config.api && config.api.cache && config.api.cache[group] && config.api.cache[group].size !== undefined ? config.api.cache[group].size : Number.MAX_SAFE_INTEGER;
591+
size = config.api && config.api.cache && config.api.cache[group] && config.api.cache[group].size !== undefined ? config.api.cache[group].size : 10000;
592592
}
593593

594594
if (!age && age !== 0) {

api/parts/data/fetch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ fetch.getTotalUsersObjWithOptions = function(metric, params, options, callback)
14441444
}
14451445

14461446
if (groupBy === "users") {
1447-
options.db.collection("app_users" + params.app_id).find(match).count(function(error, appUsersDbResult) {
1447+
options.db.collection("app_users" + params.app_id).count(match, function(error, appUsersDbResult) {
14481448
if (!error && appUsersDbResult) {
14491449
callback([{ "_id": "users", "u": appUsersDbResult }]);
14501450
}
@@ -2045,8 +2045,8 @@ fetch.alljobs = async function(metric, params) {
20452045
fetch.jobDetails = async function(metric, params) {
20462046
const columns = ["schedule", "next", "finished", "status", "data", "duration"];
20472047
let sort = {};
2048+
const total = await common.db.collection('jobs').count({ name: params.qstring.name });
20482049
const cursor = common.db.collection('jobs').find({ name: params.qstring.name });
2049-
const total = await cursor.count();
20502050
sort[columns[params.qstring.iSortCol_0 || 0]] = (params.qstring.sSortDir_0 === "asc") ? 1 : -1;
20512051
cursor.sort(sort);
20522052
cursor.skip(Number(params.qstring.iDisplayStart || 0));

api/parts/mgmt/app_users.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ usersApi.count = function(app_id, query, callback) {
330330
query: query
331331
});
332332

333-
common.db.collection('app_users' + app_id).find(query).count(callback);
333+
common.db.collection('app_users' + app_id).count(query, callback);
334334
};
335335

336336
/**

api/parts/mgmt/users.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ usersApi.deleteOwnAccount = function(params) {
666666
verifyMemberArgon2Hash(params.member.email, params.qstring.password, (err, member) => {
667667
if (member) {
668668
if (member.global_admin) {
669-
common.db.collection('members').find({'global_admin': true}).count(function(err2, count) {
669+
common.db.collection('members').count({'global_admin': true}, function(err2, count) {
670670
if (err2) {
671671
console.log(err2);
672672
common.returnMessage(params, 400, 'Mongo error');
@@ -972,7 +972,7 @@ usersApi.fetchNotes = async function(params) {
972972
log.e(' got error while paring query notes request', e);
973973
}
974974
let count = 0;
975-
common.db.collection('notes').find(query).count(function(error, noteCount) {
975+
common.db.collection('notes').count(query, function(error, noteCount) {
976976
if (!error && noteCount) {
977977
count = noteCount;
978978
common.db.collection('notes').find(query)

api/utils/taskmanager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ taskmanager.getTableQueryResult = async function(options, callback) {
641641
catch (e) {
642642
log.e(' got error while process task request parse', e);
643643
}
644-
const count = await options.db.collection("long_tasks").find(options.query, options.projection).count();
644+
const count = await options.db.collection("long_tasks").count(options.query);
645645
return options.db.collection("long_tasks").find(options.query, options.projection).sort(sortBy).skip(skip).limit(limit).toArray((err, list) => {
646646
if (!err) {
647647
callback(null, {list, count});

frontend/express/app.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,6 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
963963
stylesheets: [],
964964
offline_mode: configs.offline_mode || false
965965
};
966-
967966
// google services cannot work when offline mode enable
968967
if (toDashboard.offline_mode) {
969968
toDashboard.use_google = false;

frontend/express/public/core/device-and-type/stylesheets/_main.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
}
2929
}
3030

31-
.technology-analytics-wrapper .technology-pie-graphs .cly-vue-chart-legend__right .cly-vue-chart-legend__secondary .__vuescroll .__view {
32-
padding-right:30px;
33-
}
3431
.technology-analytics-wrapper .technology-pie-graphs .bu-level .bu-level-right {
3532
padding-right:5px;
3633
}

frontend/express/public/core/events/javascripts/countly.overview.models.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,18 @@
4848
},
4949
getBarData: function(sparklines, eventProperty) {
5050
var obj = {};
51-
var grid = {};
52-
var yAxis = {};
53-
var legend = {};
54-
var tooltip = {};
51+
var yAxis = {
52+
show: true,
53+
splitNumber: 1,
54+
minInterval: 1,
55+
position: "right"
56+
};
5557
var series = [];
5658
var ob = {};
5759
ob.name = eventProperty;
5860
ob.data = sparklines;
5961
series.push(ob);
60-
grid.height = "100px";
61-
grid.top = "-25px";
62-
yAxis.show = false;
63-
legend.show = false;
64-
tooltip.show = false;
65-
obj.grid = grid;
6662
obj.yAxis = yAxis;
67-
obj.legend = legend;
68-
obj.tooltip = tooltip;
6963
obj.series = series;
7064
return obj;
7165
},

frontend/express/public/core/events/templates/overview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ <h3 class="cly-vue-events-overview-subheadings">{{i18n('events.overview.monitor'
111111
<div slot="countValue" class="cly-monitor-events-breakdown-horizontal-tile__overviewvalue">{{item.total}}</div>
112112
<div slot="propertyName" class="cly-monitor-events-breakdown-horizontal-tile__eventproperty">{{item.eventProperty}}</div>
113113
<div slot="barGraph">
114-
<cly-chart-bar class="cly-vue-events-overview-monitor-events__charts" :legend="monitorEventsLegend" :height=100 :option="item.barData" :autoresize=false :showZoom=false :showToggle=false :showDownload=false>
114+
<cly-chart-bar class="cly-vue-events-overview-monitor-events__charts" :noEmpty="true" :legend="monitorEventsLegend" :height=130 :option="item.barData" :autoresize=true :showZoom=false :showToggle=false :showDownload=false>
115115
</cly-chart-bar>
116116
</div>
117117
</monitor-events-breakdown-horizontal-tile>

frontend/express/public/core/session-overview/javascripts/countly.views.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ var SessionHomeWidget = countlyVue.views.create({
240240
var series = [];
241241
if (sessionDP && sessionDP.chartDP && sessionDP.chartDP[0] && sessionDP.chartDP[1]) {
242242
series.push({"name": sessionDP.chartDP[1].label, "data": sessionDP.chartDP[1].data});
243-
series.push({"name": sessionDP.chartDP[0].label + "(" + CV.i18n('common.previous-period') + ")", "data": sessionDP.chartDP[0].data, "color": "#39C0C8", lineStyle: {"color": "#39C0C8"} });
243+
series.push({"name": sessionDP.chartDP[0].label + " (" + CV.i18n('common.previous-period') + ")", "data": sessionDP.chartDP[0].data, "color": "#39C0C8", lineStyle: {"color": "#39C0C8"} });
244244
}
245245
if (value === "d" || value === "d-avg") {
246246
return {

frontend/express/public/core/session-overview/stylesheets/_main.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
.session-home-widget .el-tabs--card>.el-tabs__header {
1010
margin: 0;
1111
}
12-
.session-home-widget .cly-vue-chart__echart {
13-
padding: 20px 25px 32px 15px;
14-
}
1512

1613
.session-home-widget .el-tabs__nav-wrap.is-scrollable{
1714
border-bottom: 0px;

0 commit comments

Comments
 (0)