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
2ac202b2
Commit
2ac202b2
authored
Sep 02, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moving things around
parent
de456f8b
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
53 additions
and
34 deletions
+53
-34
public/app/core/reducers/navModel.ts
+0
-2
public/app/features/admin/containers/ServerStats.test.tsx
+7
-15
public/app/features/admin/containers/ServerStats.tsx
+2
-2
public/app/features/alerting/AlertRuleList.test.tsx
+0
-0
public/app/features/alerting/AlertRuleList.tsx
+1
-1
public/app/features/alerting/AlertTabCtrl.ts
+2
-2
public/app/features/alerting/NotificationsEditCtrl.ts
+0
-0
public/app/features/alerting/NotificationsListCtrl.ts
+0
-0
public/app/features/alerting/__snapshots__/AlertRuleList.test.tsx.snap
+0
-0
public/app/features/alerting/all.ts
+0
-2
public/app/features/alerting/state/ThresholdMapper.test.ts
+1
-1
public/app/features/alerting/state/ThresholdMapper.ts
+0
-0
public/app/features/alerting/state/alertDef.ts
+0
-0
public/app/features/alerting/state/apis.ts
+1
-1
public/app/features/all.ts
+2
-1
public/app/features/annotations/annotation_tooltip.ts
+1
-1
public/app/plugins/panel/alertlist/module.ts
+1
-1
public/app/plugins/sdk.ts
+1
-1
public/app/routes/routes.ts
+1
-1
public/app/stores/AlertListStore/helpers.ts
+1
-1
public/app/types/container.ts
+2
-1
public/app/types/navModel.ts
+1
-1
public/test/mocks/common.ts
+29
-0
No files found.
public/app/core/reducers/navModel.ts
View file @
2ac202b2
...
...
@@ -12,7 +12,6 @@ function getNotFoundModel(): NavModel {
};
return
{
breadcrumbs
:
[
node
],
node
:
node
,
main
:
node
,
};
...
...
@@ -53,7 +52,6 @@ const navModelReducer = (state = initialState, action: Action): NavModel => {
return
{
main
:
main
,
node
:
node
,
breadcrumbs
:
[],
};
}
}
...
...
public/app/features/admin/containers/ServerStats.test.tsx
View file @
2ac202b2
import
React
from
'react'
;
import
renderer
from
'react-test-renderer'
;
import
{
ServerStats
}
from
'./ServerStats'
;
import
{
RootStore
}
from
'app/stores/RootStore/RootStore
'
;
import
{
backendSrv
,
createNavTree
}
from
'test/mocks/common
'
;
import
{
initNav
}
from
'test/mocks/common
'
;
import
{
ServerStat
}
from
'../apis
'
;
describe
(
'ServerStats'
,
()
=>
{
it
(
'Should render table with stats'
,
done
=>
{
backendSrv
.
get
.
mockReturnValue
(
Promise
.
resolve
({
dashboards
:
10
,
})
);
const
stats
:
ServerStat
[]
=
[{
name
:
'test'
,
value
:
'asd'
}];
const
store
=
RootStore
.
create
(
{},
{
backendSrv
:
backendSrv
,
navTree
:
createNavTree
(
'cfg'
,
'admin'
,
'server-stats'
),
}
);
let
getServerStats
=
()
=>
{
return
Promise
.
resolve
(
stats
);
};
const
page
=
renderer
.
create
(<
ServerStats
backendSrv=
{
backendSrv
}
{
...
store
}
/>);
const
page
=
renderer
.
create
(<
ServerStats
initNav=
{
initNav
}
getServerStats=
{
getServerStats
}
/>);
setTimeout
(()
=>
{
expect
(
page
.
toJSON
()).
toMatchSnapshot
();
...
...
public/app/features/admin/containers/ServerStats.tsx
View file @
2ac202b2
import
React
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
{
hot
}
from
'react-hot-loader'
;
import
{
connect
}
from
'react-redux'
;
import
{
initNav
}
from
'app/core/actions'
;
...
...
@@ -14,7 +14,7 @@ interface State {
stats
:
ServerStat
[];
}
export
class
ServerStats
extends
React
.
Component
<
Props
,
State
>
{
export
class
ServerStats
extends
Pure
Component
<
Props
,
State
>
{
constructor
(
props
)
{
super
(
props
);
...
...
public/app/features/alerting/
containers/
AlertRuleList.test.tsx
→
public/app/features/alerting/AlertRuleList.test.tsx
View file @
2ac202b2
File moved
public/app/features/alerting/
containers/
AlertRuleList.tsx
→
public/app/features/alerting/AlertRuleList.tsx
View file @
2ac202b2
...
...
@@ -7,7 +7,7 @@ import appEvents from 'app/core/app_events';
import
Highlighter
from
'react-highlight-words'
;
import
{
initNav
,
updateLocation
}
from
'app/core/actions'
;
import
{
ContainerProps
}
from
'app/types'
;
import
{
getAlertRules
,
AlertRule
}
from
'.
.
/apis'
;
import
{
getAlertRules
,
AlertRule
}
from
'.
/state
/apis'
;
interface
Props
extends
ContainerProps
{
updateLocation
:
typeof
updateLocation
;
...
...
public/app/features/alerting/
alert_tab_c
trl.ts
→
public/app/features/alerting/
AlertTabC
trl.ts
View file @
2ac202b2
import
_
from
'lodash'
;
import
{
ThresholdMapper
}
from
'./
threshold_m
apper'
;
import
{
ThresholdMapper
}
from
'./
state/ThresholdM
apper'
;
import
{
QueryPart
}
from
'app/core/components/query_part/query_part'
;
import
alertDef
from
'./
alert_d
ef'
;
import
alertDef
from
'./
state/alertD
ef'
;
import
config
from
'app/core/config'
;
import
appEvents
from
'app/core/app_events'
;
...
...
public/app/features/alerting/
notification_edit_c
trl.ts
→
public/app/features/alerting/
NotificationsEditC
trl.ts
View file @
2ac202b2
File moved
public/app/features/alerting/
notifications_list_c
trl.ts
→
public/app/features/alerting/
NotificationsListC
trl.ts
View file @
2ac202b2
File moved
public/app/features/alerting/
containers/
__snapshots__/AlertRuleList.test.tsx.snap
→
public/app/features/alerting/__snapshots__/AlertRuleList.test.tsx.snap
View file @
2ac202b2
File moved
public/app/features/alerting/all.ts
deleted
100644 → 0
View file @
de456f8b
import
'./notifications_list_ctrl'
;
import
'./notification_edit_ctrl'
;
public/app/features/alerting/s
pecs/threshold_m
apper.test.ts
→
public/app/features/alerting/s
tate/ThresholdM
apper.test.ts
View file @
2ac202b2
import
{
describe
,
it
,
expect
}
from
'test/lib/common'
;
import
{
ThresholdMapper
}
from
'.
.
/threshold_mapper'
;
import
{
ThresholdMapper
}
from
'./threshold_mapper'
;
describe
(
'ThresholdMapper'
,
()
=>
{
describe
(
'with greater than evaluator'
,
()
=>
{
...
...
public/app/features/alerting/
threshold_m
apper.ts
→
public/app/features/alerting/
state/ThresholdM
apper.ts
View file @
2ac202b2
File moved
public/app/features/alerting/
alert_d
ef.ts
→
public/app/features/alerting/
state/alertD
ef.ts
View file @
2ac202b2
File moved
public/app/features/alerting/
apis/index
.ts
→
public/app/features/alerting/
state/apis
.ts
View file @
2ac202b2
import
{
getBackendSrv
}
from
'app/core/services/backend_srv'
;
import
alertDef
from
'.
./alert_d
ef'
;
import
alertDef
from
'.
/alertD
ef'
;
import
moment
from
'moment'
;
export
interface
AlertRule
{
...
...
public/app/features/all.ts
View file @
2ac202b2
...
...
@@ -9,5 +9,6 @@ import './snapshot/all';
import
'./panel/all'
;
import
'./org/all'
;
import
'./admin/admin'
;
import
'./alerting/all'
;
import
'./alerting/NotificationsEditCtrl'
;
import
'./alerting/NotificationsListCtrl'
;
import
'./styleguide/styleguide'
;
public/app/features/annotations/annotation_tooltip.ts
View file @
2ac202b2
import
_
from
'lodash'
;
import
$
from
'jquery'
;
import
coreModule
from
'app/core/core_module'
;
import
alertDef
from
'../alerting/
alert_d
ef'
;
import
alertDef
from
'../alerting/
state/alertD
ef'
;
/** @ngInject **/
export
function
annotationTooltipDirective
(
$sanitize
,
dashboardSrv
,
contextSrv
,
$compile
)
{
...
...
public/app/plugins/panel/alertlist/module.ts
View file @
2ac202b2
import
_
from
'lodash'
;
import
moment
from
'moment'
;
import
alertDef
from
'../../../features/alerting/
alert_d
ef'
;
import
alertDef
from
'../../../features/alerting/
state/alertD
ef'
;
import
{
PanelCtrl
}
from
'app/plugins/sdk'
;
import
*
as
dateMath
from
'app/core/utils/datemath'
;
...
...
public/app/plugins/sdk.ts
View file @
2ac202b2
import
{
PanelCtrl
}
from
'app/features/panel/panel_ctrl'
;
import
{
MetricsPanelCtrl
}
from
'app/features/panel/metrics_panel_ctrl'
;
import
{
QueryCtrl
}
from
'app/features/panel/query_ctrl'
;
import
{
alertTab
}
from
'app/features/alerting/
alert_tab_c
trl'
;
import
{
alertTab
}
from
'app/features/alerting/
AlertTabC
trl'
;
import
{
loadPluginCss
}
from
'app/features/plugins/plugin_loader'
;
export
{
PanelCtrl
,
MetricsPanelCtrl
,
QueryCtrl
,
alertTab
,
loadPluginCss
};
public/app/routes/routes.ts
View file @
2ac202b2
...
...
@@ -2,7 +2,7 @@ import './dashboard_loaders';
import
'./ReactContainer'
;
import
ServerStats
from
'app/features/admin/containers/ServerStats'
;
import
AlertRuleList
from
'app/features/alerting/
containers/
AlertRuleList'
;
import
AlertRuleList
from
'app/features/alerting/AlertRuleList'
;
import
FolderSettings
from
'app/containers/ManageDashboards/FolderSettings'
;
import
FolderPermissions
from
'app/containers/ManageDashboards/FolderPermissions'
;
import
TeamPages
from
'app/containers/Teams/TeamPages'
;
...
...
public/app/stores/AlertListStore/helpers.ts
View file @
2ac202b2
import
moment
from
'moment'
;
import
alertDef
from
'app/features/alerting/
alert_d
ef'
;
import
alertDef
from
'app/features/alerting/
state/alertD
ef'
;
export
function
setStateFields
(
rule
,
state
)
{
const
stateModel
=
alertDef
.
getStateDisplayModel
(
state
);
...
...
public/app/types/container.ts
View file @
2ac202b2
import
{
NavModel
}
from
'./navModel'
;
import
{
initNav
}
from
'app/core/actions'
;
export
interface
ContainerProps
{
navModel
:
NavModel
;
initNav
:
(...
args
:
string
[])
=>
void
;
initNav
:
typeof
initNav
;
}
public/app/types/navModel.ts
View file @
2ac202b2
...
...
@@ -9,11 +9,11 @@ export interface NavModelItem {
hideFromTabs
?:
boolean
;
divider
?:
boolean
;
children
?:
NavModelItem
[];
breadcrumbs
?:
NavModelItem
[];
target
?:
string
;
}
export
interface
NavModel
{
breadcrumbs
:
NavModelItem
[];
main
:
NavModelItem
;
node
:
NavModelItem
;
}
public/test/mocks/common.ts
View file @
2ac202b2
import
{
NavModel
,
NavModelItem
}
from
'app/types'
;
export
const
backendSrv
=
{
get
:
jest
.
fn
(),
getDashboard
:
jest
.
fn
(),
...
...
@@ -17,3 +19,30 @@ export function createNavTree(...args) {
return
root
;
}
export
function
getNavModel
(
title
:
string
,
tabs
:
string
[]):
NavModel
{
const
node
:
NavModelItem
=
{
id
:
title
,
text
:
title
,
icon
:
'fa fa-fw fa-warning'
,
subTitle
:
'subTitle'
,
url
:
title
,
children
:
[],
breadcrumbs
:
[],
};
for
(
let
tab
of
tabs
)
{
node
.
children
.
push
({
id
:
tab
,
icon
:
'icon'
,
subTitle
:
'subTitle'
,
url
:
title
,
text
:
title
,
});
}
return
{
node
:
node
,
main
:
node
,
};
}
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