m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/pl/edu/mimuw/cloudatlas/client/templates/queryForm.html4
-rw-r--r--src/main/resources/pl/edu/mimuw/cloudatlas/fetcher/data_fetcher.py11
2 files changed, 10 insertions, 5 deletions
diff --git a/src/main/resources/pl/edu/mimuw/cloudatlas/client/templates/queryForm.html b/src/main/resources/pl/edu/mimuw/cloudatlas/client/templates/queryForm.html
index 08b4e89..f31ef6b 100644
--- a/src/main/resources/pl/edu/mimuw/cloudatlas/client/templates/queryForm.html
+++ b/src/main/resources/pl/edu/mimuw/cloudatlas/client/templates/queryForm.html
@@ -12,7 +12,7 @@
<div th:replace="fragments/navbar :: navbar"></div>
<div id="installQueryForm">
<h2 class="display-7">Install query</h2>
- <form action="#" th:action="@{/query}" th:object="${queryObject}" method="post">
+ <form action="#" th:action="@{/installQuery}" th:object="${queryObject}" method="post">
<div class="form-group">
<label for="InstallQueryName1">Enter query name</label>
<input type="text" class="form-control" id="InstallQueryName1" rows="3" th:field="*{name}"/>
@@ -27,7 +27,7 @@
<div id="uninstallQueryForm">
<h2 class="display-7">Uninstall query</h2>
- <form action="#" th:action="@{/query}" th:object="${queryObject}" method="post">
+ <form action="#" th:action="@{/uninstallQuery}" th:object="${queryObject}" method="post">
<div class="form-group">
<label for="UninstallQueryName1">Enter query name</label>
<input type="text" class="form-control" id="UninstallQueryName1" rows="3" th:field="*{name}"/>
diff --git a/src/main/resources/pl/edu/mimuw/cloudatlas/fetcher/data_fetcher.py b/src/main/resources/pl/edu/mimuw/cloudatlas/fetcher/data_fetcher.py
index 67b2eb4..d53ce05 100644
--- a/src/main/resources/pl/edu/mimuw/cloudatlas/fetcher/data_fetcher.py
+++ b/src/main/resources/pl/edu/mimuw/cloudatlas/fetcher/data_fetcher.py
@@ -64,9 +64,14 @@ def get_data():
kernel_ver = platform.release()
logged_users = len(psutil.users())
- external_ip = urllib.request.urlopen('https://ident.me').read().decode('utf8')
- hostname = socket.gethostbyaddr(external_ip)
- dns_names = ([hostname[0]] + hostname[1])[:3]
+ try:
+ external_ip = urllib.request.urlopen('https://ident.me').read().decode('utf8')
+ hostname = socket.gethostbyaddr(external_ip)
+ dns_names = ([hostname[0]] + hostname[1])[:3]
+ except Exception as e:
+ pass
+ else:
+ dns_names = []
sys.stdout.write("[{},{},{},{},{},{},{},{},{},{},{},{}]\n".format(
avg_load,