Another cache header fix

pull/1636/head
Torkel Ödegaard 10 years ago
parent a5c3855233
commit 7919d79347
  1. 4
      pkg/cmd/web.go
  2. 8
      src/app/features/dashboard/rowCtrl.js
  3. 8
      src/app/partials/dashboard.html
  4. 12
      src/css/less/panel.less

@ -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")
}
}

@ -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) + '%';
};
});
});

@ -86,6 +86,14 @@
<panel-loader type="panel.type" class="panel-margin"></panel-loader>
</div>
<div panel-ghost-panel class="panel ghost-panel panel-margin">
<div class="panel-container">
<div style="text-align: center">
<h2>Add panel</h2>
</div>
</div>
</div>
<div panel-drop-zone class="panel panel-drop-zone"
ui-on-drop="onDrop($data, row)"
data-drop="true">

@ -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;

Loading…
Cancel
Save