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
5e1a3c9e
Unverified
Commit
5e1a3c9e
authored
Jan 26, 2019
by
Torkel Ödegaard
Committed by
GitHub
Jan 26, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15023 from grafana/improve-organization
More file re-organization & clean-up
parents
ecbda1af
05738258
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
36 additions
and
235 deletions
+36
-235
public/app/core/controllers/all.ts
+0
-1
public/app/core/controllers/inspect_ctrl.ts
+0
-71
public/app/features/dashboard/components/AddPanelWidget/AddPanelWidget.tsx
+10
-10
public/app/features/dashboard/components/AddPanelWidget/_AddPanelWidget.scss
+5
-5
public/app/features/dashboard/components/AddPanelWidget/index.ts
+1
-0
public/app/features/dashboard/components/RowOptions/RowOptionsCtrl.ts
+0
-0
public/app/features/dashboard/components/RowOptions/index.ts
+1
-0
public/app/features/dashboard/components/RowOptions/template.html
+0
-0
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
+2
-2
public/app/features/dashboard/index.ts
+1
-1
public/app/features/dashboard/partials/folder_permissions.html
+0
-7
public/app/features/dashboard/partials/folder_settings.html
+0
-23
public/app/features/dashboard/partials/inspector.html
+0
-82
public/app/features/folders/CreateFolderCtrl.ts
+2
-1
public/app/features/folders/FolderDashboardsCtrl.ts
+2
-1
public/app/features/folders/partials/create_folder.html
+0
-0
public/app/features/folders/partials/folder_dashboards.html
+0
-0
public/app/features/folders/services/FolderPageLoader.ts
+0
-0
public/app/features/manage-dashboards/DashboardImportCtrl.ts
+2
-0
public/app/features/manage-dashboards/index.ts
+0
-6
public/app/features/manage-dashboards/partials/dashboard_import.html
+0
-0
public/app/features/panel/panel_ctrl.ts
+0
-13
public/app/features/panel/panel_directive.ts
+0
-5
public/app/routes/routes.ts
+9
-6
public/sass/_grafana.scss
+1
-1
No files found.
public/app/core/controllers/all.ts
View file @
5e1a3c9e
import
'./inspect_ctrl'
;
import
'./json_editor_ctrl'
;
import
'./login_ctrl'
;
import
'./invited_ctrl'
;
...
...
public/app/core/controllers/inspect_ctrl.ts
deleted
100644 → 0
View file @
ecbda1af
import
angular
from
'angular'
;
import
_
from
'lodash'
;
import
$
from
'jquery'
;
import
coreModule
from
'../core_module'
;
export
class
InspectCtrl
{
/** @ngInject */
constructor
(
$scope
,
$sanitize
)
{
const
model
=
$scope
.
inspector
;
$scope
.
init
=
function
()
{
$scope
.
editor
=
{
index
:
0
};
if
(
!
model
.
error
)
{
return
;
}
if
(
_
.
isString
(
model
.
error
.
data
))
{
$scope
.
response
=
$
(
'<div>'
+
model
.
error
.
data
+
'</div>'
).
text
();
}
else
if
(
model
.
error
.
data
)
{
if
(
model
.
error
.
data
.
response
)
{
$scope
.
response
=
$sanitize
(
model
.
error
.
data
.
response
);
}
else
{
$scope
.
response
=
angular
.
toJson
(
model
.
error
.
data
,
true
);
}
}
else
if
(
model
.
error
.
message
)
{
$scope
.
message
=
model
.
error
.
message
;
}
if
(
model
.
error
.
config
&&
model
.
error
.
config
.
params
)
{
$scope
.
request_parameters
=
_
.
map
(
model
.
error
.
config
.
params
,
(
value
,
key
)
=>
{
return
{
key
:
key
,
value
:
value
};
});
}
if
(
model
.
error
.
stack
)
{
$scope
.
editor
.
index
=
3
;
$scope
.
stack_trace
=
model
.
error
.
stack
;
$scope
.
message
=
model
.
error
.
message
;
}
if
(
model
.
error
.
config
&&
model
.
error
.
config
.
data
)
{
$scope
.
editor
.
index
=
2
;
if
(
_
.
isString
(
model
.
error
.
config
.
data
))
{
$scope
.
request_parameters
=
this
.
getParametersFromQueryString
(
model
.
error
.
config
.
data
);
}
else
{
$scope
.
request_parameters
=
_
.
map
(
model
.
error
.
config
.
data
,
(
value
,
key
)
=>
{
return
{
key
:
key
,
value
:
angular
.
toJson
(
value
,
true
)
};
});
}
}
};
}
getParametersFromQueryString
(
queryString
)
{
const
result
=
[];
const
parameters
=
queryString
.
split
(
'&'
);
for
(
let
i
=
0
;
i
<
parameters
.
length
;
i
++
)
{
const
keyValue
=
parameters
[
i
].
split
(
'='
);
if
(
keyValue
[
1
].
length
>
0
)
{
result
.
push
({
key
:
keyValue
[
0
],
value
:
(
window
as
any
).
unescape
(
keyValue
[
1
]),
});
}
}
return
result
;
}
}
coreModule
.
controller
(
'InspectCtrl'
,
InspectCtrl
);
public/app/features/dashboard/
dashgrid/AddPanelPanel
.tsx
→
public/app/features/dashboard/
components/AddPanelWidget/AddPanelWidget
.tsx
View file @
5e1a3c9e
import
React
from
'react'
;
import
_
from
'lodash'
;
import
config
from
'app/core/config'
;
import
{
PanelModel
}
from
'../panel_model'
;
import
{
DashboardModel
}
from
'../dashboard_model'
;
import
{
PanelModel
}
from
'../
../
panel_model'
;
import
{
DashboardModel
}
from
'../
../
dashboard_model'
;
import
store
from
'app/core/store'
;
import
{
LS_PANEL_COPY_KEY
}
from
'app/core/constants'
;
import
{
updateLocation
}
from
'app/core/actions'
;
import
{
store
as
reduxStore
}
from
'app/store/store'
;
export
interface
AddPanelPanel
Props
{
export
interface
Props
{
panel
:
PanelModel
;
dashboard
:
DashboardModel
;
}
export
interface
AddPanelPanel
State
{
export
interface
State
{
copiedPanelPlugins
:
any
[];
}
export
class
AddPanel
Panel
extends
React
.
Component
<
AddPanelPanelProps
,
AddPanelPanel
State
>
{
export
class
AddPanel
Widget
extends
React
.
Component
<
Props
,
State
>
{
constructor
(
props
)
{
super
(
props
);
this
.
handleCloseAddPanel
=
this
.
handleCloseAddPanel
.
bind
(
this
);
...
...
@@ -133,15 +133,15 @@ export class AddPanelPanel extends React.Component<AddPanelPanelProps, AddPanelP
}
return
(
<
div
className=
"panel-container add-panel-container"
>
<
div
className=
"add-panel"
>
<
div
className=
"add-panel__header grid-drag-handle"
>
<
div
className=
"panel-container add-panel-
widget-
container"
>
<
div
className=
"add-panel
-widget
"
>
<
div
className=
"add-panel
-widget
__header grid-drag-handle"
>
<
i
className=
"gicon gicon-add-panel"
/>
<
button
className=
"add-panel__close"
onClick=
{
this
.
handleCloseAddPanel
}
>
<
button
className=
"add-panel
-widget
__close"
onClick=
{
this
.
handleCloseAddPanel
}
>
<
i
className=
"fa fa-close"
/>
</
button
>
</
div
>
<
div
className=
"add-panel-btn-container"
>
<
div
className=
"add-panel-
widget__
btn-container"
>
<
button
className=
"btn-success btn btn-large"
onClick=
{
this
.
onCreateNewPanel
}
>
Edit Panel
</
button
>
...
...
public/
sass/components/_panel_add_panel
.scss
→
public/
app/features/dashboard/components/AddPanelWidget/_AddPanelWidget
.scss
View file @
5e1a3c9e
.add-panel-container
{
.add-panel-
widget-
container
{
height
:
100%
;
}
.add-panel
{
.add-panel
-widget
{
height
:
100%
;
}
.add-panel__header
{
.add-panel
-widget
__header
{
top
:
0
;
position
:
absolute
;
padding
:
0
15px
;
...
...
@@ -26,7 +26,7 @@
}
}
.add-panel__close
{
.add-panel
-widget
__close
{
margin-left
:
auto
;
background-color
:
transparent
;
border
:
0
;
...
...
@@ -34,7 +34,7 @@
margin-right
:
-10px
;
}
.add-panel-btn-container
{
.add-panel-
widget__
btn-container
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
...
...
public/app/features/dashboard/components/AddPanelWidget/index.ts
0 → 100644
View file @
5e1a3c9e
export
{
AddPanelWidget
}
from
'./AddPanelWidget'
;
public/app/features/dashboard/
dashgrid/RowOptions
.ts
→
public/app/features/dashboard/
components/RowOptions/RowOptionsCtrl
.ts
View file @
5e1a3c9e
File moved
public/app/features/dashboard/components/RowOptions/index.ts
0 → 100644
View file @
5e1a3c9e
export
{
RowOptionsCtrl
}
from
'./RowOptionsCtrl'
;
public/app/features/dashboard/
partials/row_options
.html
→
public/app/features/dashboard/
components/RowOptions/template
.html
View file @
5e1a3c9e
File moved
public/app/features/dashboard/dashgrid/DashboardPanel.tsx
View file @
5e1a3c9e
...
...
@@ -5,7 +5,7 @@ import classNames from 'classnames';
import
{
getAngularLoader
,
AngularComponent
}
from
'app/core/services/AngularLoader'
;
import
{
importPluginModule
}
from
'app/features/plugins/plugin_loader'
;
import
{
AddPanel
Panel
}
from
'./AddPanelPanel
'
;
import
{
AddPanel
Widget
}
from
'../components/AddPanelWidget
'
;
import
{
getPanelPluginNotFound
}
from
'./PanelPluginNotFound'
;
import
{
DashboardRow
}
from
'./DashboardRow'
;
import
{
PanelChrome
}
from
'./PanelChrome'
;
...
...
@@ -53,7 +53,7 @@ export class DashboardPanel extends PureComponent<Props, State> {
}
renderAddPanel
()
{
return
<
AddPanel
Panel
panel=
{
this
.
props
.
panel
}
dashboard=
{
this
.
props
.
dashboard
}
/>;
return
<
AddPanel
Widget
panel=
{
this
.
props
.
panel
}
dashboard=
{
this
.
props
.
dashboard
}
/>;
}
onPluginTypeChanged
=
(
plugin
:
PanelPlugin
)
=>
{
...
...
public/app/features/dashboard/index.ts
View file @
5e1a3c9e
...
...
@@ -2,7 +2,6 @@ import './dashboard_ctrl';
import
'./time_srv'
;
import
'./repeat_option/repeat_option'
;
import
'./dashgrid/DashboardGridDirective'
;
import
'./dashgrid/RowOptions'
;
import
'./panellinks/module'
;
// Services
...
...
@@ -25,6 +24,7 @@ import './components/UnsavedChangesModal';
import
'./components/SaveModals'
;
import
'./components/ShareModal'
;
import
'./components/AdHocFilters'
;
import
'./components/RowOptions'
;
import
DashboardPermissions
from
'./components/DashboardPermissions/DashboardPermissions'
;
...
...
public/app/features/dashboard/partials/folder_permissions.html
deleted
100644 → 0
View file @
ecbda1af
<page-header
model=
"ctrl.navModel"
></page-header>
<div
class=
"page-container page-body"
>
<dashboard-permissions
ng-if=
"ctrl.dashboard && ctrl.meta"
dashboardId=
"ctrl.dashboard.id"
/>
</div>
public/app/features/dashboard/partials/folder_settings.html
deleted
100644 → 0
View file @
ecbda1af
<page-header
model=
"ctrl.navModel"
></page-header>
<div
class=
"page-container page-body"
>
<h2
class=
"page-sub-heading"
>
Folder Settings
</h2>
<div
class=
"section gf-form-group"
>
<form
name=
"folderSettingsForm"
ng-submit=
"ctrl.save()"
>
<div
class=
"gf-form"
>
<label
class=
"gf-form-label width-7"
>
Name
</label>
<input
type=
"text"
class=
"gf-form-input width-30"
ng-model=
'ctrl.title'
ng-change=
"ctrl.titleChanged()"
></input>
</div>
<div
class=
"gf-form-button-row"
>
<button
type=
"submit"
class=
"btn btn-success"
ng-disabled=
"!ctrl.canSave || !ctrl.hasChanged"
>
<i
class=
"fa fa-save"
></i>
Save
</button>
<button
class=
"btn btn-danger"
ng-click=
"ctrl.delete($event)"
ng-disabled=
"!ctrl.canSave"
>
<i
class=
"fa fa-trash"
></i>
Delete
</button>
</div>
</form>
</div>
</div>
public/app/features/dashboard/partials/inspector.html
deleted
100644 → 0
View file @
ecbda1af
<div
class=
"modal-body"
ng-controller=
"InspectCtrl"
ng-init=
"init()"
>
<div
class=
"modal-header"
>
<h2
class=
"modal-header-title"
>
<i
class=
"fa fa-info-circle"
></i>
<span
class=
"p-l-1"
>
Inspector
</span>
</h2>
<ul
class=
"gf-tabs"
>
<li
class=
"gf-tabs-item"
ng-repeat=
"tab in ['Panel Description', 'Request', 'Response', 'JS Error']"
>
<a
class=
"gf-tabs-link"
ng-click=
"editor.index = $index"
ng-class=
"{active: editor.index === $index}"
>
{{::tab}}
</a>
</li>
</ul>
<a
class=
"modal-header-close"
ng-click=
"dismiss();"
>
<i
class=
"fa fa-remove"
></i>
</a>
</div>
<div
class=
"modal-content"
>
<div
ng-if=
"editor.index == 0"
ng-bind-html=
"panelInfoHtml"
>
</div>
<div
ng-if=
"editor.index == 1"
>
<h5
class=
"section-heading"
>
Request details
</h5>
<table
class=
"filter-table gf-form-group"
>
<tr>
<td>
Url
</td>
<td>
{{inspector.error.config.url}}
</td>
</tr>
<tr>
<td>
Method
</td>
<td>
{{inspector.error.config.method}}
</td>
</tr>
<tr
ng-repeat=
"(key, value) in inspector.error.config.headers"
>
<td>
{{key}}
</td>
<td>
{{value}}
</td>
</tr>
</table>
<h5
class=
"section-heading"
>
Request parameters
</h5>
<table
class=
"filter-table"
>
<tr
ng-repeat=
"param in request_parameters"
>
<td>
{{param.key}}
</td>
<td>
{{param.value}}
</td>
</tr>
</table>
</div>
<div
ng-if=
"editor.index == 2"
>
<h5
ng-show=
"message"
>
{{message}}
</h5>
<pre
class=
"small"
>
{{response}}
</pre>
</div>
<div
ng-if=
"editor.index == 3"
>
<label>
Message:
</label>
<pre>
{{message}}
</pre>
<label>
Stack trace:
</label>
<pre>
{{stack_trace}}
</pre>
</div>
</div>
</div>
public/app/features/
manage-dashboard
s/CreateFolderCtrl.ts
→
public/app/features/
folder
s/CreateFolderCtrl.ts
View file @
5e1a3c9e
import
appEvents
from
'app/core/app_events'
;
import
locationUtil
from
'app/core/utils/location_util'
;
export
class
CreateFolderCtrl
{
export
default
class
CreateFolderCtrl
{
title
=
''
;
navModel
:
any
;
titleTouched
=
false
;
...
...
@@ -38,3 +38,4 @@ export class CreateFolderCtrl {
});
}
}
public/app/features/
manage-dashboard
s/FolderDashboardsCtrl.ts
→
public/app/features/
folder
s/FolderDashboardsCtrl.ts
View file @
5e1a3c9e
import
{
FolderPageLoader
}
from
'./services/FolderPageLoader'
;
import
locationUtil
from
'app/core/utils/location_util'
;
export
class
FolderDashboardsCtrl
{
export
default
class
FolderDashboardsCtrl
{
navModel
:
any
;
folderId
:
number
;
uid
:
string
;
...
...
@@ -23,3 +23,4 @@ export class FolderDashboardsCtrl {
}
}
}
public/app/features/
dashboard
/partials/create_folder.html
→
public/app/features/
folders
/partials/create_folder.html
View file @
5e1a3c9e
File moved
public/app/features/
dashboard
/partials/folder_dashboards.html
→
public/app/features/
folders
/partials/folder_dashboards.html
View file @
5e1a3c9e
File moved
public/app/features/
manage-dashboard
s/services/FolderPageLoader.ts
→
public/app/features/
folder
s/services/FolderPageLoader.ts
View file @
5e1a3c9e
File moved
public/app/features/manage-dashboards/DashboardImportCtrl.ts
View file @
5e1a3c9e
...
...
@@ -232,3 +232,5 @@ export class DashboardImportCtrl {
this
.
gnetInfo
=
''
;
}
}
export
default
DashboardImportCtrl
;
public/app/features/manage-dashboards/index.ts
View file @
5e1a3c9e
...
...
@@ -8,14 +8,8 @@ export * from './components/UploadDashboard';
// Controllers
import
{
DashboardListCtrl
}
from
'./DashboardListCtrl'
;
import
{
SnapshotListCtrl
}
from
'./SnapshotListCtrl'
;
import
{
FolderDashboardsCtrl
}
from
'./FolderDashboardsCtrl'
;
import
{
DashboardImportCtrl
}
from
'./DashboardImportCtrl'
;
import
{
CreateFolderCtrl
}
from
'./CreateFolderCtrl'
;
import
coreModule
from
'app/core/core_module'
;
coreModule
.
controller
(
'DashboardListCtrl'
,
DashboardListCtrl
);
coreModule
.
controller
(
'SnapshotListCtrl'
,
SnapshotListCtrl
);
coreModule
.
controller
(
'FolderDashboardsCtrl'
,
FolderDashboardsCtrl
);
coreModule
.
controller
(
'DashboardImportCtrl'
,
DashboardImportCtrl
);
coreModule
.
controller
(
'CreateFolderCtrl'
,
CreateFolderCtrl
);
public/app/features/
dashboard
/partials/dashboard_import.html
→
public/app/features/
manage-dashboards
/partials/dashboard_import.html
View file @
5e1a3c9e
File moved
public/app/features/panel/panel_ctrl.ts
View file @
5e1a3c9e
...
...
@@ -290,17 +290,4 @@ export class PanelCtrl {
html
+=
'</div>'
;
return
sanitize
(
html
);
}
openInspector
()
{
const
modalScope
=
this
.
$scope
.
$new
();
modalScope
.
panel
=
this
.
panel
;
modalScope
.
dashboard
=
this
.
dashboard
;
modalScope
.
panelInfoHtml
=
this
.
getInfoContent
({
mode
:
'inspector'
});
modalScope
.
inspector
=
$
.
extend
(
true
,
{},
this
.
inspector
);
this
.
publishAppEvent
(
'show-modal'
,
{
src
:
'public/app/features/dashboard/partials/inspector.html'
,
scope
:
modalScope
,
});
}
}
public/app/features/panel/panel_directive.ts
View file @
5e1a3c9e
...
...
@@ -192,11 +192,6 @@ module.directive('grafanaPanel', ($rootScope, $document, $timeout) => {
scope
.
$watchGroup
([
'ctrl.error'
,
'ctrl.panel.description'
],
updatePanelCornerInfo
);
scope
.
$watchCollection
(
'ctrl.panel.links'
,
updatePanelCornerInfo
);
cornerInfoElem
.
on
(
'click'
,
()
=>
{
infoDrop
.
close
();
scope
.
$apply
(
ctrl
.
openInspector
.
bind
(
ctrl
));
});
elem
.
on
(
'mouseenter'
,
mouseEnter
);
elem
.
on
(
'mouseleave'
,
mouseLeave
);
...
...
public/app/routes/routes.ts
View file @
5e1a3c9e
...
...
@@ -10,6 +10,9 @@ import ApiKeys from 'app/features/api-keys/ApiKeysPage';
import
PluginListPage
from
'app/features/plugins/PluginListPage'
;
import
FolderSettingsPage
from
'app/features/folders/FolderSettingsPage'
;
import
FolderPermissions
from
'app/features/folders/FolderPermissions'
;
import
CreateFolderCtrl
from
'app/features/folders/CreateFolderCtrl'
;
import
FolderDashboardsCtrl
from
'app/features/folders/FolderDashboardsCtrl'
;
import
DashboardImportCtrl
from
'app/features/manage-dashboards/DashboardImportCtrl'
;
import
DataSourcesListPage
from
'app/features/datasources/DataSourcesListPage'
;
import
NewDataSourcePage
from
'../features/datasources/NewDataSourcePage'
;
import
UsersListPage
from
'app/features/users/UsersListPage'
;
...
...
@@ -66,8 +69,8 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
pageClass
:
'page-dashboard'
,
})
.
when
(
'/dashboard/import'
,
{
templateUrl
:
'public/app/features/
dashboard
/partials/dashboard_import.html'
,
controller
:
'DashboardImportCtrl'
,
templateUrl
:
'public/app/features/
manage-dashboards
/partials/dashboard_import.html'
,
controller
:
DashboardImportCtrl
,
controllerAs
:
'ctrl'
,
})
.
when
(
'/datasources'
,
{
...
...
@@ -100,8 +103,8 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
controllerAs
:
'ctrl'
,
})
.
when
(
'/dashboards/folder/new'
,
{
templateUrl
:
'public/app/features/
dashboard
/partials/create_folder.html'
,
controller
:
'CreateFolderCtrl'
,
templateUrl
:
'public/app/features/
folders
/partials/create_folder.html'
,
controller
:
CreateFolderCtrl
,
controllerAs
:
'ctrl'
,
})
.
when
(
'/dashboards/f/:uid/:slug/permissions'
,
{
...
...
@@ -117,8 +120,8 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
},
})
.
when
(
'/dashboards/f/:uid/:slug'
,
{
templateUrl
:
'public/app/features/
dashboard
/partials/folder_dashboards.html'
,
controller
:
'FolderDashboardsCtrl'
,
templateUrl
:
'public/app/features/
folders
/partials/folder_dashboards.html'
,
controller
:
FolderDashboardsCtrl
,
controllerAs
:
'ctrl'
,
})
.
when
(
'/dashboards/f/:uid'
,
{
...
...
public/sass/_grafana.scss
View file @
5e1a3c9e
...
...
@@ -39,6 +39,7 @@
@import
'layout/page'
;
// COMPONENTS
@import
'../app/features/dashboard/components/AddPanelWidget/AddPanelWidget'
;
@import
'components/scrollbar'
;
@import
'components/cards'
;
@import
'components/buttons'
;
...
...
@@ -58,7 +59,6 @@
@import
'components/panel_table'
;
@import
'components/panel_text'
;
@import
'components/panel_heatmap'
;
@import
'components/panel_add_panel'
;
@import
'components/panel_logs'
;
@import
'components/settings_permissions'
;
@import
'components/tagsinput'
;
...
...
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