From 69c8bb1eb3be4f028b0d833145e6b44a3f6a624f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 14 Mar 2016 09:10:32 +0100 Subject: [PATCH] feat(plugins): added filter (type) tabs po plugin list view --- .../plugins/partials/plugin_list.html | 36 ++++++++++++++----- .../app/features/plugins/plugin_list_ctrl.ts | 21 +++++++++-- 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/public/app/features/plugins/partials/plugin_list.html b/public/app/features/plugins/partials/plugin_list.html index 04beee4e05b..5c3d38b3459 100644 --- a/public/app/features/plugins/partials/plugin_list.html +++ b/public/app/features/plugins/partials/plugin_list.html @@ -4,6 +4,26 @@
@@ -31,12 +51,12 @@ - - -
- - Edit - -
-
+ + Edit + + + + + + diff --git a/public/app/features/plugins/plugin_list_ctrl.ts b/public/app/features/plugins/plugin_list_ctrl.ts index 2693a4d8755..9e9b679c6c1 100644 --- a/public/app/features/plugins/plugin_list_ctrl.ts +++ b/public/app/features/plugins/plugin_list_ctrl.ts @@ -4,11 +4,28 @@ import angular from 'angular'; export class PluginListCtrl { plugins: any[]; + tabIndex: number; /** @ngInject */ - constructor(private backendSrv: any) { + constructor(private backendSrv: any, $location) { + this.tabIndex = 0; - this.backendSrv.get('api/plugins', {embedded: 0}).then(plugins => { + var pluginType = $location.search().type || 'panel'; + switch (pluginType) { + case "datasource": { + this.tabIndex = 1; + break; + } + case "app": { + this.tabIndex = 2; + break; + } + case "panel": + default: + this.tabIndex = 0; + } + + this.backendSrv.get('api/plugins', {embedded: 0, type: pluginType}).then(plugins => { this.plugins = plugins; }); }