|
|
@ -3383,6 +3383,7 @@ var Home = /*#__PURE__*/function (_Vue) { |
|
|
|
id: '', |
|
|
|
file_name: '' |
|
|
|
}; |
|
|
|
_this.error = ''; |
|
|
|
return _this; |
|
|
|
} |
|
|
|
/** |
|
|
@ -3448,6 +3449,11 @@ var Home = /*#__PURE__*/function (_Vue) { |
|
|
|
|
|
|
|
return uploadFile; |
|
|
|
}() |
|
|
|
}, { |
|
|
|
key: "onError", |
|
|
|
value: function onError(error) { |
|
|
|
this.error = error; |
|
|
|
} |
|
|
|
}]); |
|
|
|
|
|
|
|
return Home; |
|
|
@ -3642,7 +3648,7 @@ var ProcessFile = /*#__PURE__*/function (_Vue) { |
|
|
|
key: "waitForFile", |
|
|
|
value: function () { |
|
|
|
var _waitForFile = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() { |
|
|
|
var response; |
|
|
|
var response, error; |
|
|
|
return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) { |
|
|
|
while (1) { |
|
|
|
switch (_context.prev = _context.next) { |
|
|
@ -3653,27 +3659,38 @@ var ProcessFile = /*#__PURE__*/function (_Vue) { |
|
|
|
case 2: |
|
|
|
response = _context.sent; |
|
|
|
|
|
|
|
if (response.content !== null) { |
|
|
|
if (response.ingest_status === 'fail') { |
|
|
|
this.$toast.add({ |
|
|
|
severity: 'error', |
|
|
|
summary: 'File error', |
|
|
|
detail: 'THere was an error processing the file in ingest', |
|
|
|
life: 3000 |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.fileContent = response.content; |
|
|
|
if (!(response.status === 'processing')) { |
|
|
|
_context.next = 5; |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
return _context.abrupt("return"); |
|
|
|
|
|
|
|
case 5: |
|
|
|
clearInterval(this.intervalId); |
|
|
|
|
|
|
|
if (response.status === 'success') { |
|
|
|
this.fileContent = response.content ? response.content : ''; |
|
|
|
this.$toast.add({ |
|
|
|
severity: 'success', |
|
|
|
summary: 'File loaded', |
|
|
|
detail: 'The file has been processed by ingest.', |
|
|
|
life: 3000 |
|
|
|
}); |
|
|
|
clearInterval(this.intervalId); |
|
|
|
} |
|
|
|
|
|
|
|
if (response.status === 'fail') { |
|
|
|
error = 'There was an error processing the file in ingest'; |
|
|
|
this.$toast.add({ |
|
|
|
severity: 'error', |
|
|
|
summary: 'File error', |
|
|
|
detail: error, |
|
|
|
life: 3000 |
|
|
|
}); |
|
|
|
this.$emit('error', error); |
|
|
|
} |
|
|
|
|
|
|
|
case 4: |
|
|
|
case 8: |
|
|
|
case "end": |
|
|
|
return _context.stop(); |
|
|
|
} |
|
|
@ -3726,22 +3743,32 @@ var ProcessFile = /*#__PURE__*/function (_Vue) { |
|
|
|
'replace_with': _this2.searchersOptions[searcher.id] || '' |
|
|
|
}); |
|
|
|
}); |
|
|
|
_context2.next = 6; |
|
|
|
_context2.prev = 4; |
|
|
|
_context2.next = 7; |
|
|
|
return this.$api.filterDocument(this.fileContent, searchers); |
|
|
|
|
|
|
|
case 6: |
|
|
|
case 7: |
|
|
|
response = _context2.sent; |
|
|
|
this.processedFileContent = response.content; |
|
|
|
this.documentDiffIndexes = response.indexes; |
|
|
|
this.createDiffPreview(); |
|
|
|
this.processing = false; |
|
|
|
_context2.next = 17; |
|
|
|
break; |
|
|
|
|
|
|
|
case 11: |
|
|
|
case 14: |
|
|
|
_context2.prev = 14; |
|
|
|
_context2.t0 = _context2["catch"](4); |
|
|
|
this.$emit('error', 'Server error.'); // if (isServerError(e)) {
|
|
|
|
// this.$emit('error', getServerErrorMessage(e));
|
|
|
|
// }
|
|
|
|
|
|
|
|
case 17: |
|
|
|
case "end": |
|
|
|
return _context2.stop(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, _callee2, this); |
|
|
|
}, _callee2, this, [[4, 14]]); |
|
|
|
})); |
|
|
|
|
|
|
|
function runSearchers() { |
|
|
@ -27997,17 +28024,26 @@ var render = function() { |
|
|
|
var _vm = this |
|
|
|
var _h = _vm.$createElement |
|
|
|
var _c = _vm._self._c || _h |
|
|
|
return !_vm.fileUploaded && !_vm.uploading |
|
|
|
? _c( |
|
|
|
return _c( |
|
|
|
"div", |
|
|
|
{ staticClass: "wrap" }, |
|
|
|
[ |
|
|
|
!_vm.error |
|
|
|
? [ |
|
|
|
!_vm.fileUploaded |
|
|
|
? [ |
|
|
|
!_vm.uploading |
|
|
|
? [ |
|
|
|
_c( |
|
|
|
"Panel", |
|
|
|
{ attrs: { header: "Please upload a file" } }, |
|
|
|
[ |
|
|
|
_c("FileUpload", { |
|
|
|
attrs: { name: "demo[]", customUpload: true, auto: true }, |
|
|
|
attrs: { |
|
|
|
name: "demo[]", |
|
|
|
customUpload: true, |
|
|
|
auto: true |
|
|
|
}, |
|
|
|
on: { uploader: _vm.uploadFile }, |
|
|
|
scopedSlots: _vm._u( |
|
|
|
[ |
|
|
@ -28016,7 +28052,9 @@ var render = function() { |
|
|
|
fn: function() { |
|
|
|
return [ |
|
|
|
_c("p", [ |
|
|
|
_vm._v("Drag and drop files to here to upload.") |
|
|
|
_vm._v( |
|
|
|
"Drag and drop files to here to upload." |
|
|
|
) |
|
|
|
]) |
|
|
|
] |
|
|
|
}, |
|
|
@ -28032,15 +28070,11 @@ var render = function() { |
|
|
|
1 |
|
|
|
), |
|
|
|
_vm._v(" "), |
|
|
|
_c("BlockUI", { attrs: { blocked: _vm.uiBlocked, fullScreen: true } }) |
|
|
|
], |
|
|
|
1 |
|
|
|
) |
|
|
|
: !_vm.fileUploaded && _vm.uploading |
|
|
|
? _c( |
|
|
|
"div", |
|
|
|
{ staticClass: "wrap" }, |
|
|
|
[ |
|
|
|
_c("BlockUI", { |
|
|
|
attrs: { blocked: _vm.uiBlocked, fullScreen: true } |
|
|
|
}) |
|
|
|
] |
|
|
|
: [ |
|
|
|
_c("Skeleton"), |
|
|
|
_c("br"), |
|
|
|
_vm._v(" "), |
|
|
@ -28061,21 +28095,40 @@ var render = function() { |
|
|
|
_vm._v(" "), |
|
|
|
_c("Skeleton"), |
|
|
|
_c("br") |
|
|
|
], |
|
|
|
1 |
|
|
|
) |
|
|
|
: _c( |
|
|
|
"div", |
|
|
|
{ staticClass: "wrap" }, |
|
|
|
[ |
|
|
|
] |
|
|
|
] |
|
|
|
: [ |
|
|
|
_c("process-file", { |
|
|
|
attrs: { file: _vm.uploadResult, searchers: _vm.searchers } |
|
|
|
attrs: { file: _vm.uploadResult, searchers: _vm.searchers }, |
|
|
|
on: { error: _vm.onError } |
|
|
|
}) |
|
|
|
] |
|
|
|
] |
|
|
|
: [ |
|
|
|
_c("h1", [_vm._v(" Something went wrong while processing. ")]), |
|
|
|
_vm._v(" "), |
|
|
|
_c("p", [_vm._v(" " + _vm._s(_vm.error) + " ")]), |
|
|
|
_vm._v(" "), |
|
|
|
_vm._m(0) |
|
|
|
] |
|
|
|
], |
|
|
|
1 |
|
|
|
2 |
|
|
|
) |
|
|
|
} |
|
|
|
var staticRenderFns = [] |
|
|
|
var staticRenderFns = [ |
|
|
|
function() { |
|
|
|
var _vm = this |
|
|
|
var _h = _vm.$createElement |
|
|
|
var _c = _vm._self._c || _h |
|
|
|
return _c("a", { attrs: { href: "/" } }, [ |
|
|
|
_c( |
|
|
|
"button", |
|
|
|
{ staticClass: "p-button p-button-primary", attrs: { type: "button" } }, |
|
|
|
[_vm._v("\n Try another file\n ")] |
|
|
|
) |
|
|
|
]) |
|
|
|
} |
|
|
|
] |
|
|
|
render._withStripped = true |
|
|
|
|
|
|
|
|
|
|
@ -28236,11 +28289,7 @@ var render = function() { |
|
|
|
icon: "pi pi-download", |
|
|
|
disabled: _vm.processedFileContent == "" |
|
|
|
}, |
|
|
|
on: { |
|
|
|
click: function($event) { |
|
|
|
return _vm.downloadOdt() |
|
|
|
} |
|
|
|
} |
|
|
|
on: { click: _vm.downloadOdt } |
|
|
|
}), |
|
|
|
_vm._v(" "), |
|
|
|
_c("Button", { |
|
|
@ -28253,11 +28302,7 @@ var render = function() { |
|
|
|
_vm.fileContent == "" || |
|
|
|
_vm.selectedSearchers.length === 0 |
|
|
|
}, |
|
|
|
on: { |
|
|
|
click: function($event) { |
|
|
|
return _vm.runSearchers() |
|
|
|
} |
|
|
|
} |
|
|
|
on: { click: _vm.runSearchers } |
|
|
|
}) |
|
|
|
] |
|
|
|
}, |
|
|
|