{% extends "_frame.html" %} {% block styles %} {% endblock %} {% block menu %}

Agentic Services

{% endblock %} {% block details %} {% include "_search.html" %} {% endblock %} {% block page %}
{% include "_eof.html" %}
{% endblock %} {% block script %} {% include "_search.js" %} let endOfList = null; let container = null; let offset = null; let isDone = false; let endOfFile = null; let isLoading = false; let observer = null; let debounceTimeout = null; function search() { searchFlows(); } async function searchFlows() { offset = null; isDone = false; container.innerHTML = ''; endOfFile.style.display = 'none'; loadFlows(); } async function loadFlows() { if (isLoading || isDone) return; isLoading = true; observer.disconnect(); try { const params = new URLSearchParams(); params.set('pp', '30'); if (offset) { params.set('offset', offset); } if (searchInput.value) { params.set('q', searchInput.value); } showPulse(); const url = `/flow?${params.toString()}` const response = await fetch(url); const data = await response.json(); if (data.items) { data.items.forEach(flow => { if (flow.method.toLowerCase() == "get") { const flowElement = document.createElement('div'); flowElement.classList.add('s12', 'l4'); flowElement.innerHTML = `
${flow.summary}

${flow.description}

${ flow.tags ? flow.tags.map(tag => `${tag}`).join(' | ') : '-' }
`; container.appendChild(flowElement); } }); offset = data.offset; } } catch (error) { console.error('Error loading flows:', error); } finally { hidePulse(); isLoading = false; if (offset) { const endOfListRect = endOfList.getBoundingClientRect(); const isVisible = endOfListRect.top < window.innerHeight && endOfListRect.bottom >= 0; if (isVisible) { loadFlows(); } else { observer.observe(endOfList); } } else { observer.observe(endOfList); isDone = true; const count = document.querySelectorAll('.flow').length; endOfFile.textContent = `(${count} item${count > 1 ? 's' : ''})`; endOfFile.style.display = 'block'; } } } document.addEventListener('DOMContentLoaded', (event) => { endOfList = document.getElementById('end-of-list'); closeIcon = document.getElementById('close-icon'); searchInput = document.getElementById('search-input'); container = document.getElementById('flow-container'); endOfFile = document.getElementById('end-of-file'); observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting && !isLoading) { loadFlows(); } }); }, { root: null, rootMargin: '100px', threshold: 0.1 }); observer.observe(endOfList); }); {% endblock %}