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

Merge pull request #14541 from grafana/minor-cleanup

Minor cleanup now that angular panel edit is no longer
Torkel Ödegaard 7 лет назад
Родитель
Сommit
1b1f8ebadc

+ 0 - 16
public/app/features/panel/panel_ctrl.ts

@@ -94,22 +94,6 @@ export class PanelCtrl {
 
     this.editModeInitiated = true;
     this.events.emit('init-edit-mode', null);
-
-    const urlTab = (this.$injector.get('$routeParams').tab || '').toLowerCase();
-    if (urlTab) {
-      this.editorTabs.forEach((tab, i) => {
-        if (tab.title.toLowerCase() === urlTab) {
-          this.editorTabIndex = i;
-        }
-      });
-    }
-  }
-
-  changeTab(newIndex) {
-    this.editorTabIndex = newIndex;
-    const route = this.$injector.get('$route');
-    route.current.params.tab = this.editorTabs[newIndex].title.toLowerCase();
-    route.updateParams();
   }
 
   addEditorTab(title, directiveFn, index?, icon?) {

+ 4 - 8
public/app/plugins/datasource/prometheus/partials/query.editor.html

@@ -9,7 +9,7 @@
 
   <div class="gf-form-inline">
     <div class="gf-form">
-      <label class="gf-form-label width-8">Legend format</label>
+      <label class="gf-form-label">Legend</label>
       <input type="text" class="gf-form-input" ng-model="ctrl.target.legendFormat" spellcheck='false' placeholder="legend format"
         data-min-length=0 data-items=1000 ng-model-onblur ng-change="ctrl.refreshMetricData()">
       </input>
@@ -39,23 +39,19 @@
       </div>
     </div>
 
-    <div class="gf-form">
-      <label class="gf-form-label width-6">Format as</label>
+    <div class="gf-form gf-form--grow">
+      <label class="gf-form-label width-5">Format</label>
       <div class="gf-form-select-wrapper width-8">
         <select class="gf-form-input gf-size-auto" ng-model="ctrl.target.format" ng-options="f.value as f.text for f in ctrl.formats"
           ng-change="ctrl.refresh()"></select>
       </div>
       <gf-form-switch class="gf-form" label="Instant" label-class="width-5" checked="ctrl.target.instant" on-change="ctrl.refresh()">
       </gf-form-switch>
-      <label class="gf-form-label">
+      <label class="gf-form-label gf-form-label--grow">
         <a href="{{ctrl.linkToPrometheus}}" target="_blank" bs-tooltip="'Link to Graph in Prometheus'">
           <i class="fa fa-share-square-o"></i>
         </a>
       </label>
     </div>
-
-    <div class="gf-form gf-form--grow">
-      <div class="gf-form-label gf-form-label--grow"></div>
-    </div>
   </div>
 </query-editor-row>