Add link to selected http function from edit/logs views. Also remove min number of lines from environment info ace editor

This commit is contained in:
Peter Stockings
2023-12-18 22:18:31 +11:00
parent 4196d89440
commit 4b0c356cda
3 changed files with 62 additions and 27 deletions

View File

@@ -1,10 +1,29 @@
<div class="flex items-center" data-id="51">
<h1 class="font-semibold text-lg md:text-2xl" data-id="52">Update: <span class="font-mono">{{ name }}</span></h1>
<div>
<div class="flex items-center pb-1" data-id="51">
<h1 class="font-semibold text-lg md:text-2xl" data-id="52">Update: <span class="font-mono">{{ name }}</span>
</h1>
<button
class="inline-flex items-center justify-center text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground hover:bg-primary/90 h-9 rounded-md px-3 ml-auto"
hx-get="{{ url_for('dashboard_http_functions') }}" hx-target="#container" hx-swap="innerHTML">
Cancel
</button>
</div>
<div class="flex">
<a class="text-gray-300" href="{{ url_for('execute_http_function', function=name) }}">{{
url_for('execute_http_function', function=name) }}</a>
<button
class="inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground px-2 text-gray-600 dark:text-gray-400"
data-id="24"><span class="sr-only" data-id="25">Add Link</span><svg xmlns="http://www.w3.org/2000/svg"
width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4" data-id="26"
data-darkreader-inline-stroke="" style="--darkreader-inline-stroke: currentColor;">
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71">
</path>
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71">
</path>
</svg>
</button>
</div>
</div>
<div>
@@ -55,7 +74,6 @@
var editor_environment = ace.edit("editor-environment");
editor_environment.setOptions({
maxLines: 15, //editor_environment.session.getLength()
minLines: 5
});
editor_environment.setTheme("ace/theme/github_dark");
editor_environment.session.setMode("ace/mode/json");

View File

@@ -1,7 +1,9 @@
<div class="flex items-center" data-id="51">
<div>
<div class="flex items-center pb-1" data-id="51">
<div class="flex items-center">
<h1 class="font-semibold text-lg md:text-2xl" data-id="52">Logs: <span class="font-mono">{{ name }}</span></h1>
<h1 class="font-semibold text-lg md:text-2xl" data-id="52">Logs: <span class="font-mono">{{ name }}</span>
</h1>
<div class="ml-2 cursor-pointer text-gray-500" hx-get="{{ url_for('get_http_function_logs', name=name) }}"
hx-target="#container" hx-swap="innerHTML">
@@ -15,12 +17,28 @@
</div>
</div>
<button
class="inline-flex items-center justify-center text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground hover:bg-primary/90 h-9 rounded-md px-3 ml-auto"
hx-get="{{ url_for('dashboard_http_functions') }}" hx-target="#container" hx-swap="innerHTML">
Cancel
</button>
</div>
<div class="flex">
<a class="text-gray-300" href="{{ url_for('execute_http_function', function=name) }}">{{
url_for('execute_http_function', function=name) }}</a>
<button
class="inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground px-2 text-gray-600 dark:text-gray-400"
data-id="24"><span class="sr-only" data-id="25">Add Link</span><svg xmlns="http://www.w3.org/2000/svg"
width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4" data-id="26"
data-darkreader-inline-stroke="" style="--darkreader-inline-stroke: currentColor;">
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71">
</path>
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71">
</path>
</svg>
</button>
</div>
</div>
<div class="block md:grid md:grid-cols-4 md:gap-4 p-4">

View File

@@ -54,7 +54,6 @@
var editor_environment = ace.edit("editor-environment");
editor_environment.setOptions({
maxLines: 15, //editor_environment.session.getLength()
minLines: 5
});
editor_environment.setTheme("ace/theme/github_dark");
editor_environment.session.setMode("ace/mode/json");