Testing #28

Merged
pi-ux-ce merged 12 commits from testing into main 2026-08-26 08:39:27 +00:00
Showing only changes of commit a991b69547 - Show all commits
+20 -2
View File
@@ -45,9 +45,27 @@ def urlcleaning(modeladmin, request, queryset):
return 0 return 0
@admin.register(streamingData) @admin.register(streamingData)
class streamingAdmin(ImportExportModelAdmin): class streamingAdmin(ImportExportModelAdmin):
list_display = ['clickable_links','result','status'] list_display = ['clickable_links','result_colored','newstatus']
fields = ['url'] fields = ['url']
actions = [check,urlcleaning] actions = [check,urlcleaning]
def clickable_links(self, obj): def clickable_links(self, obj):
return format_html('<a href="{}">{}</a>', obj.url,obj.url) return format_html('<a href="{}">{}</a>', obj.url,obj.url)
def result_colored(self, obj):
colors = {
'REACHABLE': 'green',
'VPN REQUIRED': 'yellow',
'UNREACHABLE': 'red',
}
return format_html(
'<b style="background:{};">{}</b>',
colors[obj.result],
obj.result,
)
def newstatus(self, obj):
if obj.status != '200':
return format_html('<div style="width:100%%; height:100%%; background-color:orange;">{}</div>', obj.status)
#return obj.status