showes mime on index
This commit is contained in:
parent
33b82336db
commit
e179fa481d
|
@ -11,7 +11,7 @@
|
||||||
<div style="display: inline-block;">
|
<div style="display: inline-block;">
|
||||||
<div class="centeredthumbs">
|
<div class="centeredthumbs">
|
||||||
{% for item in items %}
|
{% for item in items %}
|
||||||
<div class="mrhankyisteinneger"><a href="./{{ item }}"><img src="./t/{{ item }}.png" /></a></div>
|
<div class="mrhankyisteinneger"><a href="./{{ item.id }}" title="{{ item.mime }}"><img src="./t/{{ item.id }}.png" /></a></div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -267,9 +267,9 @@ http.createServer((req, res) => {
|
||||||
if(filePath == "./index.html") { // mainpage
|
if(filePath == "./index.html") { // mainpage
|
||||||
var tpl = swig.compile(templates.index);
|
var tpl = swig.compile(templates.index);
|
||||||
var data = { items: [] };
|
var data = { items: [] };
|
||||||
sql.query("select * from `f0ck`.`items` order by `id` desc", (err, rows, fields) => {
|
sql.query("select `id`,`mime` from `f0ck`.`items` order by `id` desc", (err, rows, fields) => {
|
||||||
rows.forEach((e,i,a) => {
|
rows.forEach((e,i,a) => {
|
||||||
data.items.push( e.id );
|
data.items.push({ "id": e.id, "mime": e.mime });
|
||||||
});
|
});
|
||||||
res.writeHead(200, { 'Content-Type': 'text/html' });
|
res.writeHead(200, { 'Content-Type': 'text/html' });
|
||||||
res.end(tpl(data), 'utf-8');
|
res.end(tpl(data), 'utf-8');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user