Skip to content

Commit

Permalink
Added special load HTML extension
Browse files Browse the repository at this point in the history
  • Loading branch information
chdominguez committed Jul 11, 2024
1 parent 60bb084 commit f0dfec8
Show file tree
Hide file tree
Showing 100 changed files with 71 additions and 7,616 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,9 @@ deps/
*.hp

# .DS_Store files
**/.DS_Store
**/.DS_Store

# Plugin configs
EAPM/config

package-lock.json
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"--line-length",
"98"
],
"python.analysis.typeCheckingMode": "off",
"python.analysis.extraPaths": [
"EAPM/deps/",
"EAPM/Include/",
Expand All @@ -21,4 +20,4 @@
"hmmer",
"mafft"
]
}
}
4 changes: 4 additions & 0 deletions EAPM/EAPM.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ def create_plugin():

eapm_plugin.addConfig(hmmerExecutableConfig)

from Pages.load_tables import load_page

eapm_plugin.addPage(load_page)

# pylint: enable=import-outside-toplevel

# Return the plugin
Expand Down
31 changes: 31 additions & 0 deletions EAPM/Include/Pages/load_tables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import urllib.parse
import flask
import urllib
import os
import HorusAPI

load_page = HorusAPI.PluginPage(
id="load_tables",
name="Load tables",
description="Load tables",
html="index.html",
hidden=True,
)


def load_html():

path = flask.request.args.get("path")

# The path was safely encoded in the uri
path = urllib.parse.unquote(path)

if path is None or not os.path.exists(path):
return flask.jsonify({"error": "Path does not exist"}, 404)

return flask.send_file(path)


load_page.addEndpoint(
HorusAPI.PluginEndpoint(url="/load_table", methods=["GET"], function=load_html)
)
29 changes: 29 additions & 0 deletions EAPM/Pages/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Load HTML</title>
</head>
<body>
<a id="load" href="/plugins/pages/eapm.load_tables/load_table"
>Loading...</a
>
<script>
function loadData() {
const data = parent.extensionData;
if (data) {
const pathToLoad = encodeURIComponent(data.path);
const aElement = document.getElementById("load");
const url = new URL(window.location.href + "load_table");
url.searchParams.set("path", pathToLoad);
const urlToGet = url.toString();
aElement.href = urlToGet;
aElement.click();
}
}

document.addEventListener("DOMContentLoaded", loadData);
</script>
</body>
</html>
4 changes: 0 additions & 4 deletions EAPM/config/eapm.json

This file was deleted.

4 changes: 0 additions & 4 deletions EAPM/config/eapm_Local.json

This file was deleted.

4 changes: 0 additions & 4 deletions EAPM/config/eapm_acc.json

This file was deleted.

4 changes: 0 additions & 4 deletions EAPM/config/eapm_nord3_test.json

This file was deleted.

1 change: 0 additions & 1 deletion EAPM/deps/bioprospecting-0.0.1.dist-info/INSTALLER

This file was deleted.

16 changes: 0 additions & 16 deletions EAPM/deps/bioprospecting-0.0.1.dist-info/METADATA

This file was deleted.

105 changes: 0 additions & 105 deletions EAPM/deps/bioprospecting-0.0.1.dist-info/RECORD

This file was deleted.

Empty file.
5 changes: 0 additions & 5 deletions EAPM/deps/bioprospecting-0.0.1.dist-info/WHEEL

This file was deleted.

1 change: 0 additions & 1 deletion EAPM/deps/bioprospecting-0.0.1.dist-info/direct_url.json

This file was deleted.

1 change: 0 additions & 1 deletion EAPM/deps/bioprospecting-0.0.1.dist-info/top_level.txt

This file was deleted.

5 changes: 0 additions & 5 deletions EAPM/deps/bioprospecting/MD/__init__.py

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit f0dfec8

Please sign in to comment.