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
960a4f71
Commit
960a4f71
authored
Aug 21, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jsc): fixed javascript indenting
parent
292db86c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
public/app/components/kbn.js
+14
-14
public/app/features/panel/panelHelper.js
+1
-1
No files found.
public/app/components/kbn.js
View file @
960a4f71
...
...
@@ -163,20 +163,6 @@ function($, _, moment) {
return
info
.
sec
*
info
.
count
;
};
kbn
.
getRelativeTimeInfo
=
function
(
str
)
{
var
info
=
{
value
:
str
};
if
(
str
===
'today'
)
{
info
.
text
=
'Today'
;
info
.
from
=
'today'
;
info
.
to
=
'now'
;
}
else
{
info
.
text
=
'Last '
+
str
;
info
.
from
=
'now-'
+
str
;
info
.
to
=
'now'
;
}
return
info
;
};
/* This is a simplified version of elasticsearch's date parser */
kbn
.
parseDate
=
function
(
text
)
{
if
(
_
.
isDate
(
text
))
{
...
...
@@ -219,6 +205,20 @@ function($, _, moment) {
return
kbn
.
parseDateMath
(
mathString
,
time
);
};
kbn
.
getRelativeTimeInfo
=
function
(
str
)
{
var
info
=
{
value
:
str
};
if
(
str
===
'today'
)
{
info
.
text
=
'Today'
;
info
.
from
=
'today'
;
info
.
to
=
'now'
;
}
else
{
info
.
text
=
'Last '
+
str
;
info
.
from
=
'now-'
+
str
;
info
.
to
=
'now'
;
}
return
info
;
};
kbn
.
_timespanRegex
=
/^
(\d
+
[
h,m,M,w,s,H,d
])
|today$/
;
kbn
.
isValidTimeSpan
=
function
(
str
)
{
return
kbn
.
_timespanRegex
.
test
(
str
);
...
...
public/app/features/panel/panelHelper.js
View file @
960a4f71
...
...
@@ -69,7 +69,7 @@ function (angular, _, kbn, $) {
}
if
(
_
.
isString
(
scope
.
rangeUnparsed
.
from
))
{
var
timeInfo
=
kbn
.
getRelativeTimeInfo
(
scope
.
panel
.
timeFrom
)
var
timeInfo
=
kbn
.
getRelativeTimeInfo
(
scope
.
panel
.
timeFrom
)
;
scope
.
panelMeta
.
timeInfo
=
timeInfo
.
text
;
scope
.
rangeUnparsed
.
from
=
timeInfo
.
from
;
scope
.
rangeUnparsed
.
to
=
timeInfo
.
to
;
...
...
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