2024-10-15 00:38:38 +00:00
|
|
|
__package__ = 'archivebox.crawls'
|
2024-10-12 02:47:05 +00:00
|
|
|
|
2024-10-15 00:38:38 +00:00
|
|
|
import abx
|
2024-10-14 22:41:58 +00:00
|
|
|
|
2024-10-15 00:38:38 +00:00
|
|
|
from abid_utils.admin import ABIDModelAdmin
|
2024-10-14 22:41:58 +00:00
|
|
|
|
2024-10-15 00:38:38 +00:00
|
|
|
from crawls.models import Crawl
|
2024-10-14 22:41:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-15 00:38:38 +00:00
|
|
|
class CrawlAdmin(ABIDModelAdmin):
|
|
|
|
list_display = ('abid', 'created_at', 'created_by', 'depth', 'parser', 'urls')
|
|
|
|
sort_fields = ('abid', 'created_at', 'created_by', 'depth', 'parser', 'urls')
|
|
|
|
search_fields = ('abid', 'created_by__username', 'depth', 'parser', 'urls')
|
2024-10-14 22:41:58 +00:00
|
|
|
|
2024-10-15 00:38:38 +00:00
|
|
|
readonly_fields = ('created_at', 'modified_at', 'abid_info')
|
|
|
|
fields = ('urls', 'depth', 'parser', 'created_by', *readonly_fields)
|
2024-10-14 22:41:58 +00:00
|
|
|
|
2024-10-15 00:38:38 +00:00
|
|
|
list_filter = ('depth', 'parser', 'created_by')
|
|
|
|
ordering = ['-created_at']
|
|
|
|
list_per_page = 100
|
|
|
|
actions = ["delete_selected"]
|
2024-10-14 22:41:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-15 00:38:38 +00:00
|
|
|
@abx.hookimpl
|
|
|
|
def register_admin(admin_site):
|
|
|
|
admin_site.register(Crawl, CrawlAdmin)
|