File tree Expand file tree Collapse file tree 6 files changed +40
-4
lines changed
component_catalog/templates/component_catalog Expand file tree Collapse file tree 6 files changed +40
-4
lines changed Original file line number Diff line number Diff line change 2222 {% endif %}
2323 {% if scan.refresh_url %}
2424 < li class ="list-inline-item "{% if not show_btn_label %} data-bs-toggle ="tooltip "{% endif %} data-bs-title ="Refresh Scan ">
25- < a class ="btn btn-outline-dark btn-sm " href ="{{ scan.refresh_url }} ">
25+ < a class ="btn btn-outline-dark btn-sm scan_refresh_link " href ="#scan-refresh-modal " role =" button " data-refresh-url =" {{ scan.refresh_url }} " data-bs-toggle =" modal ">
2626 < i class ="fa-solid fa-rotate-right "> </ i > {% if show_btn_label %} Refresh Scan{% endif %}
2727 </ a >
2828 </ li >
File renamed without changes.
Original file line number Diff line number Diff line change 1+ {% load i18n %}
2+ < div id ="scan-refresh-modal " class ="modal " tabindex ="-1 " role ="dialog ">
3+ < div class ="modal-dialog " role ="document ">
4+ < div class ="modal-content ">
5+ < div class ="modal-header ">
6+ < h5 class ="modal-title "> Refresh {% trans 'Scan' %}</ h5 >
7+ < button type ="button " class ="btn-close " data-bs-dismiss ="modal " aria-label ="Close "> </ button >
8+ </ div >
9+ < div class ="modal-body bg-body-tertiary ">
10+ < p > < strong > Are you sure you want to refresh this Scan?</ strong > </ p >
11+ < p >
12+ All current data and results related to the Scan will be lost.< br >
13+ If the Scan is in progress, it will be canceled.
14+ </ p >
15+ </ div >
16+ < div class ="modal-footer ">
17+ < button type ="button " class ="btn btn-secondary " data-bs-dismiss ="modal "> Cancel</ button >
18+ < a class ="btn btn-success refresh-confirm " href =""> Refresh Scan</ a >
19+ </ div >
20+ </ div >
21+ </ div >
22+ </ div >
Original file line number Diff line number Diff line change 2929 {% if has_add_package_permission %}
3030 {% include 'component_catalog/includes/add_package_modal.html' %}
3131 {% endif %}
32- {% include 'component_catalog/includes/scan_delete_modal.html' %}
32+ {% include 'component_catalog/modals/scan_delete_modal.html' %}
33+ {% include 'component_catalog/modals/scan_refresh_modal.html' %}
3334{% endblock %}
3435
3536{% block javascripts %}
4243 document . querySelector ( '#scan-delete-modal a.delete-confirm' ) . setAttribute ( 'href' , deleteUrl ) ;
4344 } ) ;
4445 } ) ;
46+ document . querySelectorAll ( '.scan_refresh_link' ) . forEach ( link => {
47+ link . addEventListener ( 'click' , function ( ) {
48+ let refreshUrl = this . getAttribute ( 'data-refresh-url' ) ;
49+ document . querySelector ( '#scan-refresh-modal a.refresh-confirm' ) . setAttribute ( 'href' , refreshUrl ) ;
50+ } ) ;
51+ } ) ;
4552 } ) ;
4653 </ script >
4754{% endblock %}
Original file line number Diff line number Diff line change 3939 Created < span title ="{{ scan.created_date }} "> {{ scan.created_date|naturaltime }}</ span >
4040 </ div >
4141 </ div >
42- < div class ="col-2 ">
42+ < div class ="col-auto ">
4343 {% include 'component_catalog/includes/scan_progress.html' with scan=scan only %}
4444 </ div >
4545 </ div >
Original file line number Diff line number Diff line change 2828 {% if scan_summary_to_package_form %}
2929 {% include 'component_catalog/includes/scan_summary_to_package_modal.html' %}
3030 {% endif %}
31- {% include 'component_catalog/includes/scan_delete_modal.html' %}
31+ {% include 'component_catalog/modals/scan_delete_modal.html' %}
32+ {% include 'component_catalog/modals/scan_refresh_modal.html' %}
3233 < script >
3334 document . querySelectorAll ( '.scan_delete_link' ) . forEach ( link => {
3435 link . addEventListener ( 'click' , function ( ) {
3536 let deleteUrl = this . getAttribute ( 'data-delete-url' ) ;
3637 document . querySelector ( '#scan-delete-modal a.delete-confirm' ) . setAttribute ( 'href' , deleteUrl ) ;
3738 } ) ;
3839 } ) ;
40+ document . querySelectorAll ( '.scan_refresh_link' ) . forEach ( link => {
41+ link . addEventListener ( 'click' , function ( ) {
42+ let refreshUrl = this . getAttribute ( 'data-refresh-url' ) ;
43+ document . querySelector ( '#scan-refresh-modal a.refresh-confirm' ) . setAttribute ( 'href' , refreshUrl ) ;
44+ } ) ;
45+ } ) ;
3946 </ script >
4047{% endif %}
You can’t perform that action at this time.
0 commit comments