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