Compare commits

..

No commits in common. "fb200ceb936fc15e47c5392412bed16381ef0785" and "b119dcf47de18d19f0742acf83853b9cfa01b759" have entirely different histories.

2 changed files with 2 additions and 27 deletions

View File

@ -160,7 +160,7 @@ textarea { resize: vertical; min-height: 120px; }
<div class="footer">Creative AI-imbued UI • stackchain-dashboard</div>
<script src="/static/markdown.js"></script>
<script src="static/commands.js"></script>
<script src="/static/commands.js"></script>
<script>
(function(){
const qs = (s, el=document) => el.querySelector(s);

View File

@ -1,24 +1,9 @@
import json
import subprocess
from html.parser import HTMLParser
from pathlib import Path
from urllib.parse import urljoin
FRONTEND = Path(__file__).parents[1] / "frontend"
COMMANDS = FRONTEND / "commands.js"
class ScriptSourceParser(HTMLParser):
def __init__(self):
super().__init__()
self.sources = []
def handle_starttag(self, tag, attrs):
if tag == "script":
source = dict(attrs).get("src")
if source:
self.sources.append(source)
COMMANDS = Path(__file__).parents[1] / "frontend" / "commands.js"
def test_filtered_command_runs_the_matching_action():
@ -36,13 +21,3 @@ if (action !== 'refresh') throw new Error(`expected refresh, got ${{action}}`);
"""
subprocess.run(["node", "-e", script], check=True, capture_output=True, text=True)
def test_command_script_resolves_inside_dashboard_subpath():
parser = ScriptSourceParser()
parser.feed((FRONTEND / "index.html").read_text())
command_source = next(source for source in parser.sources if source.endswith("commands.js"))
assert urljoin(
"https://forge.alexanderwhitestone.com/dashboard/", command_source
) == "https://forge.alexanderwhitestone.com/dashboard/static/commands.js"