From 7919d79347792b7d93de448844a0ce3fbb289de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 24 Mar 2015 17:16:13 +0100 Subject: [PATCH] Another cache header fix --- pkg/cmd/web.go | 4 ++-- src/app/features/dashboard/rowCtrl.js | 8 ++++++++ src/app/partials/dashboard.html | 8 ++++++++ src/css/less/panel.less | 12 ++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/web.go b/pkg/cmd/web.go index a8482185e78..72f19f6675f 100644 --- a/pkg/cmd/web.go +++ b/pkg/cmd/web.go @@ -66,12 +66,12 @@ func newMacaron() *macaron.Macaron { func mapStatic(m *macaron.Macaron, dir string, prefix string) { headers := func(c *macaron.Context) { - c.Resp.Header().Set("Cache-Control", "public max-age: 3600") + c.Resp.Header().Set("Cache-Control", "public, max-age: 3600") } if setting.Env == setting.DEV { headers = func(c *macaron.Context) { - c.Resp.Header().Set("Cache-Control", "max-age: 0") + c.Resp.Header().Set("Cache-Control", "max-age: 0, must-revalidate") } } diff --git a/src/app/features/dashboard/rowCtrl.js b/src/app/features/dashboard/rowCtrl.js index 409fee2fd37..527a29a2ad5 100644 --- a/src/app/features/dashboard/rowCtrl.js +++ b/src/app/features/dashboard/rowCtrl.js @@ -168,4 +168,12 @@ function (angular, app, _, config) { }; }); + module.directive('panelGhostPanel', function() { + return function(scope, element) { + var dropZoneSpan = 12 - scope.dashboard.rowSpan(scope.row); + element.find('.panel-container').css('height', scope.row.height); + element[0].style.width = ((dropZoneSpan / 1.2) * 10) + '%'; + }; + }); + }); diff --git a/src/app/partials/dashboard.html b/src/app/partials/dashboard.html index 6d7d0634fcd..29c4d581df3 100644 --- a/src/app/partials/dashboard.html +++ b/src/app/partials/dashboard.html @@ -86,6 +86,14 @@ +
+
+
+

Add panel

+
+
+
+
diff --git a/src/css/less/panel.less b/src/css/less/panel.less index 6a8c2355b5b..e3f1fd2b598 100644 --- a/src/css/less/panel.less +++ b/src/css/less/panel.less @@ -169,6 +169,18 @@ } } +.ghost-panel { + &:hover { + .panel-container { + visibility: visible; + } + } + .panel-container { + visibility: hidden; + border: 1px solid @grayDark; + } +} + .panel-time-info { font-weight: bold; float: right;