Skip to content

Commit

Permalink
Boilerplate code for a chat-endpoint in react
Browse files Browse the repository at this point in the history
  • Loading branch information
Karinon committed Aug 13, 2024
1 parent c97421d commit 75669d5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions assets/js/Containers/FrevaGPT/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from "react";
import { Container, Row } from "react-bootstrap";
// import PropTypes from "prop-types";

export default () => {
return (
<Container>
<Row>Your content</Row>
</Container>
);
};
2 changes: 2 additions & 0 deletions assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import PluginList from "./Containers/PluginList";
import PluginDetail from "./Containers/PluginDetail";
import Databrowser from "./Containers/Databrowser";
import Resultbrowser from "./Containers/Resultbrowser";
import FrevaGTP from "./Containers/FrevaGPT";

const initialState = window.INITIAL_STATE || {};

Expand All @@ -22,6 +23,7 @@ ReactDOM.render(
<Router history={browserHistory}>
<Route path="/" component={App}>
<Route path="plugins/" component={PluginList} />
<Route path="chat/" component={FrevaGTP} />
<Route path="history/result-browser/" component={Resultbrowser} />
<Route path="databrowser/*" component={Databrowser} />
<Route path="plugins/:pluginName/detail/" component={PluginDetail} />
Expand Down
3 changes: 3 additions & 0 deletions django_evaluation/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
)
from solr.views_api import ncdump

import django_evaluation.views

admin.autodiscover()

urlpatterns = [
url(r"^admin/doc/", include("django.contrib.admindocs.urls")),
url(r"^admin/", admin.site.urls),
url(r"chat/", django_evaluation.views.chat, name="chat"),
url(r"^plugins/", include(("plugins.urls", "plugins"), namespace="plugins")),
url(r"^history/", include(("history.urls", "history"), namespace="history")),
url(r"", include(("solr.urls", "solr"), namespace="solr")),
Expand Down
7 changes: 7 additions & 0 deletions django_evaluation/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.shortcuts import render
from django.contrib.auth.decorators import login_required


@login_required()
def chat(request):
return render(request, "plugins/list.html", {"title": "Freva Chat"})

0 comments on commit 75669d5

Please sign in to comment.