diff --git a/ui/package.json b/ui/package.json
index c1101d2dcc..b39ae99198 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -54,6 +54,7 @@
"json-schema-defaults": "^0.2.0",
"justgage": "^1.2.2",
"material-ui": "^0.16.1",
+ "material-ui-number-input": "^5.0.16",
"md-color-picker": "^0.2.6",
"mdPickers": "git://github.com/alenaksu/mdPickers.git#0.7.5",
"moment": "^2.15.0",
diff --git a/ui/src/app/api/device.service.js b/ui/src/app/api/device.service.js
index 27cf605c6b..1a1d714a3e 100644
--- a/ui/src/app/api/device.service.js
+++ b/ui/src/app/api/device.service.js
@@ -88,10 +88,10 @@ function DeviceService($http, $q, $filter, telemetryWebsocketService, types) {
return deferred.promise;
}
- function getDevice(deviceId) {
+ function getDevice(deviceId, ignoreErrors) {
var deferred = $q.defer();
var url = '/api/device/' + deviceId;
- $http.get(url, null).then(function success(response) {
+ $http.get(url, { ignoreErrors: ignoreErrors }).then(function success(response) {
deferred.resolve(response.data);
}, function fail(response) {
deferred.reject(response.data);
diff --git a/ui/src/app/components/dashboard.directive.js b/ui/src/app/components/dashboard.directive.js
index 7c5094a6ff..c55995eeb3 100644
--- a/ui/src/app/components/dashboard.directive.js
+++ b/ui/src/app/components/dashboard.directive.js
@@ -58,8 +58,10 @@ function Dashboard() {
isMobile: '=',
isMobileDisabled: '=?',
isEditActionEnabled: '=',
+ isExportActionEnabled: '=',
isRemoveActionEnabled: '=',
onEditWidget: '&?',
+ onExportWidget: '&?',
onRemoveWidget: '&?',
onWidgetMouseDown: '&?',
onWidgetClicked: '&?',
@@ -139,6 +141,7 @@ function DashboardController($scope, $rootScope, $element, $timeout, $log, toast
vm.showWidgetTitle = showWidgetTitle;
vm.hasTimewindow = hasTimewindow;
vm.editWidget = editWidget;
+ vm.exportWidget = exportWidget;
vm.removeWidget = removeWidget;
vm.loading = loading;
@@ -413,6 +416,16 @@ function DashboardController($scope, $rootScope, $element, $timeout, $log, toast
}
}
+ function exportWidget ($event, widget) {
+ resetWidgetClick();
+ if ($event) {
+ $event.stopPropagation();
+ }
+ if (vm.isExportActionEnabled && vm.onExportWidget) {
+ vm.onExportWidget({event: $event, widget: widget});
+ }
+ }
+
function removeWidget($event, widget) {
resetWidgetClick();
if ($event) {
diff --git a/ui/src/app/components/dashboard.tpl.html b/ui/src/app/components/dashboard.tpl.html
index c43caac54f..0ad43eb8eb 100644
--- a/ui/src/app/components/dashboard.tpl.html
+++ b/ui/src/app/components/dashboard.tpl.html
@@ -62,6 +62,18 @@
edit
+
+
+ {{ 'widget.export' | translate }}
+
+
+ file_download
+
+
-