diff --git a/.gitignore b/.gitignore
index b52ecff18b8..8abd0d17cbd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,4 +30,3 @@ conf/custom.ini
fig.yml
profile.cov
grafana
-tsconfig.json
diff --git a/public/test/karma.conf.js b/karma.conf.js
similarity index 67%
rename from public/test/karma.conf.js
rename to karma.conf.js
index 6b51d1a5a1e..569cf845b16 100644
--- a/public/test/karma.conf.js
+++ b/karma.conf.js
@@ -2,14 +2,16 @@ module.exports = function(config) {
'use strict';
config.set({
- basePath: '../../',
+ basePath: __dirname + '/public_gen',
frameworks: ['mocha', 'requirejs', 'expect', 'sinon'],
// list of files / patterns to load in the browser
files: [
- 'public/test/test-main.js',
- {pattern: 'public_gen/**/*.js', included: false}
+ 'test/test-main.js',
+ {pattern: 'app/**/*.js', included: false},
+ {pattern: 'vendor/**/*.js', included: false},
+ {pattern: 'test/**/*.js', included: false}
],
// list of files to exclude
diff --git a/public/app/app.js b/public/app/app.js
index 022d972511a..01f79883e84 100644
--- a/public/app/app.js
+++ b/public/app/app.js
@@ -12,7 +12,7 @@ define([
'angular-ui',
'extend-jquery',
'bindonce',
- './core/core',
+ 'app/core/core',
],
function (angular, $, _, appLevelRequire) {
"use strict";
@@ -70,10 +70,10 @@ function (angular, $, _, appLevelRequire) {
});
var preBootRequires = [
- 'services/all',
- 'features/all',
- 'controllers/all',
- 'components/partials',
+ 'app/services/all',
+ 'app/features/all',
+ 'app/controllers/all',
+ 'app/components/partials',
];
app.boot = function() {
diff --git a/public/app/components/extend-jquery.js b/public/app/components/extend-jquery.js
index f44245103b5..449afcf2019 100644
--- a/public/app/components/extend-jquery.js
+++ b/public/app/components/extend-jquery.js
@@ -2,9 +2,6 @@ define(['jquery', 'angular', 'lodash'],
function ($, angular, _) {
'use strict';
- /**
- * jQuery extensions
- */
var $win = $(window);
$.fn.place_tt = (function () {
diff --git a/public/app/components/require.config.js b/public/app/components/require.config.js
index f255418414e..074df7cbefe 100644
--- a/public/app/components/require.config.js
+++ b/public/app/components/require.config.js
@@ -1,51 +1,50 @@
require.config({
urlArgs: 'bust=' + (new Date().getTime()),
- baseUrl: 'public/app',
+ baseUrl: 'public',
paths: {
- config: 'components/config',
- settings: 'components/settings',
- kbn: 'components/kbn',
- store: 'components/store',
+ config: 'app/components/config',
+ settings: 'app/components/settings',
+ kbn: 'app/components/kbn',
+ store: 'app/components/store',
+ 'extend-jquery': 'app/components/extend-jquery',
+ lodash: 'app/components/lodash.extended',
- text: '../vendor/requirejs-text/text',
- moment: '../vendor/moment',
- filesaver: '../vendor/filesaver',
- ZeroClipboard: '../vendor/ZeroClipboard',
- angular: '../vendor/angular/angular',
- 'angular-route': '../vendor/angular-route/angular-route',
- 'angular-sanitize': '../vendor/angular-sanitize/angular-sanitize',
- 'angular-dragdrop': '../vendor/angular-native-dragdrop/draganddrop',
- 'angular-strap': '../vendor/angular-other/angular-strap',
- 'angular-ui': '../vendor/angular-ui/angular-bootstrap',
- timepicker: '../vendor/angular-other/timepicker',
- datepicker: '../vendor/angular-other/datepicker',
- bindonce: '../vendor/angular-bindonce/bindonce',
- crypto: '../vendor/crypto.min',
- spectrum: '../vendor/spectrum',
+ text: 'vendor/requirejs-text/text',
+ moment: 'vendor/moment',
+ filesaver: 'vendor/filesaver',
+ ZeroClipboard: 'vendor/ZeroClipboard',
+ angular: 'vendor/angular/angular',
+ 'angular-route': 'vendor/angular-route/angular-route',
+ 'angular-sanitize': 'vendor/angular-sanitize/angular-sanitize',
+ 'angular-dragdrop': 'vendor/angular-native-dragdrop/draganddrop',
+ 'angular-strap': 'vendor/angular-other/angular-strap',
+ 'angular-ui': 'vendor/angular-ui/tabs',
+ timepicker: 'vendor/angular-other/timepicker',
+ datepicker: 'vendor/angular-other/datepicker',
+ bindonce: 'vendor/angular-bindonce/bindonce',
+ crypto: 'vendor/crypto.min',
+ spectrum: 'vendor/spectrum',
- lodash: 'components/lodash.extended',
- '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.pie': 'vendor/flot/jquery.flot.pie',
+ 'jquery.flot.events': 'vendor/flot/jquery.flot.events',
+ 'jquery.flot.selection': 'vendor/flot/jquery.flot.selection',
+ 'jquery.flot.stack': 'vendor/flot/jquery.flot.stack',
+ 'jquery.flot.stackpercent':'vendor/flot/jquery.flot.stackpercent',
+ 'jquery.flot.time': 'vendor/flot/jquery.flot.time',
+ 'jquery.flot.crosshair': 'vendor/flot/jquery.flot.crosshair',
+ 'jquery.flot.fillbelow': 'vendor/flot/jquery.flot.fillbelow',
- 'jquery.flot': '../vendor/flot/jquery.flot',
- 'jquery.flot.pie': '../vendor/flot/jquery.flot.pie',
- 'jquery.flot.events': '../vendor/flot/jquery.flot.events',
- 'jquery.flot.selection': '../vendor/flot/jquery.flot.selection',
- 'jquery.flot.stack': '../vendor/flot/jquery.flot.stack',
- 'jquery.flot.stackpercent':'../vendor/flot/jquery.flot.stackpercent',
- 'jquery.flot.time': '../vendor/flot/jquery.flot.time',
- 'jquery.flot.crosshair': '../vendor/flot/jquery.flot.crosshair',
- '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',
- 'aws-sdk': '../vendor/aws-sdk/dist/aws-sdk.min',
+ 'bootstrap-tagsinput': 'vendor/tagsinput/bootstrap-tagsinput',
+ 'aws-sdk': 'vendor/aws-sdk/dist/aws-sdk.min',
},
shim: {
diff --git a/public/app/components/settings.js b/public/app/components/settings.js
index b3a04bb3eec..a9e1d382dd5 100644
--- a/public/app/components/settings.js
+++ b/public/app/components/settings.js
@@ -15,10 +15,10 @@ function (_) {
datasources : {},
window_title_prefix : 'Grafana - ',
panels : {
- 'graph': { path: 'panels/graph', name: 'Graph' },
- 'singlestat': { path: 'panels/singlestat', name: 'Single stat' },
- 'text': { path: 'panels/text', name: 'Text' },
- 'dashlist': { path: 'panels/dashlist', name: 'Dashboard list' },
+ 'graph': { path: 'app/panels/graph', name: 'Graph' },
+ 'singlestat': { path: 'app/panels/singlestat', name: 'Single stat' },
+ 'text': { path: 'app/panels/text', name: 'Text' },
+ 'dashlist': { path: 'app/panels/dashlist', name: 'Dashboard list' },
},
new_panel_title: 'no title (click here)',
plugins: {},
diff --git a/public/app/core/routes/all.js b/public/app/core/routes/all.js
index a16af0836dd..a7e36a0e228 100644
--- a/public/app/core/routes/all.js
+++ b/public/app/core/routes/all.js
@@ -9,7 +9,7 @@ define([
coreModule.config(function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
- var loadOrgBundle = new BundleLoader.BundleLoader('features/org/all');
+ var loadOrgBundle = new BundleLoader.BundleLoader('app/features/org/all');
$routeProvider
.when('/', {
diff --git a/public/app/core/utils/datemath.ts b/public/app/core/utils/datemath.ts
new file mode 100644
index 00000000000..0bc572eeb8f
--- /dev/null
+++ b/public/app/core/utils/datemath.ts
@@ -0,0 +1,109 @@
+///