{% extends 'clean_base.axml' %} {% from 'actions.axml' import pagination %} {% set modal_name = 'Provision Application' %} {% macro commander() %} { isFilterable: false, nameSearch: '', addressSearch: '', whenFilter: '', generatedApiKey: null, showApiKeyReveal: false, filterResults(){ let base = `/v1/applications?pagination=${this.pagination}&page=1` if(this.nameSearch) base += `&name=${this.nameSearch}` if(this.addressSearch) base += `&address=${this.addressSearch}` if(this.whenFilter) base += `&timeline=${this.whenFilter}` fetch(base) .then(r => r.json()) .then(data => { isFiltering = true; applications = data; }).catch(err => ShowFeedback('error', 'Filter operation failed')) }, clearFilter(){ this.nameSearch = ''; this.addressSearch = ''; this.whenFilter = ''; isFiltering = false; refreshPage(); }, checkDirty(){ this.isFilterable = ( this.nameSearch !== '' || this.addressSearch !== '' || this.whenFilter !== '' ); return this.isFilterable; }, async toggleActive(appName){ try { const res = await superpatch(`/v1/applications/${appName}`).send({}); $dispatch('refresher'); supertoast('success', `Application ${res.body.active ? 'activated' : 'deactivated'}`); } catch(err) { supertoast('error', err.response?.body?.error || 'Failed to toggle status'); } }, async regenerateKey(appName){ if(!confirm(`Regenerate API key for ${appName}? The old key will stop working immediately.`)) return; try { const res = await superpost(`/v1/applications/${appName}/apikey`).send({}); this.generatedApiKey = res.body.apikey; this.showApiKeyReveal = true; } catch(err) { supertoast('error', err.response?.body?.error || 'Failed to regenerate API key'); } }, copyApiKey(){ if(this.generatedApiKey){ navigator.clipboard.writeText(this.generatedApiKey); supertoast('success', 'API key copied to clipboard'); } }, dismissApiKey(){ this.generatedApiKey = null; this.showApiKeyReveal = false; } } {% endmacro %} {% block easel %}
layers
link
Name Address Status Timestamp Actions
{{ pagination() }}
{% endblock %} {% block wizard %} {% endblock %}