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
27ec0d53
Commit
27ec0d53
authored
Nov 10, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
began work on custom confirm modal
parent
3aa619b6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
6 deletions
+52
-6
src/app/controllers/row.js
+6
-3
src/app/panels/graph/legend.js
+2
-2
src/app/partials/confirm_modal.html
+20
-0
src/app/services/alertSrv.js
+24
-1
No files found.
src/app/controllers/row.js
View file @
27ec0d53
...
...
@@ -76,9 +76,12 @@ function (angular, app, _) {
};
$scope
.
remove_panel_from_row
=
function
(
row
,
panel
)
{
if
(
confirm
(
'Are you sure you want to remove this '
+
panel
.
type
+
' panel?'
))
{
row
.
panels
=
_
.
without
(
row
.
panels
,
panel
);
}
$scope
.
appEvent
(
'confirm-modal'
,
{
title
:
'Are you sure you want to remove this panel?'
,
onConfirm
:
function
()
{
row
.
panels
=
_
.
without
(
row
.
panels
,
panel
);
}
});
};
$scope
.
replacePanel
=
function
(
newPanel
,
oldPanel
)
{
...
...
src/app/panels/graph/legend.js
View file @
27ec0d53
...
...
@@ -22,8 +22,8 @@ function (angular, app, _, kbn, $) {
var
data
;
var
i
;
scope
.
$on
(
'render'
,
function
(
event
,
renderData
)
{
data
=
renderData
||
data
;
scope
.
$on
(
'render'
,
function
()
{
data
=
scope
.
seriesList
;
if
(
data
)
{
render
();
}
...
...
src/app/partials/confirm_modal.html
0 → 100644
View file @
27ec0d53
<div
class=
"modal-body"
>
<div
class=
"dashboard-editor-header"
>
<div
class=
"dashboard-editor-title"
>
<i
class=
"icon icon-ok"
></i>
Confirm
</div>
</div>
<div
class=
"dashboard-editor-body"
>
<div
class=
"row-fluid"
>
<span
class=
"span4"
>
{{title}}
</span>
<button
type=
"button"
class=
"btn btn-info span2"
ng-click=
"dismiss()"
>
Cancel
</button>
<button
type=
"button"
class=
"btn btn-success span2"
ng-click=
"onConfirm();dismiss();"
>
OK
</button>
<span
class=
"span4"
></span>
</div>
</div>
src/app/services/alertSrv.js
View file @
27ec0d53
...
...
@@ -7,7 +7,7 @@ function (angular, _) {
var
module
=
angular
.
module
(
'grafana.services'
);
module
.
service
(
'alertSrv'
,
function
(
$timeout
,
$sce
,
$rootScope
)
{
module
.
service
(
'alertSrv'
,
function
(
$timeout
,
$sce
,
$rootScope
,
$modal
,
$q
)
{
var
self
=
this
;
this
.
init
=
function
()
{
...
...
@@ -20,6 +20,7 @@ function (angular, _) {
$rootScope
.
onAppEvent
(
'alert-success'
,
function
(
e
,
alert
)
{
self
.
set
(
alert
[
0
],
alert
[
1
],
'success'
,
3000
);
});
$rootScope
.
onAppEvent
(
'confirm-modal'
,
this
.
showConfirmModal
);
};
// List of all alert objects
...
...
@@ -57,5 +58,27 @@ function (angular, _) {
this
.
clearAll
=
function
()
{
self
.
list
=
[];
};
this
.
showConfirmModal
=
function
(
e
,
payload
)
{
var
scope
=
$rootScope
.
$new
();
scope
.
title
=
payload
.
title
;
scope
.
text
=
payload
.
text
;
scope
.
onConfirm
=
payload
.
onConfirm
;
var
confirmModal
=
$modal
({
template
:
'./app/partials/confirm_modal.html'
,
persist
:
true
,
show
:
false
,
scope
:
scope
,
keyboard
:
false
});
$q
.
when
(
confirmModal
).
then
(
function
(
modalEl
)
{
modalEl
.
modal
(
'show'
);
});
};
});
});
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