{% extends 'abase.axml' %} {% from 'actions.axml' import pagination %} {% macro commander() %} { isFilterable: false, originSearch: '', completedFilter: 'all', destinationSearch: '', gistSearch: '', eventSearch: '', whenFilter: '', filterResults(){ let base = `/v1/gists?pagination=${pagination}&page=${page}` if(this.originSearch) base = `${base}&origin=${this.originSearch}` if(this.completedFilter) base = `${base}&completed=${this.completedFilter}` if(this.destinationSearch) base = `${base}&destination=${this.destinationSearch}` if(this.gistSearch) base = `${base}&gist=${this.gistSearch}` if(this.eventSearch) base = `${base}&event=${this.eventSearch}` if(this.whenFilter) base = `${base}&timeline=${this.whenFilter}` fetch(`${base}`) .then(response => response.json()) .then(data => { isFiltering = true; gists = data; }).catch(err => { ShowFeedback('error', 'Filter operation failed...') }) }, clearFilter(){ this.originSearch = ''; this.completedFilter = 'all'; this.destinationSearch = ''; this.gistSearch = ''; this.eventSearch = ''; this.whenFilter = ''; isFiltering = false; fetchAll(); }, checkDirty(){ if(this.originSearch !== '' || this.completedFilter !== 'all' || this.destinationSearch !== '' || this.gistSearch !== '' || this.eventSearch !== '' || this.whenFilter !== '' ) { this.isFilterable = true; return true; } this.isFilterable = false; return false; } } {% endmacro %} {% block easel %}
Filters:
# Sent Action Publisher Subscriber Endpoint Timestamp Resend
# Sent Action Publisher Subscriber Endpoint Timestamp Resend
{{ pagination() }}
{% endblock %} {% macro resendable() %} { resending: null, resendGist(gist){ this.resending = gist; fetch(`/v1/regists/${gist}`, { method: 'POST', headers: {'Content-Type': 'application/json'} }) .then(response => response.json()) .then(data => { if(data.error) { this.resending = null; return ShowFeedback('error', data.error); } this.resending = null; ShowFeedback('success', `Gist ${gist} resent...`, 7000); }) .catch(err => { this.resending = null; ShowFeedback('error', 'Could not resend gist...', 1000) }) } } {% endmacro %}