diff options
Diffstat (limited to 'lib/srtgui/templates/maintenance.html')
-rwxr-xr-x | lib/srtgui/templates/maintenance.html | 280 |
1 files changed, 207 insertions, 73 deletions
diff --git a/lib/srtgui/templates/maintenance.html b/lib/srtgui/templates/maintenance.html index a0bb1845..c35d6961 100755 --- a/lib/srtgui/templates/maintenance.html +++ b/lib/srtgui/templates/maintenance.html @@ -1,82 +1,216 @@ {% extends "base.html" %} {% load static %} -{% load projecttags %} +{% load jobtags %} {% load humanize %} {% block title %} Maintenance tools {% endblock %} {% block pagecontent %} - <div class="row"> - <div class="col-md-7" style="padding-left: 50px;"> - <h1>Maintenance</h1> - </div> - </div> - <div class="row"> - <div class="jumbotron well-transparent"> - - <div class="col-md-6"> - <div> - <table class="table table-striped table-condensed" data-testid="landing-hyperlinks-table"> - <thead> - <tr> - <th>Action</th> - <th>Description</th> - </tr> - </thead> - - <tr> - <td><a class="btn btn-info btn-lg" href="{% url 'error_logs' %}">Error Logs</a></td> - <td>Examine Error Logs ({{errorlog_total}})</td> - </tr> - <tr> - <td><a class="btn btn-info btn-lg" href="{% url 'history_cve' %}">History CVE</a></td> - <td>Examine History for CVEs</td> - </tr> - <tr> - <td><a class="btn btn-info btn-lg" href="{% url 'history_vulnerability' %}">History Vulnerabilities</a></td> - <td>Examine History for Vulnerabilities</td> - </tr> - <tr> - <td><a class="btn btn-info btn-lg" href="{% url 'history_investigation' %}">History Investigations</a></td> - <td>Examine History for Investigations</td> - </tr> - <tr> - <td><a class="btn btn-info btn-lg" href="{% url 'history_defect' %}">History Defects</a></td> - <td>Examine History for Defects</td> - </tr> - - </table> - </div> - - </div> - - <div class="col-md-5"> - <b>Quick Info</b> - <div class="well"> - <dl class="dl-horizontal"> - - <dt>CVE History: Total Count =</dt> - <dd> - {{history_cve_total}} - </dd> - <dt>Vulnerability History: Total Count =</dt> - <dd> - {{history_vulnerability_total}} - </dd> - <dt>Investigation: Total Count =</dt> - <dd> - {{history_investigation_total}} - </dd> - <dt>Defect: Total Count =</dt> - <dd> - {{defect_investigation_total}} - </dd> - - </dl> - </div> - </div> - - </div> - </div> + +<div class="row"> + <!-- Breadcrumbs --> + <div class="col-md-12"> + <ul class="breadcrumb" id="breadcrumb"> + <li><a href="{% url 'landing' %}">Home</a></li><span class="divider">→</span> + <li><a href="{% url 'manage' %}">Management</a></li><span class="divider">→</span> + <li>Maintenance</a> + </ul> + </div> +</div> + +<div class="row"> + <div class="col-md-7" style="padding-left: 50px;"> + <h1>Maintenance</h1> + </div> +</div> + +<div class="row"> + <div class="col-md-12"> + {% with mru=mru %} + {% include 'mrj_section.html' %} + {% endwith %} + </div> +</div> + +<div class="row"> +<div class="jumbotron well-transparent"> + + <div class="col-md-6"> + <div> + <table class="table table-striped table-condensed" data-testid="landing-hyperlinks-table"> + <thead> + <tr> + <th>Action</th> + <th>Description</th> + </tr> + </thead> + + <tr> + <td><a class="btn btn-info btn-lg" href="{% url 'error_logs' %}">Error Logs</a></td> + <td>Examine Error Logs ({{errorlog_total}})</td> + </tr> + <tr> + <td><a class="btn btn-info btn-lg" href="{% url 'history_cve' %}">History CVE</a></td> + <td>Examine History for CVEs</td> + </tr> + <tr> + <td><a class="btn btn-info btn-lg" href="{% url 'history_vulnerability' %}">History Vulnerabilities</a></td> + <td>Examine History for Vulnerabilities</td> + </tr> + <tr> + <td><a class="btn btn-info btn-lg" href="{% url 'history_investigation' %}">History Investigations</a></td> + <td>Examine History for Investigations</td> + </tr> + <tr> + <td><a class="btn btn-info btn-lg" href="{% url 'history_defect' %}">History Defects</a></td> + <td>Examine History for Defects</td> + </tr> + + <tr> + <td><a class="btn btn-info btn-lg" href="{% url 'manage_jobs' 77 %}">Manage Jobs</a></td> + <td>Manage the Jobs table</td> + </tr> + + <tr> + <td> + <button class="execute" id="submit-clearjobs"> Clear Jobs</button> + <td>Clear the Jobs table of all entries</td> + </tr> + + <tr> + <td> + <button class="execute" id="submit-testjob1"> Test Job #1 Progress </button> + <td>Test job progress bars support with default job #1</td> + </tr> + + <tr> + <td> + <button class="execute" id="submit-testjob1-2"> Test Job #2 Progress </button> + <td>Test job progress bars support with job #2</td> + </tr> + + <tr> + <td> + <button class="execute" id="submit-parent-child"> Test Parent/Child Jobs</button> + <td>Test Progress using parent and child jobs</td> + </tr> + + </table> + </div> + + </div> + + <div class="col-md-5"> + <b>Quick Info</b> + <div class="well"> + <dl class="dl-horizontal"> + + <dt>CVE History: Total Count =</dt> + <dd> + {{history_cve_total}} + </dd> + <dt>Vulnerability History: Total Count =</dt> + <dd> + {{history_vulnerability_total}} + </dd> + <dt>Investigation: Total Count =</dt> + <dd> + {{history_investigation_total}} + </dd> + <dt>Defect: Total Count =</dt> + <dd> + {{defect_investigation_total}} + </dd> + + </dl> + </div> + + <form method="post"> {% csrf_token %} + <b>Remote Backup Path + <button class="execute btn btn-primary">Update</button> <!-- btn-lg --> + </b> + <div class="well"> + <input type="hidden" name="action" value="submit-remote-backup-path"> + Path = <input type="text" placeholder="remote backup path" name="text-remote-backup-path" size="60" value="{{remote_backup_path}}"> + </div> + <form> + </div> + +</div> +</div> + + +<script type="text/javascript"> + + $(document).ready(function() { + + function onCommitAjaxSuccess(data, textstatus) { + if (window.console && window.console.log) { + console.log("XHR returned:", data, "(" + textstatus + ")"); + } else { + alert("NO CONSOLE:\n"); + return; + } + if (data.error != "ok") { + alert("error on request:\n" + data.error); + return; + } + // reload the page with the updated tables + location.reload(true); + } + + function onCommitAjaxError(jqXHR, textstatus, error) { + console.log("ERROR:"+error+"|"+textstatus); + alert("XHR errored1:\n" + error + "\n(" + textstatus + ")"); + } + + /* ensure cookie exists {% csrf_token %} */ + function postCommitAjaxRequest(reqdata,url) { + var ajax = $.ajax({ + type:"POST", + data: reqdata, + url: url, + headers: { 'X-CSRFToken': $.cookie("csrftoken")}, + success: onCommitAjaxSuccess, + error: onCommitAjaxError, + }); + } + + + $('#submit-clearjobs').click(function(){ + postCommitAjaxRequest({ + "action" : 'submit-clearjobs', + },"{% url 'xhr_job_post' %}"); + }); + + $('#submit-testjob1').click(function(){ + postCommitAjaxRequest({ + "action" : 'submit-testjob', + "command" : 'SELFTEST', + "name" : 'Basic self test', + },"{% url 'xhr_job_post' %}"); + }); + + $('#submit-testjob1-2').click(function(){ + postCommitAjaxRequest({ + "action" : 'submit-testjob-j2', + "command" : 'SELFTEST', + "name" : 'Basic self test', + },"{% url 'xhr_job_post' %}"); + }); + + $('#submit-parent-child').click(function(){ + postCommitAjaxRequest({ + "action" : 'submit-testjob-parent', + "command" : 'PARENTTEST', + "name" : 'Test Parent/Children', + },"{% url 'xhr_job_post' %}"); + }); + + + /* Set the report link */ + $('#report_link').attr('href',"{% url 'report' request.resolver_match.url_name %}"); + }); +</script> {% endblock %} |