CC-4796: Listener Stat: Authentication exception happens but no warning message on UI

- done
This commit is contained in:
James 2013-01-08 17:32:27 -05:00
parent 6d48e1faf0
commit 1263c04621
8 changed files with 62 additions and 10 deletions

View file

@ -42,6 +42,7 @@ class ApiController extends Zend_Controller_Action
->addActionContext('notify-webstream-data' , 'json')
->addActionContext('get-stream-parameters' , 'json')
->addActionContext('push-stream-stats' , 'json')
->addActionContext('update-stream-setting-table' , 'json')
->initContext();
}
@ -979,5 +980,14 @@ class ApiController extends Zend_Controller_Action
Application_Model_ListenerStat::insertDataPoints($data);
$this->view->data = $data;
}
public function updateStreamSettingTableAction() {
$request = $this->getRequest();
$data = json_decode($request->getParam("data"), true);
foreach ($data as $k=>$v) {
Application_Model_StreamSetting::SetListenerStatError($k, $v);
}
}
}

View file

@ -47,6 +47,15 @@ class ListenerstatController extends Zend_Controller_Action
'his_time_end' => $end->format("H:i")
));
$errorStatus = Application_Model_StreamSetting::GetAllListenerStatErrors();
Logging::info($errorStatus);
$out = array();
foreach ($errorStatus as $v) {
$key = explode('_listener_stat_error', $v['keyname']);
$out[$key[0]] = $v['value'];
}
$this->view->errorStatus = $out;
$this->view->date_form = $form;
}

View file

@ -457,4 +457,13 @@ class Application_Model_StreamSetting
public static function setOffAirMeta($offAirMeta){
self::setValue("off_air_meta", $offAirMeta, "string");
}
public static function GetAllListenerStatErrors(){
$sql = "SELECT * FROM cc_stream_setting WHERE keyname like :p1";
return Application_Common_Database::prepareAndExecute($sql, array(':p1'=>'%_listener_stat_error'));
}
public static function SetListenerStatError($key, $v) {
self::setValue($key, $v, 'string');
}
}

View file

@ -2,5 +2,13 @@
<?php echo _("Listener Count Over Time")?><br>
<div id="flot_placeholder" style="width:600px;height:300px;margin:0px 50px 0px 50px"></div>
<div id="legend" style="width:600px;height:70px;margin:0px 50px 0px 50px"></div>
<div id="date_form" style="margin:0px 50px 0px 50px"><?php echo $this->date_form; ?></div>
<div id="date_form" style="float:left; margin:0px 50px 0px 50px"><?php echo $this->date_form; ?></div>
<div id="errorStatus" style="float:right; width: 400px">
<fieldset class="padded stream-setting-global">
<legend>Status</legend>
<?php foreach ($this->errorStatus as $k=>$v) {?>
<div class='stream-status <?php echo ($v == 'OK')? 'status-good' : 'status-error' ?>'><h3><?php echo $k?>: <?php echo $v?></h3></div>
<?php }?>
</fieldset>
</div>
</div>