mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
Merge pull request #18397 from overleaf/em-revert-download-all-link
Revert "Merge pull request #18190 from overleaf/ar-add-download-all-l… GitOrigin-RevId: 681eb2734636d76558e682dc85083bfcaa6b7d2d
This commit is contained in:
committed by
Copybot
parent
d7f0c66d86
commit
3342d672c2
@@ -12,17 +12,6 @@ function timeSinceLastSuccessfulCompile() {
|
|||||||
return Date.now() - lastSuccessfulCompileTimestamp
|
return Date.now() - lastSuccessfulCompileTimestamp
|
||||||
}
|
}
|
||||||
|
|
||||||
function addUrlToOutputFile(outputFile, projectId, userId) {
|
|
||||||
return {
|
|
||||||
url:
|
|
||||||
`${Settings.apis.clsi.url}/project/${projectId}` +
|
|
||||||
(userId != null ? `/user/${userId}` : '') +
|
|
||||||
(outputFile.build != null ? `/build/${outputFile.build}` : '') +
|
|
||||||
`/output/${outputFile.path}`,
|
|
||||||
...outputFile,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function compile(req, res, next) {
|
function compile(req, res, next) {
|
||||||
const timer = new Metrics.Timer('compile-request')
|
const timer = new Metrics.Timer('compile-request')
|
||||||
RequestParser.parse(req.body, function (error, request) {
|
RequestParser.parse(req.body, function (error, request) {
|
||||||
@@ -41,7 +30,7 @@ function compile(req, res, next) {
|
|||||||
return next(error)
|
return next(error)
|
||||||
}
|
}
|
||||||
CompileManager.doCompileWithLock(request, (error, result) => {
|
CompileManager.doCompileWithLock(request, (error, result) => {
|
||||||
let { buildId, outputFiles, stats, timings } = result || {}
|
let { outputFiles, stats, timings } = result || {}
|
||||||
let code, status
|
let code, status
|
||||||
if (outputFiles == null) {
|
if (outputFiles == null) {
|
||||||
outputFiles = []
|
outputFiles = []
|
||||||
@@ -109,7 +98,6 @@ function compile(req, res, next) {
|
|||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
outputFiles = error.outputFiles || []
|
outputFiles = error.outputFiles || []
|
||||||
buildId = error.buildId
|
|
||||||
}
|
}
|
||||||
|
|
||||||
timer.done()
|
timer.done()
|
||||||
@@ -120,28 +108,14 @@ function compile(req, res, next) {
|
|||||||
stats,
|
stats,
|
||||||
timings,
|
timings,
|
||||||
outputUrlPrefix: Settings.apis.clsi.outputUrlPrefix,
|
outputUrlPrefix: Settings.apis.clsi.outputUrlPrefix,
|
||||||
outputFiles:
|
outputFiles: outputFiles.map(file => ({
|
||||||
outputFiles.length === 0
|
url:
|
||||||
? []
|
`${Settings.apis.clsi.url}/project/${request.project_id}` +
|
||||||
: outputFiles
|
(request.user_id != null ? `/user/${request.user_id}` : '') +
|
||||||
.map(file =>
|
(file.build != null ? `/build/${file.build}` : '') +
|
||||||
addUrlToOutputFile(
|
`/output/${file.path}`,
|
||||||
file,
|
...file,
|
||||||
request.project_id,
|
})),
|
||||||
request.user_id
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.concat(
|
|
||||||
addUrlToOutputFile(
|
|
||||||
{
|
|
||||||
build: buildId,
|
|
||||||
path: 'output.zip',
|
|
||||||
type: 'zip',
|
|
||||||
},
|
|
||||||
request.project_id,
|
|
||||||
request.user_id
|
|
||||||
)
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ async function doCompile(request) {
|
|||||||
Metrics.inc('compiles-timeout', 1, request.metricsOpts)
|
Metrics.inc('compiles-timeout', 1, request.metricsOpts)
|
||||||
}
|
}
|
||||||
|
|
||||||
const { outputFiles, allEntries, buildId } = await _saveOutputFiles({
|
const { outputFiles, allEntries } = await _saveOutputFiles({
|
||||||
request,
|
request,
|
||||||
compileDir,
|
compileDir,
|
||||||
resourceList,
|
resourceList,
|
||||||
@@ -216,7 +216,7 @@ async function doCompile(request) {
|
|||||||
timings,
|
timings,
|
||||||
})
|
})
|
||||||
error.outputFiles = outputFiles // return output files so user can check logs
|
error.outputFiles = outputFiles // return output files so user can check logs
|
||||||
error.buildId = buildId
|
|
||||||
// Clear project if this compile was abruptly terminated
|
// Clear project if this compile was abruptly terminated
|
||||||
if (error.terminated || error.timedout) {
|
if (error.terminated || error.timedout) {
|
||||||
await clearProjectWithListing(
|
await clearProjectWithListing(
|
||||||
@@ -280,7 +280,7 @@ async function doCompile(request) {
|
|||||||
// Emit compile time.
|
// Emit compile time.
|
||||||
timings.compile = ts
|
timings.compile = ts
|
||||||
|
|
||||||
const { outputFiles, buildId } = await _saveOutputFiles({
|
const { outputFiles } = await _saveOutputFiles({
|
||||||
request,
|
request,
|
||||||
compileDir,
|
compileDir,
|
||||||
resourceList,
|
resourceList,
|
||||||
@@ -296,7 +296,7 @@ async function doCompile(request) {
|
|||||||
emitPdfStats(stats, timings, request)
|
emitPdfStats(stats, timings, request)
|
||||||
}
|
}
|
||||||
|
|
||||||
return { outputFiles, stats, timings, buildId }
|
return { outputFiles, stats, timings }
|
||||||
}
|
}
|
||||||
|
|
||||||
async function _saveOutputFiles({
|
async function _saveOutputFiles({
|
||||||
@@ -316,24 +316,20 @@ async function _saveOutputFiles({
|
|||||||
let { outputFiles, allEntries } =
|
let { outputFiles, allEntries } =
|
||||||
await OutputFileFinder.promises.findOutputFiles(resourceList, compileDir)
|
await OutputFileFinder.promises.findOutputFiles(resourceList, compileDir)
|
||||||
|
|
||||||
let buildId
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const saveResult = await OutputCacheManager.promises.saveOutputFiles(
|
outputFiles = await OutputCacheManager.promises.saveOutputFiles(
|
||||||
{ request, stats, timings },
|
{ request, stats, timings },
|
||||||
outputFiles,
|
outputFiles,
|
||||||
compileDir,
|
compileDir,
|
||||||
outputDir
|
outputDir
|
||||||
)
|
)
|
||||||
buildId = saveResult.buildId
|
|
||||||
outputFiles = saveResult.outputFiles
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const { project_id: projectId, user_id: userId } = request
|
const { project_id: projectId, user_id: userId } = request
|
||||||
logger.err({ projectId, userId, err }, 'failed to save output files')
|
logger.err({ projectId, userId, err }, 'failed to save output files')
|
||||||
}
|
}
|
||||||
|
|
||||||
timings.output = timer.done()
|
timings.output = timer.done()
|
||||||
return { outputFiles, allEntries, buildId }
|
return { outputFiles, allEntries }
|
||||||
}
|
}
|
||||||
|
|
||||||
async function stopCompile(projectId, userId) {
|
async function stopCompile(projectId, userId) {
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ module.exports = OutputCacheManager = {
|
|||||||
outputDir,
|
outputDir,
|
||||||
stats,
|
stats,
|
||||||
(err, outputFiles) => {
|
(err, outputFiles) => {
|
||||||
if (err) return callback(err, { outputFiles, buildId })
|
if (err) return callback(err, outputFiles)
|
||||||
|
|
||||||
const enablePdfCaching = request.enablePdfCaching
|
const enablePdfCaching = request.enablePdfCaching
|
||||||
const enablePdfCachingDark =
|
const enablePdfCachingDark =
|
||||||
@@ -173,7 +173,7 @@ module.exports = OutputCacheManager = {
|
|||||||
!Settings.enablePdfCaching ||
|
!Settings.enablePdfCaching ||
|
||||||
(!enablePdfCaching && !enablePdfCachingDark)
|
(!enablePdfCaching && !enablePdfCachingDark)
|
||||||
) {
|
) {
|
||||||
return callback(null, { outputFiles, buildId })
|
return callback(null, outputFiles)
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputCacheManager.saveStreamsInContentDir(
|
OutputCacheManager.saveStreamsInContentDir(
|
||||||
@@ -191,9 +191,9 @@ module.exports = OutputCacheManager = {
|
|||||||
{ err, outputDir, stats, timings },
|
{ err, outputDir, stats, timings },
|
||||||
'pdf caching failed'
|
'pdf caching failed'
|
||||||
)
|
)
|
||||||
return callback(null, { outputFiles, buildId })
|
return callback(null, outputFiles)
|
||||||
}
|
}
|
||||||
callback(err, { outputFiles, buildId })
|
callback(err, outputFiles)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ function tryImageNameValidation(method, imageNameField) {
|
|||||||
|
|
||||||
describe('CompileController', function () {
|
describe('CompileController', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
this.buildId = 'build-id-123'
|
|
||||||
this.CompileController = SandboxedModule.require(modulePath, {
|
this.CompileController = SandboxedModule.require(modulePath, {
|
||||||
requires: {
|
requires: {
|
||||||
'./CompileManager': (this.CompileManager = {}),
|
'./CompileManager': (this.CompileManager = {}),
|
||||||
@@ -119,7 +118,6 @@ describe('CompileController', function () {
|
|||||||
outputFiles: this.output_files,
|
outputFiles: this.output_files,
|
||||||
stats: this.stats,
|
stats: this.stats,
|
||||||
timings: this.timings,
|
timings: this.timings,
|
||||||
buildId: this.buildId,
|
|
||||||
})
|
})
|
||||||
this.CompileController.compile(this.req, this.res)
|
this.CompileController.compile(this.req, this.res)
|
||||||
})
|
})
|
||||||
@@ -142,32 +140,21 @@ describe('CompileController', function () {
|
|||||||
|
|
||||||
it('should return the JSON response', function () {
|
it('should return the JSON response', function () {
|
||||||
this.res.status.calledWith(200).should.equal(true)
|
this.res.status.calledWith(200).should.equal(true)
|
||||||
console.log(this.res.send.args[0][0].compile)
|
this.res.send
|
||||||
sinon.assert.calledWith(
|
.calledWith({
|
||||||
this.res.send,
|
compile: {
|
||||||
sinon.match.has(
|
|
||||||
'compile',
|
|
||||||
sinon.match({
|
|
||||||
status: 'success',
|
status: 'success',
|
||||||
error: null,
|
error: null,
|
||||||
stats: this.stats,
|
stats: this.stats,
|
||||||
timings: this.timings,
|
timings: this.timings,
|
||||||
outputUrlPrefix: '/zone/b',
|
outputUrlPrefix: '/zone/b',
|
||||||
outputFiles: [
|
outputFiles: this.output_files.map(file => ({
|
||||||
...this.output_files.map(file => ({
|
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${file.build}/output/${file.path}`,
|
||||||
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${file.build}/output/${file.path}`,
|
...file,
|
||||||
...file,
|
})),
|
||||||
})),
|
},
|
||||||
{
|
})
|
||||||
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${this.buildId}/output/output.zip`,
|
.should.equal(true)
|
||||||
build: this.buildId,
|
|
||||||
path: 'output.zip',
|
|
||||||
type: 'zip',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
|
||||||
)
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -178,7 +165,6 @@ describe('CompileController', function () {
|
|||||||
outputFiles: this.output_files,
|
outputFiles: this.output_files,
|
||||||
stats: this.stats,
|
stats: this.stats,
|
||||||
timings: this.timings,
|
timings: this.timings,
|
||||||
buildId: this.buildId,
|
|
||||||
})
|
})
|
||||||
this.CompileController.compile(this.req, this.res)
|
this.CompileController.compile(this.req, this.res)
|
||||||
})
|
})
|
||||||
@@ -193,18 +179,10 @@ describe('CompileController', function () {
|
|||||||
stats: this.stats,
|
stats: this.stats,
|
||||||
timings: this.timings,
|
timings: this.timings,
|
||||||
outputUrlPrefix: '',
|
outputUrlPrefix: '',
|
||||||
outputFiles: [
|
outputFiles: this.output_files.map(file => ({
|
||||||
...this.output_files.map(file => ({
|
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${file.build}/output/${file.path}`,
|
||||||
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${file.build}/output/${file.path}`,
|
...file,
|
||||||
...file,
|
})),
|
||||||
})),
|
|
||||||
{
|
|
||||||
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${this.buildId}/output/output.zip`,
|
|
||||||
build: this.buildId,
|
|
||||||
path: 'output.zip',
|
|
||||||
type: 'zip',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.should.equal(true)
|
.should.equal(true)
|
||||||
@@ -229,7 +207,6 @@ describe('CompileController', function () {
|
|||||||
outputFiles: this.output_files,
|
outputFiles: this.output_files,
|
||||||
stats: this.stats,
|
stats: this.stats,
|
||||||
timings: this.timings,
|
timings: this.timings,
|
||||||
buildId: this.buildId,
|
|
||||||
})
|
})
|
||||||
this.CompileController.compile(this.req, this.res)
|
this.CompileController.compile(this.req, this.res)
|
||||||
})
|
})
|
||||||
@@ -244,18 +221,10 @@ describe('CompileController', function () {
|
|||||||
stats: this.stats,
|
stats: this.stats,
|
||||||
timings: this.timings,
|
timings: this.timings,
|
||||||
outputUrlPrefix: '/zone/b',
|
outputUrlPrefix: '/zone/b',
|
||||||
outputFiles: [
|
outputFiles: this.output_files.map(file => ({
|
||||||
...this.output_files.map(file => ({
|
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${file.build}/output/${file.path}`,
|
||||||
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${file.build}/output/${file.path}`,
|
...file,
|
||||||
...file,
|
})),
|
||||||
})),
|
|
||||||
{
|
|
||||||
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${this.buildId}/output/output.zip`,
|
|
||||||
build: this.buildId,
|
|
||||||
path: 'output.zip',
|
|
||||||
type: 'zip',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.should.equal(true)
|
.should.equal(true)
|
||||||
@@ -281,7 +250,6 @@ describe('CompileController', function () {
|
|||||||
outputFiles: this.output_files,
|
outputFiles: this.output_files,
|
||||||
stats: this.stats,
|
stats: this.stats,
|
||||||
timings: this.timings,
|
timings: this.timings,
|
||||||
buildId: this.buildId,
|
|
||||||
})
|
})
|
||||||
this.CompileController.compile(this.req, this.res)
|
this.CompileController.compile(this.req, this.res)
|
||||||
})
|
})
|
||||||
@@ -296,18 +264,10 @@ describe('CompileController', function () {
|
|||||||
stats: this.stats,
|
stats: this.stats,
|
||||||
timings: this.timings,
|
timings: this.timings,
|
||||||
outputUrlPrefix: '/zone/b',
|
outputUrlPrefix: '/zone/b',
|
||||||
outputFiles: [
|
outputFiles: this.output_files.map(file => ({
|
||||||
...this.output_files.map(file => ({
|
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${file.build}/output/${file.path}`,
|
||||||
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${file.build}/output/${file.path}`,
|
...file,
|
||||||
...file,
|
})),
|
||||||
})),
|
|
||||||
{
|
|
||||||
url: `${this.Settings.apis.clsi.url}/project/${this.project_id}/build/${this.buildId}/output/output.zip`,
|
|
||||||
build: this.buildId,
|
|
||||||
path: 'output.zip',
|
|
||||||
type: 'zip',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.should.equal(true)
|
.should.equal(true)
|
||||||
@@ -316,11 +276,9 @@ describe('CompileController', function () {
|
|||||||
|
|
||||||
describe('with an error', function () {
|
describe('with an error', function () {
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
const error = new Error((this.message = 'error message'))
|
|
||||||
error.buildId = this.buildId
|
|
||||||
this.CompileManager.doCompileWithLock = sinon
|
this.CompileManager.doCompileWithLock = sinon
|
||||||
.stub()
|
.stub()
|
||||||
.callsArgWith(1, error, null)
|
.callsArgWith(1, new Error((this.message = 'error message')), null)
|
||||||
this.CompileController.compile(this.req, this.res)
|
this.CompileController.compile(this.req, this.res)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ describe('CompileManager', function () {
|
|||||||
build: 1234,
|
build: 1234,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
this.buildId = 'build-id-123'
|
|
||||||
this.commandOutput = 'Dummy output'
|
this.commandOutput = 'Dummy output'
|
||||||
this.compileBaseDir = '/compile/dir'
|
this.compileBaseDir = '/compile/dir'
|
||||||
this.outputBaseDir = '/output/dir'
|
this.outputBaseDir = '/output/dir'
|
||||||
@@ -62,9 +61,7 @@ describe('CompileManager', function () {
|
|||||||
}
|
}
|
||||||
this.OutputCacheManager = {
|
this.OutputCacheManager = {
|
||||||
promises: {
|
promises: {
|
||||||
saveOutputFiles: sinon
|
saveOutputFiles: sinon.stub().resolves(this.buildFiles),
|
||||||
.stub()
|
|
||||||
.resolves({ outputFiles: this.buildFiles, buildId: this.buildId }),
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
this.Settings = {
|
this.Settings = {
|
||||||
|
|||||||
@@ -398,13 +398,6 @@ module.exports = CompileController = {
|
|||||||
if (error) {
|
if (error) {
|
||||||
return next(error)
|
return next(error)
|
||||||
}
|
}
|
||||||
|
|
||||||
const qs = {}
|
|
||||||
|
|
||||||
if (req.params.file === 'output.zip') {
|
|
||||||
qs.files = req.query.files
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = CompileController._getFileUrl(
|
const url = CompileController._getFileUrl(
|
||||||
projectId,
|
projectId,
|
||||||
userId,
|
userId,
|
||||||
@@ -415,7 +408,7 @@ module.exports = CompileController = {
|
|||||||
projectId,
|
projectId,
|
||||||
'output-file',
|
'output-file',
|
||||||
url,
|
url,
|
||||||
qs,
|
{},
|
||||||
req,
|
req,
|
||||||
res,
|
res,
|
||||||
next
|
next
|
||||||
@@ -580,20 +573,10 @@ module.exports = CompileController = {
|
|||||||
return next(err)
|
return next(err)
|
||||||
}
|
}
|
||||||
url = new URL(`${Settings.apis.clsi.url}${url}`)
|
url = new URL(`${Settings.apis.clsi.url}${url}`)
|
||||||
|
url.search = new URLSearchParams({
|
||||||
const params = new URLSearchParams(persistenceOptions.qs)
|
...persistenceOptions.qs,
|
||||||
|
...qs,
|
||||||
for (const [key, value] of Object.entries(qs)) {
|
}).toString()
|
||||||
if (Array.isArray(value)) {
|
|
||||||
for (const v of value) {
|
|
||||||
params.append(key, v)
|
|
||||||
}
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
params.append(key, value)
|
|
||||||
}
|
|
||||||
|
|
||||||
url.search = params.toString()
|
|
||||||
const timer = new Metrics.Timer(
|
const timer = new Metrics.Timer(
|
||||||
'proxy_to_clsi',
|
'proxy_to_clsi',
|
||||||
1,
|
1,
|
||||||
@@ -621,10 +604,7 @@ module.exports = CompileController = {
|
|||||||
})
|
})
|
||||||
|
|
||||||
for (const key of ['Content-Length', 'Content-Type']) {
|
for (const key of ['Content-Length', 'Content-Type']) {
|
||||||
const headerValue = response.headers.get(key)
|
res.setHeader(key, response.headers.get(key))
|
||||||
if (headerValue) {
|
|
||||||
res.setHeader(key, headerValue)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
res.writeHead(response.status)
|
res.writeHead(response.status)
|
||||||
return pipeline(stream, res)
|
return pipeline(stream, res)
|
||||||
|
|||||||
@@ -304,7 +304,6 @@
|
|||||||
"doing_this_will_verify_affiliation_and_allow_log_in_2": "",
|
"doing_this_will_verify_affiliation_and_allow_log_in_2": "",
|
||||||
"done": "",
|
"done": "",
|
||||||
"download": "",
|
"download": "",
|
||||||
"download_all": "",
|
|
||||||
"download_metadata": "",
|
"download_metadata": "",
|
||||||
"download_pdf": "",
|
"download_pdf": "",
|
||||||
"download_zip_file": "",
|
"download_zip_file": "",
|
||||||
|
|||||||
@@ -33,18 +33,6 @@ function PdfFileList({ fileList }) {
|
|||||||
<b>{file.path}</b>
|
<b>{file.path}</b>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{fileList.other.length + fileList.top.length > 0 && fileList.archive && (
|
|
||||||
<MenuItem
|
|
||||||
download={basename(fileList.archive)}
|
|
||||||
href={fileList.archive.url}
|
|
||||||
key={fileList.archive.path}
|
|
||||||
>
|
|
||||||
<b>
|
|
||||||
{t('download_all')} ({fileList.other.length + fileList.top.length})
|
|
||||||
</b>
|
|
||||||
</MenuItem>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -60,10 +48,6 @@ PdfFileList.propTypes = {
|
|||||||
fileList: PropTypes.shape({
|
fileList: PropTypes.shape({
|
||||||
top: FilesArray,
|
top: FilesArray,
|
||||||
other: FilesArray,
|
other: FilesArray,
|
||||||
archive: PropTypes.shape({
|
|
||||||
path: PropTypes.string.isRequired,
|
|
||||||
url: PropTypes.string.isRequired,
|
|
||||||
}),
|
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const topFileTypes = ['bbl', 'gls', 'ind']
|
const topFileTypes = ['bbl', 'gls', 'ind']
|
||||||
const ignoreFiles = ['output.fls', 'output.fdb_latexmk', 'output.zip']
|
const ignoreFiles = ['output.fls', 'output.fdb_latexmk']
|
||||||
|
|
||||||
export const buildFileList = (outputFiles, clsiServerId, compileGroup) => {
|
export const buildFileList = (outputFiles, clsiServerId, compileGroup) => {
|
||||||
const files = { top: [], other: [] }
|
const files = { top: [], other: [] }
|
||||||
@@ -18,8 +18,6 @@ export const buildFileList = (outputFiles, clsiServerId, compileGroup) => {
|
|||||||
|
|
||||||
const allFiles = []
|
const allFiles = []
|
||||||
|
|
||||||
let outputArchiveFile
|
|
||||||
|
|
||||||
// filter out ignored files and set some properties
|
// filter out ignored files and set some properties
|
||||||
for (const file of outputFiles.values()) {
|
for (const file of outputFiles.values()) {
|
||||||
if (!ignoreFiles.includes(file.path)) {
|
if (!ignoreFiles.includes(file.path)) {
|
||||||
@@ -30,8 +28,6 @@ export const buildFileList = (outputFiles, clsiServerId, compileGroup) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
allFiles.push(file)
|
allFiles.push(file)
|
||||||
} else if (file.type === 'zip') {
|
|
||||||
outputArchiveFile = file
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,14 +52,6 @@ export const buildFileList = (outputFiles, clsiServerId, compileGroup) => {
|
|||||||
files.other.push(file)
|
files.other.push(file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outputArchiveFile) {
|
|
||||||
allFiles.forEach(
|
|
||||||
file => file.type !== 'pdf' && params.append('files', file.path)
|
|
||||||
)
|
|
||||||
outputArchiveFile.url += `?${params.toString()}`
|
|
||||||
files.archive = outputArchiveFile
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return files
|
return files
|
||||||
|
|||||||
@@ -430,7 +430,6 @@
|
|||||||
"done": "Done",
|
"done": "Done",
|
||||||
"dont_have_account": "Don’t have an account?",
|
"dont_have_account": "Don’t have an account?",
|
||||||
"download": "Download",
|
"download": "Download",
|
||||||
"download_all": "Download all",
|
|
||||||
"download_metadata": "Download Overleaf metadata",
|
"download_metadata": "Download Overleaf metadata",
|
||||||
"download_pdf": "Download PDF",
|
"download_pdf": "Download PDF",
|
||||||
"download_zip_file": "Download .zip file",
|
"download_zip_file": "Download .zip file",
|
||||||
|
|||||||
Reference in New Issue
Block a user