mirror of
				https://git.collinwebdesigns.de/oscar.krause/fastapi-dls.git
				synced 2025-10-26 18:05:28 +03:00 
			
		
		
		
	fixed refreshing data after deleting some origin or lease
This commit is contained in:
		
							parent
							
								
									dcbcba88cb
								
							
						
					
					
						commit
						fc00dab5c9
					
				@ -102,7 +102,6 @@ async function deleteOrigins() {
 | 
			
		||||
    let xhr = new XMLHttpRequest();
 | 
			
		||||
    xhr.open("DELETE", '/-/origins', true);
 | 
			
		||||
    xhr.send();
 | 
			
		||||
    await fetchOriginsWithLeases()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function deleteOrigin(origin_ref) {
 | 
			
		||||
 | 
			
		||||
@ -5,18 +5,20 @@
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div>
 | 
			
		||||
    <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
 | 
			
		||||
        <h1 class="h2">Leases <small>with origin</small></h1>
 | 
			
		||||
        <div class="btn-toolbar mb-2 mb-md-0">
 | 
			
		||||
            <div class="btn-group me-2">
 | 
			
		||||
                <button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteLease();load();">delete lease</button>
 | 
			
		||||
    <div>
 | 
			
		||||
        <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
 | 
			
		||||
            <h1 class="h2">Leases <small>with origin</small></h1>
 | 
			
		||||
            <div class="btn-toolbar mb-2 mb-md-0">
 | 
			
		||||
                <div class="btn-group me-2">
 | 
			
		||||
                    <button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteLease().finally(() => load())">
 | 
			
		||||
                        delete lease
 | 
			
		||||
                    </button>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div id="leases" class="mt-3"></div>
 | 
			
		||||
</div>
 | 
			
		||||
        <div id="leases" class="mt-3"></div>
 | 
			
		||||
    </div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block scripts %}
 | 
			
		||||
 | 
			
		||||
@ -5,24 +5,33 @@
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div>
 | 
			
		||||
    <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
 | 
			
		||||
        <h1 class="h2">Origins <small>with leases</small></h1>
 | 
			
		||||
        <div class="btn-toolbar mb-2 mb-md-0">
 | 
			
		||||
            <div class="btn-group me-2">
 | 
			
		||||
                <button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteOrigins()">delete all</button>
 | 
			
		||||
    <div>
 | 
			
		||||
        <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
 | 
			
		||||
            <h1 class="h2">Origins <small>with leases</small></h1>
 | 
			
		||||
            <div class="btn-toolbar mb-2 mb-md-0">
 | 
			
		||||
                <div class="btn-group me-2">
 | 
			
		||||
                    <button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteOrigin().finally(() => load())">
 | 
			
		||||
                        delete origin
 | 
			
		||||
                    </button>
 | 
			
		||||
                    <button type="button" class="btn btn-sm btn-outline-danger" onclick="deleteOrigins().finally(() => load())">
 | 
			
		||||
                        delete all
 | 
			
		||||
                    </button>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div id="origins" class="mt-3"></div>
 | 
			
		||||
</div>
 | 
			
		||||
        <div id="origins" class="mt-3"></div>
 | 
			
		||||
    </div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block scripts %}
 | 
			
		||||
{{ super() }}
 | 
			
		||||
<script type="application/javascript">
 | 
			
		||||
    const origins = document.getElementById('origins')
 | 
			
		||||
    fetchOriginsWithLeases(origins)
 | 
			
		||||
</script>
 | 
			
		||||
    <script type="application/javascript">
 | 
			
		||||
        function load() {
 | 
			
		||||
            const origins = document.getElementById('origins')
 | 
			
		||||
            fetchOriginsWithLeases(origins)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        load()
 | 
			
		||||
    </script>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user