
- Updated `.env` and added `.env.test` for environment variables. - Introduced API documentation in `API_DOCUMENTATION.md`. - Added authentication setup guide in `AUTHENTICATION_SETUP.md`. - Implemented user authentication with JWT and email verification. - Created new routes for user management and form submissions. - Added middleware for API key authentication and error handling. - Set up Redis for rate limiting and notifications. - Removed obsolete files and configurations related to the previous Rust implementation.
51 lines
3.1 KiB
Plaintext
51 lines
3.1 KiB
Plaintext
<% if (forms && forms.length > 0) { %>
|
|
<table style="width: 100%; border-collapse: collapse;">
|
|
<thead>
|
|
<tr style="background-color: #eee;">
|
|
<th style="padding: 0.5rem; border: 1px solid #ddd; text-align: left;">Form Name</th>
|
|
<th style="padding: 0.5rem; border: 1px solid #ddd; text-align: left;">Submissions</th>
|
|
<th style="padding: 0.5rem; border: 1px solid #ddd; text-align: left;">Endpoint URL</th>
|
|
<th style="padding: 0.5rem; border: 1px solid #ddd; text-align: left;">Created Date</th>
|
|
<th style="padding: 0.5rem; border: 1px solid #ddd; text-align: left;">Status</th>
|
|
<th style="padding: 0.5rem; border: 1px solid #ddd; text-align: left;">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<% forms.forEach(form => { %>
|
|
<tr>
|
|
<td style="padding: 0.5rem; border: 1px solid #ddd;"><%= form.name %></td>
|
|
<td style="padding: 0.5rem; border: 1px solid #ddd;"><%= form.submission_count %></td>
|
|
<td style="padding: 0.5rem; border: 1px solid #ddd;">
|
|
<code><%= appUrl %>/submit/<%= form.uuid %></code>
|
|
<button onclick="copyToClipboard('<%= appUrl %>/submit/<%= form.uuid %>')">Copy</button>
|
|
</td>
|
|
<td style="padding: 0.5rem; border: 1px solid #ddd;"><%= new Date(form.created_at).toLocaleDateString() %></td>
|
|
<td style="padding: 0.5rem; border: 1px solid #ddd;"><%= form.is_archived ? 'Archived' : 'Active' %></td>
|
|
<td style="padding: 0.5rem; border: 1px solid #ddd;">
|
|
<a href="/dashboard/submissions/<%= form.uuid %>" class="btn btn-secondary">View Submissions</a>
|
|
<a href="/dashboard/forms/<%= form.uuid %>/settings" class="btn btn-secondary">Settings</a>
|
|
<!-- Add Archive/Delete buttons/forms here -->
|
|
<form action="/dashboard/forms/<%= form.is_archived ? 'unarchive' : 'archive' %>/<%= form.uuid %>" method="POST" style="display: inline;">
|
|
<button type="submit" class="btn btn-secondary"><%= form.is_archived ? 'Unarchive' : 'Archive' %></button>
|
|
</form>
|
|
<form action="/dashboard/forms/delete/<%= form.uuid %>" method="POST" style="display: inline;" onsubmit="return confirm('Are you sure you want to permanently delete this form and all its submissions?');">
|
|
<button type_submit" class="btn btn-danger">Delete</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<% }); %>
|
|
</tbody>
|
|
</table>
|
|
<% } else { %>
|
|
<p>You haven't created any forms yet. <a href="/dashboard/create-form">Create one now!</a></p>
|
|
<% } %>
|
|
|
|
<script>
|
|
function copyToClipboard(text) {
|
|
navigator.clipboard.writeText(text).then(function() {
|
|
alert('Endpoint URL copied to clipboard!');
|
|
}, function(err) {
|
|
alert('Could not copy text: ', err);
|
|
});
|
|
}
|
|
</script> |