mirror of
https://github.com/skiqqy/skiqqy.github.io
synced 2025-01-31 03:41:36 +00:00
Added templating
This commit is contained in:
parent
3d0bfeac13
commit
3a85b7f864
32
assets/api_templates/domain_status.html
Normal file
32
assets/api_templates/domain_status.html
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background-color:black;
|
||||||
|
color:white
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color:#DC143C
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
padding: 60px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.para {
|
||||||
|
text-align: center;
|
||||||
|
font-size:15
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type=text] {
|
||||||
|
border: 2px solid black;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class=header>{{ TITLE }}</div>
|
||||||
|
<div class=para>
|
||||||
|
{% for res in results %}
|
||||||
|
<p>{{ res }}</p>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
11
src/main.py
11
src/main.py
@ -16,16 +16,17 @@ def main():
|
|||||||
|
|
||||||
@app.route('/domain/status/<dom>', methods = ["GET"])
|
@app.route('/domain/status/<dom>', methods = ["GET"])
|
||||||
def domstatus(dom):
|
def domstatus(dom):
|
||||||
|
results = []
|
||||||
if dom == 'all':
|
if dom == 'all':
|
||||||
dom = ''
|
|
||||||
for sub in domains:
|
for sub in domains:
|
||||||
ip = os.popen('ping -c 1 -w 5 %s.%s | head -1 | cut -d \" \" -f 3' % (sub, main_domain)).read()
|
ip = os.popen('ping -c 1 -w 5 %s.%s | head -1 | cut -d \" \" -f 3' % (sub, main_domain)).read()
|
||||||
dom += sub + ':' + ip + '\n'
|
results.append("%s.%s:%s" % (sub, main_domain, ip))
|
||||||
elif dom not in domains:
|
elif dom not in domains:
|
||||||
dom = "unknown domain"
|
results = "unknown domain"
|
||||||
else:
|
else:
|
||||||
dom += ':' + str(os.popen('ping -c 1 -w 5 %s.%s | head -1 | cut -d \" \" -f 3' % (dom, main_domain)).read())
|
ip = os.popen('ping -c 1 -w 5 %s.%s | head -1 | cut -d \" \" -f 3' % (dom, main_domain)).read()
|
||||||
return dom
|
results.append("%s.%s:%s" % (dom, main_domain, ip))
|
||||||
|
return render_template('domain_status.html', results=results, TITLE=str("Results for " + dom))
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
app.template_folder = "../assets/api_templates/"
|
app.template_folder = "../assets/api_templates/"
|
||||||
|
Loading…
Reference in New Issue
Block a user