Kubernetes Web View to list and view all Kubernetes resources https://kube-web-view.readthedocs.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
944 B

<div>
{{ resource.obj|yaml|highlight(config=config, cluster=cluster, namespace=namespace, resource=resource, linenos=True)|safe }}
</div>
<script>
function highlight() {
const fragment = location.hash;
if (!!fragment) {
document.querySelectorAll('pre>span').forEach( el => { el.style.background = null; });
const element = document.getElementById('yaml-' + fragment.substring(1));
if (!!element) {
element.style.background = 'hsl(48, 100%, 67%)';
element.scrollIntoView({block: 'center'});
}
}
}
highlight();
const $lineNumbers = Array.prototype.slice.call(document.querySelectorAll('.linenos a'), 0);
$lineNumbers.forEach( el => {
el.addEventListener('click', (event) => {
location.hash = '#' + el.href.split('#')[1];
highlight();
event.preventDefault();
});
});
</script>