var scApp = angular.module("scApp", ["ngRoute", "ngResource", "bravoUiAlert", "bravoUiPopover" ]); scApp.config(["$routeProvider", function($routeProvider){ $routeProvider.otherwise({redirectTo:"/connect"}) .when("/connect", {templateUrl:"views/connect_en.html", controller:"CSCConnect"}) .when("/vhosts", {templateUrl:"views/vhosts_en.html", controller:"CSCVhosts"}) .when("/vhosts/:id", {templateUrl:"views/vhost_en.html", controller:"CSCVhost"}) .when("/streams", {templateUrl:"views/streams_en.html", controller:"CSCStreams"}) .when("/streams/:id", {templateUrl:"views/stream_en.html", controller:"CSCStream"}) .when("/clients", {templateUrl:"views/clients_en.html", controller:"CSCClients"}) .when("/clients/:id", {templateUrl:"views/client_en.html", controller:"CSCClient"}) .when("/configs", {templateUrl:"views/configs_en.html", controller:"CSCConfigs"}) .when("/summaries", {templateUrl:"views/summary_en.html", controller:"CSCSummary"}); }]); scApp.filter("sc_filter_time", function(){ return function(v){ var s = ""; if (v > 3600 * 24) { s = Number(v / 3600 / 24).toFixed(0) + "d "; v = v % (3600 * 24); } s += relative_seconds_to_HHMMSS(v); return s; }; }); scApp.filter("sc_filter_yesno", function(){ return function(v){ return v? "Yes":"No"; }; }); scApp.filter("sc_filter_enabled", function(){ return function(v){ return v? "Enabled":"Disabled"; }; }); scApp.filter("sc_filter_yn", function(){ return function(v){ return v? "Y":"N"; }; }); scApp.filter("sc_filter_has_stream", function(){ return function(v){ return v? "Y":"N"; }; }); scApp.filter("sc_filter_ctype", function(){ return function(v){ return v? "Publish":"Play"; }; }); scApp.filter("sc_filter_obj", function(){ return function(v) { return v !== undefined? v : "Unknown"; }; }); scApp.filter("sc_filter_security", function(){ return function(v) { var action = v.action === "allow"? "Allow":"Denied"; var method = v.method === "all"? "Any": (v.method === "publish"? "Publish":"Play"); var entry = v.entry === "all"? "All" : v.entry; return action + " " + entry + " " + method; } }); var scDirectiveTemplate = '' + '' + '{{key}}' + '' + '' + '
' + '' + '{{data.value| sc_filter_enabled}}' + '{{data.value| sc_filter_obj| sc_filter_less}}' + ' ' + ' ' + ' ' + '' + 'Restore ' + '
' + '
{{desc}}
' + '' + '' + '{{desc}}' + '' + '' + 'Update ' + '' + 'Submit' + ' ' + 'Cancel ' + '';