Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
c27db7a3
Commit
c27db7a3
authored
Mar 24, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small updates to share dashboard snapshot feature
parent
d7587296
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
26 deletions
+37
-26
pkg/api/dashboard_snapshot.go
+1
-1
src/app/features/dashboard/partials/shareDashboard.html
+4
-7
src/app/features/dashboard/shareSnapshotCtrl.js
+5
-2
src/css/less/gfbox.less
+0
-16
src/css/less/grafana.less
+27
-0
No files found.
pkg/api/dashboard_snapshot.go
View file @
c27db7a3
...
@@ -9,7 +9,7 @@ import (
...
@@ -9,7 +9,7 @@ import (
)
)
func
CreateDashboardSnapshot
(
c
*
middleware
.
Context
,
cmd
m
.
CreateDashboardSnapshotCommand
)
{
func
CreateDashboardSnapshot
(
c
*
middleware
.
Context
,
cmd
m
.
CreateDashboardSnapshotCommand
)
{
cmd
.
Key
=
util
.
GetRandomString
(
20
)
cmd
.
Key
=
util
.
GetRandomString
(
32
)
if
err
:=
bus
.
Dispatch
(
&
cmd
);
err
!=
nil
{
if
err
:=
bus
.
Dispatch
(
&
cmd
);
err
!=
nil
{
c
.
JsonApiErr
(
500
,
"Failed to create snaphost"
,
err
)
c
.
JsonApiErr
(
500
,
"Failed to create snaphost"
,
err
)
...
...
src/app/features/dashboard/partials/shareDashboard.html
View file @
c27db7a3
...
@@ -50,13 +50,11 @@
...
@@ -50,13 +50,11 @@
<h4
class=
"share-snapshot-header"
>
<h4
class=
"share-snapshot-header"
>
<i
ng-if=
"!loading"
class=
"fa fa-camera"
></i>
<i
ng-if=
"!loading"
class=
"fa fa-camera"
></i>
<i
ng-if=
"loading"
class=
"fa fa-spinner fa-spin"
></i>
<i
ng-if=
"loading"
class=
"fa fa-spinner fa-spin"
></i>
Create dashboard with embedded
data and share with anyone
Snapshot dashboard
&
visible
data and share with anyone
</h4>
</h4>
<div
class=
"editor-row"
style=
"margin: 11px 20px 33px 20px"
>
<div
class=
"editor-row"
style=
"margin: 11px 20px 33px 20px"
>
<div
class=
"section"
>
<div
class=
"section"
ng-if=
"!snapshotUrl"
>
<div
ng-if=
"!snapshotUrl"
>
<div
class=
"tight-form last"
>
<div
class=
"tight-form last"
>
<ul
class=
"tight-form-list"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
>
<li
class=
"tight-form-item"
>
...
@@ -72,14 +70,13 @@
...
@@ -72,14 +70,13 @@
<div
class=
"gf-form"
ng-if=
"snapshotUrl"
>
<div
class=
"gf-form"
ng-if=
"snapshotUrl"
>
<div
class=
"gf-form-row"
>
<div
class=
"gf-form-row"
>
<a
href=
"{{snapshotUrl}}"
class=
"large
"
target=
"_blank"
>
<a
href=
"{{snapshotUrl}}"
class=
"large share-snapshot-link
"
target=
"_blank"
>
<i
class=
"fa fa-external-link-square"
></i>
<i
class=
"fa fa-external-link-square"
></i>
{{snapshotUrl}}
{{snapshotUrl}}
</a>
</a>
<br>
<br>
<br>
<br>
<button
class=
"btn btn-inverse btn-large"
data-clipboard-text=
"{{snapshotUrl}}"
clipboard-button
><i
class=
"fa fa-clipboard"
></i>
Copy
</button>
<button
class=
"btn btn-inverse btn-large"
data-clipboard-text=
"{{snapshotUrl}}"
clipboard-button
><i
class=
"fa fa-clipboard"
></i>
Copy Link
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/app/features/dashboard/shareSnapshotCtrl.js
View file @
c27db7a3
...
@@ -6,7 +6,7 @@ function (angular) {
...
@@ -6,7 +6,7 @@ function (angular) {
var
module
=
angular
.
module
(
'grafana.controllers'
);
var
module
=
angular
.
module
(
'grafana.controllers'
);
module
.
controller
(
'ShareSnapshotCtrl'
,
function
(
$scope
,
$rootScope
,
$location
,
backendSrv
,
$timeout
)
{
module
.
controller
(
'ShareSnapshotCtrl'
,
function
(
$scope
,
$rootScope
,
$location
,
backendSrv
,
$timeout
,
timeSrv
)
{
$scope
.
snapshot
=
{
$scope
.
snapshot
=
{
name
:
$scope
.
dashboard
.
title
name
:
$scope
.
dashboard
.
title
...
@@ -24,8 +24,11 @@ function (angular) {
...
@@ -24,8 +24,11 @@ function (angular) {
$scope
.
saveSnapshot
=
function
(
makePublic
)
{
$scope
.
saveSnapshot
=
function
(
makePublic
)
{
var
dash
=
angular
.
copy
(
$scope
.
dashboard
);
var
dash
=
angular
.
copy
(
$scope
.
dashboard
);
// change title
dash
.
title
=
$scope
.
snapshot
.
name
;
dash
.
title
=
$scope
.
snapshot
.
name
;
// make relative times absolute
dash
.
time
=
timeSrv
.
timeRange
();
// remove panel queries & links
dash
.
forEachPanel
(
function
(
panel
)
{
dash
.
forEachPanel
(
function
(
panel
)
{
panel
.
targets
=
[];
panel
.
targets
=
[];
panel
.
links
=
[];
panel
.
links
=
[];
...
...
src/css/less/gfbox.less
View file @
c27db7a3
...
@@ -97,20 +97,4 @@
...
@@ -97,20 +97,4 @@
}
}
}
}
.share-snapshot {
text-align: center;
.share-snapshot-header {
.fa {
position: absolute;
font-size: 600%;
left: 41%;
color: @grafanaTargetFuncBackground;
z-index: -1;
}
position: relative;
z-index: 1000;
line-height: 106px;
}
}
src/css/less/grafana.less
View file @
c27db7a3
...
@@ -294,3 +294,30 @@
...
@@ -294,3 +294,30 @@
}
}
}
}
}
}
.share-snapshot {
text-align: center;
.share-snapshot-header {
.fa {
position: absolute;
font-size: 600%;
left: 42%;
color: @grafanaTargetFuncBackground;
z-index: -1;
}
position: relative;
z-index: 1000;
line-height: 106px;
margin: 45px 0 22px 0;
}
.share-snapshot-link {
max-width: 716px;
white-space: nowrap;
overflow: hidden;
display: block;
text-overflow: ellipsis;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment