Skip to content

Commit

Permalink
Merge pull request #114 from ar2rsawseen/master
Browse files Browse the repository at this point in the history
All Apps empty view + prod/dev switch + fixes
  • Loading branch information
ar2rsawseen committed Dec 16, 2014
2 parents e744f5a + d5c9414 commit 8f9317d
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 22 deletions.
2 changes: 1 addition & 1 deletion api/parts/data/usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ var usage = {},
recvMetricValue = params.qstring.metrics[tmpMetric.name];

if (recvMetricValue) {
var escapedMetricVal = recvMetricValue.replace(/^\$/, "").replace(/\./g, ":");
var escapedMetricVal = (recvMetricValue+"").replace(/^\$/, "").replace(/\./g, ":");
needsUpdate = true;
tmpSet["meta." + tmpMetric.set] = escapedMetricVal;
common.fillTimeObject(params, tmpTimeObj, escapedMetricVal + '.' + common.dbMap['total']);
Expand Down
3 changes: 2 additions & 1 deletion frontend/express/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ app.get('/dashboard', function (req, res, next) {
userOfApps:userOfApps,
countlyVersion:"14.08",
member:member,
cdn: countlyConfig.cdn || ""
cdn: countlyConfig.cdn || "",
production: countlyConfig.production || false
});
});
}
Expand Down
3 changes: 2 additions & 1 deletion frontend/express/config.sample.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ var countlyConfig = {
port: 6001,
host: "localhost",
use_intercom: true
}
},
production: true
};

module.exports = countlyConfig;
31 changes: 22 additions & 9 deletions frontend/express/public/javascripts/countly/countly.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -2871,7 +2871,7 @@ window.EnterpriseView = countlyView.extend({
window.AllAppsView = countlyView.extend({
selectedView:"#draw-total-sessions",
selectedApps: {"all":true},
selectedCount: 1,
selectedCount: 0,
initialize:function () {
this.template = Handlebars.compile($("#template-allapps").html());
},
Expand Down Expand Up @@ -2931,7 +2931,7 @@ window.AllAppsView = countlyView.extend({
$("#sidebar-menu > .item").addClass("hide");
$("#management-menu").removeClass("hide");
$("#enterprise-menu").removeClass("hide");
$("#allapps-menu").removeClass("hide").css("display", "inline");
$("#allapps-menu").removeClass("hide").css("display", "inline-block");
var appData = countlyAllApps.getData();

this.templateData = {
Expand Down Expand Up @@ -3010,21 +3010,34 @@ window.AllAppsView = countlyView.extend({
row.find(".check").removeClass("icon-check").addClass("icon-unchecked");
row.find(".color").css("background-color", "transparent");
delete self.selectedApps[row.attr("id")];
self.selectedCount--;
if(row.attr("id") != "all")
self.selectedCount--;
if(self.selectedCount==0){
$("#empty-graph").show();
$(".big-numbers").removeClass("active");
$(".big-numbers .select").removeClass("selected");
}

}
else if(self.selectedCount <= 10 || row.attr("id") == "all"){
else if(self.selectedCount < 10 || row.attr("id") == "all"){
if(self.selectedCount==0){
$("#empty-graph").hide();
$(self.selectedView).parents(".big-numbers").addClass("active");
}
if(row.attr("id") == "all"){
$(".check.icon-check").removeClass("icon-check").addClass("icon-unchecked");
$('.d-table').find(".color").css("background-color", "transparent");
self.selectedApps = {};
self.selectedCount = 0;
}
else if(self.selectedApps["all"]){
$(".d-table #all .check.icon-check").removeClass("icon-check").addClass("icon-unchecked");
$('.d-table #all').find(".color").css("background-color", "transparent");
delete self.selectedApps["all"];
else{
if(self.selectedApps["all"]){
$(".d-table #all .check.icon-check").removeClass("icon-check").addClass("icon-unchecked");
$('.d-table #all').find(".color").css("background-color", "transparent");
delete self.selectedApps["all"];
}
self.selectedCount++;
}
self.selectedCount++;
row.find(".check").removeClass("icon-unchecked").addClass("icon-check");
self.selectedApps[row.attr("id")] = true;
}
Expand Down
11 changes: 6 additions & 5 deletions frontend/express/public/javascripts/min/countly.lib.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,5 @@ allapps.total-sessions = Total Sessions
allapps.total-users = Total Users
allapps.new-users = New Users
allapps.total-duration = Total Duration
allapps.average-duration = Average Duration
allapps.average-duration = Average Duration
allapps.empty-graph = Select one or more applications to see the chart
1 change: 1 addition & 0 deletions frontend/express/public/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -700,4 +700,5 @@ table.events-table { width:100%; padding:0; margin:0; }

.allappview .widget-content .big-numbers .inner{height: 30px;}
.allappview .widget-footer{border-radius: 0;}
.allappview #empty-graph {position: absolute; text-align: center; font-size: 35px; width:100%; top:50%; margin-top: -20px; display: none;}
.allapps div.color{ width: 10px; height: 20px; float: right;}
8 changes: 4 additions & 4 deletions frontend/express/views/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@
</div>
</div>
<div class="widget-footer" style="height:220px; padding-top:20px; padding-bottom:10px; overflow:visible; box-shadow:none; position:relative;">
<div id="empty-graph" data-localize="allapps.empty-graph"></div>
<div id="dashboard-graph" class="graph" style="height:100%; margin-left:-10px;"></div>
</div>
</div>
Expand Down Expand Up @@ -1093,17 +1094,16 @@

<script language="javascript" type="text/javascript" src="https://www.google.com/jsapi"></script>

<% if (production) { %>
<!-- PRODUCTION -->
<!---->
<script language="javascript" type="text/javascript" src="/javascripts/min/countly.dom.js?<%= countlyVersion %>"></script>
<script language="javascript" type="text/javascript" src="/javascripts/dom/tablesorter/jquery.tablesorter.min.js?<%= countlyVersion %>"></script>
<script language="javascript" type="text/javascript" src="/javascripts/min/countly.utils.js?<%= countlyVersion %>"></script>
<script language="javascript" type="text/javascript" src="/javascripts/min/countly.visualization.js?<%= countlyVersion %>"></script>
<script language="javascript" type="text/javascript" src="/javascripts/countly/countly.config.js?<%= countlyVersion %>"></script>
<script language="javascript" type="text/javascript" src="/javascripts/min/countly.lib.js?<%= countlyVersion %>"></script>
<!---->
<% } else { %>
<!-- DEVELOPMENT -->
<!--
<script language="javascript" type="text/javascript" src="/javascripts/dom/jquery/jquery-1.8.3.min.js"></script>
<script language="javascript" type="text/javascript" src="/javascripts/utils/underscore-min.js"></script>
<script language="javascript" type="text/javascript" src="/javascripts/utils/prefixfree.min.js"></script>
Expand Down Expand Up @@ -1151,7 +1151,7 @@
<script language="javascript" type="text/javascript" src="/javascripts/countly/countly.carrier.js"></script>
<script language="javascript" type="text/javascript" src="/javascripts/countly/countly.allapps.js"></script>
<script language="javascript" type="text/javascript" src="/javascripts/countly/countly.template.js"></script>
-->
<% } %>
<% if (member.in_user_id && member.in_user_hash) { %>
<!---->
<script id="IntercomSettingsScriptTag">
Expand Down

0 comments on commit 8f9317d

Please sign in to comment.