You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by kb...@apache.org on 2017/09/15 14:32:59 UTC
atlas git commit: ATLAS-2090 : UI - Cache busting for static content
(css, js)
Repository: atlas
Updated Branches:
refs/heads/master 979200e7b -> 3440240e5
ATLAS-2090 : UI - Cache busting for static content (css, js)
Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/3440240e
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/3440240e
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/3440240e
Branch: refs/heads/master
Commit: 3440240e51a5e4105021ea741be8af15cd1dce88
Parents: 979200e
Author: kevalbhatt <kb...@apache.org>
Authored: Mon Aug 28 17:27:09 2017 +0530
Committer: kevalbhatt <kb...@apache.org>
Committed: Fri Sep 15 19:58:00 2017 +0530
----------------------------------------------------------------------
dashboardv2/gruntfile.js | 23 ++++++++--
dashboardv2/package.json | 1 +
dashboardv2/public/index.html | 79 --------------------------------
dashboardv2/public/index.html.tpl | 84 ++++++++++++++++++++++++++++++++++
dashboardv2/public/js/main.js | 1 +
5 files changed, 106 insertions(+), 82 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/atlas/blob/3440240e/dashboardv2/gruntfile.js
----------------------------------------------------------------------
diff --git a/dashboardv2/gruntfile.js b/dashboardv2/gruntfile.js
index 900ee40..e9c077c 100644
--- a/dashboardv2/gruntfile.js
+++ b/dashboardv2/gruntfile.js
@@ -23,8 +23,8 @@ module.exports = function(grunt) {
var classPathSep = (process.platform === "win32") ? ';' : ':',
gitHash = '',
pkg = grunt.file.readJSON('package.json'),
+ buildTime = new Date().getTime(),
distPath = 'dist',
- publicPath = 'public',
libPath = distPath + '/js/libs',
isDashboardDirectory = grunt.file.isDir('public'),
modulesPath = 'public/';
@@ -259,6 +259,18 @@ module.exports = function(grunt) {
dest: 'dist/js/templates'
}]
}
+ },
+ template: {
+ build: {
+ options: {
+ data: {
+ 'bust': buildTime
+ }
+ },
+ files: {
+ [distPath + '/index.html']: [modulesPath + '/index.html.tpl']
+ }
+ }
}
});
@@ -269,6 +281,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
+ grunt.loadNpmTasks('grunt-template');
require('load-grunt-tasks')(grunt);
@@ -287,6 +300,7 @@ module.exports = function(grunt) {
'npmcopy:license',
'copy:dist',
'sass:dist',
+ 'template',
'configureProxies:server',
'connect:server',
'watch'
@@ -298,7 +312,8 @@ module.exports = function(grunt) {
'npmcopy:css',
'npmcopy:license',
'copy:build',
- 'sass:build'
+ 'sass:build',
+ 'template'
]);
grunt.registerTask('dev-minify', [
@@ -310,6 +325,7 @@ module.exports = function(grunt) {
'sass:dist',
'uglify:build',
'cssmin:build',
+ 'template',
'configureProxies:server',
'connect:server',
'watch'
@@ -323,6 +339,7 @@ module.exports = function(grunt) {
'copy:build',
'sass:build',
'uglify:build',
- 'cssmin:build'
+ 'cssmin:build',
+ 'template'
]);
};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/atlas/blob/3440240e/dashboardv2/package.json
----------------------------------------------------------------------
diff --git a/dashboardv2/package.json b/dashboardv2/package.json
index 6068c79..1cb1384 100644
--- a/dashboardv2/package.json
+++ b/dashboardv2/package.json
@@ -70,6 +70,7 @@
"grunt-npmcopy": "^0.1.0",
"grunt-sass": "^1.1.0",
"grunt-shell": "^1.1.1",
+ "grunt-template": "^1.0.0",
"load-grunt-tasks": "^3.1.0",
"proxit": "~0.6.4"
}
http://git-wip-us.apache.org/repos/asf/atlas/blob/3440240e/dashboardv2/public/index.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/index.html b/dashboardv2/public/index.html
deleted file mode 100644
index f572049..0000000
--- a/dashboardv2/public/index.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!doctype html>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
-<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
-<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
-<!--[if gt IE 7]>
- <script src="js/external_lib/es5-shim.min.js"></script>
- <script src="js/external_lib/respond.min.js"></script>
-<![endif]-->
-<!--[if gt IE 8]><!-->
-<html class="no-js">
-<!--<![endif]-->
-
-<head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8; Cache-Control: no-cache" />
- <title>Atlas</title>
- <meta name="description" content="">
- <meta name="viewport" content="width=device-width">
- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
- <link rel="icon" href="favicon.ico" type="image/x-icon">
- <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
- <link rel="stylesheet" type="text/css" href="css/animate.min.css" />
- <link rel="stylesheet" href="js/libs/backgrid/css/backgrid.css">
- <link rel="stylesheet" href="js/libs/backgrid-filter/css/backgrid-filter.min.css">
- <link rel="stylesheet" href="js/libs/backgrid-paginator/css/backgrid-paginator.css">
- <link rel="stylesheet" href="js/libs/backgrid-orderable-columns/css/backgrid-orderable-columns.css">
- <link rel="stylesheet" href="js/libs/backgrid-sizeable-columns/css/backgrid-sizeable-columns.css">
- <link rel="stylesheet" href="js/libs/backgrid-columnmanager/css/Backgrid.ColumnManager.css">
- <link rel="stylesheet" href="js/libs/select2/css/select2.min.css">
- <link rel="stylesheet" href="js/libs/bootstrap/css/bootstrap.min.css">
- <link rel="stylesheet" href="js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.min.css">
- <link rel="stylesheet" href="css/googlefonts.css" type='text/css'>
- <link rel="stylesheet" type="text/css" href="js/external_lib/jquery-ui/jquery-ui.min.css">
- <link href="css/bootstrap-sidebar.css" rel="stylesheet">
- <link href="js/libs/font-awesome/css/font-awesome.min.css" rel="stylesheet">
- <link href="js/external_lib/pnotify/pnotify.custom.min.css" rel="stylesheet">
- <link href="js/libs/jQueryQueryBuilder/css/query-builder.default.min.css" rel="stylesheet">
- <link href="js/libs/bootstrap-daterangepicker/css/daterangepicker.css" rel="stylesheet">
- <link rel="stylesheet" href="js/libs/nvd3/css/nv.d3.min.css">
- <link href="css/style.css" rel="stylesheet">
-</head>
-
-<body>
- <div id="wrapper">
- <div id="sidebar-wrapper" class="sidebar-wrapper">
- <div id="sideNav-wrapper"></div>
- </div>
- <div id="page-content-wrapper" class="page-content-wrapper">
- <header id="new-header" class="clearfix"></header>
- <div id="new-page-wrapper">
- <div>
- <img class="initialLoading" src="img/ring.gif">
- </div>
- </div>
- </div>
- </div>
- <!-- build:js scripts/main.js -->
- <script data-main="js/main" src="js/libs/requirejs/require.js"></script>
- <!-- endbuild -->
-</body>
-
-</html>
http://git-wip-us.apache.org/repos/asf/atlas/blob/3440240e/dashboardv2/public/index.html.tpl
----------------------------------------------------------------------
diff --git a/dashboardv2/public/index.html.tpl b/dashboardv2/public/index.html.tpl
new file mode 100644
index 0000000..f13f34a
--- /dev/null
+++ b/dashboardv2/public/index.html.tpl
@@ -0,0 +1,84 @@
+<!doctype html>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 7]>
+ <script src="js/external_lib/es5-shim.min.js?bust=<%- bust %>"></script>
+ <script src="js/external_lib/respond.min.js?bust=<%- bust %>"></script>
+<![endif]-->
+<!--[if gt IE 8]><!-->
+<html class="no-js">
+<!--<![endif]-->
+
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8;" />
+ <title>Atlas</title>
+ <meta name="description" content="">
+ <meta name="viewport" content="width=device-width">
+ <link rel="shortcut icon" href="favicon.ico?bust=<%- bust %>" type="image/x-icon">
+ <link rel="icon" href="favicon.ico?bust=<%- bust %>" type="image/x-icon">
+ <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
+ <link rel="stylesheet" type="text/css" href="css/animate.min.css?bust=<%- bust %>" />
+ <link rel="stylesheet" href="js/libs/backgrid/css/backgrid.css?bust=<%- bust %>">
+ <link rel="stylesheet" href="js/libs/backgrid-filter/css/backgrid-filter.min.css?bust=<%- bust %>">
+ <link rel="stylesheet" href="js/libs/backgrid-paginator/css/backgrid-paginator.css?bust=<%- bust %>">
+ <link rel="stylesheet" href="js/libs/backgrid-orderable-columns/css/backgrid-orderable-columns.css?bust=<%- bust %>">
+ <link rel="stylesheet" href="js/libs/backgrid-sizeable-columns/css/backgrid-sizeable-columns.css?bust=<%- bust %>">
+ <link rel="stylesheet" href="js/libs/backgrid-columnmanager/css/Backgrid.ColumnManager.css?bust=<%- bust %>">
+ <link rel="stylesheet" href="js/libs/select2/css/select2.min.css?bust=<%- bust %>">
+ <link rel="stylesheet" href="js/libs/bootstrap/css/bootstrap.min.css?bust=<%- bust %>">
+ <link rel="stylesheet" href="js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.min.css?bust=<%- bust %>">
+ <link rel="stylesheet" href="css/googlefonts.css?bust=<%- bust %>" type='text/css'>
+ <link rel="stylesheet" type="text/css" href="js/external_lib/jquery-ui/jquery-ui.min.css?bust=<%- bust %>">
+ <link href="css/bootstrap-sidebar.css?bust=<%- bust %>" rel="stylesheet">
+ <link href="js/libs/font-awesome/css/font-awesome.min.css?bust=<%- bust %>" rel="stylesheet">
+ <link href="js/external_lib/pnotify/pnotify.custom.min.css?bust=<%- bust %>" rel="stylesheet">
+ <link href="js/libs/jQueryQueryBuilder/css/query-builder.default.min.css?bust=<%- bust %>" rel="stylesheet">
+ <link href="js/libs/bootstrap-daterangepicker/css/daterangepicker.css?bust=<%- bust %>" rel="stylesheet">
+ <link rel="stylesheet" href="js/libs/nvd3/css/nv.d3.min.css?bust=<%- bust %>">
+ <link href="css/style.css?bust=<%- bust %>" rel="stylesheet">
+</head>
+
+<body>
+ <div id="wrapper">
+ <div id="sidebar-wrapper" class="sidebar-wrapper">
+ <div id="sideNav-wrapper"></div>
+ </div>
+ <div id="page-content-wrapper" class="page-content-wrapper">
+ <header id="new-header" class="clearfix"></header>
+ <div id="new-page-wrapper">
+ <div>
+ <img class="initialLoading" src="img/ring.gif">
+ </div>
+ </div>
+ </div>
+ </div>
+ <!-- build:js scripts/main.js -->
+ <script data-main="js/main.js?bust=<%- bust %>" src="js/libs/requirejs/require.js?bust=<%- bust %>"></script>
+ <!-- endbuild -->
+ <script type="text/javascript">
+ var getBustValue = function() {
+ return '<%- bust %>'
+ }
+ </script>
+</body>
+
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/atlas/blob/3440240e/dashboardv2/public/js/main.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/main.js b/dashboardv2/public/js/main.js
index 63e9abc..aae231c 100644
--- a/dashboardv2/public/js/main.js
+++ b/dashboardv2/public/js/main.js
@@ -27,6 +27,7 @@ require.config({
'templateExtension': 'html', // Set the extension automatically appended to templates
'compileOptions': {} // options object which is passed to Handlebars compiler
},
+ 'urlArgs': "bust=" + getBustValue(),
/**
* Requested as soon as the loader has processed the configuration. It does
* not block any other require() calls from starting their requests for