mirror of https://github.com/grafana/grafana
Provisioning: Do not allow deletion of provisioned dashboards (#16211)
* Unprovision dashboard in case of DisableDeletion = true * Rename command struct * Handle removed provision files * Allow html in confirm-modal * Do not show confirm button without onConfirm * Show dialog on deleting provisioned dashboard * Changed DeleteDashboard to DeleteProvisionedDashboard * Remove unreachable return * Add provisioned checks to API * Remove filter func * Fix and add tests for deleting dashboards * Change delete confirm text * Added and used pkg/errors for error wrappingpull/16483/head
parent
9f007137b3
commit
2d7fc55df7
@ -0,0 +1,172 @@ |
||||
{ |
||||
"title": "Grafana1", |
||||
"tags": [], |
||||
"style": "dark", |
||||
"timezone": "browser", |
||||
"editable": true, |
||||
"rows": [ |
||||
{ |
||||
"title": "New row", |
||||
"height": "150px", |
||||
"collapse": false, |
||||
"editable": true, |
||||
"panels": [ |
||||
{ |
||||
"id": 1, |
||||
"span": 12, |
||||
"editable": true, |
||||
"type": "text", |
||||
"mode": "html", |
||||
"content": "<div class=\"text-center\" style=\"padding-top: 15px\">\n<img src=\"img/logo_transparent_200x.png\"> \n</div>", |
||||
"style": {}, |
||||
"title": "Welcome to" |
||||
} |
||||
] |
||||
}, |
||||
{ |
||||
"title": "Welcome to Grafana", |
||||
"height": "210px", |
||||
"collapse": false, |
||||
"editable": true, |
||||
"panels": [ |
||||
{ |
||||
"id": 2, |
||||
"span": 6, |
||||
"type": "text", |
||||
"mode": "html", |
||||
"content": "<br/>\n\n<div class=\"row-fluid\">\n <div class=\"span6\">\n <ul>\n <li>\n <a href=\"http://grafana.org/docs#configuration\" target=\"_blank\">Configuration</a>\n </li>\n <li>\n <a href=\"http://grafana.org/docs/troubleshooting\" target=\"_blank\">Troubleshooting</a>\n </li>\n <li>\n <a href=\"http://grafana.org/docs/support\" target=\"_blank\">Support</a>\n </li>\n <li>\n <a href=\"http://grafana.org/docs/features/intro\" target=\"_blank\">Getting started</a> (Must read!)\n </li>\n </ul>\n </div>\n <div class=\"span6\">\n <ul>\n <li>\n <a href=\"http://grafana.org/docs/features/graphing\" target=\"_blank\">Graphing</a>\n </li>\n <li>\n <a href=\"http://grafana.org/docs/features/annotations\" target=\"_blank\">Annotations</a>\n </li>\n <li>\n <a href=\"http://grafana.org/docs/features/graphite\" target=\"_blank\">Graphite</a>\n </li>\n <li>\n <a href=\"http://grafana.org/docs/features/influxdb\" target=\"_blank\">InfluxDB</a>\n </li>\n <li>\n <a href=\"http://grafana.org/docs/features/opentsdb\" target=\"_blank\">OpenTSDB</a>\n </li>\n </ul>\n </div>\n</div>", |
||||
"style": {}, |
||||
"title": "Documentation Links" |
||||
}, |
||||
{ |
||||
"id": 3, |
||||
"span": 6, |
||||
"type": "text", |
||||
"mode": "html", |
||||
"content": "<br/>\n\n<div class=\"row-fluid\">\n <div class=\"span12\">\n <ul>\n <li>Ctrl+S saves the current dashboard</li>\n <li>Ctrl+F Opens the dashboard finder</li>\n <li>Ctrl+H Hide/show row controls</li>\n <li>Click and drag graph title to move panel</li>\n <li>Hit Escape to exit graph when in fullscreen or edit mode</li>\n <li>Click the colored icon in the legend to change series color</li>\n <li>Ctrl or Shift + Click legend name to hide other series</li>\n </ul>\n </div>\n</div>\n", |
||||
"style": {}, |
||||
"title": "Tips & Shortcuts" |
||||
} |
||||
] |
||||
}, |
||||
{ |
||||
"title": "test", |
||||
"height": "250px", |
||||
"editable": true, |
||||
"collapse": false, |
||||
"panels": [ |
||||
{ |
||||
"id": 4, |
||||
"span": 12, |
||||
"type": "graph", |
||||
"x-axis": true, |
||||
"y-axis": true, |
||||
"scale": 1, |
||||
"y_formats": [ |
||||
"short", |
||||
"short" |
||||
], |
||||
"grid": { |
||||
"max": null, |
||||
"min": null, |
||||
"leftMax": null, |
||||
"rightMax": null, |
||||
"leftMin": null, |
||||
"rightMin": null, |
||||
"threshold1": null, |
||||
"threshold2": null, |
||||
"threshold1Color": "rgba(216, 200, 27, 0.27)", |
||||
"threshold2Color": "rgba(234, 112, 112, 0.22)" |
||||
}, |
||||
"resolution": 100, |
||||
"lines": true, |
||||
"fill": 1, |
||||
"linewidth": 2, |
||||
"dashes": false, |
||||
"dashLength": 10, |
||||
"spaceLength": 10, |
||||
"points": false, |
||||
"pointradius": 5, |
||||
"bars": false, |
||||
"stack": true, |
||||
"spyable": true, |
||||
"options": false, |
||||
"legend": { |
||||
"show": true, |
||||
"values": false, |
||||
"min": false, |
||||
"max": false, |
||||
"current": false, |
||||
"total": false, |
||||
"avg": false |
||||
}, |
||||
"interactive": true, |
||||
"legend_counts": true, |
||||
"timezone": "browser", |
||||
"percentage": false, |
||||
"nullPointMode": "connected", |
||||
"steppedLine": false, |
||||
"tooltip": { |
||||
"value_type": "cumulative", |
||||
"query_as_alias": true |
||||
}, |
||||
"targets": [ |
||||
{ |
||||
"target": "randomWalk('random walk')", |
||||
"function": "mean", |
||||
"column": "value" |
||||
} |
||||
], |
||||
"aliasColors": {}, |
||||
"aliasYAxis": {}, |
||||
"title": "First Graph (click title to edit)", |
||||
"datasource": "graphite", |
||||
"renderer": "flot", |
||||
"annotate": { |
||||
"enable": false |
||||
} |
||||
} |
||||
] |
||||
} |
||||
], |
||||
"nav": [ |
||||
{ |
||||
"type": "timepicker", |
||||
"collapse": false, |
||||
"enable": true, |
||||
"status": "Stable", |
||||
"time_options": [ |
||||
"5m", |
||||
"15m", |
||||
"1h", |
||||
"6h", |
||||
"12h", |
||||
"24h", |
||||
"2d", |
||||
"7d", |
||||
"30d" |
||||
], |
||||
"refresh_intervals": [ |
||||
"5s", |
||||
"10s", |
||||
"30s", |
||||
"1m", |
||||
"5m", |
||||
"15m", |
||||
"30m", |
||||
"1h", |
||||
"2h", |
||||
"1d" |
||||
], |
||||
"now": true |
||||
} |
||||
], |
||||
"time": { |
||||
"from": "now-6h", |
||||
"to": "now" |
||||
}, |
||||
"templating": { |
||||
"list": [] |
||||
}, |
||||
"version": 5 |
||||
} |
||||
@ -0,0 +1,17 @@ |
||||
package util |
||||
|
||||
// MaxInt returns the larger of x or y.
|
||||
func MaxInt(x, y int) int { |
||||
if x < y { |
||||
return y |
||||
} |
||||
return x |
||||
} |
||||
|
||||
// MinInt returns the smaller of x or y.
|
||||
func MinInt(x, y int) int { |
||||
if x > y { |
||||
return y |
||||
} |
||||
return x |
||||
} |
||||
Loading…
Reference in new issue