Compare commits

...

12 Commits

Author SHA1 Message Date
Book Pauk
083151460a Merge branch 'release/0.12.2-3' 2022-10-05 17:59:10 +07:00
Book Pauk
c8f97ef386 Решение проблемы 'unable to verify the first certificate' для некоторых сайтов с валидным сертификатом 2022-10-05 17:58:39 +07:00
Book Pauk
c9a22a5eaf Merge tag '0.12.2-2' into develop
0.12.2-2
2022-10-05 15:16:29 +07:00
Book Pauk
f926732070 Merge branch 'release/0.12.2-2' 2022-10-05 15:16:24 +07:00
Book Pauk
3fbe6e9d9b Улучшение обработки ошибок 2022-10-05 15:15:26 +07:00
Book Pauk
225230381f Добавлена чистка output перед сборкой 2022-10-01 13:39:02 +07:00
Book Pauk
b58d3a1b8b Поправки параметров CopyWebpackPlugin 2022-09-20 20:21:41 +07:00
Book Pauk
ffedce4351 Поправки обработки ошибок сервера 2022-09-12 15:23:22 +07:00
Book Pauk
a4fdb67913 Merge tag '0.12.2-1' into develop
0.12.2-1
2022-09-04 21:44:06 +07:00
Book Pauk
6ba46421b9 Merge branch 'release/0.12.2-1' 2022-09-04 21:43:54 +07:00
Book Pauk
d201961046 Поправка положения notify-сообщений 2022-09-04 21:42:50 +07:00
Book Pauk
614a7f9da7 Merge tag '0.12.2' into develop
0.12.2
2022-09-04 21:22:39 +07:00
7 changed files with 34 additions and 14 deletions

View File

@@ -14,6 +14,7 @@ module.exports = {
entry: [`${clientDir}/main.js`], entry: [`${clientDir}/main.js`],
output: { output: {
publicPath: '/app/', publicPath: '/app/',
clean: true
}, },
module: { module: {

View File

@@ -16,7 +16,8 @@ module.exports = merge(baseWpConfig, {
devtool: 'inline-source-map', devtool: 'inline-source-map',
output: { output: {
path: `${publicDir}/app`, path: `${publicDir}/app`,
filename: 'bundle.js' filename: 'bundle.js',
clean: true
}, },
module: { module: {
@@ -38,6 +39,6 @@ module.exports = merge(baseWpConfig, {
template: `${clientDir}/index.html.template`, template: `${clientDir}/index.html.template`,
filename: `${publicDir}/index.html` filename: `${publicDir}/index.html`
}), }),
new CopyWebpackPlugin({patterns: [{from: `${clientDir}/assets/*`, to: `${publicDir}/`}]}) new CopyWebpackPlugin({patterns: [{context: `${clientDir}/assets`, from: `${clientDir}/assets/*`, to: `${publicDir}/`}]})
] ]
}); });

View File

@@ -18,7 +18,8 @@ module.exports = merge(baseWpConfig, {
mode: 'production', mode: 'production',
output: { output: {
path: `${publicDir}/app_new`, path: `${publicDir}/app_new`,
filename: 'bundle.[contenthash].js' filename: 'bundle.[contenthash].js',
clean: true
}, },
module: { module: {
rules: [ rules: [
@@ -54,7 +55,7 @@ module.exports = merge(baseWpConfig, {
filename: `${publicDir}/index.html` filename: `${publicDir}/index.html`
}), }),
new CopyWebpackPlugin({patterns: new CopyWebpackPlugin({patterns:
[{from: `${clientDir}/assets/*`, to: `${publicDir}/`, context: `${clientDir}/assets` }] [{context: `${clientDir}/assets`, from: `${clientDir}/assets/*`, to: `${publicDir}/` }]
}), }),
new GenerateSW({ new GenerateSW({
cacheId: 'liberama', cacheId: 'liberama',

View File

@@ -271,6 +271,10 @@ body, html, #app {
font: normal 12pt ReaderDefault; font: normal 12pt ReaderDefault;
} }
.notify-margin {
margin-top: 55px;
}
.dborder { .dborder {
border: 2px solid magenta !important; border: 2px solid magenta !important;
} }

View File

@@ -27,9 +27,10 @@ class Notify {
icon, icon,
actions: [{icon: 'la la-times notify-button-icon', color: 'black'}], actions: [{icon: 'la la-times notify-button-icon', color: 'black'}],
html: true, html: true,
classes: 'notify-margin',
message: message:
`<div style="max-width: 350px;"> `<div style="max-width: 350px">
${caption} ${caption}
<div style="color: ${messageColor}; overflow-wrap: break-word; word-wrap: break-word;">${message}</div> <div style="color: ${messageColor}; overflow-wrap: break-word; word-wrap: break-word;">${message}</div>
</div>` </div>`

View File

@@ -1,3 +1,4 @@
const https = require('https');
const axios = require('axios'); const axios = require('axios');
const utils = require('./utils'); const utils = require('./utils');
@@ -16,6 +17,9 @@ class FileDownloader {
'user-agent': userAgent, 'user-agent': userAgent,
timeout: 300*1000, timeout: 300*1000,
}, },
httpsAgent: new https.Agent({
rejectUnauthorized: false // решение проблемы 'unable to verify the first certificate' для некоторых сайтов с валидным сертификатом
}),
responseType: 'stream', responseType: 'stream',
}; };

View File

@@ -83,6 +83,7 @@ class ReaderWorker {
let convertFilename = ''; let convertFilename = '';
const overLoadMes = 'Слишком большая очередь загрузки. Пожалуйста, попробуйте позже.'; const overLoadMes = 'Слишком большая очередь загрузки. Пожалуйста, попробуйте позже.';
const fileNotFoundMes = 'Файл не найден';
const overLoadErr = new Error(overLoadMes); const overLoadErr = new Error(overLoadMes);
let q = null; let q = null;
@@ -184,26 +185,33 @@ class ReaderWorker {
})(); })();
} catch (e) { } catch (e) {
log(LM_ERR, `url: ${url}, downloadedFilename: ${downloadedFilename}`);
log(LM_ERR, e.stack); log(LM_ERR, e.stack);
let mes = e.message.split('|FORLOG|'); let mes = e.message.split('|FORLOG|');
if (mes[1]) if (mes[1])
log(LM_ERR, mes[0] + mes[1]); log(LM_ERR, mes[0] + mes[1]);
log(LM_ERR, `downloadedFilename: ${downloadedFilename}`);
mes = mes[0]; mes = mes[0];
if (mes == 'abort') if (mes == 'abort')
mes = overLoadMes; mes = overLoadMes;
if (mes.indexOf('ENOTDIR') >= 0)
mes = fileNotFoundMes;
wState.set({state: 'error', error: mes}); wState.set({state: 'error', error: mes});
} finally { } finally {
//clean //clean
if (q) try {
q.ret(); if (q)
if (decompDir) q.ret();
await fs.remove(decompDir); if (decompDir)
if (downloadedFilename && !isUploaded) await fs.remove(decompDir);
await fs.remove(downloadedFilename); if (downloadedFilename && !isUploaded)
if (convertFilename) await fs.remove(downloadedFilename);
await fs.remove(convertFilename); if (convertFilename)
await fs.remove(convertFilename);
} catch (e) {
log(LM_ERR, `Remove error: ${e.stack}`);
}
} }
} }