mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
worked on css and js asset reving, and angular partial precaching, still need to fix panel module.html, issue #418
This commit is contained in:
parent
d499f4e0d0
commit
f799ded434
@ -47,6 +47,7 @@ require.config({
|
||||
elasticjs: '../vendor/elasticjs/elastic-angular-client',
|
||||
|
||||
'bootstrap-tagsinput': '../vendor/tagsinput/bootstrap-tagsinput',
|
||||
|
||||
},
|
||||
shim: {
|
||||
underscore: {
|
||||
|
@ -7,17 +7,20 @@
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<title>Grafana</title>
|
||||
<link rel="stylesheet" href="css/default.min.css" title="Light">
|
||||
<!-- load the root require context -->
|
||||
<link rel="stylesheet" href="css/default.min.css" title="Dark">
|
||||
|
||||
<!-- build:js app/app.js -->
|
||||
<script src="vendor/require/require.js"></script>
|
||||
<script src="app/components/require.config.js"></script>
|
||||
<!-- endbuild -->
|
||||
|
||||
<script>require(['app'], function () {})</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body ng-cloak body-class>
|
||||
|
||||
<link rel="stylesheet" ng-href="css/bootstrap.{{dashboard.current.style||'dark'}}.min.css">
|
||||
<link rel="stylesheet" href="css/bootstrap.light.min.css" ng-if="dashboard.current.style === 'light'">
|
||||
<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
|
||||
<link rel="stylesheet" href="css/font-awesome.min.css">
|
||||
|
||||
|
@ -9,11 +9,13 @@ module.exports = function(grunt) {
|
||||
'concat:css',
|
||||
'copy:everything_but_less_to_temp',
|
||||
'htmlmin:build',
|
||||
'ngtemplates:app',
|
||||
'ngtemplates',
|
||||
'cssmin:build',
|
||||
'ngmin:build',
|
||||
'requirejs:build',
|
||||
'concat:js',
|
||||
'filerev',
|
||||
'usemin',
|
||||
'clean:temp',
|
||||
'build:write_revision',
|
||||
'uglify:dest'
|
||||
|
@ -10,5 +10,13 @@ module.exports = function(config) {
|
||||
],
|
||||
dest: '<%= srcDir %>/css/default.min.css'
|
||||
},
|
||||
js: {
|
||||
src: [
|
||||
'<%= destDir %>/vendor/require/require.js',
|
||||
'<%= destDir %>/app/components/require.config.js',
|
||||
'<%= destDir %>/app/app.js',
|
||||
],
|
||||
dest: '<%= destDir %>/app/app.js'
|
||||
},
|
||||
};
|
||||
};
|
||||
|
@ -6,8 +6,12 @@ module.exports = function(config) {
|
||||
length: 8,
|
||||
},
|
||||
css: {
|
||||
src: '<%= srcDir %>/css/default.min.css',
|
||||
src: '<%= destDir %>/css/default.min.css',
|
||||
dest: '<%= destDir %>/css'
|
||||
},
|
||||
js: {
|
||||
src: '<%= destDir %>/app/app.js',
|
||||
dest: '<%= destDir %>/app'
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -8,7 +8,7 @@ module.exports = function(config) {
|
||||
expand: true,
|
||||
cwd: '<%= tempDir %>',
|
||||
src: [
|
||||
'index.html',
|
||||
//'index.html',
|
||||
'app/panels/**/*.html',
|
||||
'app/partials/**/*.html'
|
||||
],
|
||||
|
@ -1,9 +1,18 @@
|
||||
module.exports = function(config) {
|
||||
return {
|
||||
kibana: {
|
||||
grafana: {
|
||||
cwd: '<%= tempDir %>',
|
||||
src: 'app/**/*.html',
|
||||
src: 'app/partials/**/*.html',
|
||||
dest: '<%= tempDir %>/app/components/partials.js',
|
||||
options: {
|
||||
bootstrap: function(module, script) {
|
||||
return "define('components/partials', ['angular'], function(angular) { \n" +
|
||||
"angular.module('kibana').run(['$templateCache', function($templateCache) { \n" +
|
||||
script +
|
||||
'\n}]);' +
|
||||
'\n});';
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
@ -60,7 +60,10 @@ module.exports = function(config,grunt) {
|
||||
'directives/all',
|
||||
'jquery.flot.pie',
|
||||
'angular-sanitize',
|
||||
'angular-dragdrop'
|
||||
'angular-dragdrop',
|
||||
'panels/graphite/module',
|
||||
'panels/text/module',
|
||||
'panels/timepicker/module'
|
||||
]
|
||||
}
|
||||
];
|
||||
@ -75,7 +78,8 @@ module.exports = function(config,grunt) {
|
||||
requireModules.push({
|
||||
name: 'panels/'+panelName+'/'+subName+'/module',
|
||||
exclude: ['app']
|
||||
}); })
|
||||
});
|
||||
})
|
||||
} else {
|
||||
requireModules.push({
|
||||
name: 'panels/'+panelName+'/module',
|
||||
|
@ -1,8 +1,5 @@
|
||||
module.exports = function(config) {
|
||||
return {
|
||||
html: '<%= destDir %>/index.html',
|
||||
options: {
|
||||
assetsDirs: ['<%= destDir %>/css/']
|
||||
}
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user