Commit c8d67301 authored by Your Name's avatar Your Name

Fix malformed Jinja2 template syntax caused by previous sed replacement

- Corrected nested template tags in dashboard templates
- All fetch() calls and URL generations now use proper url_for syntax
- Templates should render correctly now
parent a320f5af
......@@ -73,7 +73,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
function restartServer() {
if (confirm('Are you sure you want to restart the server? This will disconnect all active connections.')) {
fetch('{{ url_for(request, "{{ url_for(request, "/dashboard/restart") }}', {
fetch('{{ url_for(request, "/dashboard/restart") }}', {
method: 'POST',
headers: {'Content-Type': 'application/json'}
})
......
......@@ -912,7 +912,7 @@ async function authenticateCodex(key) {
statusEl.innerHTML = '<p style="margin: 0; color: #4a9eff;">🔄 Starting Codex OAuth2 Device Authorization flow...</p>';
try {
const response = await fetch('{{ url_for(request, "{{ url_for(request, "/dashboard/codex/auth/start") }}', {
const response = await fetch('{{ url_for(request, "/dashboard/codex/auth/start") }}', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
......@@ -962,7 +962,7 @@ async function authenticateCodex(key) {
pollCount++;
try {
const pollResponse = await fetch('{{ url_for(request, "{{ url_for(request, "/dashboard/codex/auth/poll") }}', {
const pollResponse = await fetch('{{ url_for(request, "/dashboard/codex/auth/poll") }}', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
......@@ -1015,7 +1015,7 @@ async function checkCodexAuth(key) {
statusEl.innerHTML = '<p style="margin: 0; color: #4a9eff;">🔄 Checking Codex authentication status...</p>';
try {
const response = await fetch('{{ url_for(request, "{{ url_for(request, "/dashboard/codex/auth/status") }}', {
const response = await fetch('{{ url_for(request, "/dashboard/codex/auth/status") }}', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
......
......@@ -508,7 +508,7 @@ function createPersistentService() {
async function checkTorStatus() {
try {
const response = await fetch('{{ url_for(request, "{{ url_for(request, "/dashboard/tor/status") }}');
const response = await fetch('{{ url_for(request, "/dashboard/tor/status") }}');
const status = await response.json();
const statusText = document.getElementById('tor-status-text');
......@@ -550,7 +550,7 @@ document.addEventListener('DOMContentLoaded', function() {
async function refreshCacheStats() {
try {
const response = await fetch('{{ url_for(request, "{{ url_for(request, "/dashboard/response-cache/stats") }}');
const response = await fetch('{{ url_for(request, "/dashboard/response-cache/stats") }}');
const data = await response.json();
const statsText = document.getElementById('cache-stats-text');
......@@ -585,7 +585,7 @@ async function clearResponseCache() {
}
try {
const response = await fetch('{{ url_for(request, "{{ url_for(request, "/dashboard/response-cache/clear") }}', {
const response = await fetch('{{ url_for(request, "/dashboard/response-cache/clear") }}', {
method: 'POST'
});
const data = await response.json();
......
......@@ -114,7 +114,7 @@ function closeModal() {
function deleteAutoselect(autoselectName) {
if (!confirm(`Are you sure you want to delete the autoselect "${autoselectName}"? This action cannot be undone.`)) return;
fetch('{{ url_for(request, "{{ url_for(request, "/dashboard/user/autoselects") }}/' + encodeURIComponent(autoselectName), {
fetch('{{ url_for(request, "/dashboard/user/autoselects") }}/' + encodeURIComponent(autoselectName), {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
......@@ -161,7 +161,7 @@ document.getElementById('autoselect-form').addEventListener('submit', function(e
formData.append('autoselect_name', autoselectName);
formData.append('autoselect_config', JSON.stringify(configObj));
const url = '{{ url_for(request, "{{ url_for(request, "/dashboard/user/autoselects") }}';
const url = '{{ url_for(request, "/dashboard/user/autoselects") }}';
const method = currentEditingIndex >= 0 ? 'PUT' : 'POST';
fetch(url, {
......
......@@ -156,7 +156,7 @@ function closeModal() {
function deleteProvider(providerName) {
if (!confirm(`Are you sure you want to delete the provider "${providerName}"? This action cannot be undone.`)) return;
fetch('{{ url_for(request, "{{ url_for(request, "/dashboard/user/providers") }}/' + encodeURIComponent(providerName), {
fetch('{{ url_for(request, "/dashboard/user/providers") }}/' + encodeURIComponent(providerName), {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
......@@ -203,7 +203,7 @@ document.getElementById('provider-form').addEventListener('submit', function(e)
formData.append('provider_name', providerName);
formData.append('provider_config', JSON.stringify(configObj));
const url = '{{ url_for(request, "{{ url_for(request, "/dashboard/user/providers") }}';
const url = '{{ url_for(request, "/dashboard/user/providers") }}';
const method = currentEditingIndex >= 0 ? 'PUT' : 'POST';
fetch(url, {
......
......@@ -114,7 +114,7 @@ function closeModal() {
function deleteRotation(rotationName) {
if (!confirm(`Are you sure you want to delete the rotation "${rotationName}"? This action cannot be undone.`)) return;
fetch('{{ url_for(request, "{{ url_for(request, "/dashboard/user/rotations") }}/' + encodeURIComponent(rotationName), {
fetch('{{ url_for(request, "/dashboard/user/rotations") }}/' + encodeURIComponent(rotationName), {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
......@@ -161,7 +161,7 @@ document.getElementById('rotation-form').addEventListener('submit', function(e)
formData.append('rotation_name', rotationName);
formData.append('rotation_config', JSON.stringify(configObj));
const url = '{{ url_for(request, "{{ url_for(request, "/dashboard/user/rotations") }}';
const url = '{{ url_for(request, "/dashboard/user/rotations") }}';
const method = currentEditingIndex >= 0 ? 'PUT' : 'POST';
fetch(url, {
......
......@@ -181,7 +181,7 @@ function closeModal() {
function deleteToken(tokenId) {
if (!confirm('Are you sure you want to delete this API token? This action cannot be undone and will immediately revoke access.')) return;
fetch('{{ url_for(request, "{{ url_for(request, "/dashboard/user/tokens") }}/' + tokenId, {
fetch('{{ url_for(request, "/dashboard/user/tokens") }}/' + tokenId, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
......@@ -228,7 +228,7 @@ document.getElementById('create-token-form').addEventListener('submit', function
formData.append('description', description);
}
fetch('{{ url_for(request, "{{ url_for(request, "/dashboard/user/tokens") }}', {
fetch('{{ url_for(request, "/dashboard/user/tokens") }}', {
method: 'POST',
body: formData
}).then(response => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment