|
|
|
@ -8,116 +8,178 @@ |
|
|
|
<template #header> |
|
|
|
<Toolbar> |
|
|
|
<template #left> |
|
|
|
<h3>File preview</h3> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template #right> |
|
|
|
<Button |
|
|
|
label="Run filters" |
|
|
|
icon="pi pi-play" |
|
|
|
class="p-button-success p-button-outlined p-button-sm" |
|
|
|
:disabled="fileContent == ''" |
|
|
|
@click="runFilters()"/> |
|
|
|
<h3>Original document content</h3> |
|
|
|
</template> |
|
|
|
</Toolbar> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template #content> |
|
|
|
<template v-if="fileContent === ''"> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<vue-markdown :source="fileContent" /> |
|
|
|
</template> |
|
|
|
<div class="md-viewer"> |
|
|
|
<template v-if="fileContent === ''"> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<vue-markdown :source="fileContent" /> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
</Card> |
|
|
|
|
|
|
|
<Card class="p-mr-2 p-as-stretch filters-card"> |
|
|
|
<Card |
|
|
|
class="p-mr-2 p-as-stretch file-card" |
|
|
|
> |
|
|
|
|
|
|
|
<template #header> |
|
|
|
<Toolbar> |
|
|
|
<template #left> |
|
|
|
<h3>Document searchers</h3> |
|
|
|
<h3>Processed document content</h3> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template #right> |
|
|
|
<Button |
|
|
|
icon="pi pi-plus" |
|
|
|
class="p-button-success p-button-sm p-button-text" |
|
|
|
@click="toggleSearchersMenu" |
|
|
|
aria:haspopup="true" |
|
|
|
aria-controls="overlay_panel" /> |
|
|
|
label="Download document" |
|
|
|
icon="pi pi-download" |
|
|
|
class="p-button-secondary p-button-outlined p-button-sm"/> |
|
|
|
|
|
|
|
<Button |
|
|
|
label="Run filters" |
|
|
|
icon="pi pi-play" |
|
|
|
class="p-button-success p-button-outlined p-button-sm" |
|
|
|
:disabled="fileContent == ''" |
|
|
|
@click="runSearchers()"/> |
|
|
|
|
|
|
|
<Button |
|
|
|
label="Toggle filters list" |
|
|
|
icon="pi pi-list" |
|
|
|
class="p-button-info p-button-outlined p-button-sm" |
|
|
|
@click="toggleSearchersSidebar()"/> |
|
|
|
</template> |
|
|
|
</Toolbar> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template #content> |
|
|
|
<div class="md-viewer"> |
|
|
|
<template v-if="processing === true"> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
<Skeleton /><br /> |
|
|
|
</template> |
|
|
|
<template v-else-if="processedFileContent !== ''"> |
|
|
|
<vue-markdown :source="processedFileContent" /> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<Message severity="info" :closable="false"> |
|
|
|
Not processed yet. Please select and run some filters to see the result. |
|
|
|
</Message> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
</Card> |
|
|
|
|
|
|
|
|
|
|
|
<Sidebar |
|
|
|
:visible.sync="searchersSidebarVisible" |
|
|
|
:showCloseIcon="true" |
|
|
|
class="p-sidebar-md" |
|
|
|
position="right"> |
|
|
|
|
|
|
|
<div class="p-grid p-jc-between sidebar-title-container"> |
|
|
|
<div class="p-col sidebar-title"> |
|
|
|
<h3>Document searchers</h3> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="p-col-2"> |
|
|
|
<Button |
|
|
|
icon="pi pi-plus" |
|
|
|
class="p-button-success p-button-sm p-button-text add-searchers" |
|
|
|
@click="toggleSearchersDialog(true)" |
|
|
|
aria:haspopup="true" |
|
|
|
aria-controls="searcers_dialog" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<Dialog |
|
|
|
header="Available document searchers" |
|
|
|
:visible.sync="searchersDialogVisible" |
|
|
|
:maximizable="true" |
|
|
|
:style="{width: '50vw'}" |
|
|
|
:contentStyle="{overflow: 'visible'}" |
|
|
|
id="searcers_dialog" |
|
|
|
ref="searcers-dialog"> |
|
|
|
|
|
|
|
<DataTable |
|
|
|
:value.sync="selectedSearchers" |
|
|
|
:value.sync="searchersData" |
|
|
|
:selection.sync="selectedSearchers" |
|
|
|
dataKey="id" |
|
|
|
selectionMode="multiple" |
|
|
|
class="p-datatable-sm" |
|
|
|
:expandedRows.sync="expandedRows" |
|
|
|
@row-reorder="onSelectedSearchersReorder"> |
|
|
|
:metaKeySelection="false" |
|
|
|
:paginator="true" :rows="10" |
|
|
|
paginatorTemplate="CurrentPageReport FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown" |
|
|
|
currentPageReportTemplate="Showing {first} to {last} of {totalRecords}" |
|
|
|
:rowsPerPageOptions="[10,20,50]"> |
|
|
|
|
|
|
|
<Column :rowReorder="true" headerStyle="width: 3rem" /> |
|
|
|
<Column selectionMode="multiple" headerStyle="width: 3em"></Column> |
|
|
|
<Column field="name" header="Name" sortable></Column> |
|
|
|
<Column :expander="true" headerStyle="width: 3rem" /> |
|
|
|
|
|
|
|
<template #expansion="slotProps"> |
|
|
|
<div class="options-subtable"> |
|
|
|
<!-- TODO: Add real options here --> |
|
|
|
<!-- <h5>Options for {{slotProps.data.name}}</h5> --> |
|
|
|
|
|
|
|
<!-- <ProgressSpinner /> --> |
|
|
|
|
|
|
|
<div class="p-fluid"> |
|
|
|
<div class="p-field"> |
|
|
|
<label :for="`replace_with__${slotProps.data.id}`"> |
|
|
|
Replace values with: |
|
|
|
</label> |
|
|
|
|
|
|
|
<InputText |
|
|
|
:id="`replace_with__${slotProps.data.id}`" |
|
|
|
type="text" |
|
|
|
class="p-inputtext-sm" |
|
|
|
v-model="searchersOptions[slotProps.data.id]"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
</DataTable> |
|
|
|
</template> |
|
|
|
</Card> |
|
|
|
|
|
|
|
<OverlayPanel |
|
|
|
ref="searchers-overlay" |
|
|
|
appendTo="body" |
|
|
|
id="overlay_panel" |
|
|
|
style="width: 300px"> |
|
|
|
<template #footer> |
|
|
|
<Button |
|
|
|
label="Done" |
|
|
|
icon="pi pi-check" |
|
|
|
class="p-button-info p-button-outlined p-button-sm" |
|
|
|
@click="toggleSearchersDialog(false)"/> |
|
|
|
</template> |
|
|
|
|
|
|
|
</Dialog> |
|
|
|
|
|
|
|
<DataTable |
|
|
|
:value.sync="searchersData" |
|
|
|
:selection.sync="selectedSearchers" |
|
|
|
:value.sync="selectedSearchers" |
|
|
|
dataKey="id" |
|
|
|
selectionMode="multiple" |
|
|
|
class="p-datatable-sm" |
|
|
|
:metaKeySelection="false" |
|
|
|
:paginator="true" :rows="10" |
|
|
|
paginatorTemplate="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown" |
|
|
|
:rowsPerPageOptions="[10,20,50]"> |
|
|
|
:expandedRows.sync="expandedRows" |
|
|
|
@row-reorder="onSelectedSearchersReorder"> |
|
|
|
|
|
|
|
<Column :rowReorder="true" headerStyle="width: 3rem" /> |
|
|
|
<Column field="name" header="Name"> |
|
|
|
</Column> |
|
|
|
<Column :expander="true" headerStyle="width: 3rem" /> |
|
|
|
|
|
|
|
<template #expansion="slotProps"> |
|
|
|
<div class="options-subtable"> |
|
|
|
|
|
|
|
<div class="p-fluid"> |
|
|
|
<div class="p-field"> |
|
|
|
<label :for="`replace_with__${slotProps.data.id}`"> |
|
|
|
Replace values with: |
|
|
|
</label> |
|
|
|
|
|
|
|
<InputText |
|
|
|
:id="`replace_with__${slotProps.data.id}`" |
|
|
|
type="text" |
|
|
|
class="p-inputtext-sm" |
|
|
|
v-model="searchersOptions[slotProps.data.id]"/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<Column selectionMode="multiple" headerStyle="width: 3em"></Column> |
|
|
|
<Column field="name" header="Name" sortable></Column> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
</DataTable> |
|
|
|
</OverlayPanel> |
|
|
|
</Sidebar> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
|