Embed bootstrap, jquery and other external dependencies to allow cAdvisor to function without a connection to the Internet per issue #304.

This commit is contained in:
Craig Wickesser 2014-11-13 18:07:16 -05:00
parent a4e25f056b
commit b4e1dbb4f9
9 changed files with 1546 additions and 6 deletions

View File

@ -19,17 +19,17 @@ const containersHtmlTemplate = `
<head> <head>
<title>cAdvisor - {{.DisplayName}}</title> <title>cAdvisor - {{.DisplayName}}</title>
<!-- Latest compiled and minified CSS --> <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> <link rel="stylesheet" href="/static/bootstrap.min.css">
<!-- Optional theme --> <!-- Optional theme -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css"> <link rel="stylesheet" href="/static/bootstrap-theme.min.css">
<link rel="stylesheet" href="/static/containers.css"> <link rel="stylesheet" href="/static/containers.css">
<!-- Latest compiled and minified JavaScript --> <!-- Latest compiled and minified JavaScript -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="/static/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> <script src="/static/bootstrap.min.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript" src="/static/google-jsapi.js"></script>
<script type="text/javascript" src="/static/containers.js"></script> <script type="text/javascript" src="/static/containers.js"></script>
</head> </head>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -27,6 +27,11 @@ const StaticResource = "/static/"
var staticFiles = map[string]string{ var staticFiles = map[string]string{
"containers.css": containersCss, "containers.css": containersCss,
"containers.js": containersJs, "containers.js": containersJs,
"bootstrap.min.css": bootstrapCss,
"bootstrap-theme.min.css": bootstrapThemeCss,
"jquery.min.js": jqueryJs,
"bootstrap.min.js": bootstrapJs,
"google-jsapi.js": googleJsapiJs,
} }
func HandleRequest(w http.ResponseWriter, u *url.URL) error { func HandleRequest(w http.ResponseWriter, u *url.URL) error {