You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by br...@apache.org on 2013/06/14 02:00:56 UTC
git commit: WebUI: Use slave hostname rather than libprocess.
Updated Branches:
refs/heads/master 90bcfe575 -> b51847af5
WebUI: Use slave hostname rather than libprocess.
It's safer to use the hostname of the slave rather than the libprocess
IP since we don't necessarily know that the interface's IP is publicly
accessible. This applies especially for services like EC2.
Review: https://reviews.apache.org/r/11813
Project: http://git-wip-us.apache.org/repos/asf/incubator-mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mesos/commit/b51847af
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mesos/tree/b51847af
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mesos/diff/b51847af
Branch: refs/heads/master
Commit: b51847af5fa8ec09f364165a46f901e485257acd
Parents: 90bcfe5
Author: Brenden Matthews <br...@airbnb.com>
Authored: Tue Jun 11 17:47:29 2013 -0700
Committer: Brenden Matthews <br...@airbnb.com>
Committed: Thu Jun 13 16:59:33 2013 -0700
----------------------------------------------------------------------
src/webui/master/static/controllers.js | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mesos/blob/b51847af/src/webui/master/static/controllers.js
----------------------------------------------------------------------
diff --git a/src/webui/master/static/controllers.js b/src/webui/master/static/controllers.js
index 0ea77ce..31e7c91 100644
--- a/src/webui/master/static/controllers.js
+++ b/src/webui/master/static/controllers.js
@@ -440,8 +440,9 @@ function SlaveCtrl($scope, $routeParams, $http, $q) {
}
var pid = $scope.slaves[$routeParams.slave_id].pid;
+ var hostname = $scope.slaves[$routeParams.slave_id].hostname;
var id = pid.substring(0, pid.indexOf('@'));
- var host = pid.substring(pid.indexOf('@') + 1);
+ var host = hostname + ":" + pid.substring(pid.lastIndexOf(':') + 1)
$scope.log = function($event) {
if (!$scope.state.log_dir) {
@@ -533,8 +534,9 @@ function SlaveFrameworkCtrl($scope, $routeParams, $http, $q) {
}
var pid = $scope.slaves[$routeParams.slave_id].pid;
+ var hostname = $scope.slaves[$routeParams.slave_id].hostname;
var id = pid.substring(0, pid.indexOf('@'));
- var host = pid.substring(pid.indexOf('@') + 1);
+ var host = hostname + ":" + pid.substring(pid.lastIndexOf(':') + 1)
var usageRequest = $http.jsonp(
'http://' + host + '/monitor/usage.json?jsonp=JSON_CALLBACK');
@@ -641,8 +643,9 @@ function SlaveExecutorCtrl($scope, $routeParams, $http, $q) {
}
var pid = $scope.slaves[$routeParams.slave_id].pid;
+ var hostname = $scope.slaves[$routeParams.slave_id].hostname;
var id = pid.substring(0, pid.indexOf('@'));
- var host = pid.substring(pid.indexOf('@') + 1);
+ var host = hostname + ":" + pid.substring(pid.lastIndexOf(':') + 1)
var usageRequest = $http.jsonp(
'http://' + host + '/monitor/usage.json?jsonp=JSON_CALLBACK');
@@ -718,8 +721,9 @@ function BrowseCtrl($scope, $routeParams, $http) {
$scope.path = $routeParams.path;
var pid = $scope.slaves[$routeParams.slave_id].pid;
+ var hostname = $scope.slaves[$routeParams.slave_id].hostname;
var id = pid.substring(0, pid.indexOf('@'));
- var host = pid.substring(pid.indexOf('@') + 1);
+ var host = hostname + ":" + pid.substring(pid.lastIndexOf(':') + 1)
var url = 'http://' + host + '/files/browse.json?jsonp=JSON_CALLBACK';
$scope.slave_host = host;
@@ -757,4 +761,4 @@ function BrowseCtrl($scope, $routeParams, $http) {
$scope.$on('$beforeRouteChange', function() {
$(document).off('state_updated', update);
});
-}
\ No newline at end of file
+}