From 7ae68f079ddfb74c9a1b17c4f30dfe4c258d4a9f Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 20 Dec 2019 17:47:04 +0100 Subject: Viewer project foundations --- viewer/vue.config.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 viewer/vue.config.js (limited to 'viewer/vue.config.js') diff --git a/viewer/vue.config.js b/viewer/vue.config.js new file mode 100644 index 0000000..3f94880 --- /dev/null +++ b/viewer/vue.config.js @@ -0,0 +1,12 @@ +module.exports = { + pluginOptions: { + i18n: { + locale: "en", + fallbackLocale: "en", + localeDir: "locales", + enableInSFC: false, + }, + }, + + productionSourceMap: false, +}; -- cgit v1.2.3 From 9e4fdd6f38853d8a4a959901ab7902569de75484 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 21 Dec 2019 08:08:54 +0100 Subject: viewer: Implemented the "example" project in devServer Display loader and error messages (not translated yet) Created a "GalleryStore" to fetch the JSon data from the gallery (currently from example) --- viewer/vue.config.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'viewer/vue.config.js') diff --git a/viewer/vue.config.js b/viewer/vue.config.js index 3f94880..3bb56e5 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -7,6 +7,17 @@ module.exports = { enableInSFC: false, }, }, - productionSourceMap: false, + devServer: { + port: 8085, + serveIndex: true, + before: (app, server, compiler) => { + app.get("/gallery/*", (req, res) => { + const fs = require("fs"); + const fileName = req.url.replace(/^\/gallery/, "../example"); + const file = fs.readFileSync(fileName); + res.end(file); + }); + } + } }; -- cgit v1.2.3 From dd7e1ec5bb5f9d8ad5aab2c99e80146958e592a0 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sat, 21 Dec 2019 20:54:06 +0100 Subject: viewer: Fixed devServer for URL encoded filenames Disabled a buggy ESLint rule --- viewer/vue.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'viewer/vue.config.js') diff --git a/viewer/vue.config.js b/viewer/vue.config.js index 3bb56e5..f116619 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -15,7 +15,7 @@ module.exports = { app.get("/gallery/*", (req, res) => { const fs = require("fs"); const fileName = req.url.replace(/^\/gallery/, "../example"); - const file = fs.readFileSync(fileName); + const file = fs.readFileSync(decodeURIComponent(fileName)); res.end(file); }); } -- cgit v1.2.3 From dc251fffc2998f1cf4f8e9631928c4b92ac0d90e Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Sun, 22 Dec 2019 07:40:55 +0100 Subject: viewer: Implemented the search by tags. Pushed the special urls to ENV. --- viewer/vue.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'viewer/vue.config.js') diff --git a/viewer/vue.config.js b/viewer/vue.config.js index f116619..dbf1551 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -12,9 +12,9 @@ module.exports = { port: 8085, serveIndex: true, before: (app, server, compiler) => { - app.get("/gallery/*", (req, res) => { + app.get(`${process.env.VUE_APP_DATA_URL}/*`, (req, res) => { const fs = require("fs"); - const fileName = req.url.replace(/^\/gallery/, "../example"); + const fileName = `../${process.env.VUE_APP_EXAMPLE_PROJECT}${req.url.slice(process.env.VUE_APP_DATA_URL.length)}`; const file = fs.readFileSync(decodeURIComponent(fileName)); res.end(file); }); -- cgit v1.2.3 From c7153c8d6d3879566b49af0f7b23593d46477eb9 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Tue, 7 Jan 2020 19:46:41 +0100 Subject: viewer: relative gallery path (NOT STABLE with current compiler) compiler: commands for compilation on Windows --- viewer/vue.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'viewer/vue.config.js') diff --git a/viewer/vue.config.js b/viewer/vue.config.js index dbf1551..0f84d44 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -12,9 +12,9 @@ module.exports = { port: 8085, serveIndex: true, before: (app, server, compiler) => { - app.get(`${process.env.VUE_APP_DATA_URL}/*`, (req, res) => { + app.get(`${process.env.VUE_APP_DATA_URL}*`, (req, res) => { const fs = require("fs"); - const fileName = `../${process.env.VUE_APP_EXAMPLE_PROJECT}${req.url.slice(process.env.VUE_APP_DATA_URL.length)}`; + const fileName = `${process.env.VUE_APP_EXAMPLE_PROJECT}${req.url.slice(process.env.VUE_APP_DATA_URL.length)}`; const file = fs.readFileSync(decodeURIComponent(fileName)); res.end(file); }); -- cgit v1.2.3 From 27b51018525dbb7a6edb3073819d82245387ddd3 Mon Sep 17 00:00:00 2001 From: Zero~Informatique Date: Fri, 10 Jan 2020 22:22:22 +0100 Subject: viewer: license headers --- viewer/vue.config.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'viewer/vue.config.js') diff --git a/viewer/vue.config.js b/viewer/vue.config.js index 0f84d44..614f975 100644 --- a/viewer/vue.config.js +++ b/viewer/vue.config.js @@ -1,3 +1,22 @@ +/* ldgallery - A static generator which turns a collection of tagged +-- pictures into a searchable web gallery. +-- +-- Copyright (C) 2019-2020 Guillaume FOUET +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Affero General Public License for more details. +-- +-- You should have received a copy of the GNU Affero General Public License +-- along with this program. If not, see . +*/ + module.exports = { pluginOptions: { i18n: { -- cgit v1.2.3