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
5f515bb3
Commit
5f515bb3
authored
Oct 19, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using react component
parent
5bd11744
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
14 deletions
+41
-14
public/app/core/angular_wrappers.ts
+2
-0
public/app/core/components/Alerts/AlertList.tsx
+36
-0
public/app/core/services/alert_srv.ts
+2
-0
public/views/index.template.html
+1
-14
No files found.
public/app/core/angular_wrappers.ts
View file @
5f515bb3
...
...
@@ -5,10 +5,12 @@ import EmptyListCTA from './components/EmptyListCTA/EmptyListCTA';
import
{
SearchResult
}
from
'./components/search/SearchResult'
;
import
{
TagFilter
}
from
'./components/TagFilter/TagFilter'
;
import
{
SideMenu
}
from
'./components/sidemenu/SideMenu'
;
import
{
AlertList
}
from
'./components/Alerts/AlertList'
;
export
function
registerAngularDirectives
()
{
react2AngularDirective
(
'passwordStrength'
,
PasswordStrength
,
[
'password'
]);
react2AngularDirective
(
'sidemenu'
,
SideMenu
,
[]);
react2AngularDirective
(
'pageAlertList'
,
AlertList
,
[]);
react2AngularDirective
(
'pageHeader'
,
PageHeader
,
[
'model'
,
'noTabs'
]);
react2AngularDirective
(
'emptyListCta'
,
EmptyListCTA
,
[
'model'
]);
react2AngularDirective
(
'searchResult'
,
SearchResult
,
[]);
...
...
public/app/core/components/Alerts/AlertList.tsx
0 → 100644
View file @
5f515bb3
import
React
,
{
PureComponent
}
from
'react'
;
export
interface
Props
{
alerts
:
any
[];
}
export
class
AlertList
extends
PureComponent
<
Props
>
{
onClearAlert
=
alert
=>
{
console
.
log
(
'clear alert'
,
alert
);
};
render
()
{
const
alerts
=
[{
severity
:
'success'
,
icon
:
'warning'
,
title
:
'test'
,
text
:
'test text'
}];
return
(
<
div
>
{
alerts
.
map
((
alert
,
index
)
=>
{
return
(
<
div
key=
{
index
}
className=
{
`alert-${alert.severity} alert`
}
>
<
div
className=
"alert-icon"
>
<
i
className=
{
alert
.
icon
}
/>
</
div
>
<
div
className=
"alert-body"
>
<
div
className=
"alert-title"
>
{
alert
.
title
}
</
div
>
<
div
className=
"alert-text"
>
{
alert
.
text
}
</
div
>
</
div
>
<
button
type=
"button"
className=
"alert-close"
onClick=
{
()
=>
this
.
onClearAlert
(
alert
)
}
>
<
i
className=
"fa fa fa-remove"
/>
</
button
>
</
div
>
);
})
}
</
div
>
);
}
}
public/app/core/services/alert_srv.ts
View file @
5f515bb3
...
...
@@ -20,6 +20,8 @@ export class AlertSrv {
this
.
$rootScope
);
this
.
list
.
push
({
severity
:
'success'
,
icon
:
'warning'
,
title
:
'test'
,
text
:
'test text'
});
this
.
$rootScope
.
onAppEvent
(
'alert-warning'
,
(
e
,
alert
)
=>
{
...
...
public/views/index.template.html
View file @
5f515bb3
...
...
@@ -200,21 +200,8 @@
<grafana-app
class=
"grafana-app"
ng-cloak
>
<sidemenu
class=
"sidemenu"
></sidemenu>
<page-alert-list
class=
"page-alert-list"
></page-alert-list>
<div
class=
"page-alert-list"
>
<div
ng-repeat=
'alert in dashAlerts.list'
class=
"alert-{{alert.severity}} alert"
>
<div
class=
"alert-icon"
>
<i
class=
"{{alert.icon}}"
></i>
</div>
<div
class=
"alert-body"
>
<div
class=
"alert-title"
>
{{alert.title}}
</div>
<div
class=
"alert-text"
ng-bind=
'alert.text'
></div>
</div>
<button
type=
"button"
class=
"alert-close"
ng-click=
"dashAlerts.clear(alert)"
>
<i
class=
"fa fa fa-remove"
></i>
</button>
</div>
</div>
<div
class=
"main-view"
>
<div
class=
"scroll-canvas"
page-scrollbar
>
...
...
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