Skip to content

Commit

Permalink
model for manual update
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefal committed Jun 19, 2024
1 parent bbbd5c7 commit f22fcaa
Showing 1 changed file with 34 additions and 20 deletions.
54 changes: 34 additions & 20 deletions web_app/templates/manual_update.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,44 @@

{% block content %}
<div class="container">
<div id="upload">
<h1>Manual Update: </h1>
<form method="POST" action="" enctype="multipart/form-data">
<p><input type="file" name="file"></p>
<p><input type="submit" value="Submit"></p>
</form>
</div>
<div id="updating"></div>
</div>


<!-- The update Modal dialog box-->
<div class="modal" id="updateModal">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<h4 class="modal-title">Update</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<!-- Modal body -->
<div class="modal-body">
<h1>Manual Update: </h1>
<form method="POST" action="" enctype="multipart/form-data">
<p><input type="file" name="file"></p>
<p><input onclick="form_submit()" id="submit-button" type="submit" value="Submit"></p>
</form>
</div>
<!-- Modal footer -->
<div class="modal-footer mx-auto">
<button id="start-update-button" type="button" class="btn btn-success" disabled>Update</button>
<button id="cancel-button" type="button" class="btn btn-primary" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

{% block scripts %}
{{super()}}
<script>
// SocketIO namespace:
namespace = "/test";

// initiate SocketIO connection
socket = io.connect(namespace);

socket.on("updating_rtkbase", function() {
$("#updating").text("Please wait...Updating...Refresh manually in a few minutes");

})
<script type="text/javascript" src="{{ url_for('static', filename='lib/bootstrap4-toggle.js') }}" charset="utf-8"></script>
<script type="text/javascript" src="{{ url_for('static', filename='settings.js', v=g.version) }}" charset="utf-8"></script>
<script type="text/javascript">
$('#updateModal').modal();
function form_submit() {
document.querySelector("form").submit();
};
</script>
{% endblock %}

0 comments on commit f22fcaa

Please sign in to comment.