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
4ffa26cf
Commit
4ffa26cf
authored
Sep 15, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat() started work on more feature rich time picker
parent
2b95cd50
Hide whitespace changes
Inline
Side-by-side
Showing
74 changed files
with
494 additions
and
318 deletions
+494
-318
.gitignore
+0
-1
karma.conf.js
+5
-3
public/app/app.js
+5
-5
public/app/components/extend-jquery.js
+0
-3
public/app/components/require.config.js
+43
-44
public/app/components/settings.js
+4
-4
public/app/core/routes/all.js
+1
-1
public/app/core/utils/datemath.ts
+109
-0
public/app/features/dashboard/graphiteImportCtrl.js
+1
-2
public/app/features/dashboard/rowCtrl.js
+1
-2
public/app/features/dashboard/timepicker/timepicker.html
+3
-3
public/app/features/dashboard/timepicker/timepicker.ts
+3
-10
public/app/features/dashboard/timepicker/timerange.ts
+60
-0
public/app/panels/dashlist/module.js
+2
-2
public/app/panels/graph/module.js
+2
-2
public/app/panels/graph/seriesOverridesCtrl.js
+1
-1
public/app/panels/singlestat/module.js
+4
-4
public/app/panels/singlestat/singleStatPanel.js
+1
-1
public/app/panels/text/module.js
+2
-2
public/app/plugins/datasource/cloudwatch/_plugin.json
+1
-1
public/app/plugins/datasource/elasticsearch/plugin.json
+1
-1
public/app/plugins/datasource/grafana/plugin.json
+1
-1
public/app/plugins/datasource/graphite/plugin.json
+1
-1
public/app/plugins/datasource/influxdb/plugin.json
+1
-1
public/app/plugins/datasource/influxdb_08/plugin.json
+1
-1
public/app/plugins/datasource/kairosdb/plugin.json
+1
-1
public/app/plugins/datasource/mixed/plugin.json
+1
-1
public/app/plugins/datasource/opentsdb/plugin.json
+1
-1
public/app/plugins/datasource/sql/plugin.json_
+1
-1
public/test/specs/cloudwatch-datasource-specs.js
+3
-2
public/test/specs/core/utils/datemath_specs.ts
+16
-0
public/test/specs/dashboardSrv-specs.js
+1
-1
public/test/specs/dashboardViewStateSrv-specs.js
+1
-1
public/test/specs/dynamicDashboardSrv-specs.js
+2
-2
public/test/specs/elasticsearch-indexPattern-specs.js
+1
-1
public/test/specs/elasticsearch-querybuilder-specs.js
+1
-1
public/test/specs/elasticsearch-queryctrl-specs.js
+3
-3
public/test/specs/elasticsearch-response-specs.js
+1
-1
public/test/specs/elasticsearch-specs.js
+2
-2
public/test/specs/gfunc-specs.js
+1
-1
public/test/specs/graph-ctrl-specs.js
+4
-4
public/test/specs/graph-specs.js
+3
-3
public/test/specs/graph-tooltip-specs.js
+1
-1
public/test/specs/graphiteDatasource-specs.js
+2
-2
public/test/specs/graphiteTargetCtrl-specs.js
+4
-4
public/test/specs/influx09-querybuilder-specs.js
+1
-1
public/test/specs/influxQueryBuilder-specs.js
+1
-1
public/test/specs/influxSeries-specs.js
+1
-1
public/test/specs/influxSeries08-specs.js
+1
-1
public/test/specs/influxdb-datasource-specs.js
+4
-4
public/test/specs/influxdbQueryCtrl-specs.js
+3
-3
public/test/specs/kairosdb-datasource-specs.js
+2
-2
public/test/specs/lexer-specs.js
+1
-1
public/test/specs/opentsdbDatasource-specs.js
+2
-2
public/test/specs/overview-ctrl-specs.js
+0
-30
public/test/specs/panelSrv-specs.js
+2
-2
public/test/specs/parser-specs.js
+1
-1
public/test/specs/row-ctrl-specs.js
+2
-2
public/test/specs/seriesOverridesCtrl-specs.js
+2
-2
public/test/specs/shareModalCtrl-specs.js
+3
-3
public/test/specs/singlestat-specs.js
+4
-4
public/test/specs/templateSrv-specs.js
+2
-2
public/test/specs/templateValuesSrv-specs.js
+3
-3
public/test/specs/timeSeries-specs.js
+1
-1
public/test/specs/timeSrv-specs.js
+4
-4
public/test/specs/unsavedChangesSrv-specs.js
+2
-2
public/test/specs/value_select_dropdown_specs.js
+1
-1
public/test/test-main.js
+111
-99
public/vendor/angular-ui/angular-bootstrap.js
+0
-6
public/views/index.html
+1
-1
tasks/options/karma.js
+6
-4
tasks/options/typescript.js
+7
-5
tasks/options/watch.js
+1
-1
tsconfig.json
+22
-0
No files found.
.gitignore
View file @
4ffa26cf
...
@@ -30,4 +30,3 @@ conf/custom.ini
...
@@ -30,4 +30,3 @@ conf/custom.ini
fig.yml
fig.yml
profile.cov
profile.cov
grafana
grafana
tsconfig.json
public/test/
karma.conf.js
→
karma.conf.js
View file @
4ffa26cf
...
@@ -2,14 +2,16 @@ module.exports = function(config) {
...
@@ -2,14 +2,16 @@ module.exports = function(config) {
'use strict'
;
'use strict'
;
config
.
set
({
config
.
set
({
basePath
:
'../../
'
,
basePath
:
__dirname
+
'/public_gen
'
,
frameworks
:
[
'mocha'
,
'requirejs'
,
'expect'
,
'sinon'
],
frameworks
:
[
'mocha'
,
'requirejs'
,
'expect'
,
'sinon'
],
// list of files / patterns to load in the browser
// list of files / patterns to load in the browser
files
:
[
files
:
[
'public/test/test-main.js'
,
'test/test-main.js'
,
{
pattern
:
'public_gen/**/*.js'
,
included
:
false
}
{
pattern
:
'app/**/*.js'
,
included
:
false
},
{
pattern
:
'vendor/**/*.js'
,
included
:
false
},
{
pattern
:
'test/**/*.js'
,
included
:
false
}
],
],
// list of files to exclude
// list of files to exclude
...
...
public/app/app.js
View file @
4ffa26cf
...
@@ -12,7 +12,7 @@ define([
...
@@ -12,7 +12,7 @@ define([
'angular-ui'
,
'angular-ui'
,
'extend-jquery'
,
'extend-jquery'
,
'bindonce'
,
'bindonce'
,
'
.
/core/core'
,
'
app
/core/core'
,
],
],
function
(
angular
,
$
,
_
,
appLevelRequire
)
{
function
(
angular
,
$
,
_
,
appLevelRequire
)
{
"use strict"
;
"use strict"
;
...
@@ -70,10 +70,10 @@ function (angular, $, _, appLevelRequire) {
...
@@ -70,10 +70,10 @@ function (angular, $, _, appLevelRequire) {
});
});
var
preBootRequires
=
[
var
preBootRequires
=
[
'services/all'
,
'
app/
services/all'
,
'features/all'
,
'
app/
features/all'
,
'controllers/all'
,
'
app/
controllers/all'
,
'components/partials'
,
'
app/
components/partials'
,
];
];
app
.
boot
=
function
()
{
app
.
boot
=
function
()
{
...
...
public/app/components/extend-jquery.js
View file @
4ffa26cf
...
@@ -2,9 +2,6 @@ define(['jquery', 'angular', 'lodash'],
...
@@ -2,9 +2,6 @@ define(['jquery', 'angular', 'lodash'],
function
(
$
,
angular
,
_
)
{
function
(
$
,
angular
,
_
)
{
'use strict'
;
'use strict'
;
/**
* jQuery extensions
*/
var
$win
=
$
(
window
);
var
$win
=
$
(
window
);
$
.
fn
.
place_tt
=
(
function
()
{
$
.
fn
.
place_tt
=
(
function
()
{
...
...
public/app/components/require.config.js
View file @
4ffa26cf
require
.
config
({
require
.
config
({
urlArgs
:
'bust='
+
(
new
Date
().
getTime
()),
urlArgs
:
'bust='
+
(
new
Date
().
getTime
()),
baseUrl
:
'public
/app
'
,
baseUrl
:
'public'
,
paths
:
{
paths
:
{
config
:
'components/config'
,
config
:
'app/components/config'
,
settings
:
'components/settings'
,
settings
:
'app/components/settings'
,
kbn
:
'components/kbn'
,
kbn
:
'app/components/kbn'
,
store
:
'components/store'
,
store
:
'app/components/store'
,
'extend-jquery'
:
'app/components/extend-jquery'
,
text
:
'../vendor/requirejs-text/text'
,
lodash
:
'app/components/lodash.extended'
,
moment
:
'../vendor/moment'
,
filesaver
:
'../vendor/filesaver'
,
text
:
'vendor/requirejs-text/text'
,
ZeroClipboard
:
'../vendor/ZeroClipboard'
,
moment
:
'vendor/moment'
,
angular
:
'../vendor/angular/angular'
,
filesaver
:
'vendor/filesaver'
,
'angular-route'
:
'../vendor/angular-route/angular-route'
,
ZeroClipboard
:
'vendor/ZeroClipboard'
,
'angular-sanitize'
:
'../vendor/angular-sanitize/angular-sanitize'
,
angular
:
'vendor/angular/angular'
,
'angular-dragdrop'
:
'../vendor/angular-native-dragdrop/draganddrop'
,
'angular-route'
:
'vendor/angular-route/angular-route'
,
'angular-strap'
:
'../vendor/angular-other/angular-strap'
,
'angular-sanitize'
:
'vendor/angular-sanitize/angular-sanitize'
,
'angular-ui'
:
'../vendor/angular-ui/angular-bootstrap'
,
'angular-dragdrop'
:
'vendor/angular-native-dragdrop/draganddrop'
,
timepicker
:
'../vendor/angular-other/timepicker'
,
'angular-strap'
:
'vendor/angular-other/angular-strap'
,
datepicker
:
'../vendor/angular-other/datepicker'
,
'angular-ui'
:
'vendor/angular-ui/tabs'
,
bindonce
:
'../vendor/angular-bindonce/bindonce'
,
timepicker
:
'vendor/angular-other/timepicker'
,
crypto
:
'../vendor/crypto.min'
,
datepicker
:
'vendor/angular-other/datepicker'
,
spectrum
:
'../vendor/spectrum'
,
bindonce
:
'vendor/angular-bindonce/bindonce'
,
crypto
:
'vendor/crypto.min'
,
lodash
:
'components/lodash.extended'
,
spectrum
:
'vendor/spectrum'
,
'lodash-src'
:
'../vendor/lodash'
,
bootstrap
:
'../vendor/bootstrap/bootstrap'
,
'lodash-src'
:
'vendor/lodash'
,
bootstrap
:
'vendor/bootstrap/bootstrap'
,
jquery
:
'../vendor/jquery/dist/jquery'
,
jquery
:
'vendor/jquery/dist/jquery'
,
'extend-jquery'
:
'components/extend-jquery'
,
'jquery.flot'
:
'vendor/flot/jquery.flot'
,
'jquery.flot'
:
'../vendor/flot/jquery.flot'
,
'jquery.flot.pie'
:
'vendor/flot/jquery.flot.pie'
,
'jquery.flot.pie'
:
'../vendor/flot/jquery.flot.pie'
,
'jquery.flot.events'
:
'vendor/flot/jquery.flot.events'
,
'jquery.flot.events'
:
'../vendor/flot/jquery.flot.events'
,
'jquery.flot.selection'
:
'vendor/flot/jquery.flot.selection'
,
'jquery.flot.selection'
:
'../vendor/flot/jquery.flot.selection'
,
'jquery.flot.stack'
:
'vendor/flot/jquery.flot.stack'
,
'jquery.flot.stack'
:
'../vendor/flot/jquery.flot.stack'
,
'jquery.flot.stackpercent'
:
'vendor/flot/jquery.flot.stackpercent'
,
'jquery.flot.stackpercent'
:
'../vendor/flot/jquery.flot.stackpercent'
,
'jquery.flot.time'
:
'vendor/flot/jquery.flot.time'
,
'jquery.flot.time'
:
'../vendor/flot/jquery.flot.time'
,
'jquery.flot.crosshair'
:
'vendor/flot/jquery.flot.crosshair'
,
'jquery.flot.crosshair'
:
'../vendor/flot/jquery.flot.crosshair'
,
'jquery.flot.fillbelow'
:
'vendor/flot/jquery.flot.fillbelow'
,
'jquery.flot.fillbelow'
:
'../vendor/flot/jquery.flot.fillbelow'
,
modernizr
:
'vendor/modernizr-2.6.1'
,
modernizr
:
'../vendor/modernizr-2.6.1'
,
'bootstrap-tagsinput'
:
'vendor/tagsinput/bootstrap-tagsinput'
,
'bootstrap-tagsinput'
:
'../vendor/tagsinput/bootstrap-tagsinput'
,
'aws-sdk'
:
'vendor/aws-sdk/dist/aws-sdk.min'
,
'aws-sdk'
:
'../vendor/aws-sdk/dist/aws-sdk.min'
,
},
},
shim
:
{
shim
:
{
...
...
public/app/components/settings.js
View file @
4ffa26cf
...
@@ -15,10 +15,10 @@ function (_) {
...
@@ -15,10 +15,10 @@ function (_) {
datasources
:
{},
datasources
:
{},
window_title_prefix
:
'Grafana - '
,
window_title_prefix
:
'Grafana - '
,
panels
:
{
panels
:
{
'graph'
:
{
path
:
'panels/graph'
,
name
:
'Graph'
},
'graph'
:
{
path
:
'
app/
panels/graph'
,
name
:
'Graph'
},
'singlestat'
:
{
path
:
'panels/singlestat'
,
name
:
'Single stat'
},
'singlestat'
:
{
path
:
'
app/
panels/singlestat'
,
name
:
'Single stat'
},
'text'
:
{
path
:
'panels/text'
,
name
:
'Text'
},
'text'
:
{
path
:
'
app/
panels/text'
,
name
:
'Text'
},
'dashlist'
:
{
path
:
'panels/dashlist'
,
name
:
'Dashboard list'
},
'dashlist'
:
{
path
:
'
app/
panels/dashlist'
,
name
:
'Dashboard list'
},
},
},
new_panel_title
:
'no title (click here)'
,
new_panel_title
:
'no title (click here)'
,
plugins
:
{},
plugins
:
{},
...
...
public/app/core/routes/all.js
View file @
4ffa26cf
...
@@ -9,7 +9,7 @@ define([
...
@@ -9,7 +9,7 @@ define([
coreModule
.
config
(
function
(
$routeProvider
,
$locationProvider
)
{
coreModule
.
config
(
function
(
$routeProvider
,
$locationProvider
)
{
$locationProvider
.
html5Mode
(
true
);
$locationProvider
.
html5Mode
(
true
);
var
loadOrgBundle
=
new
BundleLoader
.
BundleLoader
(
'features/org/all'
);
var
loadOrgBundle
=
new
BundleLoader
.
BundleLoader
(
'
app/
features/org/all'
);
$routeProvider
$routeProvider
.
when
(
'/'
,
{
.
when
(
'/'
,
{
...
...
public/app/core/utils/datemath.ts
0 → 100644
View file @
4ffa26cf
///<reference path="../../headers/common.d.ts" />
import
_
=
require
(
'lodash'
);
import
moment
=
require
(
'moment'
);
var
units
=
[
'y'
,
'M'
,
'w'
,
'd'
,
'h'
,
'm'
,
's'
];
var
unitsAsc
=
_
.
sortBy
(
units
,
function
(
unit
)
{
return
moment
.
duration
(
1
,
unit
).
valueOf
();
});
var
unitsDesc
=
unitsAsc
.
reverse
();
export
class
DateMath
{
static
parse
(
text
,
roundUp
)
{
if
(
!
text
)
{
return
undefined
;
}
if
(
moment
.
isMoment
(
text
))
{
return
text
;
}
if
(
_
.
isDate
(
text
))
{
return
moment
(
text
);
}
var
time
;
var
mathString
=
''
;
var
index
;
var
parseString
;
if
(
text
.
substring
(
0
,
3
)
===
'now'
)
{
time
=
moment
();
mathString
=
text
.
substring
(
'now'
.
length
);
}
else
{
index
=
text
.
indexOf
(
'||'
);
if
(
index
===
-
1
)
{
parseString
=
text
;
mathString
=
''
;
// nothing else
}
else
{
parseString
=
text
.
substring
(
0
,
index
);
mathString
=
text
.
substring
(
index
+
2
);
}
// We're going to just require ISO8601 timestamps, k?
time
=
moment
(
parseString
);
}
if
(
!
mathString
.
length
)
{
return
time
;
}
return
DateMath
.
parseDateMath
(
mathString
,
time
,
roundUp
);
}
static
parseDateMath
(
mathString
,
time
,
roundUp
)
{
var
dateTime
=
time
;
var
i
=
0
;
var
len
=
mathString
.
length
;
while
(
i
<
len
)
{
var
c
=
mathString
.
charAt
(
i
++
);
var
type
;
var
num
;
var
unit
;
if
(
c
===
'/'
)
{
type
=
0
;
}
else
if
(
c
===
'+'
)
{
type
=
1
;
}
else
if
(
c
===
'-'
)
{
type
=
2
;
}
else
{
return
undefined
;
}
if
(
isNaN
(
mathString
.
charAt
(
i
)))
{
num
=
1
;
}
else
if
(
mathString
.
length
===
2
)
{
num
=
mathString
.
charAt
(
i
);
}
else
{
var
numFrom
=
i
;
while
(
!
isNaN
(
mathString
.
charAt
(
i
)))
{
i
++
;
if
(
i
>
10
)
{
return
undefined
;
}
}
num
=
parseInt
(
mathString
.
substring
(
numFrom
,
i
),
10
);
}
if
(
type
===
0
)
{
// rounding is only allowed on whole, single, units (eg M or 1M, not 0.5M or 2M)
if
(
num
!==
1
)
{
return
undefined
;
}
}
unit
=
mathString
.
charAt
(
i
++
);
if
(
!
_
.
contains
(
units
,
unit
))
{
return
undefined
;
}
else
{
if
(
type
===
0
)
{
if
(
roundUp
)
{
dateTime
.
endOf
(
unit
);
}
else
{
dateTime
.
startOf
(
unit
);
}
}
else
if
(
type
===
1
)
{
dateTime
.
add
(
num
,
unit
);
}
else
if
(
type
===
2
)
{
dateTime
.
subtract
(
num
,
unit
);
}
}
}
return
dateTime
;
}
}
public/app/features/dashboard/graphiteImportCtrl.js
View file @
4ffa26cf
define
([
define
([
'angular'
,
'angular'
,
'app'
,
'lodash'
,
'lodash'
,
'kbn'
'kbn'
],
],
function
(
angular
,
app
,
_
,
kbn
)
{
function
(
angular
,
_
,
kbn
)
{
'use strict'
;
'use strict'
;
var
module
=
angular
.
module
(
'grafana.controllers'
);
var
module
=
angular
.
module
(
'grafana.controllers'
);
...
...
public/app/features/dashboard/rowCtrl.js
View file @
4ffa26cf
define
([
define
([
'angular'
,
'angular'
,
'app'
,
'lodash'
,
'lodash'
,
'config'
'config'
],
],
function
(
angular
,
app
,
_
,
config
)
{
function
(
angular
,
_
,
config
)
{
'use strict'
;
'use strict'
;
var
module
=
angular
.
module
(
'grafana.controllers'
);
var
module
=
angular
.
module
(
'grafana.controllers'
);
...
...
public/app/features/dashboard/timepicker/timepicker.html
View file @
4ffa26cf
...
@@ -27,9 +27,9 @@
...
@@ -27,9 +27,9 @@
</a>
</a>
<!-- lacy load this -->
<!-- lacy load this -->
<ul
class=
"dropdown-menu"
ng-if=
"time
_o
ptions"
>
<ul
class=
"dropdown-menu"
ng-if=
"time
O
ptions"
>
<li
bindonce
ng-repeat=
'option in time
_o
ptions'
>
<li
bindonce
ng-repeat=
'option in time
O
ptions'
>
<a
ng-click=
"ctrl.setRelativeFilter(option)"
bo-text=
"option.
text
"
></a>
<a
ng-click=
"ctrl.setRelativeFilter(option)"
bo-text=
"option.
display
"
></a>
</li>
</li>
<!-- Auto refresh submenu -->
<!-- Auto refresh submenu -->
...
...
public/app/features/dashboard/timepicker/timepicker.ts
View file @
4ffa26cf
...
@@ -4,6 +4,7 @@ import angular = require('angular');
...
@@ -4,6 +4,7 @@ import angular = require('angular');
import
_
=
require
(
'lodash'
);
import
_
=
require
(
'lodash'
);
import
moment
=
require
(
'moment'
);
import
moment
=
require
(
'moment'
);
import
kbn
=
require
(
'kbn'
);
import
kbn
=
require
(
'kbn'
);
import
{
TimeRange
}
from
'./timerange'
;
export
class
TimePickerCtrl
{
export
class
TimePickerCtrl
{
...
@@ -79,12 +80,7 @@ export class TimePickerCtrl {
...
@@ -79,12 +80,7 @@ export class TimePickerCtrl {
if
(
this
.
timeSrv
.
time
)
{
if
(
this
.
timeSrv
.
time
)
{
if
(
this
.
$scope
.
panel
.
now
)
{
if
(
this
.
$scope
.
panel
.
now
)
{
if
(
this
.
timeSrv
.
time
.
from
===
'today'
)
{
model
.
rangeString
=
TimeRange
.
describeRelativeTime
(
this
.
timeSrv
.
time
);
model
.
rangeString
=
'Today'
;
}
else
{
model
.
rangeString
=
moment
(
model
.
from
.
date
).
fromNow
()
+
' to '
+
moment
(
model
.
to
.
date
).
fromNow
();
}
}
}
else
{
else
{
model
.
rangeString
=
this
.
$scope
.
dashboard
.
formatDate
(
model
.
from
.
date
,
'MMM D, YYYY HH:mm:ss'
)
+
' to '
+
model
.
rangeString
=
this
.
$scope
.
dashboard
.
formatDate
(
model
.
from
.
date
,
'MMM D, YYYY HH:mm:ss'
)
+
' to '
+
...
@@ -96,10 +92,7 @@ export class TimePickerCtrl {
...
@@ -96,10 +92,7 @@ export class TimePickerCtrl {
}
}
loadTimeOptions
()
{
loadTimeOptions
()
{
this
.
$scope
.
time_options
=
_
.
map
(
this
.
$scope
.
panel
.
time_options
,
function
(
str
)
{
this
.
$scope
.
timeOptions
=
TimeRange
.
getRelativeTimesList
(
this
.
$scope
.
panel
);
return
kbn
.
getRelativeTimeInfo
(
str
);
});
this
.
$scope
.
refreshMenuLeftSide
=
this
.
$scope
.
time
.
rangeString
.
length
<
10
;
this
.
$scope
.
refreshMenuLeftSide
=
this
.
$scope
.
time
.
rangeString
.
length
<
10
;
}
}
...
...
public/app/features/dashboard/timepicker/timerange.ts
0 → 100644
View file @
4ffa26cf
///<reference path="../../../headers/common.d.ts" />
import
_
=
require
(
'lodash'
);
import
moment
=
require
(
'moment'
);
var
rangeOptions
=
[
{
from
:
'now/d'
,
to
:
'now/d'
,
display
:
'Today'
,
section
:
0
},
{
from
:
'now/w'
,
to
:
'now/w'
,
display
:
'This week'
,
section
:
0
},
{
from
:
'now/d'
,
to
:
'now'
,
display
:
'The day so far'
,
section
:
0
},
{
from
:
'now/w'
,
to
:
'now'
,
display
:
'Week to date'
,
section
:
0
},
// { from: 'now/M', to: 'now/M', display: 'This month', section: 0 },
// { from: 'now/y', to: 'now/y', display: 'This year', section: 0 },
//
// { from: 'now-1d/d', to: 'now-1d/d', display: 'Yesterday', section: 1 },
// { from: 'now-2d/d', to: 'now-2d/d', display: 'Day before yesterday', section: 1 },
// { from: 'now-7d/d', to: 'now-7d/d', display: 'This day last week', section: 1 },
// { from: 'now-1w/w', to: 'now-1w/w', display: 'Previous week', section: 1 },
// { from: 'now-1M/M', to: 'now-1M/M', display: 'Previous month', section: 1 },
// { from: 'now-1y/y', to: 'now-1y/y', display: 'Previous year', section: 1 },
{
from
:
'now-5m'
,
to
:
'now'
,
display
:
'Last 5 minutes'
,
section
:
2
},
{
from
:
'now-15m'
,
to
:
'now'
,
display
:
'Last 15 minutes'
,
section
:
2
},
{
from
:
'now-30m'
,
to
:
'now'
,
display
:
'Last 30 minutes'
,
section
:
2
},
{
from
:
'now-1h'
,
to
:
'now'
,
display
:
'Last 1 hour'
,
section
:
2
},
{
from
:
'now-4h'
,
to
:
'now'
,
display
:
'Last 4 hours'
,
section
:
2
},
{
from
:
'now-12h'
,
to
:
'now'
,
display
:
'Last 12 hours'
,
section
:
2
},
{
from
:
'now-24h'
,
to
:
'now'
,
display
:
'Last 24 hours'
,
section
:
2
},
{
from
:
'now-7d'
,
to
:
'now'
,
display
:
'Last 7 days'
,
section
:
2
},
{
from
:
'now-30d'
,
to
:
'now'
,
display
:
'Last 30 days'
,
section
:
3
},
// { from: 'now-60d', to: 'now', display: 'Last 60 days', section: 3 },
// { from: 'now-90d', to: 'now', display: 'Last 90 days', section: 3 },
// { from: 'now-6M', to: 'now', display: 'Last 6 months', section: 3 },
// { from: 'now-1y', to: 'now', display: 'Last 1 year', section: 3 },
// { from: 'now-2y', to: 'now', display: 'Last 2 years', section: 3 },
// { from: 'now-5y', to: 'now', display: 'Last 5 years', section: 3 },
];
var
rangeIndex
=
{};
_
.
each
(
rangeOptions
,
function
(
frame
)
{
rangeIndex
[
frame
.
from
+
' to '
+
frame
.
to
]
=
frame
;
});
export
class
TimeRange
{
static
getRelativeTimesList
(
timepickerSettings
)
{
return
rangeOptions
;
}
static
describeRelativeTime
(
range
)
{
var
option
=
rangeIndex
[
range
.
from
.
toString
()
+
' to '
+
range
.
to
.
toString
()];
if
(
option
)
{
return
option
.
display
;
}
return
"NA"
;
}
}
public/app/panels/dashlist/module.js
View file @
4ffa26cf
define
([
define
([
'angular'
,
'angular'
,
'app'
,
'app
/app
'
,
'lodash'
,
'lodash'
,
'config'
,
'config'
,
'components/panelmeta'
,
'
app/
components/panelmeta'
,
],
],
function
(
angular
,
app
,
_
,
config
,
PanelMeta
)
{
function
(
angular
,
app
,
_
,
config
,
PanelMeta
)
{
'use strict'
;
'use strict'
;
...
...
public/app/panels/graph/module.js
View file @
4ffa26cf
...
@@ -4,8 +4,8 @@ define([
...
@@ -4,8 +4,8 @@ define([
'lodash'
,
'lodash'
,
'kbn'
,
'kbn'
,
'moment'
,
'moment'
,
'components/timeSeries'
,
'
app/
components/timeSeries'
,
'components/panelmeta'
,
'
app/
components/panelmeta'
,
'./seriesOverridesCtrl'
,
'./seriesOverridesCtrl'
,
'./graph'
,
'./graph'
,
'./legend'
,
'./legend'
,
...
...
public/app/panels/graph/seriesOverridesCtrl.js
View file @
4ffa26cf
define
([
define
([
'angular'
,
'angular'
,
'jquery'
,
'jquery'
,
'app'
,
'app
/app
'
,
'lodash'
,
'lodash'
,
],
function
(
angular
,
jquery
,
app
,
_
)
{
],
function
(
angular
,
jquery
,
app
,
_
)
{
'use strict'
;
'use strict'
;
...
...
public/app/panels/singlestat/module.js
View file @
4ffa26cf
define
([
define
([
'angular'
,
'angular'
,
'app'
,
'app
/app
'
,
'lodash'
,
'lodash'
,
'components/timeSeries'
,
'kbn'
,
'kbn'
,
'components/panelmeta'
,
'app/components/timeSeries'
,
'app/components/panelmeta'
,
'./singleStatPanel'
,
'./singleStatPanel'
,
],
],
function
(
angular
,
app
,
_
,
TimeSeries
,
kbn
,
PanelMeta
)
{
function
(
angular
,
app
,
_
,
kbn
,
TimeSeries
,
PanelMeta
)
{
'use strict'
;
'use strict'
;
var
module
=
angular
.
module
(
'grafana.panels.singlestat'
);
var
module
=
angular
.
module
(
'grafana.panels.singlestat'
);
...
...
public/app/panels/singlestat/singleStatPanel.js
View file @
4ffa26cf
define
([
define
([
'angular'
,
'angular'
,
'app'
,
'app
/app
'
,
'lodash'
,
'lodash'
,
'jquery'
,
'jquery'
,
'jquery.flot'
,
'jquery.flot'
,
...
...
public/app/panels/text/module.js
View file @
4ffa26cf
define
([
define
([
'angular'
,
'angular'
,
'app'
,
'app
/app
'
,
'lodash'
,
'lodash'
,
'require'
,
'require'
,
'components/panelmeta'
,
'
app/
components/panelmeta'
,
],
],
function
(
angular
,
app
,
_
,
require
,
PanelMeta
)
{
function
(
angular
,
app
,
_
,
require
,
PanelMeta
)
{
'use strict'
;
'use strict'
;
...
...
public/app/plugins/datasource/cloudwatch/_plugin.json
View file @
4ffa26cf
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"type"
:
"cloudwatch"
,
"type"
:
"cloudwatch"
,
"serviceName"
:
"CloudWatchDatasource"
,
"serviceName"
:
"CloudWatchDatasource"
,
"module"
:
"plugins/datasource/cloudwatch/datasource"
,
"module"
:
"
app/
plugins/datasource/cloudwatch/datasource"
,
"partials"
:
{
"partials"
:
{
"config"
:
"app/plugins/datasource/cloudwatch/partials/config.html"
,
"config"
:
"app/plugins/datasource/cloudwatch/partials/config.html"
,
...
...
public/app/plugins/datasource/elasticsearch/plugin.json
View file @
4ffa26cf
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"type"
:
"elasticsearch"
,
"type"
:
"elasticsearch"
,
"serviceName"
:
"ElasticDatasource"
,
"serviceName"
:
"ElasticDatasource"
,
"module"
:
"plugins/datasource/elasticsearch/datasource"
,
"module"
:
"
app/
plugins/datasource/elasticsearch/datasource"
,
"partials"
:
{
"partials"
:
{
"config"
:
"app/plugins/datasource/elasticsearch/partials/config.html"
,
"config"
:
"app/plugins/datasource/elasticsearch/partials/config.html"
,
...
...
public/app/plugins/datasource/grafana/plugin.json
View file @
4ffa26cf
...
@@ -6,6 +6,6 @@
...
@@ -6,6 +6,6 @@
"type"
:
"grafana"
,
"type"
:
"grafana"
,
"serviceName"
:
"GrafanaDatasource"
,
"serviceName"
:
"GrafanaDatasource"
,
"module"
:
"plugins/datasource/grafana/datasource"
,
"module"
:
"
app/
plugins/datasource/grafana/datasource"
,
"metrics"
:
true
"metrics"
:
true
}
}
public/app/plugins/datasource/graphite/plugin.json
View file @
4ffa26cf
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"type"
:
"graphite"
,
"type"
:
"graphite"
,
"serviceName"
:
"GraphiteDatasource"
,
"serviceName"
:
"GraphiteDatasource"
,
"module"
:
"plugins/datasource/graphite/datasource"
,
"module"
:
"
app/
plugins/datasource/graphite/datasource"
,
"partials"
:
{
"partials"
:
{
"config"
:
"app/plugins/datasource/graphite/partials/config.html"
"config"
:
"app/plugins/datasource/graphite/partials/config.html"
...
...
public/app/plugins/datasource/influxdb/plugin.json
View file @
4ffa26cf
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"type"
:
"influxdb"
,
"type"
:
"influxdb"
,
"serviceName"
:
"InfluxDatasource"
,
"serviceName"
:
"InfluxDatasource"
,
"module"
:
"plugins/datasource/influxdb/datasource"
,
"module"
:
"
app/
plugins/datasource/influxdb/datasource"
,
"partials"
:
{
"partials"
:
{
"config"
:
"app/plugins/datasource/influxdb/partials/config.html"
"config"
:
"app/plugins/datasource/influxdb/partials/config.html"
...
...
public/app/plugins/datasource/influxdb_08/plugin.json
View file @
4ffa26cf
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"type"
:
"influxdb_08"
,
"type"
:
"influxdb_08"
,
"serviceName"
:
"InfluxDatasource_08"
,
"serviceName"
:
"InfluxDatasource_08"
,
"module"
:
"plugins/datasource/influxdb_08/datasource"
,
"module"
:
"
app/
plugins/datasource/influxdb_08/datasource"
,
"partials"
:
{
"partials"
:
{
"config"
:
"app/plugins/datasource/influxdb_08/partials/config.html"
"config"
:
"app/plugins/datasource/influxdb_08/partials/config.html"
...
...
public/app/plugins/datasource/kairosdb/plugin.json
View file @
4ffa26cf
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"type"
:
"kairosdb"
,
"type"
:
"kairosdb"
,
"serviceName"
:
"KairosDBDatasource"
,
"serviceName"
:
"KairosDBDatasource"
,
"module"
:
"plugins/datasource/kairosdb/datasource"
,
"module"
:
"
app/
plugins/datasource/kairosdb/datasource"
,
"partials"
:
{
"partials"
:
{
"config"
:
"app/plugins/datasource/kairosdb/partials/config.html"
"config"
:
"app/plugins/datasource/kairosdb/partials/config.html"
...
...
public/app/plugins/datasource/mixed/plugin.json
View file @
4ffa26cf
...
@@ -7,6 +7,6 @@
...
@@ -7,6 +7,6 @@
"type"
:
"mixed"
,
"type"
:
"mixed"
,
"serviceName"
:
"MixedDatasource"
,
"serviceName"
:
"MixedDatasource"
,
"module"
:
"plugins/datasource/mixed/datasource"
,
"module"
:
"
app/
plugins/datasource/mixed/datasource"
,
"metrics"
:
true
"metrics"
:
true
}
}
public/app/plugins/datasource/opentsdb/plugin.json
View file @
4ffa26cf
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"type"
:
"opentsdb"
,
"type"
:
"opentsdb"
,
"serviceName"
:
"OpenTSDBDatasource"
,
"serviceName"
:
"OpenTSDBDatasource"
,
"module"
:
"plugins/datasource/opentsdb/datasource"
,
"module"
:
"
app/
plugins/datasource/opentsdb/datasource"
,
"partials"
:
{
"partials"
:
{
"config"
:
"app/plugins/datasource/opentsdb/partials/config.html"
"config"
:
"app/plugins/datasource/opentsdb/partials/config.html"
...
...
public/app/plugins/datasource/sql/plugin.json_
View file @
4ffa26cf
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"type": "generic_sql",
"type": "generic_sql",
"serviceName": "SqlDatasource",
"serviceName": "SqlDatasource",
"module": "plugins/datasource/sql/datasource",
"module": "
app/
plugins/datasource/sql/datasource",
"partials": {
"partials": {
"config": "app/plugins/datasource/sql/partials/config.html",
"config": "app/plugins/datasource/sql/partials/config.html",
...
...
public/test/specs/cloudwatch-datasource-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'plugins/datasource/cloudwatch/datasource'
,
'
app/
plugins/datasource/cloudwatch/datasource'
,
'aws-sdk'
,
'aws-sdk'
,
],
function
(
helpers
)
{
],
function
(
helpers
)
{
'use strict'
;
'use strict'
;
...
@@ -9,6 +9,7 @@ define([
...
@@ -9,6 +9,7 @@ define([
var
ctx
=
new
helpers
.
ServiceTestContext
();
var
ctx
=
new
helpers
.
ServiceTestContext
();
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
module
(
'grafana.controllers'
));
beforeEach
(
ctx
.
providePhase
([
'templateSrv'
]));
beforeEach
(
ctx
.
providePhase
([
'templateSrv'
]));
beforeEach
(
ctx
.
createService
(
'CloudWatchDatasource'
));
beforeEach
(
ctx
.
createService
(
'CloudWatchDatasource'
));
beforeEach
(
function
()
{
beforeEach
(
function
()
{
...
...
public/test/specs/core/utils/datemath_specs.ts
0 → 100644
View file @
4ffa26cf
import
{
DateMath
}
from
'app/core/utils/datemath'
declare
var
describe
:
any
;
declare
var
expect
:
any
;
declare
var
it
:
any
;
describe
(
"test"
,
()
=>
{
it
(
"hello"
,
()
=>
{
expect
(
true
).
to
.
be
(
true
);
});
});
export
=
{};
public/test/specs/dashboardSrv-specs.js
View file @
4ffa26cf
define
([
define
([
'features/dashboard/dashboardSrv'
'
app/
features/dashboard/dashboardSrv'
],
function
()
{
],
function
()
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/dashboardViewStateSrv-specs.js
View file @
4ffa26cf
define
([
define
([
'features/dashboard/viewStateSrv'
'
app/
features/dashboard/viewStateSrv'
],
function
()
{
],
function
()
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/dynamicDashboardSrv-specs.js
View file @
4ffa26cf
define
([
define
([
'features/dashboard/dynamicDashboardSrv'
,
'
app/
features/dashboard/dynamicDashboardSrv'
,
'features/dashboard/dashboardSrv'
'
app/
features/dashboard/dashboardSrv'
],
function
()
{
],
function
()
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/elasticsearch-indexPattern-specs.js
View file @
4ffa26cf
define
([
define
([
'moment'
,
'moment'
,
'plugins/datasource/elasticsearch/indexPattern'
'
app/
plugins/datasource/elasticsearch/indexPattern'
],
function
(
moment
,
IndexPattern
)
{
],
function
(
moment
,
IndexPattern
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/elasticsearch-querybuilder-specs.js
View file @
4ffa26cf
define
([
define
([
'plugins/datasource/elasticsearch/queryBuilder'
'
app/
plugins/datasource/elasticsearch/queryBuilder'
],
function
(
ElasticQueryBuilder
)
{
],
function
(
ElasticQueryBuilder
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/elasticsearch-queryctrl-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'plugins/datasource/elasticsearch/queryCtrl'
,
'
app/
plugins/datasource/elasticsearch/queryCtrl'
,
'services/uiSegmentSrv'
'
app/
services/uiSegmentSrv'
],
function
(
helpers
)
{
],
function
(
helpers
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/elasticsearch-response-specs.js
View file @
4ffa26cf
define
([
define
([
'plugins/datasource/elasticsearch/elasticResponse'
,
'
app/
plugins/datasource/elasticsearch/elasticResponse'
,
],
function
(
ElasticResponse
)
{
],
function
(
ElasticResponse
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/elasticsearch-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'moment'
,
'moment'
,
'angular'
,
'angular'
,
'plugins/datasource/elasticsearch/datasource'
,
'
app/
plugins/datasource/elasticsearch/datasource'
,
],
function
(
helpers
,
moment
,
angular
)
{
],
function
(
helpers
,
moment
,
angular
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/gfunc-specs.js
View file @
4ffa26cf
define
([
define
([
'plugins/datasource/graphite/gfunc'
'
app/
plugins/datasource/graphite/gfunc'
],
function
(
gfunc
)
{
],
function
(
gfunc
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/graph-ctrl-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'features/panel/panelSrv'
,
'
app/
features/panel/panelSrv'
,
'features/panel/panelHelper'
,
'
app/
features/panel/panelHelper'
,
'panels/graph/module'
'
app/
panels/graph/module'
],
function
(
helpers
)
{
],
function
(
helpers
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/graph-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'angular'
,
'angular'
,
'jquery'
,
'jquery'
,
'components/timeSeries'
,
'
app/
components/timeSeries'
,
'panels/graph/graph'
'
app/
panels/graph/graph'
],
function
(
helpers
,
angular
,
$
,
TimeSeries
)
{
],
function
(
helpers
,
angular
,
$
,
TimeSeries
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/graph-tooltip-specs.js
View file @
4ffa26cf
define
([
define
([
'jquery'
,
'jquery'
,
'panels/graph/graph.tooltip'
'
app/
panels/graph/graph.tooltip'
],
function
(
$
,
GraphTooltip
)
{
],
function
(
$
,
GraphTooltip
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/graphiteDatasource-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'plugins/datasource/graphite/datasource'
'
app/
plugins/datasource/graphite/datasource'
],
function
(
helpers
)
{
],
function
(
helpers
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/graphiteTargetCtrl-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'plugins/datasource/graphite/gfunc'
,
'
app/
plugins/datasource/graphite/gfunc'
,
'plugins/datasource/graphite/queryCtrl'
,
'
app/
plugins/datasource/graphite/queryCtrl'
,
'services/uiSegmentSrv'
'
app/
services/uiSegmentSrv'
],
function
(
helpers
,
gfunc
)
{
],
function
(
helpers
,
gfunc
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/influx09-querybuilder-specs.js
View file @
4ffa26cf
define
([
define
([
'plugins/datasource/influxdb/queryBuilder'
'
app/
plugins/datasource/influxdb/queryBuilder'
],
function
(
InfluxQueryBuilder
)
{
],
function
(
InfluxQueryBuilder
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/influxQueryBuilder-specs.js
View file @
4ffa26cf
define
([
define
([
'plugins/datasource/influxdb_08/queryBuilder'
'
app/
plugins/datasource/influxdb_08/queryBuilder'
],
function
(
InfluxQueryBuilder
)
{
],
function
(
InfluxQueryBuilder
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/influxSeries-specs.js
View file @
4ffa26cf
define
([
define
([
'plugins/datasource/influxdb/influxSeries'
'
app/
plugins/datasource/influxdb/influxSeries'
],
function
(
InfluxSeries
)
{
],
function
(
InfluxSeries
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/influxSeries08-specs.js
View file @
4ffa26cf
define
([
define
([
'plugins/datasource/influxdb_08/influxSeries'
'
app/
plugins/datasource/influxdb_08/influxSeries'
],
function
(
InfluxSeries
)
{
],
function
(
InfluxSeries
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/influxdb-datasource-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'plugins/datasource/influxdb_08/datasource'
,
'
app/
plugins/datasource/influxdb_08/datasource'
,
'services/backendSrv'
,
'
app/
services/backendSrv'
,
'services/alertSrv'
'
app/
services/alertSrv'
],
function
(
helpers
)
{
],
function
(
helpers
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/influxdbQueryCtrl-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'plugins/datasource/influxdb/queryCtrl'
,
'
app/
plugins/datasource/influxdb/queryCtrl'
,
'services/uiSegmentSrv'
'
app/
services/uiSegmentSrv'
],
function
(
helpers
)
{
],
function
(
helpers
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/kairosdb-datasource-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'plugins/datasource/kairosdb/datasource'
'
app/
plugins/datasource/kairosdb/datasource'
],
function
(
helpers
)
{
],
function
(
helpers
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/lexer-specs.js
View file @
4ffa26cf
define
([
define
([
'plugins/datasource/graphite/lexer'
'
app/
plugins/datasource/graphite/lexer'
],
function
(
Lexer
)
{
],
function
(
Lexer
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/opentsdbDatasource-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'plugins/datasource/opentsdb/datasource'
'
app/
plugins/datasource/opentsdb/datasource'
],
function
(
helpers
)
{
],
function
(
helpers
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/overview-ctrl-specs.js
deleted
100644 → 0
View file @
2b95cd50
define
([
'./helpers'
,
'panels/overview/module'
],
function
(
helpers
)
{
'use strict'
;
describe
(
'OverviewCtrl'
,
function
()
{
var
ctx
=
new
helpers
.
ControllerTestContext
();
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
module
(
'grafana.panels.overview'
));
beforeEach
(
ctx
.
providePhase
());
beforeEach
(
ctx
.
createControllerPhase
(
'OverviewCtrl'
));
describe
(
'when query return error'
,
function
()
{
beforeEach
(
function
()
{
ctx
.
datasource
.
query
=
function
()
{
return
ctx
.
$q
.
reject
({
message
:
'Some error'
});
};
ctx
.
scope
.
get_data
();
ctx
.
scope
.
$digest
();
});
it
(
'panel.error should be set'
,
function
()
{
expect
(
ctx
.
scope
.
panel
.
error
).
to
.
be
(
"Some error"
);
});
});
});
});
public/test/specs/panelSrv-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'features/panel/panelSrv'
,
'
app/
features/panel/panelSrv'
,
],
function
()
{
],
function
()
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/parser-specs.js
View file @
4ffa26cf
define
([
define
([
'plugins/datasource/graphite/parser'
'
app/
plugins/datasource/graphite/parser'
],
function
(
Parser
)
{
],
function
(
Parser
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/row-ctrl-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'features/dashboard/rowCtrl'
'
app/
features/dashboard/rowCtrl'
],
function
(
helpers
)
{
],
function
(
helpers
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/seriesOverridesCtrl-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'panels/graph/seriesOverridesCtrl'
'
app/
panels/graph/seriesOverridesCtrl'
],
function
(
helpers
)
{
],
function
(
helpers
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/shareModalCtrl-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'features/dashboard/shareModalCtrl'
,
'
app/
features/dashboard/shareModalCtrl'
,
'features/panellinks/linkSrv'
,
'
app/
features/panellinks/linkSrv'
,
],
function
(
helpers
)
{
],
function
(
helpers
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/singlestat-specs.js
View file @
4ffa26cf
define
([
define
([
'helpers'
,
'
./
helpers'
,
'features/panel/panelSrv'
,
'
app/
features/panel/panelSrv'
,
'features/panel/panelHelper'
,
'
app/
features/panel/panelHelper'
,
'panels/singlestat/module'
'
app/
panels/singlestat/module'
],
function
(
helpers
)
{
],
function
(
helpers
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/templateSrv-specs.js
View file @
4ffa26cf
define
([
define
([
'mocks/dashboard-mock'
,
'
../
mocks/dashboard-mock'
,
'lodash'
,
'lodash'
,
'features/templating/templateSrv'
'
app/
features/templating/templateSrv'
],
function
(
dashboardMock
)
{
],
function
(
dashboardMock
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/templateValuesSrv-specs.js
View file @
4ffa26cf
define
([
define
([
'mocks/dashboard-mock'
,
'
../
mocks/dashboard-mock'
,
'helpers'
,
'
./
helpers'
,
'moment'
,
'moment'
,
'features/templating/templateValuesSrv'
'
app/
features/templating/templateValuesSrv'
],
function
(
dashboardMock
,
helpers
,
moment
)
{
],
function
(
dashboardMock
,
helpers
,
moment
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/timeSeries-specs.js
View file @
4ffa26cf
define
([
define
([
'components/timeSeries'
'
app/
components/timeSeries'
],
function
(
TimeSeries
)
{
],
function
(
TimeSeries
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/timeSrv-specs.js
View file @
4ffa26cf
define
([
define
([
'mocks/dashboard-mock'
,
'
../
mocks/dashboard-mock'
,
'helpers'
,
'
./
helpers'
,
'lodash'
,
'lodash'
,
'services/timer'
,
'
app/
services/timer'
,
'features/dashboard/timeSrv'
'
app/
features/dashboard/timeSrv'
],
function
(
dashboardMock
,
helpers
,
_
)
{
],
function
(
dashboardMock
,
helpers
,
_
)
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/unsavedChangesSrv-specs.js
View file @
4ffa26cf
define
([
define
([
'features/dashboard/unsavedChangesSrv'
,
'
app/
features/dashboard/unsavedChangesSrv'
,
'features/dashboard/dashboardSrv'
'
app/
features/dashboard/dashboardSrv'
],
function
()
{
],
function
()
{
'use strict'
;
'use strict'
;
...
...
public/test/specs/value_select_dropdown_specs.js
View file @
4ffa26cf
define
([
define
([
'core/directives/value_select_dropdown'
,
'
app/
core/directives/value_select_dropdown'
,
],
],
function
()
{
function
()
{
'use strict'
;
'use strict'
;
...
...
public/test/test-main.js
View file @
4ffa26cf
require
.
config
({
require
.
config
({
baseUrl
:
'http://localhost:9876/base/
public_gen/app
'
,
baseUrl
:
'http://localhost:9876/base/'
,
paths
:
{
paths
:
{
specs
:
'../test/specs'
,
config
:
'app/components/config'
,
mocks
:
'../test/mocks'
,
kbn
:
'app/components/kbn'
,
helpers
:
'../test/specs/helpers'
,
store
:
'app/components/store'
,
config
:
'components/config'
,
kbn
:
'components/kbn'
,
settings
:
'app/components/settings'
,
store
:
'components/store'
,
lodash
:
'app/components/lodash.extended'
,
'lodash-src'
:
'vendor/lodash'
,
settings
:
'components/settings'
,
lodash
:
'components/lodash.extended'
,
moment
:
'vendor/moment'
,
'lodash-src'
:
'../vendor/lodash'
,
chromath
:
'vendor/chromath'
,
filesaver
:
'vendor/filesaver'
,
moment
:
'../vendor/moment'
,
chromath
:
'../vendor/chromath'
,
angular
:
'vendor/angular/angular'
,
filesaver
:
'../vendor/filesaver'
,
'angular-route'
:
'vendor/angular-route/angular-route'
,
'angular-sanitize'
:
'vendor/angular-sanitize/angular-sanitize'
,
angular
:
'../vendor/angular/angular'
,
angularMocks
:
'vendor/angular-mocks/angular-mocks'
,
'angular-route'
:
'../vendor/angular-route/angular-route'
,
'angular-dragdrop'
:
'vendor/angular-native-dragdrop/draganddrop'
,
'angular-sanitize'
:
'../vendor/angular-sanitize/angular-sanitize'
,
'angular-ui'
:
'vendor/angular-ui/tabs'
,
angularMocks
:
'../vendor/angular-mocks/angular-mocks'
,
'angular-strap'
:
'vendor/angular-other/angular-strap'
,
'angular-dragdrop'
:
'../vendor/angular-native-dragdrop/draganddrop'
,
timepicker
:
'vendor/angular-other/timepicker'
,
'angular-ui'
:
'../vendor/angular-ui/angular-bootstrap'
,
datepicker
:
'vendor/angular-other/datepicker'
,
'angular-strap'
:
'../vendor/angular-other/angular-strap'
,
bindonce
:
'vendor/angular-bindonce/bindonce'
,
timepicker
:
'../vendor/angular-other/timepicker'
,
crypto
:
'vendor/crypto.min'
,
datepicker
:
'../vendor/angular-other/datepicker'
,
spectrum
:
'vendor/spectrum'
,
bindonce
:
'../vendor/angular-bindonce/bindonce'
,
crypto
:
'../vendor/crypto.min'
,
jquery
:
'vendor/jquery/dist/jquery'
,
spectrum
:
'../vendor/spectrum'
,
bootstrap
:
'vendor/bootstrap/bootstrap'
,
jquery
:
'../vendor/jquery/dist/jquery'
,
'bootstrap-tagsinput'
:
'vendor/tagsinput/bootstrap-tagsinput'
,
bootstrap
:
'../vendor/bootstrap/bootstrap'
,
'extend-jquery'
:
'app/components/extend-jquery'
,
'bootstrap-tagsinput'
:
'../vendor/tagsinput/bootstrap-tagsinput'
,
'jquery.flot'
:
'vendor/flot/jquery.flot'
,
'extend-jquery'
:
'components/extend-jquery'
,
'jquery.flot.pie'
:
'vendor/flot/jquery.flot.pie'
,
'jquery.flot.events'
:
'vendor/flot/jquery.flot.events'
,
'jquery.flot'
:
'../vendor/flot/jquery.flot'
,
'jquery.flot.selection'
:
'vendor/flot/jquery.flot.selection'
,
'jquery.flot.pie'
:
'../vendor/flot/jquery.flot.pie'
,
'jquery.flot.stack'
:
'vendor/flot/jquery.flot.stack'
,
'jquery.flot.events'
:
'../vendor/flot/jquery.flot.events'
,
'jquery.flot.stackpercent'
:
'vendor/flot/jquery.flot.stackpercent'
,
'jquery.flot.selection'
:
'../vendor/flot/jquery.flot.selection'
,
'jquery.flot.time'
:
'vendor/flot/jquery.flot.time'
,
'jquery.flot.stack'
:
'../vendor/flot/jquery.flot.stack'
,
'jquery.flot.crosshair'
:
'vendor/flot/jquery.flot.crosshair'
,
'jquery.flot.stackpercent'
:
'../vendor/flot/jquery.flot.stackpercent'
,
'jquery.flot.fillbelow'
:
'vendor/flot/jquery.flot.fillbelow'
,
'jquery.flot.time'
:
'../vendor/flot/jquery.flot.time'
,
'jquery.flot.crosshair'
:
'../vendor/flot/jquery.flot.crosshair'
,
modernizr
:
'vendor/modernizr-2.6.1'
,
'jquery.flot.fillbelow'
:
'../vendor/flot/jquery.flot.fillbelow'
,
'aws-sdk'
:
'vendor/aws-sdk/dist/aws-sdk.min'
,
modernizr
:
'../vendor/modernizr-2.6.1'
,
'aws-sdk'
:
'../vendor/aws-sdk/dist/aws-sdk.min'
,
},
},
shim
:
{
shim
:
{
...
@@ -98,20 +95,37 @@ require.config({
...
@@ -98,20 +95,37 @@ require.config({
}
}
});
});
function
file2moduleName
(
filePath
)
{
'use strict'
;
return
filePath
.
replace
(
/
\\
/g
,
'/'
)
.
replace
(
/^
\/
base
\/
/
,
''
)
.
replace
(
/
\.\w
*$/
,
''
);
}
require
([
require
([
'angular'
,
'angular'
,
'config'
,
'angularMocks'
,
'angularMocks'
,
'app'
,
'app
/app
'
,
],
function
(
angular
,
config
)
{
],
function
(
angular
)
{
'use strict'
;
'use strict'
;
var
specs
=
[];
for
(
var
file
in
window
.
__karma__
.
files
)
{
for
(
var
file
in
window
.
__karma__
.
files
)
{
if
(
/spec
\.
js$/
.
test
(
file
))
{
if
(
/base
\/
test
\/
specs.*/
.
test
(
file
))
{
window
.
tests
.
push
(
file
.
replace
(
/^
\/
base
\/
/
,
'http://localhost:9876/base/'
));
console
.
log
(
file
);
file
=
file2moduleName
(
file
);
console
.
log
(
file
);
specs
.
push
(
file
);
//file = file.replace(/^\/base\/test/, '');
//specs.push(file);
//window.tests.push();
}
}
}
}
require
(
specs
,
function
()
{
window
.
__karma__
.
start
();
});
angular
.
module
(
'grafana'
,
[
'ngRoute'
]);
angular
.
module
(
'grafana'
,
[
'ngRoute'
]);
angular
.
module
(
'grafana.services'
,
[
'ngRoute'
,
'$strap.directives'
]);
angular
.
module
(
'grafana.services'
,
[
'ngRoute'
,
'$strap.directives'
]);
...
@@ -119,51 +133,49 @@ require([
...
@@ -119,51 +133,49 @@ require([
angular
.
module
(
'grafana.filters'
,
[]);
angular
.
module
(
'grafana.filters'
,
[]);
angular
.
module
(
'grafana.routes'
,
[
'ngRoute'
]);
angular
.
module
(
'grafana.routes'
,
[
'ngRoute'
]);
var
specs
=
[
// var specs = [
'specs/lexer-specs'
,
// 'specs/lexer-specs',
'specs/parser-specs'
,
// 'specs/parser-specs',
'specs/gfunc-specs'
,
// 'specs/gfunc-specs',
'specs/timeSeries-specs'
,
// 'specs/timeSeries-specs',
'specs/row-ctrl-specs'
,
// 'specs/row-ctrl-specs',
'specs/graphiteTargetCtrl-specs'
,
// 'specs/graphiteTargetCtrl-specs',
'specs/graphiteDatasource-specs'
,
// 'specs/graphiteDatasource-specs',
'specs/influxSeries-specs'
,
// 'specs/influxSeries-specs',
'specs/influxSeries08-specs'
,
// 'specs/influxSeries08-specs',
'specs/influxQueryBuilder-specs'
,
// 'specs/influxQueryBuilder-specs',
'specs/influx09-querybuilder-specs'
,
// 'specs/influx09-querybuilder-specs',
'specs/influxdb-datasource-specs'
,
// // 'specs/influxdb-datasource-specs',
'specs/influxdbQueryCtrl-specs'
,
// 'specs/influxdbQueryCtrl-specs',
'specs/kairosdb-datasource-specs'
,
// // 'specs/kairosdb-datasource-specs',
'specs/graph-ctrl-specs'
,
// 'specs/graph-ctrl-specs',
'specs/graph-specs'
,
// 'specs/graph-specs',
'specs/graph-tooltip-specs'
,
// 'specs/graph-tooltip-specs',
'specs/seriesOverridesCtrl-specs'
,
// 'specs/seriesOverridesCtrl-specs',
'specs/shareModalCtrl-specs'
,
// 'specs/shareModalCtrl-specs',
'specs/timeSrv-specs'
,
// 'specs/timeSrv-specs',
'specs/panelSrv-specs'
,
// 'specs/panelSrv-specs',
'specs/templateSrv-specs'
,
// 'specs/templateSrv-specs',
'specs/templateValuesSrv-specs'
,
// 'specs/templateValuesSrv-specs',
'specs/kbn-format-specs'
,
// 'specs/kbn-format-specs',
'specs/dashboardSrv-specs'
,
// 'specs/dashboardSrv-specs',
'specs/dashboardViewStateSrv-specs'
,
// 'specs/dashboardViewStateSrv-specs',
'specs/singlestat-specs'
,
// 'specs/singlestat-specs',
'specs/dynamicDashboardSrv-specs'
,
// 'specs/dynamicDashboardSrv-specs',
'specs/unsavedChangesSrv-specs'
,
// 'specs/unsavedChangesSrv-specs',
'specs/value_select_dropdown_specs'
,
// 'specs/value_select_dropdown_specs',
'specs/opentsdbDatasource-specs'
,
// 'specs/opentsdbDatasource-specs',
'specs/cloudwatch-datasource-specs'
,
// 'specs/cloudwatch-datasource-specs',
'specs/elasticsearch-specs'
,
// 'specs/elasticsearch-specs',
'specs/elasticsearch-querybuilder-specs'
,
// 'specs/elasticsearch-querybuilder-specs',
'specs/elasticsearch-queryctrl-specs'
,
// 'specs/elasticsearch-queryctrl-specs',
'specs/elasticsearch-indexPattern-specs'
,
// 'specs/elasticsearch-indexPattern-specs',
'specs/elasticsearch-response-specs'
,
// 'specs/elasticsearch-response-specs',
];
// 'specs/core/utils/datemath_specs',
// ];
var
pluginSpecs
=
(
config
.
plugins
.
specs
||
[]).
map
(
function
(
spec
)
{
//
return
'../plugins/'
+
spec
;
// var pluginSpecs = (config.plugins.specs || []).map(function (spec) {
});
// return '../plugins/' + spec;
// });
require
(
specs
.
concat
(
pluginSpecs
),
function
()
{
window
.
__karma__
.
start
();
});
});
});
public/vendor/angular-ui/angular-bootstrap.js
deleted
100644 → 0
View file @
2b95cd50
define
([
'angular'
,
'../vendor/angular-ui/tabs'
,
],
function
()
{
});
public/views/index.html
View file @
4ffa26cf
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
settings
:
[[.
Settings
]],
settings
:
[[.
Settings
]],
};
};
require
([
'app'
],
function
(
app
)
{
require
([
'app
/app
'
],
function
(
app
)
{
app
.
boot
();
app
.
boot
();
})
})
</script>
</script>
...
...
tasks/options/karma.js
View file @
4ffa26cf
module
.
exports
=
function
(
config
)
{
module
.
exports
=
function
(
config
)
{
'use strict'
;
return
{
return
{
dev
:
{
dev
:
{
configFile
:
'
<%= srcDir %>/test/
karma.conf.js'
,
configFile
:
'karma.conf.js'
,
singleRun
:
false
,
singleRun
:
false
,
},
},
debug
:
{
debug
:
{
configFile
:
'
<%= srcDir %>/test/
karma.conf.js'
,
configFile
:
'karma.conf.js'
,
singleRun
:
false
,
singleRun
:
false
,
browsers
:
[
'Chrome'
]
browsers
:
[
'Chrome'
]
},
},
test
:
{
test
:
{
configFile
:
'
<%= srcDir %>/test/
karma.conf.js'
,
configFile
:
'karma.conf.js'
,
},
},
coveralls
:
{
coveralls
:
{
configFile
:
'
<%= srcDir %>/test/
karma.conf.js'
,
configFile
:
'karma.conf.js'
,
reporters
:
[
'dots'
,
'coverage'
,
'coveralls'
],
reporters
:
[
'dots'
,
'coverage'
,
'coveralls'
],
preprocessors
:
{
preprocessors
:
{
'public/app/**/*.js'
:
[
'coverage'
]
'public/app/**/*.js'
:
[
'coverage'
]
...
...
tasks/options/typescript.js
View file @
4ffa26cf
...
@@ -3,15 +3,18 @@ module.exports = function() {
...
@@ -3,15 +3,18 @@ module.exports = function() {
return
{
return
{
build
:
{
build
:
{
src
:
[
'public/
app
/**/*.ts'
],
src
:
[
'public/
**/*.ts'
,
'public/test
/**/*.ts'
],
dest
:
'public_gen/
app
'
,
dest
:
'public_gen/'
,
options
:
{
options
:
{
module
:
'amd'
,
//or commonjs
module
:
'amd'
,
//or commonjs
target
:
'es5'
,
//or es3
target
:
'es5'
,
//or es3
rootDir
:
'public/app'
,
rootDir
:
'public/'
,
sourceRoot
:
'public/'
,
declaration
:
true
,
declaration
:
true
,
emitDecoratorMetadata
:
true
,
experimentalDecorators
:
true
,
sourceMap
:
true
,
sourceMap
:
true
,
generateTsConfig
:
tru
e
,
noImplicitAny
:
fals
e
,
}
}
},
},
...
@@ -35,7 +38,6 @@ module.exports = function() {
...
@@ -35,7 +38,6 @@ module.exports = function() {
declaration
:
true
,
declaration
:
true
,
sourceMap
:
true
,
sourceMap
:
true
,
watch
:
true
,
watch
:
true
,
generateTsConfig
:
true
,
}
}
}
}
};
};
...
...
tasks/options/watch.js
View file @
4ffa26cf
...
@@ -17,7 +17,7 @@ module.exports = function(config) {
...
@@ -17,7 +17,7 @@ module.exports = function(config) {
},
},
typescript
:
{
typescript
:
{
files
:
[
'<%= srcDir %>/app/**/*.ts'
],
files
:
[
'<%= srcDir %>/app/**/*.ts'
,
'<%= srcDir %>/test/**/*.ts'
],
tasks
:
[
'tslint'
,
'typescript:build'
],
tasks
:
[
'tslint'
,
'typescript:build'
],
options
:
{
options
:
{
spawn
:
false
spawn
:
false
...
...
tsconfig.json
0 → 100644
View file @
4ffa26cf
{
"compilerOptions"
:
{
"emitDecoratorMetadata"
:
true
,
"experimentalDecorators"
:
true
,
"sourceMap"
:
true
,
"declaration"
:
true
,
"noImplicitAny"
:
false
,
"removeComments"
:
true
,
"noLib"
:
true
,
"outDir"
:
"public_gen/app"
,
"target"
:
"ES5"
,
"rootDir"
:
"public/app"
,
"sourceRoot"
:
"public/app"
,
"module"
:
"amd"
,
"noEmitOnError"
:
true
},
"fileGlobs"
:
[
"./public/app/**/*.ts"
,
"!./node_modules/**"
,
"!./public_gen/**"
,
]
}
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