<|start_filename|>Dockerfile<|end_filename|>
FROM ubuntu:latest
COPY . /IOS-XE-RESTCONF-Viewer
WORKDIR /IOS-XE-RESTCONF-Viewer
RUN apt update
RUN DEBIAN_FRONTEND='noninteractive' apt  install -y python3 python3-dev python3-pip nginx
RUN DEBIAN_FRONTEND='noninteractive' pip3 install uwsgi
RUN DEBIAN_FRONTEND='noninteractive' pip3 install -r requirements.txt
EXPOSE 5000
ENTRYPOINT [ "python3" ]
CMD [ "run.py" ]


<|start_filename|>app/home/templates/config.html<|end_filename|>
{% extends 'layouts/base.html' %}

{% block title %}RESTCONF Viewer{% endblock title %}

{% block stylesheets %}

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  <style type="text/css">
        .btn-round-lg{
        border-radius: 22.5px;
        }
        .btn-round{
        border-radius: 17px;
        }
        .btn-round-sm{
        border-radius: 15px;
        }
        .btn-round-xs{
        border-radius: 11px;
        padding-left: 10px;
        padding-right: 10px;
        margin-bottom: 5px;
        }
  </style>

{% endblock stylesheets %}

{% block content %}

<div class="row">
  <div class="col-xl-12">
    <div class="row">
      <div class="col-xl-6">
          <div class="card">
             <div class="card-header border-0">
               <div class="row align-items-center">
                   <div class="col">
                     <h1 class="text-center">Containers for RESTCONF Module: {{ module }}</h1>
                     <br/>
                      {% if lists != None %}
                            <span><input value="Full Configuration" name="{{ module }}" class="btn btn-warning btn-round-xs" type="button" onclick="getModule(this.name)" ></span>
                          {% for i in lists %}
                            <span><input value="{{ i }}" class="btn btn-primary btn-round-xs" type="button" onclick="getContainer(this.value)"></span>
                          {% endfor %}
                      {%else%}
                        <div class="row">
                            <div class="col">
                                <pre class="text-center" style="font-size: 20px">{{json}}</pre>
                            </div>
                        </div>
                      {%endif%}
                       <div class="table-responsive">
                        <span class="counter pull-right"></span>
                        <table class="table align-items-center table-flush results" id="configTable">
                          <tbody id="resttTable">
                            <tr>
                                <td>
                                    <pre style="font-size: 15px">{{ json }}</pre>
                                </td>
                            </tr>
                        </table>
                      </div>
                  </div>
               </div>
             </div>
          </div>
        </div>
        <div class="col-xl-6">
          <div class="card">
            <div id='response' style="font-size: 15px"></div>
        </div>
      </div>
    </div>
  </div>
</div>


<script>

function getContainer(val){
 $.ajax({
  url: '/config',
  type: 'POST',
  data: {'container': val},
  success: function(response) {
      $('#response').html(response.data);
  },
 });
}


</script>

<script>

function getModule(val){
 $.ajax({
  url: '/config',
  type: 'POST',
  data: {'full_config': val},
  success: function(response) {
      $('#response').html(response.data);
  },
 });
}


</script>
 {% endblock content %}

{% block javascripts %}


{% endblock javascripts %}

<|start_filename|>app/home/templates/submit_leaf.html<|end_filename|>
{% if lists %}

    <h1>Lists for Container: {{ container }}</h1>
    <br/>
    {% for i in lists %}
        <span><input value="{{ i }}" class="btn btn-primary btn-round-xs" type="button" onclick="getLeaf(this.value)"></span>
    {% endfor %}
    <pre>{{ object_list }}</pre>

{% else %}

    <h1>No Lists for this Container</h1>
    <br/>
    {% for i in lists %}
        <span><input value="{{ i }}" class="btn btn-primary btn-round-xs" type="button" onclick="getLeaf(this.value)"></span>
    {% endfor %}
    <pre>{{ object_list }}</pre>

{% endif %}
<script>

    function getLeaf(val){
      $.ajax({
      url: '/config',
      type: 'POST',
      data: {'leaf': val},
      success: function(response){
       $('#response').html(response.data);
      },
     });
    }

</script>