From 7f0440fdeda9e098a6c2f3eac2501b557e2b2c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 13 Dec 2017 17:58:33 +0100 Subject: [PATCH] minor tweaks --- pkg/api/index.go | 2 +- public/app/core/services/backend_srv.ts | 53 +------------ .../partials/folder_permissions.html | 6 +- .../dashboard/partials/folder_settings.html | 38 +++++----- .../plugins/panel/permissionlist/editor.html | 12 --- .../img/icn-singlestat-panel.svg | 75 ------------------- .../plugins/panel/permissionlist/module.html | 30 -------- .../plugins/panel/permissionlist/module.ts | 58 -------------- .../plugins/panel/permissionlist/plugin.json | 16 ---- 9 files changed, 25 insertions(+), 265 deletions(-) delete mode 100644 public/app/plugins/panel/permissionlist/editor.html delete mode 100644 public/app/plugins/panel/permissionlist/img/icn-singlestat-panel.svg delete mode 100644 public/app/plugins/panel/permissionlist/module.html delete mode 100644 public/app/plugins/panel/permissionlist/module.ts delete mode 100644 public/app/plugins/panel/permissionlist/plugin.json diff --git a/pkg/api/index.go b/pkg/api/index.go index 49d3f1c6cd2..84a18e694e0 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -92,7 +92,7 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) { Text: "Create", Id: "create", Icon: "fa fa-fw fa-plus", - Url: "#", + Url: setting.AppSubUrl + "dashboard/new", Children: []*dtos.NavLink{ {Text: "Dashboard", Icon: "gicon gicon-dashboard-new", Url: setting.AppSubUrl + "/dashboard/new"}, {Text: "Folder", SubTitle: "Create a new folder to organize your dashboards", Id: "folder", Icon: "gicon gicon-folder-new", Url: setting.AppSubUrl + "/dashboards/folder/new"}, diff --git a/public/app/core/services/backend_srv.ts b/public/app/core/services/backend_srv.ts index e80e1b5c357..97165f1284d 100644 --- a/public/app/core/services/backend_srv.ts +++ b/public/app/core/services/backend_srv.ts @@ -238,63 +238,12 @@ export class BackendSrv { schemaVersion: 16, title: name, editable: true, - hideControls: true, - panels: [ - { - id: 1, - folderId: 0, - headings: false, - limit: 1000, - links: [], - query: '', - recent: false, - search: true, - starred: false, - tags: [], - title: 'Dashboards in this folder', - type: 'dashlist', - gridPos: { - x: 0, - y: 0, - w: 8, - h: 10 - } - }, - { - id: 2, - onlyAlertsOnDashboard: true, - title: 'Alerts in this folder', - type: 'alertlist', - gridPos: { - x: 4, - y: 0, - w: 8, - h: 10 - } - }, - { - id: 3, - title: 'Permissions for this folder', - type: 'permissionlist', - folderId: 0, - gridPos: { - x: 8, - y: 0, - w: 8, - h: 10 - } - } - ] + panels: [] }; return this.post('/api/dashboards/db/', {dashboard: dash, isFolder: true, overwrite: false}) .then(res => { return this.getDashboard('db', res.slug); - }) - .then(res => { - res.dashboard.panels[0].folderId = res.dashboard.id; - res.dashboard.panels[2].folderId = res.dashboard.id; - return this.saveDashboard(res.dashboard, {overwrite: false}); }); } } diff --git a/public/app/features/dashboard/partials/folder_permissions.html b/public/app/features/dashboard/partials/folder_permissions.html index ad34618457d..6d037c7ab5e 100644 --- a/public/app/features/dashboard/partials/folder_permissions.html +++ b/public/app/features/dashboard/partials/folder_permissions.html @@ -1,5 +1,7 @@
-

Coming soon! Permissions will be added in Grafana 5.0 beta.

-
\ No newline at end of file +

+ Coming soon! Permissions will be added in Grafana 5.0 beta. +

