Commit 41fd0ed4 by utkarshcmu

Merge branch 'master' of https://github.com/grafana/grafana into snapshot-view

parents bcb44b7b 6b85a6fd
...@@ -36,6 +36,7 @@ func CreateDashboardSnapshot(c *middleware.Context, cmd m.CreateDashboardSnapsho ...@@ -36,6 +36,7 @@ func CreateDashboardSnapshot(c *middleware.Context, cmd m.CreateDashboardSnapsho
cmd.DeleteKey = util.GetRandomString(32) cmd.DeleteKey = util.GetRandomString(32)
cmd.OrgId = c.OrgId cmd.OrgId = c.OrgId
cmd.UserId = c.UserId cmd.UserId = c.UserId
cmd.Name = c.Name
metrics.M_Api_Dashboard_Snapshot_Create.Inc(1) metrics.M_Api_Dashboard_Snapshot_Create.Inc(1)
} }
......
...@@ -25,6 +25,7 @@ type DashboardSnapshot struct { ...@@ -25,6 +25,7 @@ type DashboardSnapshot struct {
type CreateDashboardSnapshotCommand struct { type CreateDashboardSnapshotCommand struct {
Dashboard map[string]interface{} `json:"dashboard" binding:"Required"` Dashboard map[string]interface{} `json:"dashboard" binding:"Required"`
Name string `json:"name" binding:"Required"`
Expires int64 `json:"expires"` Expires int64 `json:"expires"`
// these are passed when storing an external snapshot ref // these are passed when storing an external snapshot ref
......
...@@ -25,6 +25,7 @@ func CreateDashboardSnapshot(cmd *m.CreateDashboardSnapshotCommand) error { ...@@ -25,6 +25,7 @@ func CreateDashboardSnapshot(cmd *m.CreateDashboardSnapshotCommand) error {
} }
snapshot := &m.DashboardSnapshot{ snapshot := &m.DashboardSnapshot{
Name: cmd.Name,
Key: cmd.Key, Key: cmd.Key,
DeleteKey: cmd.DeleteKey, DeleteKey: cmd.DeleteKey,
OrgId: cmd.OrgId, OrgId: cmd.OrgId,
......
...@@ -7,10 +7,9 @@ export class AppEditCtrl { ...@@ -7,10 +7,9 @@ export class AppEditCtrl {
appModel: any; appModel: any;
/** @ngInject */ /** @ngInject */
constructor(private backendSrv: any, private $routeParams: any) {} constructor(private backendSrv: any, private $routeParams: any) {
init() {
this.appModel = {}; this.appModel = {};
this.backendSrv.get(`/api/org/apps/${this.$routeParams.appId}/settings`).then(result => { this.backendSrv.get(`/api/org/apps/${this.$routeParams.appId}/settings`).then(result => {
this.appModel = result; this.appModel = result;
}); });
......
...@@ -5,37 +5,38 @@ ...@@ -5,37 +5,38 @@
</navbar> </navbar>
<div class="page-container"> <div class="page-container">
<div class="apps-side-box"> <div class="flex-container">
<div class="apps-side-box-logo" > <div class="flex-column app-edit-logo-box">
<img src="{{ctrl.appModel.info.logos.large}}"> <img src="{{ctrl.appModel.info.logos.large}}">
</div> </div>
<ul class="app-side-box-links"> <div class="flex-column">
<li>
By <a href="{{ctrl.appModel.info.author.url}}" class="external-link" target="_blank">{{ctrl.appModel.info.author.name}}</a>
</li>
<li ng-repeat="link in ctrl.appModel.info.links">
<a href="{{link.url}}" class="external-link" target="_blank">{{link.name}}</a>
</li>
</ul>
</div>
<div class="page-wide-margined" ng-init="ctrl.init()">
<h1> <h1>
{{ctrl.appModel.name}} {{ctrl.appModel.name}}
</h1> </h1>
<em> <div class="app-edit-description">
{{ctrl.appModel.info.description}}<br> {{ctrl.appModel.info.description}}<br>
<span style="small"> <span style="small">
Version: {{ctrl.appModel.info.version}} &nbsp; &nbsp; Updated: {{ctrl.appModel.info.updated}} Version: {{ctrl.appModel.info.version}} &nbsp; &nbsp; Updated: {{ctrl.appModel.info.updated}}
</span> </span>
</em> </div>
<br><br>
<div class="form-inline"> <div class="form-inline">
<editor-checkbox text="Enabled" model="ctrl.appModel.enabled" change="ctrl.toggleEnabled()"></editor-checkbox> <editor-checkbox text="Enabled" model="ctrl.appModel.enabled" change="ctrl.toggleEnabled()"></editor-checkbox>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<editor-checkbox text="Pinned" model="ctrl.appModel.pinned" change="ctrl.togglePinned()"></editor-checkbox> <editor-checkbox text="Pinned" model="ctrl.appModel.pinned" change="ctrl.togglePinned()"></editor-checkbox>
</div> </div>
</div>
<div class="flex-column">
<ul class="app-edit-links">
<li>
By <a href="{{ctrl.appModel.info.author.url}}" class="external-link" target="_blank">{{ctrl.appModel.info.author.name}}</a>
</li>
<li ng-repeat="link in ctrl.appModel.info.links">
<a href="{{link.url}}" class="external-link" target="_blank">{{link.name}}</a>
</li>
</ul>
</div>
</div>
<section class="simple-box"> <section class="simple-box">
<h3 class="simple-box-header">Included with app:</h3> <h3 class="simple-box-header">Included with app:</h3>
...@@ -99,5 +100,4 @@ ...@@ -99,5 +100,4 @@
</section> </section>
</div>
</div> </div>
...@@ -60,6 +60,7 @@ function (angular, _) { ...@@ -60,6 +60,7 @@ function (angular, _) {
var cmdData = { var cmdData = {
dashboard: dash, dashboard: dash,
name: dash.title,
expires: $scope.snapshot.expires, expires: $scope.snapshot.expires,
}; };
......
.apps-side-box {
float: left;
}
.apps-side-box-logo { .app-edit-logo-box {
padding: 15px; padding: 1.2rem;
background: @grafanaPanelBackground; background: @grafanaPanelBackground;
width: 120px;
text-align: center; text-align: center;
img { img {
max-width: 100px; max-width: 7rem;
} }
margin-bottom: 10px; margin-right: 2rem;
} }
.app-side-box-links { .app-edit-links {
list-style: none; list-style: none;
margin: 0; margin: 0 0 0 2rem;
li { li {
background: @grafanaPanelBackground; background: @grafanaPanelBackground;
margin-top: 4px; margin-top: 4px;
padding-left: 10px; padding: 0.2rem 1rem;
line-height: 25px;
} }
} }
.app-edit-description {
font-style: italic;
margin-bottom: 1.5rem;
}
...@@ -44,3 +44,7 @@ ...@@ -44,3 +44,7 @@
.flex-container { .flex-container {
display: flex; display: flex;
} }
.flex-column {
flex-direction: row;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment