diff --git a/src/app/controllers/sidemenuCtrl.js b/src/app/controllers/sidemenuCtrl.js index 89d1b308428..4a10445afc5 100644 --- a/src/app/controllers/sidemenuCtrl.js +++ b/src/app/controllers/sidemenuCtrl.js @@ -20,7 +20,8 @@ function (angular, _, $) { { text: 'Settings', editview: 'settings', icon: "fa fa-cogs" }, { text: 'Templating', editview: 'templating', icon: "fa fa-cogs" }, { text: 'Annotations', editview: 'annotations', icon: "fa fa-bolt" }, - { text: 'More', href:"asd", icon: "fa fa-bolt" }, + { text: 'Export', href:"", icon: "fa fa-bolt" }, + { text: 'JSON', href:"", icon: "fa fa-bolt" }, ] }, { @@ -63,6 +64,7 @@ function (angular, _, $) { if (item.startsWith) { if (currentPath.indexOf(item.startsWith) === 0) { item.active = true; + item.href = currentPath; } } diff --git a/src/app/directives/dashEditLink.js b/src/app/directives/dashEditLink.js index 263982d3258..dbafebae35c 100644 --- a/src/app/directives/dashEditLink.js +++ b/src/app/directives/dashEditLink.js @@ -54,12 +54,8 @@ function (angular, $) { if (editorScope) { editorScope.dismiss(); } } - scope.onAppEvent('hide-dash-editor', hideEditorPane); - - scope.onAppEvent('show-dash-editor', function(evt, payload) { - if (payload.editview) { - payload.src = editViewMap[payload.editview]; - } + function showEditorPane(evt, payload, editview) { + if (editview) { payload.src = editViewMap[editview]; } if (lastEditor === payload.src) { hideEditorPane(); @@ -80,9 +76,9 @@ function (angular, $) { editorScope = null; hideScrollbars(false); - if (payload.editview) { + if (editview) { var urlParams = $location.search(); - if (payload.editview === urlParams.editview) { + if (editview === urlParams.editview) { delete urlParams.editview; $location.search(urlParams); } @@ -96,8 +92,18 @@ function (angular, $) { var view = $('
'); elem.append(view); $compile(elem.contents())(editorScope); + } + + scope.$watch("dashboardViewState.state.editview", function(newValue, oldValue) { + if (newValue) { + showEditorPane(null, {}, newValue); + } else if (oldValue) { + hideEditorPane(); + } }); + scope.onAppEvent('hide-dash-editor', hideEditorPane); + scope.onAppEvent('show-dash-editor', showEditorPane); } }; }); diff --git a/src/app/features/account/partials/account.html b/src/app/features/account/partials/account.html index e41c05584de..f45138b9736 100644 --- a/src/app/features/account/partials/account.html +++ b/src/app/features/account/partials/account.html @@ -1,3 +1,19 @@
+
+ +
+
+ + Account info +
+
+ +
+ +

TODO

+ +
+
+ diff --git a/src/app/features/dashboard/viewStateSrv.js b/src/app/features/dashboard/viewStateSrv.js index 2928e0800e9..6ebb5d05fab 100644 --- a/src/app/features/dashboard/viewStateSrv.js +++ b/src/app/features/dashboard/viewStateSrv.js @@ -53,12 +53,13 @@ function (angular, _, $) { state.panelId = parseInt(state.panelId) || null; state.fullscreen = state.fullscreen ? true : null; state.edit = (state.edit === "true" || state.edit === true) || null; + state.editview = state.editview || null; return state; }; DashboardViewState.prototype.serializeToUrl = function() { var urlState = _.clone(this.state); - urlState.fullscreen = this.state.fullscreen ? true : null, + urlState.fullscreen = this.state.fullscreen ? true : null; urlState.edit = this.state.edit ? true : null; return urlState; }; @@ -81,11 +82,6 @@ function (angular, _, $) { }; DashboardViewState.prototype.syncState = function() { - if (this.state.editview) { - this.$scope.appEvent('show-dash-editor', { scope: this.$scope, editview: this.state.editview }); - return; - } - if (this.panelScopes.length === 0) { return; } if (this.fullscreen) { diff --git a/src/app/partials/dashboard_topnav.html b/src/app/partials/dashboard_topnav.html index a0bba8c1a15..98261b1a94f 100644 --- a/src/app/partials/dashboard_topnav.html +++ b/src/app/partials/dashboard_topnav.html @@ -1,4 +1,4 @@ -