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
66d9c4f1
Commit
66d9c4f1
authored
Feb 02, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed share dashboard feature, sharing temp feature is currently removed
parent
f424abf8
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
51 deletions
+45
-51
src/app/features/dashboard/dashboardNavCtrl.js
+5
-11
src/app/features/dashboard/panelSrv.js
+1
-1
src/app/features/dashboard/partials/shareModal.html
+14
-17
src/app/features/dashboard/sharePanelCtrl.js
+6
-4
src/app/partials/dashLoaderShare.html
+0
-11
src/app/partials/dashboard_topnav.html
+1
-7
src/app/partials/shareDashboard.html
+18
-0
No files found.
src/app/features/dashboard/dashboardNavCtrl.js
View file @
66d9c4f1
...
...
@@ -39,17 +39,11 @@ function (angular, _, moment, config, store) {
$location
.
search
(
search
);
};
$scope
.
saveForSharing
=
function
()
{
var
clone
=
angular
.
copy
(
$scope
.
dashboard
);
clone
.
temp
=
true
;
$scope
.
db
.
saveDashboard
(
clone
)
.
then
(
function
(
result
)
{
$scope
.
share
=
{
url
:
result
.
url
,
title
:
result
.
title
};
},
function
(
err
)
{
alertSrv
.
set
(
'Save for sharing failed'
,
err
,
'error'
,
5000
);
});
$scope
.
shareDashboard
=
function
()
{
$scope
.
appEvent
(
'show-modal'
,
{
src
:
'./app/features/dashboard/partials/shareModal.html'
,
scope
:
$scope
.
$new
(),
});
};
$scope
.
passwordCache
=
function
(
pwd
)
{
...
...
src/app/features/dashboard/panelSrv.js
View file @
66d9c4f1
...
...
@@ -24,7 +24,7 @@ function (angular, _) {
$scope
.
sharePanel
=
function
()
{
$scope
.
appEvent
(
'show-modal'
,
{
src
:
'./app/
partials/share-pane
l.html'
,
src
:
'./app/
features/dashboard/partials/shareModa
l.html'
,
scope
:
$scope
.
$new
()
});
};
...
...
src/app/
partials/share-pane
l.html
→
src/app/
features/dashboard/partials/shareModa
l.html
View file @
66d9c4f1
<div
ng-controller=
"SharePanelCtrl"
>
<div
class=
"modal-header"
>
<div
class=
"dashboard-editor-header"
>
<div
class=
"dashboard-editor-title"
>
<i
class=
"fa fa-share"
></i>
Share
</div>
<div
class=
"modal-body gf-box gf-box-no-margin"
ng-controller=
"SharePanelCtrl"
>
<div
class=
"gf-box-header"
>
<div
class=
"gf-box-title"
>
<i
class=
"fa fa-share"
></i>
Share
</div>
<div
ng-model=
"editor.index"
bs-tabs
style=
"text-transform:capitalize;"
>
<div
ng-repeat=
"tab in ['Link']"
data-title=
"{{tab}}"
>
</div>
<div
ng-model=
"editor.index"
bs-tabs
style=
"text-transform:capitalize;"
>
<div
ng-repeat=
"tab in ['Link']"
data-title=
"{{tab}}"
>
</div>
</div>
</div>
<div
class=
"modal-body"
>
<button
class=
"gf-box-header-close-btn"
ng-click=
"dismiss();"
>
<i
class=
"fa fa-remove"
></i>
</button>
</div>
<div
class=
"gf-box-body"
>
<div
class=
"editor-row"
>
<editor-opt-bool
text=
"Current time range"
model=
"forCurrent"
change=
"buildUrl()"
></editor-opt-bool>
<editor-opt-bool
text=
"To this panel only"
model=
"toPanel"
change=
"buildUrl()"
></editor-opt-bool>
...
...
@@ -29,10 +29,7 @@
<div
class=
"editor-row"
style=
"margin-top: 20px;"
>
<a
href=
"{{imageUrl}}"
target=
"_blank"
>
Link to rendered image
</a>
</div>
</div>
<div
class=
"modal-footer"
>
<button
class=
"btn btn-success pull-right"
ng-click=
"dismiss();"
>
close
</button>
</div>
</div>
src/app/features/dashboard/sharePanelCtrl.js
View file @
66d9c4f1
...
...
@@ -12,9 +12,12 @@ function (angular, _) {
$scope
.
init
=
function
()
{
$scope
.
editor
=
{
index
:
0
};
$scope
.
forCurrent
=
true
;
$scope
.
toPanel
=
true
;
$scope
.
includeTemplateVars
=
true
;
if
(
$scope
.
panel
)
{
$scope
.
toPanel
=
true
;
}
$scope
.
includeTemplateVars
=
true
;
$scope
.
buildUrl
();
};
...
...
@@ -26,7 +29,6 @@ function (angular, _) {
baseUrl
=
baseUrl
.
substring
(
0
,
queryStart
);
}
var
panelId
=
$scope
.
panel
.
id
;
var
params
=
angular
.
copy
(
$location
.
search
());
var
range
=
timeSrv
.
timeRangeForUrl
();
...
...
@@ -50,7 +52,7 @@ function (angular, _) {
}
if
(
$scope
.
toPanel
)
{
params
.
panelId
=
panelI
d
;
params
.
panelId
=
$scope
.
panel
.
i
d
;
params
.
fullscreen
=
true
;
}
else
{
delete
params
.
panelId
;
...
...
src/app/partials/dashLoaderShare.html
deleted
100644 → 0
View file @
f424abf8
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h3>
{{share.title}}
<small>
shareable link
</small></h3>
</div>
<div
class=
"modal-body"
>
<label>
Share this dashboard with this URL
</label>
<input
ng-model=
'share.url'
type=
"text"
style=
"width:90%"
onclick=
"this.select()"
onfocus=
"this.select()"
>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-success"
ng-click=
"dismiss();$broadcast('render')"
>
Close
</button>
</div>
src/app/partials/dashboard_topnav.html
View file @
66d9c4f1
...
...
@@ -23,7 +23,7 @@
<a
class=
"pointer"
ng-click=
"starDashboard()"
><i
class=
"fa fa-star-o"
style=
"color: orange;"
></i></a>
</li>
<li>
<a
class=
"pointer"
ng-click=
"
as
d()"
><i
class=
"fa fa-share-square-o"
></i></a>
<a
class=
"pointer"
ng-click=
"
shareDashboar
d()"
><i
class=
"fa fa-share-square-o"
></i></a>
</li>
<li>
<a
ng-click=
"saveDashboard()"
><i
class=
"fa fa-save"
></i></a>
...
...
@@ -52,12 +52,6 @@
</grafana-simple-panel>
</li>
<!-- <li class="dropdown grafana-menu-save"> -->
<!-- <a bs-tooltip="'Save'" data-placement="bottom" class="dropdown-toggle" data-toggle="dropdown" ng-click="saveDashboard()"> -->
<!-- <i class='fa fa-save'></i> -->
<!-- </a> -->
<!-- </li> -->
<!-- -->
<li
class=
"grafana-menu-stop-playlist hide"
>
<a
class=
'small'
ng-click=
'stopPlaylist(2)'
>
Stop playlist
...
...
src/app/partials/shareDashboard.html
0 → 100644
View file @
66d9c4f1
<div
class=
"modal-body gf-box gf-box-no-margin"
>
<div
class=
"gf-box-header"
>
<div
class=
"gf-box-title"
>
<i
class=
"fa fa-share-alt"
></i>
Share dashboard
</div>
<button
class=
"gf-box-header-close-btn"
ng-click=
"dismiss();"
>
<i
class=
"fa fa-remove"
></i>
</button>
</div>
<div
class=
"gf-box-body"
>
<label>
Share this dashboard with this URL
</label>
<input
ng-model=
'share.url'
type=
"text"
style=
"width:90%"
onclick=
"this.select()"
onfocus=
"this.select()"
>
</div>
</div>
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