Skip to content

Commit 5b200a0

Browse files
committed
Fix running head from server
1 parent 3aa3b47 commit 5b200a0

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

Gruntfile.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ module.exports = function(grunt) {
2929
},
3030

3131
copy: {
32+
site_index: {
33+
src: 'index.html',
34+
dest: '_site/index.html',
35+
options: {
36+
process: function( src ) {
37+
return src.replace(/_site\//g, "");
38+
}
39+
}
40+
},
3241
base: {
3342
expand: true,
3443
cwd: 'src/app/base/',

index.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
3+
<html>
4+
<head>
5+
<meta charset="UTF-8">
6+
<title>elasticsearch-head</title>
7+
<link rel="stylesheet" href="_site/base/reset.css">
8+
<link rel="stylesheet" href="_site/vendor.css">
9+
<link rel="stylesheet" href="_site/app.css">
10+
<script src="_site/i18n.js" data-baseDir="_site/lang" data-langs="en,fr,pt,zh"></script>
11+
<script src="_site/vendor.js"></script>
12+
<script src="_site/app.js"></script>
13+
<script>
14+
window.onload = function() {
15+
if(location.href.contains("/_plugin/")) {
16+
var base_uri = location.href.replace(/_plugin\/.*/, '');
17+
}
18+
var args = location.search.substring(1).split("&").reduce(function(r, p) {
19+
r[decodeURIComponent(p.split("=")[0])] = decodeURIComponent(p.split("=")[1]); return r;
20+
}, {});
21+
new app.App("body", {
22+
id: "es",
23+
base_uri: args["base_uri"] || base_uri,
24+
auth_user : args["auth_user"] || "",
25+
auth_password : args["auth_password"],
26+
dashboard: args["dashboard"]
27+
});
28+
};
29+
</script>
30+
<link rel="icon" href="base/favicon.png" type="image/png">
31+
</head>
32+
<body></body>
33+
</html>

0 commit comments

Comments
 (0)