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