From 4819e50441fd4358dc3420a635fa924e6210020d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 25 Aug 2017 14:47:57 +0200 Subject: [PATCH] newgrid: fixes to default home dashboard --- pkg/api/dashboard.go | 15 +- .../plugins/panel/gettingstarted/module.html | 29 ++-- public/dashboards/home.json | 134 +++++++++--------- public/sass/_variables.dark.scss | 1 + public/sass/_variables.light.scss | 1 + .../components/_panel_gettingstarted.scss | 2 +- public/sass/layout/_page.scss | 2 +- public/sass/pages/_dashboard.scss | 3 + 8 files changed, 93 insertions(+), 94 deletions(-) diff --git a/pkg/api/dashboard.go b/pkg/api/dashboard.go index 60b3aba56fb..8c815401245 100644 --- a/pkg/api/dashboard.go +++ b/pkg/api/dashboard.go @@ -275,18 +275,19 @@ func GetHomeDashboard(c *middleware.Context) Response { } func addGettingStartedPanelToHomeDashboard(dash *simplejson.Json) { - rows := dash.Get("rows").MustArray() - row := simplejson.NewFromAny(rows[0]) + panels := dash.Get("panels").MustArray() newpanel := simplejson.NewFromAny(map[string]interface{}{ - "type": "gettingstarted", - "id": 123123, - "span": 12, + "type": "gettingstarted", + "id": 123123, + "x": 0, + "y": 3, + "width": 12, + "height": 4, }) - panels := row.Get("panels").MustArray() panels = append(panels, newpanel) - row.Set("panels", panels) + dash.Set("panels", panels) } // GetDashboardVersions returns all dashboard versions as JSON diff --git a/public/app/plugins/panel/gettingstarted/module.html b/public/app/plugins/panel/gettingstarted/module.html index 71aeb07dd9a..b4073faadbb 100644 --- a/public/app/plugins/panel/gettingstarted/module.html +++ b/public/app/plugins/panel/gettingstarted/module.html @@ -1,19 +1,16 @@
-
- Getting Started with Grafana - -
- -
+ + +
diff --git a/public/dashboards/home.json b/public/dashboards/home.json index c0c7694c76d..d19ecfd6809 100644 --- a/public/dashboards/home.json +++ b/public/dashboards/home.json @@ -1,68 +1,70 @@ { - "id": null, - "title": "Home", - "tags": [], - "style": "dark", - "timezone": "browser", + "annotations": { + "list": [] + }, "editable": true, + "folderId": null, + "gnetId": null, + "graphTooltip": 0, "hideControls": true, - "sharedCrosshair": false, - "rows": [ - { - "title": "Home Dashboard", - "collapse": false, + "id": null, + "links": [], + "panels": [ + { + "content": "
\n Home Dashboard\n
", "editable": true, - "height": 150, - "panels": [ - { - "content": "
\n Home Dashboard\n
", - "editable": true, - "id": 1, - "links": [], - "mode": "html", - "span": 12, - "style": {}, - "title": "", - "transparent": true, - "type": "text" - } - ] - }, - { - "collapse": false, + "height": 2, + "id": 1, + "links": [], + "mode": "html", + "style": {}, + "title": "", + "transparent": true, + "type": "text", + "width": 12, + "x": 0, + "y": 0 + }, + { + "folderId": 0, + "headings": true, + "height": 17, + "id": 3, + "limit": 4, + "links": [], + "query": "", + "recent": true, + "search": false, + "starred": true, + "tags": [], + "title": "", + "transparent": false, + "type": "dashlist", + "width": 7, + "x": 0, + "y": 6 + }, + { "editable": true, - "height": "510px", - "panels": [ - { - "id": 3, - "limit": 4, - "links": [], - "query": "", - "span": 7, - "tags": [], - "title": "", - "transparent": false, - "type": "dashlist", - "recent": true, - "search": false, - "starred": true, - "headings": true - }, - { - "editable": true, - "error": false, - "id": 4, - "isNew": true, - "links": [], - "span": 5, - "title": "", - "transparent": false, - "type": "pluginlist" - } - ], - "title": "Row" - } - ], + "error": false, + "height": 17, + "id": 4, + "links": [], + "title": "", + "transparent": false, + "type": "pluginlist", + "width": 5, + "x": 7, + "y": 6 + } + ], + "rows": [], + "schemaVersion": 15, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, "time": { "from": "now-6h", "to": "now" @@ -94,13 +96,7 @@ ], "type": "timepicker" }, - "templating": { - "list": [] - }, - "annotations": { - "list": [] - }, - "schemaVersion": 12, - "version": 0, - "links": [] + "timezone": "browser", + "title": "Home", + "version": 0 } diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index 19a99dadc49..6194a4549d3 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -245,6 +245,7 @@ $menu-dropdown-shadow: 5px 5px 20px -5px $black; // ------------------------- $page-nav-bg: $black; $page-nav-shadow: 5px 5px 20px -5px $black; +$page-nav-breadcrumb-color: $gray-3; // Pagination diff --git a/public/sass/_variables.light.scss b/public/sass/_variables.light.scss index b5b118671d4..b6a564c064a 100644 --- a/public/sass/_variables.light.scss +++ b/public/sass/_variables.light.scss @@ -197,6 +197,7 @@ $menu-dropdown-shadow: 5px 5px 20px -5px $gray-4; // ------------------------- $page-nav-bg: $white; $page-nav-shadow: 5px 5px 20px -5px $gray-4; +$page-nav-breadcrumb-color: $black; // search $search-shadow: 0 5px 30px 0 $gray-4; diff --git a/public/sass/components/_panel_gettingstarted.scss b/public/sass/components/_panel_gettingstarted.scss index d5a231a220c..e20f473fbf6 100644 --- a/public/sass/components/_panel_gettingstarted.scss +++ b/public/sass/components/_panel_gettingstarted.scss @@ -35,7 +35,7 @@ $path-position: $marker-size-half - ($path-height / 2); // Container element .progress-tracker { display: flex; - margin: 20px auto; + margin: 0 auto; padding: 0; list-style: none; } diff --git a/public/sass/layout/_page.scss b/public/sass/layout/_page.scss index 7e7cceb3650..9708602f309 100644 --- a/public/sass/layout/_page.scss +++ b/public/sass/layout/_page.scss @@ -140,7 +140,7 @@ $page-breadcrumb__angle-a: 30px; > a { - color: $text-color-weak; + color: $page-nav-breadcrumb-color; font-size: $font-size-sm; display: block; padding: 0.6rem 1rem 0.6rem 3rem;; diff --git a/public/sass/pages/_dashboard.scss b/public/sass/pages/_dashboard.scss index 82f3e4c7944..f9bf276c40a 100644 --- a/public/sass/pages/_dashboard.scss +++ b/public/sass/pages/_dashboard.scss @@ -246,6 +246,9 @@ div.flot-text { font-family: $headings-font-family; font-size: $font-size-h3; text-align: center; + overflow: hidden; + position: relative; + top: -10px; span { display: inline-block; @include brand-bottom-border();