Update makefile/resources path
This commit is contained in:
parent
9dc23deed5
commit
d00fb7e9ca
21
Makefile
21
Makefile
@ -5,7 +5,7 @@
|
||||
|
||||
# File-system location (directory) of static media.
|
||||
# See HTURI for the web-visible component.
|
||||
HTDOCS = /var/www/htdocs
|
||||
HTDOCS = /usr/local/www/bouquins/
|
||||
|
||||
# URL location (path) of static media.
|
||||
# See HTDOCS.
|
||||
@ -13,11 +13,11 @@ HTURI =
|
||||
|
||||
# File-system location (directory) of CGI script.
|
||||
# See CGIURI.
|
||||
CGIBIN = /var/www/cgi-bin
|
||||
CGIBIN = /usr/local/www/bouquins/cgi-bin
|
||||
|
||||
# File-system location of database.
|
||||
# See RDDIR.
|
||||
DATADIR = /var/www/data
|
||||
DATADIR = /usr/local/www/data
|
||||
|
||||
# Web-server relative location of system log file.
|
||||
# This will have all logging messages by the system.
|
||||
@ -59,8 +59,13 @@ sinclude GNUmakefile.local
|
||||
|
||||
DATABASE = metadata.db
|
||||
OBJS = db.o json.o main.o
|
||||
|
||||
HTMLS = index.html
|
||||
JSMINS = index.min.js
|
||||
EXTJS = externals/vue.min.js
|
||||
CSS = externals/bootstrap.min.css
|
||||
FONTS = externals/fonts/*
|
||||
|
||||
CFLAGS += -g -W -Wall -O2 $(SECURE)
|
||||
CFLAGS += -DLOGFILE=\"$(LOGFILE)\"
|
||||
CFLAGS += -DDATADIR=\"$(RDDIR)\"
|
||||
@ -72,8 +77,11 @@ all: $(TARGET) $(HTMLS) $(JSMINS)
|
||||
api: swagger.json
|
||||
|
||||
installwww: all
|
||||
mkdir -p $(HTDOCS)
|
||||
install -m 0444 $(HTMLS) $(JSMINS) $(HTDOCS)
|
||||
mkdir -p $(HTDOCS) $(HTDOCS)/css $(HTDOCS)/fonts $(HTDOCS)/js
|
||||
install -m 0444 $(HTMLS) $(HTDOCS)
|
||||
install -m 0444 $(JSMINS) $(EXTJS) $(HTDOCS)/js
|
||||
install -m 0444 $(CSS) $(HTDOCS)/css
|
||||
install -m 0444 $(FONTS) $(HTDOCS)/fonts
|
||||
|
||||
installapi: api
|
||||
mkdir -p $(APIDOCS)
|
||||
@ -82,6 +90,7 @@ installapi: api
|
||||
updatecgi: all
|
||||
mkdir -p $(CGIBIN)
|
||||
install -m 0555 $(TARGET) $(CGIBIN)/$(CGINAME)
|
||||
install -m 0555 $(OBJS) $(CGIBIN)/
|
||||
|
||||
installcgi: updatecgi
|
||||
mkdir -p $(DATADIR)
|
||||
@ -97,7 +106,7 @@ clean:
|
||||
-e "s!@CGIURI@!$(CGIURI)!g" $< >$@
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(CC) $(STATIC) -o $@ $(OBJS) ksql.o $(LDFLAGS) -lkcgi -lkcgijson -lz -lsqlite3 -pthread
|
||||
$(CC) $(STATIC) -o $@ $(OBJS) externals/ksql.o $(LDFLAGS) -lkcgi -lkcgijson -lz -lsqlite3 -pthread
|
||||
|
||||
$(OBJS): extern.h
|
||||
|
||||
|
35
index.html
35
index.html
@ -4,43 +4,42 @@
|
||||
<title>Bouquins</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="bootstrap.min.css">
|
||||
<link rel="preload" href="cgi-bin/bouquins/books">
|
||||
<link rel="preload" href="index.js" as="script">
|
||||
<link rel="preload" href="vue.min.js" as="script">
|
||||
<link rel="prefetch" href="cgi-bin/bouquins/books">
|
||||
<link rel="prefetch" href="index.js">
|
||||
<link rel="prefetch" href="vue.min.js">
|
||||
<link rel="stylesheet" href="css/bootstrap.min.css">
|
||||
<link rel="preload" href="js/index.min.js" as="script">
|
||||
<link rel="preload" href="js/vue.min.js" as="script">
|
||||
<link rel="prefetch" href="js/index.min.js">
|
||||
<link rel="prefetch" href="js/vue.min.js">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container" id="app">
|
||||
<div class="jumbotron">
|
||||
<h1>Bouquins</h1>
|
||||
<p>Cette bibliothèque contient actuellement <strong>{{ booksCount }}</strong> livres et BD en format papier ou électronique.</p>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<button class="btn btn-primary" type="button" v-on:click="loadBooks">Livres</button>
|
||||
</div>
|
||||
<div class="table-responsive" v-if="books.length > 0">
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>Titre</th>
|
||||
<th>Serie</th>
|
||||
<th>Auteur(s)</th>
|
||||
<th>Serie</th>
|
||||
</tr>
|
||||
<tr v-for="book in books">
|
||||
<td>{{ book.title }}</td>
|
||||
<td>
|
||||
{{ book.series ? book.series.name : '' }}
|
||||
<span class="badge">{{ book.series ? book.series.idx : '' }}</span>
|
||||
</td>
|
||||
<td><span class="glyphicon glyphicon-book"></span>{{ book.title }}</td>
|
||||
<td>
|
||||
<template v-for="author in book.authors">
|
||||
{{ author.name }}
|
||||
<span class="glyphicon glyphicon-user"></span>{{ author.name }}
|
||||
</template>
|
||||
</td>
|
||||
<td>
|
||||
<span class="glyphicon glyphicon-list"></span>{{ book.series ? book.series.name : '' }}
|
||||
<span class="badge">{{ book.series ? book.series.idx : '' }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<script src="vue.min.js"></script>
|
||||
<script src="index.js"></script>
|
||||
<script src="js/vue.min.js"></script>
|
||||
<script src="js/index.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
13
index.js
13
index.js
@ -32,16 +32,25 @@
|
||||
console.log('ERROR ' + code + ': ' + resp);
|
||||
}
|
||||
|
||||
function indexSuccess(resp) {
|
||||
function booksSuccess(resp) {
|
||||
app.books = resp;
|
||||
app.booksCount = app.books.length;
|
||||
}
|
||||
|
||||
function indexSuccess(resp) {
|
||||
app.booksCount = 9999; //TODO
|
||||
}
|
||||
|
||||
function loadIndex() {
|
||||
// TODO load books count
|
||||
sendQuery('cgi-bin/bouquins/books', stdError, indexSuccess);
|
||||
}
|
||||
|
||||
function loadBooks() {
|
||||
sendQuery('cgi-bin/bouquins/books', stdError, booksSuccess);
|
||||
}
|
||||
|
||||
root.loadIndex = loadIndex;
|
||||
root.loadBooks = loadBooks;
|
||||
})(this);
|
||||
|
||||
var app = new Vue({
|
||||
|
8
vue.min.js
vendored
8
vue.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user