Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
HORSE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Iulisloi Zacarias
HORSE
Commits
3061d205
Commit
3061d205
authored
9 months ago
by
izacarias
Browse files
Options
Downloads
Patches
Plain Diff
Properly redirecting users to the GUI (using HTTP headers)
parent
b81a5c6b
Branches
code-refactor
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/main.py
+5
-4
5 additions, 4 deletions
app/main.py
with
5 additions
and
4 deletions
app/main.py
+
5
−
4
View file @
3061d205
...
...
@@ -11,6 +11,7 @@ import warnings
from
flask
import
Flask
,
request
,
render_template
from
fastapi.middleware.wsgi
import
WSGIMiddleware
from
fastapi.staticfiles
import
StaticFiles
from
fastapi.responses
import
RedirectResponse
import
config
import
get_intents_script
...
...
@@ -40,10 +41,9 @@ print('creating APIs')
@app.get
(
'
/
'
)
def
first_page
():
to_return
=
{
'
gui_endpoint
'
:
'
/gui
'
,
}
return
to_return
# If the user reaches the root document, it redirects the user to
# the GUI
return
RedirectResponse
(
"
/gui
"
)
#API for receiving intents from the DTE
class
Intent
(
BaseModel
):
...
...
@@ -248,6 +248,7 @@ def ml_reco():
@flask_app.route
(
'
/intents.html
'
)
def
intents_html
():
stored_intents_arr
=
get_intents_script
.
get_intent_fun
(
stored_intents_url
)
items
=
stored_intents_arr
[
0
].
items
()
keys
=
[
key
for
key
,
value
in
items
]
headings
=
tuple
(
keys
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment