diff --git a/.gitignore b/.gitignore
index 9640d95d0f..aed401fe57 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,4 @@
.DS_Store
-bundle
-bundle.tar.gz
.demeteorized
dist
node_modules
@@ -9,14 +7,15 @@ cache
bin
# Resources
-resources/cache
-resources/base-images-*.tar.gz
resources/virtualbox-*.pkg
resources/boot2docker*
-resources/node-webkit
resources/mongod
resources/MONGOD_LICENSE.txt
resources/node
resources/NODE_LICENSE.txt
+resources/settings.json
+
+# Cache
+cache
script/sign.sh
diff --git a/meteor/.jshintrc b/meteor/.jshintrc
index 66bf659a23..0cb0537100 100755
--- a/meteor/.jshintrc
+++ b/meteor/.jshintrc
@@ -166,6 +166,7 @@
"VirtualBox": true,
"ImageUtil": true,
"AppUtil": true,
+ "Metrics": true
// Forms
"showFormErrors": true,
@@ -173,8 +174,7 @@
"formValidate": true,
"FormSchema": true,
"showFormSuccess": true,
- "resetForm": true,
- "trackLink": true,
+ "resetForm": true
// Testing
"require": false,
diff --git a/meteor/.meteor/packages b/meteor/.meteor/packages
index 0eef044dda..8b07153aa8 100755
--- a/meteor/.meteor/packages
+++ b/meteor/.meteor/packages
@@ -9,5 +9,4 @@ raix:handlebar-helpers
mrt:underscore-string-latest
dburles:collection-helpers
iron:router
-reywood:iron-router-ga
simison:bootstrap3-less
diff --git a/meteor/.meteor/versions b/meteor/.meteor/versions
index c821689bcb..b3372a1ff9 100644
--- a/meteor/.meteor/versions
+++ b/meteor/.meteor/versions
@@ -49,7 +49,6 @@ reactive-dict@1.0.4
reactive-var@1.0.3
reload@1.1.1
retry@1.0.1
-reywood:iron-router-ga@0.4.1
routepolicy@1.0.2
session@1.0.4
simison:bootstrap3-less@0.3.0
diff --git a/meteor/client/lib/imageutil.js b/meteor/client/lib/imageutil.js
index 24b9e62e39..6f8e83fa08 100644
--- a/meteor/client/lib/imageutil.js
+++ b/meteor/client/lib/imageutil.js
@@ -269,7 +269,7 @@ ImageUtil.sync = function (callback) {
return _.contains(kitematicIds, image.Id);
});
_.each(diffDockerImages, function (image) {
- if (!image.RepoTags || _.isEmpty(image.Config.ExposedPorts)) {
+ if (!image.RepoTags || !image.Config || _.isEmpty(image.Config.ExposedPorts)) {
return;
}
diff --git a/meteor/client/lib/metrics.js b/meteor/client/lib/metrics.js
new file mode 100644
index 0000000000..9f586ea768
--- /dev/null
+++ b/meteor/client/lib/metrics.js
@@ -0,0 +1,37 @@
+var remote = require('remote');
+var app = remote.require('app');
+var crypto = require('crypto');
+var getmac = require('getmac');
+var uuid = require('node-uuid');
+
+var Mixpanel = require('mixpanel');
+var mixpanel = Mixpanel.init(Meteor.settings.public.mixpanel.token);
+
+Metrics = {};
+
+Metrics.trackEvent = function (name) {
+ if (!name) {
+ return;
+ }
+ var uuid = localStorage.getItem('metrics.uuid');
+ if (localStorage.getItem('metrics.enabled') && uuid) {
+ mixpanel.track('docker_gui ' + name, {
+ distinct_id: uuid,
+ version: app.getVersion()
+ });
+ }
+};
+
+Metrics.prepareTracking = function () {
+ if (localStorage.getItem('metrics.enabled') === null) {
+ var settings = Settings.findOne();
+ if (settings && settings.tracking) {
+ localStorage.setItem('metrics.enabled', !!settings.tracking);
+ } else {
+ localStorage.setItem('metrics.enabled', true);
+ }
+ }
+ if (!localStorage.getItem('metrics.uuid')) {
+ localStorage.setItem('metrics.uuid', uuid.v4());
+ }
+};
diff --git a/meteor/client/lib/router.js b/meteor/client/lib/router.js
index 47444c424a..c7a277a6d8 100755
--- a/meteor/client/lib/router.js
+++ b/meteor/client/lib/router.js
@@ -1,13 +1,5 @@
Router.configure({
- layoutTemplate: 'layout',
- onBeforeAction: function () {
- var setting = Settings.findOne({});
- if (setting && setting.tracking) {
- var currentPath = Router.current().path;
- ga('send', 'pageview', currentPath);
- }
- this.next();
- }
+ layoutTemplate: 'layout'
});
DashboardController = RouteController.extend({
@@ -44,11 +36,8 @@ Router.map(function () {
if (err) {
console.log('Setup failed.');
console.log(err);
+ Metrics.trackEvent('app setup failed');
} else {
- var settings = Settings.findOne();
- if (!settings) {
- Settings.insert({tracking: true});
- }
startUpdatingBoot2DockerUtilization();
startSyncingAppState();
if (Apps.findOne()) {
diff --git a/meteor/client/lib/startup.js b/meteor/client/lib/startup.js
index c53faaee3e..6bd9ea31f5 100644
--- a/meteor/client/lib/startup.js
+++ b/meteor/client/lib/startup.js
@@ -18,6 +18,13 @@ Meteor.startup(function () {
fs.mkdirSync(Util.getResourceDir());
}
+ Metrics.prepareTracking();
+ Metrics.trackEvent('app started');
+ Metrics.trackEvent('app heartbeat');
+ Meteor.setInterval(function () {
+ Metrics.trackEvent('app heartbeat');
+ }, 14400000);
+
Boot2Docker.ip(function (err, ip) {
if (!err) {
console.log('Setting host IP to: ' + ip);
diff --git a/meteor/client/lib/util.js b/meteor/client/lib/util.js
index a1edeb2bc2..9973e812d4 100755
--- a/meteor/client/lib/util.js
+++ b/meteor/client/lib/util.js
@@ -186,12 +186,3 @@ Util.compareVersions = function (v1, v2, options) {
return 0;
};
-
-trackLink = function (trackLabel) {
- var setting = Settings.findOne({});
- if (setting && setting.tracking) {
- if (trackLabel) {
- ga('send', 'event', 'link', 'click', trackLabel);
- }
- }
-};
diff --git a/meteor/client/views/dashboard/apps/dashboard-apps-settings.html b/meteor/client/views/dashboard/apps/dashboard-apps-settings.html
index ba35617731..79de63052d 100755
--- a/meteor/client/views/dashboard/apps/dashboard-apps-settings.html
+++ b/meteor/client/views/dashboard/apps/dashboard-apps-settings.html
@@ -29,7 +29,7 @@
{{name}}
{{value}}
{{/each}}
@@ -41,7 +41,7 @@
-
+
@@ -52,9 +52,9 @@
@@ -64,7 +64,7 @@
Delete this container permanently.
diff --git a/meteor/client/views/dashboard/apps/dashboard-apps.html b/meteor/client/views/dashboard/apps/dashboard-apps.html
index 7c02610c35..5c6270589a 100755
--- a/meteor/client/views/dashboard/apps/dashboard-apps.html
+++ b/meteor/client/views/dashboard/apps/dashboard-apps.html
@@ -5,7 +5,7 @@
{{#if $.Session.equals 'boot2dockerState' 'poweroff'}}
Create Container
{{else}}
- Create Container
+ Create Container
{{/if}}
@@ -24,7 +24,7 @@
{{#if $.Session.equals 'boot2dockerState' 'poweroff'}}
Create Container
{{else}}
- Create Container
+ Create Container
{{/if}}
{{/if}}
diff --git a/meteor/client/views/dashboard/apps/dashboard-single-app.html b/meteor/client/views/dashboard/apps/dashboard-single-app.html
index bf3a37568e..61449e019b 100755
--- a/meteor/client/views/dashboard/apps/dashboard-single-app.html
+++ b/meteor/client/views/dashboard/apps/dashboard-single-app.html
@@ -18,18 +18,18 @@
{{/if}}
{{/if}}
{{/if}}
- {{name}}
- {{displayTags image.tags}}
+ {{name}}
+ {{displayTags image.tags}}
{{#if $eq status 'READY'}}
{{#if ports}}
{{#if viewPort}}
-
+
-
+
Toggle Dropdown
@@ -40,7 +40,7 @@
{{else}}
-
+
@@ -52,19 +52,19 @@
{{/if}}
{{/if}}
{{/if}}
-
+
{{#if $eq status 'READY'}}
-
-
+
+
{{/if}}
{{#if $eq status 'STOPPED'}}
-
+
{{/if}}
{{#unless changingState}}
-
+
{{/unless}}
-
-
+
+
diff --git a/meteor/client/views/dashboard/components/dashboard-menu.html b/meteor/client/views/dashboard/components/dashboard-menu.html
index ae4bbe3cbc..bc989daef2 100755
--- a/meteor/client/views/dashboard/components/dashboard-menu.html
+++ b/meteor/client/views/dashboard/components/dashboard-menu.html
@@ -6,10 +6,10 @@