+ diff --git a/public/app/features/dashboard/partials/folder_settings.html b/public/app/features/dashboard/partials/folder_settings.html index 3d04b292ce0..37fdfef4a3f 100644 --- a/public/app/features/dashboard/partials/folder_settings.html +++ b/public/app/features/dashboard/partials/folder_settings.html @@ -1,24 +1,24 @@
+

Folder Settings

-
-

Folder Settings

-
-
- - -
-
- - -
-
-
+
+
+
+ + +
+
+ + +
+
+
diff --git a/public/app/plugins/panel/permissionlist/editor.html b/public/app/plugins/panel/permissionlist/editor.html deleted file mode 100644 index 3f0708642dc..00000000000 --- a/public/app/plugins/panel/permissionlist/editor.html +++ /dev/null @@ -1,12 +0,0 @@ -
-
-
Options
-
- - -
-
- -
diff --git a/public/app/plugins/panel/permissionlist/img/icn-singlestat-panel.svg b/public/app/plugins/panel/permissionlist/img/icn-singlestat-panel.svg deleted file mode 100644 index d6ba04bbf01..00000000000 --- a/public/app/plugins/panel/permissionlist/img/icn-singlestat-panel.svg +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/public/app/plugins/panel/permissionlist/module.html b/public/app/plugins/panel/permissionlist/module.html deleted file mode 100644 index 2f83ac5e7a0..00000000000 --- a/public/app/plugins/panel/permissionlist/module.html +++ /dev/null @@ -1,30 +0,0 @@ -
-
    -
  1. -
    -
    -
    {{permission.permissionName}}
    -
    -
    -
    -
    {{permission.userLogin}}
    -
    -
    -
    - -
  2. -
  3. -
    -
    -
    {{permission.permissionName}}
    -
    -
    -
    -
    {{permission.team}}
    -
    -
    -
    - -
  4. -
-
diff --git a/public/app/plugins/panel/permissionlist/module.ts b/public/app/plugins/panel/permissionlist/module.ts deleted file mode 100644 index 62012517f86..00000000000 --- a/public/app/plugins/panel/permissionlist/module.ts +++ /dev/null @@ -1,58 +0,0 @@ -/// - -import _ from 'lodash'; -import {PanelCtrl} from 'app/plugins/sdk'; - -class PermissionListCtrl extends PanelCtrl { - static templateUrl = 'module.html'; - - userPermissions: any[]; - teamPermissions: any[]; - roles: any[]; - - panelDefaults = { - folderId: 0 - }; - - /** @ngInject */ - constructor($scope, $injector, private backendSrv) { - super($scope, $injector); - _.defaults(this.panel, this.panelDefaults); - - this.events.on('refresh', this.onRefresh.bind(this)); - this.events.on('init-edit-mode', this.onInitEditMode.bind(this)); - - this.getPermissions(); - } - - onInitEditMode() { - this.editorTabIndex = 1; - this.addEditorTab('Options', 'public/app/plugins/panel/permissionlist/editor.html'); - } - - onRefresh() { - var promises = []; - - promises.push(this.getPermissions()); - - return Promise.all(promises) - .then(this.renderingCompleted.bind(this)); - } - - onFolderChange(folder: any) { - this.panel.folderId = folder.id; - this.refresh(); - } - - getPermissions() { - return this.backendSrv.get(`/api/dashboards/id/${this.panel.folderId}/acl`) - .then(result => { - this.userPermissions = _.filter(result, p => { return p.userId > 0;}); - this.teamPermissions = _.filter(result, p => { return p.teamId > 0;}); - // this.roles = this.setRoles(result); - }); - } - -} - -export {PermissionListCtrl, PermissionListCtrl as PanelCtrl}; diff --git a/public/app/plugins/panel/permissionlist/plugin.json b/public/app/plugins/panel/permissionlist/plugin.json deleted file mode 100644 index c52ac54c79c..00000000000 --- a/public/app/plugins/panel/permissionlist/plugin.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "panel", - "name": "Permission List", - "id": "permissionlist", - - "info": { - "author": { - "name": "Grafana Project", - "url": "https://grafana.com" -}, - "logos": { - "small": "img/icn-singlestat-panel.svg", - "large": "img/icn-singlestat-panel.svg" - } - } -}