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
0f2989e1
Commit
0f2989e1
authored
Oct 26, 2017
by
Patrick O'Carroll
Committed by
Torkel Ödegaard
Oct 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
converted inspect_ctrl.js to ts (#9673)
parent
bb1097b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
25 deletions
+23
-25
public/app/core/controllers/inspect_ctrl.ts
+23
-25
No files found.
public/app/core/controllers/inspect_ctrl.
j
s
→
public/app/core/controllers/inspect_ctrl.
t
s
View file @
0f2989e1
define
([
'angular'
,
'lodash'
,
'jquery'
,
'../core_module'
,
],
function
(
angular
,
_
,
$
,
coreModule
)
{
'use strict'
;
import
angular
from
'angular'
;
import
_
from
'lodash'
;
import
$
from
'jquery'
;
import
coreModule
from
'../core_module'
;
coreModule
.
default
.
controller
(
'InspectCtrl'
,
function
(
$scope
,
$sanitize
)
{
var
model
=
$scope
.
inspector
;
export
class
InspectCtrl
{
function
getParametersFromQueryString
(
queryString
)
{
var
result
=
[];
var
parameters
=
queryString
.
split
(
"&"
);
for
(
var
i
=
0
;
i
<
parameters
.
length
;
i
++
)
{
var
keyValue
=
parameters
[
i
].
split
(
"="
);
if
(
keyValue
[
1
].
length
>
0
)
{
result
.
push
({
key
:
keyValue
[
0
],
value
:
window
.
unescape
(
keyValue
[
1
])
});
}
}
return
result
;
}
/** @ngInject */
constructor
(
$scope
,
$sanitize
)
{
var
model
=
$scope
.
inspector
;
$scope
.
init
=
function
()
{
$scope
.
editor
=
{
index
:
0
};
...
...
@@ -57,7 +44,7 @@ function (angular, _, $, coreModule) {
$scope
.
editor
.
index
=
2
;
if
(
_
.
isString
(
model
.
error
.
config
.
data
))
{
$scope
.
request_parameters
=
getParametersFromQueryString
(
model
.
error
.
config
.
data
);
$scope
.
request_parameters
=
this
.
getParametersFromQueryString
(
model
.
error
.
config
.
data
);
}
else
{
$scope
.
request_parameters
=
_
.
map
(
model
.
error
.
config
.
data
,
function
(
value
,
key
)
{
return
{
key
:
key
,
value
:
angular
.
toJson
(
value
,
true
)};
...
...
@@ -65,7 +52,18 @@ function (angular, _, $, coreModule) {
}
}
};
}
getParametersFromQueryString
(
queryString
)
{
var
result
=
[];
var
parameters
=
queryString
.
split
(
"&"
);
for
(
var
i
=
0
;
i
<
parameters
.
length
;
i
++
)
{
var
keyValue
=
parameters
[
i
].
split
(
"="
);
if
(
keyValue
[
1
].
length
>
0
)
{
result
.
push
({
key
:
keyValue
[
0
],
value
:
(
<
any
>
window
).
unescape
(
keyValue
[
1
])
});
}
}
return
result
;
}
}
});
});
coreModule
.
controller
(
'InspectCtrl'
,
InspectCtrl
);
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