Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
083151460a | ||
|
|
c8f97ef386 | ||
|
|
c9a22a5eaf | ||
|
|
f926732070 | ||
|
|
3fbe6e9d9b | ||
|
|
225230381f | ||
|
|
b58d3a1b8b | ||
|
|
ffedce4351 | ||
|
|
a4fdb67913 | ||
|
|
6ba46421b9 | ||
|
|
d201961046 | ||
|
|
614a7f9da7 |
@@ -14,6 +14,7 @@ module.exports = {
|
|||||||
entry: [`${clientDir}/main.js`],
|
entry: [`${clientDir}/main.js`],
|
||||||
output: {
|
output: {
|
||||||
publicPath: '/app/',
|
publicPath: '/app/',
|
||||||
|
clean: true
|
||||||
},
|
},
|
||||||
|
|
||||||
module: {
|
module: {
|
||||||
|
|||||||
@@ -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}/`}]})
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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',
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>`
|
||||||
|
|||||||
@@ -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',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -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}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user