editor.html 907 B

1234567891011121314
  1. {% extends "layout.html" %}
  2. {% block content %}
  3. <div class="flex justify-between items-center mb-6 bg-gray-800 p-4 rounded border border-gray-700 shadow">
  4. <h2 class="text-2xl font-bold">{{ title }}</h2>
  5. <button onclick="document.getElementById('hid').value=editor.getValue();document.getElementById('frm').submit();" class="bg-blue-600 hover:bg-blue-500 px-8 py-2 rounded font-bold shadow-lg transition">Save Config</button>
  6. </div>
  7. <div class="border border-gray-700 rounded overflow-hidden shadow-2xl relative" style="height: 65vh;"><div id="editor" class="absolute inset-0 text-lg">{{ content }}</div></div>
  8. <form id="frm" action="{{ action }}" method="POST" class="hidden"><textarea name="content" id="hid"></textarea></form>
  9. <script>
  10. var editor = ace.edit("editor");
  11. editor.setTheme("ace/theme/monokai");
  12. editor.session.setMode("ace/mode/perl");
  13. </script>
  14. {% endblock %}