Skip to content

Commit

Permalink
work in progress for idaholab#331, improvements to extracted_files_ht…
Browse files Browse the repository at this point in the history
…tp_server.py and the setting/creation of ACL rules on hedgehog
  • Loading branch information
mmguero committed Apr 1, 2024
1 parent 5b2359c commit 695fe5d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions shared/bin/extracted_files_http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
orig_path = os.getcwd()
filename_truncate_len_malcolm = 20
filename_truncate_len = 32
malcolm_forward_header = 'X-Malcolm-Forward'


###################################################################################################
Expand Down Expand Up @@ -82,6 +83,8 @@ def do_GET(self):
global debug
global args

assetsDirRespReplacer = f"{str(dict(self.headers).get(malcolm_forward_header, ''))}{args.assetsDirRespReplacer}"

fullpath, relpath = self.translate_path(self.path)
fileBaseName = os.path.basename(fullpath)
fnameDispLen = filename_truncate_len_malcolm if args.malcolm else filename_truncate_len
Expand Down Expand Up @@ -110,10 +113,10 @@ def do_GET(self):
with doc.head:
meta(charset="utf-8")
meta(name="viewport", content="width=device-width, initial-scale=1, shrink-to-fit=no")
link(rel="icon", href=f"{args.assetsDirRespReplacer}favicon.ico", type="image/x-icon")
link(rel="stylesheet", href=f"{args.assetsDirRespReplacer}css/bootstrap-icons.css", type="text/css")
link(rel="stylesheet", href=f"{args.assetsDirRespReplacer}css/google-fonts.css", type="text/css")
link(rel="stylesheet", href=f"{args.assetsDirRespReplacer}css/styles.css", type="text/css")
link(rel="icon", href=f"{assetsDirRespReplacer}favicon.ico", type="image/x-icon")
link(rel="stylesheet", href=f"{assetsDirRespReplacer}css/bootstrap-icons.css", type="text/css")
link(rel="stylesheet", href=f"{assetsDirRespReplacer}css/google-fonts.css", type="text/css")
link(rel="stylesheet", href=f"{assetsDirRespReplacer}css/styles.css", type="text/css")

# <body>
with doc:
Expand Down Expand Up @@ -324,8 +327,8 @@ def do_GET(self):
a(href=f'https://github.com/idaholab/Malcolm/', target="_blank")
).add(i(cls="bi-github fs-3", title="GitHub"))

script(type="text/javascript", src=f"{args.assetsDirRespReplacer}js/bootstrap.bundle.min.js")
script(type="text/javascript", src=f"{args.assetsDirRespReplacer}js/scripts.js")
script(type="text/javascript", src=f"{assetsDirRespReplacer}js/bootstrap.bundle.min.js")
script(type="text/javascript", src=f"{assetsDirRespReplacer}js/scripts.js")

# send directory listing HTML to web client
self.wfile.write(str.encode(str(doc)))
Expand Down

0 comments on commit 695fe5d

Please sign in to comment.