Scanyonero/static/js/components/document-queue-entry-separator.js
David Vogel b5ecf95a7b Add split function
- Add ServerWebsocketPacketQueueSplit
- Add Split method to Queue
- Correct automatic separator insertion for newly ingested documents
- Rework UI so that entries have their own set of buttons
- Refactor occurrences of "document" to "queueEntry"
2025-05-19 12:03:40 +02:00

54 lines
1002 B
JavaScript

import { API } from '../api.js';
import { LitElement, css, html, repeat } from '../vendor/lit-html/lit-all.min.js';
export class DocumentQueueEntrySeparator extends LitElement {
static properties = {
queueEntry: { type: Object },
api: { type: Object, state: true },
};
constructor() {
super();
/** @type {API} */
this.api;
/** @type {import('model').APIQueueEntry} */
this.queueEntry;
}
static styles = css`
:host {
width: 100%;
display: flex;
justify-content: space-between;
gap: 8px;
}
#buttons {
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 8px;
}
button {
padding: 8px;
}
`;
// @ts-ignore
render() {
return html`
<div style="flex-grow: 1; align-self: center;">
<hr>
</div>
<div id="buttons">
<button @click=${e => this.api.queueDelete(this.queueEntry.id)}>Delete</button>
</div>
`;
}
}
customElements.define("document-queue-entry-separator", DocumentQueueEntrySeparator);