Add "Open Port" button (#362)

This commit is contained in:
Michael Irwin
2019-10-22 11:21:19 -04:00
committed by Marcos Nils
parent d0ff81cc98
commit bacf00e658
2 changed files with 12 additions and 1 deletions

View File

@@ -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;

View File

@@ -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>