Prechádzať zdrojové kódy

feat(plugins): added disable button to app config tab

Torkel Ödegaard 9 rokov pred
rodič
commit
05cc370c55

+ 1 - 0
public/app/features/plugins/partials/plugin_edit.html

@@ -42,6 +42,7 @@
 	      <div class="gf-form-button-row">
 					<button type="submit" class="btn btn-success" ng-click="ctrl.enable()" ng-show="!ctrl.model.enabled">Enable</button>
 					<button type="submit" class="btn btn-success" ng-click="ctrl.update()" ng-show="ctrl.model.enabled">Update</button>
+					<button type="submit" class="btn btn-danger" ng-click="ctrl.disable()" ng-show="ctrl.model.enabled">Disable</button>
 				</div>
       </div>
     </div>

+ 5 - 0
public/app/features/plugins/plugin_edit_ctrl.ts

@@ -122,6 +122,11 @@ export class PluginEditCtrl {
     this.update();
   }
 
+  disable() {
+    this.model.enabled = false;
+    this.model.pinned = false;
+    this.update();
+  }
 }
 
 angular.module('grafana.controllers').controller('PluginEditCtrl', PluginEditCtrl);