Reload the DVB mux list when a new mux is created
This commit is contained in:
parent
4d69b1c6be
commit
365205ed16
6 changed files with 45 additions and 4 deletions
|
@ -218,11 +218,11 @@ ajax_adaptereditor(http_connection_t *hc, http_reply_t *hr,
|
|||
|
||||
ajax_box_begin(tq, AJAX_BOX_SIDEBOX, NULL, NULL, "Multiplexes");
|
||||
|
||||
tcp_qprintf(tq, "<div id=\"dvbmuxlist%s\"></div>",
|
||||
tcp_qprintf(tq, "<div id=\"dvbmuxlist_%s\"></div>",
|
||||
tda->tda_identifier);
|
||||
|
||||
ajax_js(tq,
|
||||
"new Ajax.Updater('dvbmuxlist%s', "
|
||||
"new Ajax.Updater('dvbmuxlist_%s', "
|
||||
"'/ajax/dvbadaptermuxlist/%s', {method: 'get', evalScripts: true})",
|
||||
tda->tda_identifier, tda->tda_identifier);
|
||||
|
||||
|
@ -515,7 +515,7 @@ ajax_adaptercreatemux(http_connection_t *hc, http_reply_t *hr,
|
|||
dvb_make_add_link(tq, tda, "Successfully created");
|
||||
|
||||
ajax_js(tq,
|
||||
"new Ajax.Updater('dvbmuxlist%s', "
|
||||
"new Ajax.Updater('dvbmuxlist_%s', "
|
||||
"'/ajax/dvbadaptermuxlist/%s', {method: 'get', evalScripts: true})",
|
||||
tda->tda_identifier, tda->tda_identifier);
|
||||
|
||||
|
@ -569,7 +569,7 @@ ajax_adaptermuxlist(http_connection_t *hc, http_reply_t *hr,
|
|||
if(nmuxes < displines)
|
||||
v = nmuxes;
|
||||
|
||||
tcp_qprintf(tq, "<div id=\"dvbmuxlist%s\" "
|
||||
tcp_qprintf(tq, "<div id=\"dvbmuxinnerlist%s\" "
|
||||
"style=\"height: %dpx; overflow: auto\" class=\"normallist\">",
|
||||
tda->tda_identifier, v * 14);
|
||||
|
||||
|
|
|
@ -270,6 +270,21 @@ ajax_mailbox_update_div(const char *subscription, const char *prefix,
|
|||
|
||||
|
||||
|
||||
static void
|
||||
ajax_mailbox_reload_div(const char *subscription, const char *prefix,
|
||||
const char *postfix, const char *url)
|
||||
{
|
||||
char buf[1000];
|
||||
|
||||
snprintf(buf, sizeof(buf), "new Ajax.Updater('%s_%s', '%s', "
|
||||
"{method: 'get', evalScripts: true});\r\n",
|
||||
prefix, postfix, url);
|
||||
|
||||
ajax_mailbox_add_to_subscription(subscription, buf);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
ajax_mailbox_tdmi_state_change(th_dvb_mux_instance_t *tdmi)
|
||||
{
|
||||
|
@ -304,3 +319,18 @@ ajax_mailbox_tdmi_status_change(th_dvb_mux_instance_t *tdmi)
|
|||
"status", tdmi->tdmi_identifier,
|
||||
tdmi->tdmi_last_status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
ajax_mailbox_tda_change(th_dvb_adapter_t *tda)
|
||||
{
|
||||
char buf[500];
|
||||
|
||||
snprintf(buf, sizeof(buf), "/ajax/dvbadaptermuxlist/%s",
|
||||
tda->tda_identifier);
|
||||
|
||||
ajax_mailbox_reload_div(tda->tda_identifier,
|
||||
"dvbmuxlist", tda->tda_identifier,
|
||||
buf);
|
||||
}
|
||||
|
|
|
@ -25,4 +25,6 @@ void ajax_mailbox_tdmi_name_change(th_dvb_mux_instance_t *tdmi);
|
|||
|
||||
void ajax_mailbox_tdmi_status_change(th_dvb_mux_instance_t *tdmi);
|
||||
|
||||
void ajax_mailbox_tda_change(th_dvb_adapter_t *tda);
|
||||
|
||||
#endif /* AJAXUI_MAILBOX_H_ */
|
||||
|
|
BIN
dvb.c
BIN
dvb.c
Binary file not shown.
7
notify.c
7
notify.c
|
@ -45,3 +45,10 @@ notify_tdmi_status_change(th_dvb_mux_instance_t *tdmi)
|
|||
{
|
||||
ajax_mailbox_tdmi_status_change(tdmi);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
notify_tda_change(th_dvb_adapter_t *tda)
|
||||
{
|
||||
ajax_mailbox_tda_change(tda);
|
||||
}
|
||||
|
|
2
notify.h
2
notify.h
|
@ -25,4 +25,6 @@ void notify_tdmi_name_change(th_dvb_mux_instance_t *tdmi);
|
|||
|
||||
void notify_tdmi_status_change(th_dvb_mux_instance_t *tdmi);
|
||||
|
||||
void notify_tda_change(th_dvb_adapter_t *tda);
|
||||
|
||||
#endif /* NOTIFY_H_ */
|
||||
|
|
Loading…
Add table
Reference in a new issue