Use url_for to generate url for http functions on overview page
This commit is contained in:
@@ -1,13 +1,8 @@
|
|||||||
def create_http_function_view_model(http_function):
|
def create_http_function_view_model(http_function):
|
||||||
# Base URL for the function invocation
|
|
||||||
base_url = "https://function.peterstockings.com/f/"
|
|
||||||
|
|
||||||
name = http_function['name']
|
|
||||||
function_view_model = {
|
function_view_model = {
|
||||||
"id": http_function['id'],
|
"id": http_function['id'],
|
||||||
"name": name,
|
"name": http_function['name'],
|
||||||
"script_content": http_function['script_content'],
|
"script_content": http_function['script_content'],
|
||||||
"url": f"{base_url}{name}",
|
|
||||||
"invoked_count": http_function['invoked_count'],
|
"invoked_count": http_function['invoked_count'],
|
||||||
"environment_info": http_function['environment_info']
|
"environment_info": http_function['environment_info']
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,9 +30,10 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="p-4 align-middle [&:has([role=checkbox])]:pr-0 hidden md:table-cell" data-id="67">
|
<td class="p-4 align-middle [&:has([role=checkbox])]:pr-0 hidden md:table-cell" data-id="67">
|
||||||
<a href="{{ function.url }}">{{ function.url }}</a>
|
<a href="{{ url_for('execute_http_function', function=function.name) }}">{{
|
||||||
|
url_for('execute_http_function', function=function.name) }}</a>
|
||||||
<button
|
<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-4 text-gray-600 dark:text-gray-400"
|
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 pl-1 text-gray-600 dark:text-gray-400"
|
||||||
data-id="24"><span class="sr-only" data-id="25">Add Link</span><svg
|
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"
|
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"
|
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
||||||
|
|||||||
Reference in New Issue
Block a user