Просмотр исходного кода

fix(datasources): many datasources did not work in optimized build due to missing ngInject comment

Torkel Ödegaard 10 лет назад
Родитель
Сommit
d4e1a715eb

+ 6 - 4
public/app/features/sidemenu/sidemenu.ts

@@ -38,9 +38,14 @@ class SideMenuCtrl {
  openUserDropdown() {
    this.orgMenu = [
      {section: 'You', cssClass: 'dropdown-menu-title'},
-     {text: 'Profile', url: this.getUrl('/profile')},
+     {text: 'Preferences', url: this.getUrl('/profile')},
+     {text: 'Account', url: this.getUrl('/profile')},
    ];
 
+   if (this.isSignedIn) {
+     this.orgMenu.push({text: "Sign out", url: this.getUrl("/logout"), target: "_self"});
+   }
+
    if (this.contextSrv.hasRole('Admin')) {
      this.orgMenu.push({section: this.user.orgName, cssClass: 'dropdown-menu-title'});
      this.orgMenu.push({
@@ -83,9 +88,6 @@ class SideMenuCtrl {
      if (this.contextSrv.isGrafanaAdmin) {
        this.orgMenu.push({text: "Server admin", url: this.getUrl("/admin/settings")});
      }
-     if (this.isSignedIn) {
-       this.orgMenu.push({text: "Sign out", url: this.getUrl("/logout"), target: "_self"});
-     }
    });
  }
 

+ 1 - 0
public/app/plugins/datasource/grafana/datasource.ts

@@ -2,6 +2,7 @@
 
 class GrafanaDatasource {
 
+  /** @ngInject */
   constructor(private backendSrv) {}
 
   query(options) {

+ 1 - 0
public/app/plugins/datasource/influxdb/datasource.js

@@ -11,6 +11,7 @@ function (angular, _, dateMath, InfluxSeries, InfluxQuery) {
 
   InfluxQuery = InfluxQuery.default;
 
+  /** @ngInject */
   function InfluxDatasource(instanceSettings, $q, backendSrv, templateSrv) {
     this.type = 'influxdb';
     this.urls = _.map(instanceSettings.url.split(','), function(url) {

+ 1 - 0
public/app/plugins/datasource/opentsdb/datasource.js

@@ -8,6 +8,7 @@ define([
 function (angular, _, dateMath) {
   'use strict';
 
+  /** @ngInject */
   function OpenTSDBDatasource(instanceSettings, $q, backendSrv, templateSrv) {
     this.type = 'opentsdb';
     this.url = instanceSettings.url;

+ 1 - 0
public/app/plugins/datasource/prometheus/datasource.js

@@ -10,6 +10,7 @@ function (angular, _, moment, dateMath) {
 
   var durationSplitRegexp = /(\d+)(ms|s|m|h|d|w|M|y)/;
 
+  /** @ngInject */
   function PrometheusDatasource(instanceSettings, $q, backendSrv, templateSrv) {
     this.type = 'prometheus';
     this.editorSrc = 'app/features/prometheus/partials/query.editor.html';

+ 15 - 19
public/less/sidemenu.less

@@ -12,6 +12,7 @@
   border: @sideMenuBorder;
   min-height: 100%;
   z-index: 101;
+  transform: translate3d(-100%, 0, 0);
 
   a:focus {
     text-decoration: none;
@@ -20,15 +21,10 @@
 
 .sidemenu-open {
   .sidemenu-wrapper {
-    display: block;
-  }
-
-  .search-container {
-    left: 200px;
-  }
-
-  .main-view {
-    padding-left: 200px;
+    visibility: visible;
+    -webkit-transform: translate3d(0, 0, 0);
+    transform: translate3d(0, 0, 0);
+    transition: all 0.3s;
   }
 }
 
@@ -38,14 +34,20 @@
   margin: 0;
   padding: 0;
 
-  >li {
-  }
-
   .fa-caret-down {
     position: relative;
     top: 2px;
     font-size: 90%;
   }
+
+  .dropdown-menu {
+    top: 0px;
+    left: 200px;
+    margin: 0;
+    >li>a {
+      color: @linkColor;
+    }
+  }
 }
 
 .sidemenu-main-link {
@@ -135,17 +137,11 @@
   padding-top: 4px;
 }
 
-.sidemenu-org-section .dropdown-menu {
-  top: 51%;
-  left: 100px;
-}
-
 .sidemenu-org-section .dropdown-menu-title {
   margin: 0 10px 0 6px;
-  padding: 10px 0 0;
+  padding: 7px 0 7px;
   overflow: hidden;
   color: @dropdownTitle;
-  font-weight: bold;
 }
 
 .sidemenu-org-section .dropdown-menu-title > span {

+ 2 - 2
public/less/variables.dark.less

@@ -159,7 +159,7 @@
 
 // Sidemenu
 // -------------------------
-@sideMenuTopShadow:             inset 0 4px 15px -4px @black;
+@sideMenuTopShadow:          @navbarDropdownShadow;
 @sideMenuBorder:             1px solid @bodyBackground;
 @sideMenuBackground:         @grayDark;
 @sideMenuBackgroundHighlight: lighten(@grayDark, 4%);
@@ -171,7 +171,7 @@
 @dropdownDividerTop:            transparent;
 @dropdownDividerBottom:         #444;
 @dropdownDivider:               @dropdownDividerBottom;
-@dropdownTitle:                 @white;
+@dropdownTitle:                 @linkColorDisabled;
 
 @dropdownLinkColor:             @textColor;
 @dropdownLinkColorHover:        @white;

+ 3 - 3
public/views/index.html

@@ -25,11 +25,11 @@
 
 	</head>
 
-	<body ng-cloak ng-controller="GrafanaCtrl" ng-class="{'sidemenu-open': contextSrv.sidemenuPinned}">
+	<body ng-cloak ng-controller="GrafanaCtrl" ng-class="{'sidemenu-open': contextSrv.sidemenu}">
 		<div class="sidemenu-canvas">
 
-			<aside class="sidemenu-wrapper" ng-if="contextSrv.sidemenu" >
-				<sidemenu></sidemenu>
+			<aside class="sidemenu-wrapper">
+				<sidemenu ng-if="contextSrv.sidemenu"></sidemenu>
 			</aside>
 
 			<div class="page-alert-list">