Autoremove not used pads
This commit is contained in:
parent
89c175e17b
commit
e533d18bbe
11
main.py
11
main.py
@ -4,12 +4,12 @@ from flask import Flask, render_template, request
|
|||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.debug = True
|
app.debug = True
|
||||||
|
|
||||||
sql_statement = 'SELECT "id","title" FROM "Notes";'
|
sql_statement = 'SELECT "id","title","alias","shortid","viewcount","lastchangeAt" FROM "Notes";'
|
||||||
HOST = '192.168.0.3'
|
HOST = '192.168.0.3'
|
||||||
DB = 'hackmd'
|
DB = 'hackmd'
|
||||||
USER = 'hackmd'
|
USER = 'hackmd'
|
||||||
PASSWORD = 'osHx34e4aDazGsER'
|
PASSWORD = 'osHx34e4aDazGsER'
|
||||||
|
#lastchangeAt, alias, viewcount
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def main():
|
def main():
|
||||||
@ -17,12 +17,11 @@ def main():
|
|||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
cur.execute(sql_statement)
|
cur.execute(sql_statement)
|
||||||
print("The number of parts: ", cur.rowcount)
|
print("The number of parts: ", cur.rowcount)
|
||||||
res = cur.fetchall()
|
notes = cur.fetchall()
|
||||||
print(res)
|
print(notes)
|
||||||
cur.close()
|
cur.close()
|
||||||
conn.close()
|
conn.close()
|
||||||
return render_template('index.html',
|
return render_template('index.html', notes=notes)
|
||||||
notes=res)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@ -15,9 +15,24 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% for note in notes %}
|
{% for note in notes %}
|
||||||
<div class="col-3">
|
{% if note[1] and note[2] %}
|
||||||
<p>{{note[1]}}</p>
|
<div class="col-12 col-sm-6 col-md-6 col-lg-4 col-xl-3 mb-2">
|
||||||
|
<a href="https://hackmd.wiai.de/{{note[2]}}">
|
||||||
|
<div class="card" style="width: 18rem;">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">{{note[1]}}</h5>
|
||||||
|
<h6 class="card-subtitle mb-2 text-muted">LastChanged: {{note[5]}}</h6>
|
||||||
|
<p class="card-text">ViewCount: {{note[4]}}</p>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--<h3>{{note[1]}}</h3></a>-->
|
||||||
|
<!--<p>Alias: {{note[2]}}</p>-->
|
||||||
|
<!--<p>ShortID: {{note[3]}}</p>-->
|
||||||
|
<!--<p>ViewCount: {{note[4]}}</p>-->
|
||||||
|
<!--<p>LastChanged: {{note[5]}}</p>-->
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user