mirror of
https://github.com/fastogt/fastocloud_admin.git
synced 2025-03-09 23:38:52 +00:00
Minor fixes
This commit is contained in:
parent
a57dfea8ac
commit
a345cc28c3
7 changed files with 17 additions and 11 deletions
|
@ -6,6 +6,7 @@ from pyfastocloud_models.stream.entry import IStream, ProxyStream, EncodeStream,
|
|||
from pyfastocloud.client_constants import ClientStatus
|
||||
|
||||
from pyfastocloud_models.series.entry import Serial
|
||||
import pyfastocloud_models.constants as constants
|
||||
from pyfastocloud_models.service.entry import ServiceSettings, ProviderPair, safe_delete_stream
|
||||
from app.service.service_client import ServiceClient, OperationSystem
|
||||
from app.service.stream_handler import IStreamHandler
|
||||
|
@ -109,7 +110,9 @@ class Service(IStreamHandler):
|
|||
settings = self._settings
|
||||
if prepare:
|
||||
self._client.prepare_service(settings)
|
||||
return self._client.sync_service(settings)
|
||||
res = self._client.sync_service(settings)
|
||||
self.__refresh_catchups()
|
||||
return res
|
||||
|
||||
def get_log_stream(self, sid: str):
|
||||
stream = self.find_stream_by_id(sid)
|
||||
|
@ -401,3 +404,9 @@ class Service(IStreamHandler):
|
|||
for stream in streams:
|
||||
self.__init_stream_runtime_fields(stream)
|
||||
self._streams.append(stream)
|
||||
|
||||
def __refresh_catchups(self):
|
||||
for stream in self._streams:
|
||||
if stream.get_type() == constants.StreamType.CATCHUP:
|
||||
self._client.start_stream(stream.config())
|
||||
return
|
||||
|
|
|
@ -108,7 +108,8 @@ class ServiceClient(IClientHandler):
|
|||
streams = []
|
||||
for stream in settings.streams:
|
||||
stream.set_server_settings(settings)
|
||||
streams.append(stream.config())
|
||||
config = stream.config()
|
||||
streams.append(config)
|
||||
|
||||
return self._client.sync_service(self._gen_request_id(), streams)
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ class ServiceManager(object):
|
|||
|
||||
readable, writeable, _ = select.select(rsockets, [], [], 1)
|
||||
for read in readable:
|
||||
|
||||
for server in self._servers_pool:
|
||||
if server.socket() == read:
|
||||
server.recv_data()
|
||||
|
|
|
@ -73,6 +73,8 @@ class ServiceView(FlaskView):
|
|||
oid=stream.output.urls[0].id)
|
||||
elif stream_type == constants.StreamType.CATCHUP:
|
||||
stream = server.make_catchup_stream()
|
||||
stream.output.urls[0] = stream.generate_http_link(constants.HlsType.HLS_PULL,
|
||||
oid=stream.output.urls[0].id)
|
||||
else:
|
||||
stream = server.make_test_life_stream()
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ class StreamView(FlaskView):
|
|||
if server:
|
||||
stream = server.make_catchup_stream()
|
||||
form = CatchupStreamForm(obj=stream)
|
||||
if request.method == 'POST': # FIXME form.validate_on_submit()
|
||||
if request.method == 'POST' and form.validate_on_submit():
|
||||
new_entry = form.update_entry(stream)
|
||||
new_entry.save()
|
||||
server.add_stream(new_entry)
|
||||
|
|
|
@ -49,12 +49,6 @@ Dashboard | {{ config['PUBLIC_CONFIG'].site.title }}
|
|||
th.stream_actions {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
{{super()}}
|
||||
{% endblock %}
|
||||
|
@ -1624,6 +1618,5 @@ Dashboard | {{ config['PUBLIC_CONFIG'].site.title }}
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
|
|
@ -54,6 +54,8 @@
|
|||
<br>
|
||||
{{ render_bootstrap_form(form.input) }}
|
||||
<br>
|
||||
{{ render_bootstrap_form(form.output) }}
|
||||
<br>
|
||||
{{ render_bootstrap_form(form.timeshift_chunk_duration) }}
|
||||
<br>
|
||||
{{ render_bootstrap_form(form.timeshift_chunk_life_time) }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue