Commit 52de3010 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

monitor: move static files into a static directory (and removed external jquery)

parent 3b6e41d0
......@@ -127,8 +127,18 @@ logfile = $${directory:log}/crond.log
recipe = hexagonit.recipe.download
url = http://git.erp5.org/gitweb/slapos.git/snapshot/6f44080d0edacdeee9eed59887957c6834d09775.tar.gz
#url = https://github.com/SlapOS/staticForMonitoring/blob/8b7050faa2dd22592766e25b66b9efe0d0b216c9/static-files.tar.gz?raw=true
download-only = true
download-only = false
#md5sum = 05030ff31dc75c2b96559dedc70945f5
filename = monitor-static.tar.gz
destination = ${buildout:directory}/parts/monitor-static-files
ignore-existing = true
strip-top-level-dir = true
mode = 0644
[download-monitor-jquery]
recipe = hexagonit.recipe.download
url = http://code.jquery.com/jquery-1.10.2.min.js
download-only = true
destination = ${download-monitor-static:destination}
filename = jquery-1.10.2.min.js
mode = 0644
......@@ -87,13 +87,9 @@ frequency = */5 * * * *
command = $${make-rss:rendered}
[setup-static-files]
recipe = hexagonit.recipe.download
url = ${download-monitor-static:destination}/${download-monitor-static:filename}
filename = static
destination = $${monitor-directory:www}
ignore-existing = true
strip-top-level-dir = true
mode = 0644
recipe = plone.recipe.command
command = ln -s ${download-monitor-jquery:destination} $${monitor-directory:www}/static
update-command = $${:command}
[deploy-index]
recipe = slapos.recipe.template:jinja2
......@@ -108,7 +104,7 @@ context =
key monitor_password_script_path deploy-monitor-password-cgi:rendered
key apache_update_command :update-apache-access
raw extra_eggs_interpreter ${buildout:directory}/bin/${extra-eggs:interpreter}
raw default_page /welcome.html
raw default_page /static/welcome.html
[deploy-index-template]
recipe = hexagonit.recipe.download
......
......@@ -161,8 +161,8 @@ if not is_password_set():
elif not check_password(password):
print "<html><head>"
print """
<link rel="stylesheet" href="pure-min.css">
<link rel="stylesheet" href="/style.css">"""
<link rel="stylesheet" href="static/pure-min.css">
<link rel="stylesheet" href="static/style.css">"""
print "</head><body>"
if password is None:
print "<h1>This is the monitoring interface</h1>"
......
<html>
<head>
<title>Monitoring Interface</title>
<link rel="stylesheet" href="pure-min.css">
<link rel="stylesheet" href="/style.css">
<script src="jquery-1.10.2.min.js"></script>
<script src="script.js"></script>
<link rel="stylesheet" href="static/pure-min.css">
<link rel="stylesheet" href="static/style.css">
<script src="static/jquery-1.10.2.min.js"></script>
<script src="static/script.js"></script>
</head>
<body>
<div id="div-menu">
......
......@@ -6,9 +6,9 @@ cgitb.enable()
print "<html><head>"
print """
<script type="text/javascript" src="/jquery-1.10.2.min.js"></script>
<link rel="stylesheet" href="pure-min.css">
<link rel="stylesheet" href="/style.css">"""
<script type="text/javascript" src="static/jquery-1.10.2.min.js"></script>
<link rel="stylesheet" href="static/pure-min.css">
<link rel="stylesheet" href="static/style.css">"""
print "</head><body>"
print "<h1>This is the monitoring interface</h1>"
print "<h2>Please set your password for later access</h2>"
......@@ -24,6 +24,6 @@ print """
<div class="pure-controls">
<button id="register-button" type="submit" class="pure-button pure-button-primary" disabled>Access</button></div>
</form>
<script type="text/javascript" src="monitor-register.js"></script>
<script type="text/javascript" src="static/monitor-register.js"></script>
</body></html>
"""
......@@ -9,8 +9,8 @@ cgitb.enable()
form = cgi.FieldStorage()
print "<html><head>"
print "<link rel=\"stylesheet\" href=\"pure-min.css\">"
print "<link rel=\"stylesheet\" href=\"/style.css\">"
print "<link rel=\"stylesheet\" href=\"static/pure-min.css\">"
print "<link rel=\"stylesheet\" href=\"static/style.css\">"
print "</head><body>"
config_file = "{{ config_cfg }}"
......
......@@ -2,7 +2,7 @@
<head>
<title>Welcome to the Monitoring Interface</title>
<link rel="stylesheet" href="pure-min.css">
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Welcome to your monitoring interface</h1>
......
......@@ -12,8 +12,8 @@ status_history_length = '{{ status_history_length }}'
db = sqlite3.connect(db_path)
print """<html><head>
<link rel="stylesheet" href="pure-min.css">
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="static/pure-min.css">
<link rel="stylesheet" href="static/style.css">
</head><body>
<h1>Monitor Status History :</h1>"""
......
......@@ -20,8 +20,8 @@ if not os.path.exists(json_file) or "refresh" in form:
if not os.path.exists(json_file):
print """<html><head>
<link rel="stylesheet" href="pure-min.css">
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="static/pure-min.css">
<link rel="stylesheet" href="static/style.css">
</head><body>
<h1>Monitoring :</h1>
No status file found</p></body></html>"""
......@@ -30,8 +30,8 @@ if not os.path.exists(json_file):
result = json.load(open(json_file))
print "<html><head>"
print "<link rel=\"stylesheet\" href=\"pure-min.css\">"
print "<link rel=\"stylesheet\" href=\"/style.css\">"
print "<link rel=\"stylesheet\" href=\"static/pure-min.css\">"
print "<link rel=\"stylesheet\" href=\"static/style.css\">"
print "</head><body>"
print "<h1>Monitoring :</h1>"
print "<form action=\"/index.cgi\" method=\"post\" class=\"pure-form-aligned\">"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment