Skip to content

Commit

Permalink
Console: Add HTTP server port input box
Browse files Browse the repository at this point in the history
  • Loading branch information
xNyapAe3 committed Nov 16, 2024
1 parent 7951bf3 commit d0d315c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
8 changes: 5 additions & 3 deletions trunk/research/console/js/srs.console.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ scApp.controller("CSCConnect", ["$scope", "$location", "MSCApi", "$sc_utility",
$scope.server = {
schema: $sc_server.schema,
ip: $sc_server.host,
port: $sc_server.port
port: $sc_server.port,
http: $sc_server.http
};
$scope.connect = function(){
$sc_server.schema = $scope.server.schema;
$sc_server.host = $scope.server.ip;
$sc_server.port = $scope.server.port;
$sc_server.http = $scope.server.http;

MSCApi.versions_get(function(data){
$sc_utility.log("trace", "连接到SRS" + $scope.server.ip + "成功, SRS/" + data.data.version);
Expand Down Expand Up @@ -571,9 +573,8 @@ scApp.filter('sc_filter_style_error', function(){
scApp.filter('sc_filter_preview_url', ['$sc_server', function($sc_server){
return function(v){
var page = $sc_server.schema + `://${$sc_server.host}:${$sc_server.http}/players/srs_player.html`;
var http = $sc_server.http[$sc_server.http.length - 1];
var query = "vhost=" + v.owner.name + "&app=" + v.app + "&stream=" + v.name + ".flv";
query += "&server=" + $sc_server.host +"&port=" + http + "&autostart=true&schema=" + $sc_server.schema;
query += "&server=" + $sc_server.host +"&port=" + $sc_server.http + "&autostart=true&schema=" + $sc_server.schema;
return v? page+"?" + query:"javascript:void(0)";
};
}]);
Expand Down Expand Up @@ -674,6 +675,7 @@ scApp.provider("$sc_server", [function(){
query['schema'] = self.schema;
query['host'] = self.host;
query['port'] = self.port;
query['http'] = self.http;

var queries = [];
for (var key in query) {
Expand Down
6 changes: 6 additions & 0 deletions trunk/research/console/views/connect.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
<input type="text" id="sscPort" placeholder="SRS API Server Port" ng-model="server.port">
</div>
</div>
<div class="control-group">
<label class="control-label" for="sscPort">HTTP端口</label>
<div class="controls">
<input type="text" id="sscHttp" placeholder="SRS HTTP Server Port" ng-model="server.http">
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn" ng-click="connect()">连接到SRS</button>
Expand Down
6 changes: 6 additions & 0 deletions trunk/research/console/views/connect_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
<input type="text" id="sscPort" placeholder="SRS API Server Port" ng-model="server.port">
</div>
</div>
<div class="control-group">
<label class="control-label" for="sscPort">SRS HTTP Port</label>
<div class="controls">
<input type="text" id="sscHttp" placeholder="SRS HTTP Server Port" ng-model="server.http">
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn" ng-click="connect()">Connect</button>
Expand Down

0 comments on commit d0d315c

Please sign in to comment.