This is an automated email from the ASF dual-hosted git repository. machristie pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/airavata-cookiecutter-django-app.git
commit 8a72803381850bcabc62f40152fc3bd2db5409a5 Author: Marcus Christie <machris...@apache.org> AuthorDate: Thu Jun 3 11:32:56 2021 -0400 Adding JavaScript SDK sample code --- .../{{cookiecutter.project_slug}}/home.html | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html index 523a4e0..0913ce1 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/{{cookiecutter.project_slug}}/home.html @@ -9,3 +9,31 @@ </main> </div> {% endblock content %} + +{% block scripts %} +<!-- Load the AiravataAPI JavaScript SDK (optional) --> +<script src="{% static 'django_airavata_api/dist/airavata-api.js' %}"></script> +<script> + const { models, services, session, utils } = AiravataAPI; + + // Your code here ... + // Example code: AiravataAPI JavaScript SDK + // Use the JavaScript SDK to make REST API calls. For example, load the most + // recent 5 experiments created by the current user: + // + // services.ExperimentSearchService + // .list({limit: 5, + // [models.ExperimentSearchFields.USER_NAME.name]: session.Session.username, + // }) + // .then(data => { + // const experiments = data.results; + // // Do something with the experiments ... + // }); + // + // See the Gateways tutorial for more examples: + // https://apache-airavata-django-portal.readthedocs.io/en/latest/tutorial/gateways_tutorial/#tutorial-exercise-create-a-custom-django-app + // To see what is in the `AiravataAPI` JavaScript library, take a look at + // it's index.js file: + // https://github.com/apache/airavata-django-portal/blob/master/django_airavata/apps/api/static/django_airavata_api/js/index.js +</script> +{% endblock scripts %}