mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-28 03:05:35 +01:00
fix (table): embed table
This commit is contained in:
parent
c6e7f39f67
commit
844fd5d7bb
1 changed files with 4 additions and 11 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { init as initConfig, getVersion } from "../model/config.js";
|
||||
import { init as initConfig, getVersion, get } from "../model/config.js";
|
||||
|
||||
const DEBOUNCETIME = 100;
|
||||
|
||||
|
|
@ -11,7 +11,7 @@ class FilestashTable extends HTMLElement {
|
|||
|
||||
this.iframe = document.createElement("iframe");
|
||||
this.iframe.setAttribute("style", "width: 100%; height: 100%; border: none; display: block;");
|
||||
this.iframe.setAttribute("sandbox", "allow-downloads allow-scripts allow-presentation");
|
||||
this.iframe.setAttribute("sandbox", "allow-downloads allow-scripts allow-presentation allow-forms");
|
||||
this.shadowRoot.appendChild(this.iframe);
|
||||
|
||||
this.debounce = null;
|
||||
|
|
@ -41,15 +41,8 @@ class FilestashTable extends HTMLElement {
|
|||
|
||||
connectedCallback() {
|
||||
const src = this.getAttribute("src") || "";
|
||||
const name = this.getAttribute("name") || "main.dbf";
|
||||
const mime = {
|
||||
"orc": "application/vnd.apache.orc",
|
||||
"arrow": "application/vnd.apache.feather",
|
||||
"avro": "application/vnd.apache.avro",
|
||||
"feather": "application/vnd.apache.feather",
|
||||
"parquet": "application/vnd.apache.parquet",
|
||||
"dbf": "application/dbf",
|
||||
}[name.split(".").pop().toLowerCase()];
|
||||
const name = this.getAttribute("name") || "main.dat";
|
||||
const mime = get("mime", {})[name.split(".").pop().toLowerCase()];
|
||||
|
||||
this.style.display = "inline-block";
|
||||
this.iframe.srcdoc = `<!DOCTYPE html>
|
||||
|
|
|
|||
Loading…
Reference in a new issue