YARN-10233. Fix YARN UI2 Daemon Logs
Contributed by Akhil PB.
This commit is contained in:
parent
55fcbcb5c2
commit
94f7470c71
|
@ -2,3 +2,4 @@ tmp/
|
||||||
node_modules/
|
node_modules/
|
||||||
bower_components/
|
bower_components/
|
||||||
dist/
|
dist/
|
||||||
|
node/
|
||||||
|
|
|
@ -19,5 +19,6 @@
|
||||||
import DS from 'ember-data';
|
import DS from 'ember-data';
|
||||||
|
|
||||||
export default DS.Model.extend({
|
export default DS.Model.extend({
|
||||||
logfileName: DS.attr()
|
logFileName: DS.attr(),
|
||||||
|
logFileUrl: DS.attr()
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
import DS from 'ember-data';
|
import DS from 'ember-data';
|
||||||
|
|
||||||
export default DS.JSONAPISerializer.extend({
|
export default DS.JSONAPISerializer.extend({
|
||||||
normalizeResponse(store, primaryModelClass, payload, id, requestType) {
|
normalizeResponse(store, primaryModelClass, payload) {
|
||||||
const pattern = new RegExp('<A HREF="/logs/.+">', 'g');
|
const pattern = new RegExp('<A HREF="/logs/.+">|<a href="/logs/.+">', 'g');
|
||||||
let fileNames = payload.match(pattern);
|
let fileNames = payload.match(pattern);
|
||||||
|
|
||||||
if (fileNames == null) {
|
if (fileNames == null) {
|
||||||
|
@ -29,16 +29,20 @@ export default DS.JSONAPISerializer.extend({
|
||||||
|
|
||||||
let logfileNames = [];
|
let logfileNames = [];
|
||||||
for (var i = 0; i < fileNames.length; i++) {
|
for (var i = 0; i < fileNames.length; i++) {
|
||||||
var fileName = fileNames[i].match(/<A HREF="(\/logs\/.+)">/);
|
var fileNameMatch = fileNames[i].match(/<A HREF="(\/logs\/.+)">.+<\/A>|<a href="(\/logs\/.+)">.+<\/a>/);
|
||||||
if (fileName.length != null) {
|
var logFileUrl = fileNameMatch[1] || fileNameMatch[2];
|
||||||
logfileNames.push({
|
var logFileName = logFileUrl.replace('logs', '').replace(/\//g, '');
|
||||||
id: i,
|
|
||||||
type: primaryModelClass.modelName,
|
if (fileNameMatch.length != null) {
|
||||||
attributes: {
|
logfileNames.push({
|
||||||
logfileName: fileName[1]
|
id: i,
|
||||||
}
|
type: primaryModelClass.modelName,
|
||||||
});
|
attributes: {
|
||||||
}
|
logFileUrl: logFileUrl,
|
||||||
|
logFileName: logFileName
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return { data : logfileNames };
|
return { data : logfileNames };
|
||||||
},
|
},
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{#link-to 'yarn-tools.yarn-rm-log' tagName="li"}}
|
{{#link-to 'yarn-tools.yarn-rm-log' tagName="li"}}
|
||||||
{{#link-to 'yarn-tools.yarn-rm-log'}}YARN Daemon logs
|
{{#link-to 'yarn-tools.yarn-rm-log'}}YARN Daemon Logs
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -17,15 +17,15 @@
|
||||||
}}
|
}}
|
||||||
|
|
||||||
<h1>YARN Daemon Logs</h1>
|
<h1>YARN Daemon Logs</h1>
|
||||||
<div class="col-md-12 container-fluid">
|
<div class="row">
|
||||||
<div class="col-md-10">
|
<div class="col-md-12">
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
{{#if model.logs}}
|
{{#if model.logs}}
|
||||||
{{#each model.logs as |log|}}
|
{{#each model.logs as |log|}}
|
||||||
<li class=list-group-item>
|
<li class="list-group-item">
|
||||||
{{#link-to 'yarn-tools.yarn-rm-log' (query-params filename=log.logfileName)}}
|
{{#link-to 'yarn-tools.yarn-rm-log' (query-params filename=log.logFileUrl)}}
|
||||||
{{log.logfileName}}
|
{{log.logFileName}}
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
Loading…
Reference in New Issue