|
|
@ -43,7 +43,7 @@ module Kubernetes {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
terminals: {},
|
|
|
|
terminals: {},
|
|
|
|
httpTask: {},
|
|
|
|
httpTask: {},
|
|
|
|
newTerminal: ($interval, podLink, containerName, entity, template = defaultTemplate) => {
|
|
|
|
newTerminal: ($interval, podLink, containerName, entity, url ,template = defaultTemplate) => {
|
|
|
|
var terminalId = UrlHelpers.join(podLink, containerName);
|
|
|
|
var terminalId = UrlHelpers.join(podLink, containerName);
|
|
|
|
if (terminalId in self.terminals) {
|
|
|
|
if (terminalId in self.terminals) {
|
|
|
|
log.debug("Already a terminal with id: ", terminalId);
|
|
|
|
log.debug("Already a terminal with id: ", terminalId);
|
|
|
@ -51,7 +51,7 @@ module Kubernetes {
|
|
|
|
return terminalId;
|
|
|
|
return terminalId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var scope = $rootScope.$new();
|
|
|
|
var scope = $rootScope.$new();
|
|
|
|
getLogs(entity, scope);
|
|
|
|
getLogs(entity, scope, url);
|
|
|
|
scope.podLink = podLink;
|
|
|
|
scope.podLink = podLink;
|
|
|
|
scope.containerName = containerName;
|
|
|
|
scope.containerName = containerName;
|
|
|
|
scope.id = terminalId;
|
|
|
|
scope.id = terminalId;
|
|
|
@ -61,7 +61,7 @@ module Kubernetes {
|
|
|
|
return terminalId;
|
|
|
|
return terminalId;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
self.httpTask[terminalId] = $interval(() =>{
|
|
|
|
self.httpTask[terminalId] = $interval(() =>{
|
|
|
|
getLogs(entity, scope);
|
|
|
|
getLogs(entity, scope, url);
|
|
|
|
},2000);
|
|
|
|
},2000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var el = $($compile(template)(scope));
|
|
|
|
var el = $($compile(template)(scope));
|
|
|
@ -300,13 +300,13 @@ module Kubernetes {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function getLogs(rc, scope){
|
|
|
|
function getLogs(rc, scope, url){
|
|
|
|
var xhr= new XMLHttpRequest();
|
|
|
|
var xhr= new XMLHttpRequest();
|
|
|
|
xhr.onreadystatechange = () => {
|
|
|
|
xhr.onreadystatechange = () => {
|
|
|
|
if(xhr.readyState == 4){
|
|
|
|
if(xhr.readyState == 4){
|
|
|
|
if (xhr.status == 200){
|
|
|
|
if (xhr.status == 200){
|
|
|
|
if(xhr.responseText !="" && xhr.responseText !=null){
|
|
|
|
if(xhr.responseText !="" && xhr.responseText !=null){
|
|
|
|
var logObject = JSON.parse(xhr.responseText);
|
|
|
|
var logObject = JSON.parse(xhr.responseText);
|
|
|
|
scope.logs = logObject[getName(rc)];
|
|
|
|
scope.logs = logObject[getName(rc)];
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
scope.logs = "当前没有可以查看的日志信息";
|
|
|
|
scope.logs = "当前没有可以查看的日志信息";
|
|
|
@ -319,7 +319,8 @@ module Kubernetes {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
xhr.open("POST", "/java/console/api/oracle/extract/log?rcName=" + getName(rc),false);
|
|
|
|
xhr.open("POST", url, false);
|
|
|
|
|
|
|
|
//xhr.open("POST", "/java/console/api/oracle/extract/log?rcName=" + getName(rc),false);
|
|
|
|
xhr.send(null);
|
|
|
|
xhr.send(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|