Skip to content

Commit

Permalink
Closed #59, and cleaned up code and increased performance on VCenter …
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
Raj Kumar committed Mar 9, 2022
1 parent bafe579 commit 78ced90
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions terraform/TEMPLATES/vcenter.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,38 +61,21 @@
console.log("No saved value for vCenter DC Name")
}

document.addEventListener('turbo:load', function () {
const loadListener = document.addEventListener('turbo:load', function () {
console.log("turbo:load fired");
loadInputVCenter();

const vcTurboFrame = document.getElementById("vc");
console.log(vcTurboFrame)

const path = window.location.pathname;
const page = path.split("/").pop();

const dummyC = document.getElementById('dummy_container')

const observer = new MutationObserver((mutationsList, observered) => {
console.log('Mutation observer body is being ran!')
// console.log('Mutation observer body is being ran!')
loadInput();
observer.disconnect();

delete observer;
// observered.disconnect()

document.removeEventListener('turbo:load', null)

})
// observer.disconnect();
// setTimeout( () => {
// observer.disconnect();
// } , 2000)
observer.observe(dummyC, { attributes: true, childList: true, subtree: true })
document.getElementById("vc").addEventListener('turbo:frame-render', function () {
console.log("VC turbo frame was loaded");
});
document.getElementById("dummy_container").addEventListener('turbo:frame-render', function () {
console.log("VC turbo frame was loaded");
});
});


Expand Down Expand Up @@ -184,10 +167,10 @@ <h2>vCenter Details</h2>
</main>
<!-- End Main Content -->
</div>
<script src="{{ url_for('static',filename='assets/cui-2.0.0/js/jquery-3.0.0.min.js') }}"></script>
<!-- <script src="{{ url_for('static',filename='assets/cui-2.0.0/js/jquery-3.0.0.min.js') }}"></script>
<script src="{{ url_for('static',filename='assets/cui-2.0.0/js/lodash.min.js') }}"></script>
<script src="{{ url_for('static',filename='assets/cui-2.0.0/js/clipboard.js') }}"></script>
<script src="{{ url_for('static',filename='assets/cui-2.0.0/js/styleguide.js') }}"></script>
<script src="{{ url_for('static',filename='assets/cui-2.0.0/js/styleguide.js') }}"></script> -->
<!-- <script src="{{ url_for('static',filename='assets/cui-2.0.0/js/highcharts.js') }}"></script> -->
<!-- <script src="{{ url_for('static',filename='assets/cui-2.0.0/js/exporting.js') }}"></script> -->
<!-- <script src="{{ url_for('static',filename='assets/cui-2.0.0/js/html2canvas.js') }}"></script> -->
Expand Down

0 comments on commit 78ced90

Please sign in to comment.