Add "Open Port" button (#362)
This commit is contained in:
committed by
Marcos Nils
parent
d0ff81cc98
commit
bacf00e658
@@ -389,6 +389,14 @@
|
||||
});
|
||||
}
|
||||
|
||||
$scope.openPort = function(instance) {
|
||||
var port = prompt('What port would you like to open?');
|
||||
if (!port) return;
|
||||
|
||||
var url = $scope.getProxyUrl(instance, port);
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
|
||||
$scope.getProxyUrl = function(instance, port) {
|
||||
var url = 'http://' + instance.proxy_host + '-' + port + '.direct.' + $scope.host;
|
||||
|
||||
|
||||
@@ -93,8 +93,11 @@
|
||||
<label>IP</label>
|
||||
<input ng-model="instance.ip" type="text" readonly="readonly">
|
||||
</md-input-container>
|
||||
<md-button class="md-raised" ng-click="openPort(instance)">
|
||||
Open Port
|
||||
</md-button>
|
||||
<md-chips ng-model="instance.ports" name="port" readonly="true" md-removable="false">
|
||||
<md-chip-template>
|
||||
<md-chip-template>
|
||||
<strong><a href="{{getProxyUrl(instance, $chip)}}" title="{{getProxyUrl(instance, $chip)}}" target="_blank">{{$chip}}</a></strong>
|
||||
</md-chip-template>
|
||||
</md-chips>
|
||||
|
||||
Reference in New Issue
Block a user