portier/source/config/admin.py

47 lines
1.3 KiB
Python
Raw Normal View History

from django.contrib import admin
from guardian.admin import GuardedModelAdmin
2024-04-22 14:25:15 +02:00
from config.models import TranscodingProfile, Stream, Restream, Pull, Recorder, LocalRecordingStorage, S3RecordingStorage, SRSNode, SRSStreamInstance
2024-04-22 14:25:15 +02:00
@admin.register(LocalRecordingStorage)
class LocalRecordingStorageAdmin(GuardedModelAdmin):
pass
@admin.register(S3RecordingStorage)
class S3RecordingStorageAdmin(GuardedModelAdmin):
pass
@admin.register(Recorder)
class RecorderAdmin(GuardedModelAdmin):
pass
@admin.register(TranscodingProfile)
class TranscodingProfileAdmin(GuardedModelAdmin):
pass
@admin.register(Stream)
class StreamAdmin(GuardedModelAdmin):
2024-04-22 14:25:15 +02:00
pass
@admin.register(Restream)
class RestreamAdmin(GuardedModelAdmin):
2024-04-22 14:25:15 +02:00
pass
2024-04-01 16:27:31 +02:00
@admin.register(Pull)
class PullAdmin(GuardedModelAdmin):
2024-04-22 14:25:15 +02:00
pass
2024-04-01 16:27:31 +02:00
@admin.register(SRSNode)
class SRSNodeAdmin(GuardedModelAdmin):
2024-04-22 14:25:15 +02:00
pass
@admin.register(SRSStreamInstance)
class SRSStreamInstanceAdmin(GuardedModelAdmin):
fields = ['stream', 'node']
# Stream Instances are just representations of the streams on the SRS server,
# and should not be addable/editable. Deleting them can be useful though.
def has_change_permission(self, request, obj=None):
return False
def has_add_permission(self, request):
2024-04-01 16:27:31 +02:00
return False