Ext.BLANK_IMAGE_URL = 'ext3/resources/images/default/s.gif"';
Ext.onReady(function(){
var id='<%=request.getParameter("id")%>';
var listurl = "task!topology_stats.action?task.id="+id;
var dstopostats = new Ext.data.Store({
/* proxy : new Ext.data.HttpProxy({
url : listurl
}), */
//proxy也不需要了
reader : new Ext.data.JsonReader({
//root : "sysList",
//root也不需要了
id : 'id',
fields : [{
name : 'windowPretty',
type : 'String',
mapping : 'windowPretty'
},{
name : 'emitted',
type : 'String',
mapping : 'emitted'
}, {
name : 'transferred',
type : 'string',
mapping : 'transferred'
}, {
name : 'completeLatency',
type : 'string',
mapping : 'completeLatency'
},
{
name : 'acked',
type : 'String',
mapping : 'acked'
},
{
name : 'failed',
type : 'String',
mapping : 'failed'
}]
})
});
//dssys.load();
//dssys.loadData(resultData1);
//加载数据,storm supervisor summary
var dsspouts = new Ext.data.Store({
/* proxy : new Ext.data.HttpProxy({
url : listurl
}), */
reader : new Ext.data.JsonReader({
//root : 'hadoopList',
id : 'id',
fields : [{
name : 'spoutId',
type : 'string',
mapping : 'spoutId'
}, {
name : 'executors',
type : 'string',
mapping : 'executors'
}, {
name : 'tasks',
type : 'string',
mapping : 'tasks'
},
{
name : 'emitted',
type : 'String',
mapping : 'emitted'
},
{
name : 'transferred',
type : 'String',
mapping : 'transferred'
},
{
name : 'completeLatency',
type : 'String',
mapping : 'completeLatency'
},
{
name : 'acked',
type : 'String',
mapping : 'acked'
},
{
name : 'failed',
type : 'String',
mapping : 'failed'
},
{
name : 'errorHost',
type : 'String',
mapping : 'errorHost'
},
{
name : 'errorPort',
type : 'String',
mapping : 'errorPort'
},
{
name : 'lastError',
type : 'String',
mapping : 'lastError'
}]
})
});
var dsbolts = new Ext.data.Store({
/* proxy : new Ext.data.HttpProxy({
url : listurl
}), */
reader : new Ext.data.JsonReader({
//root : 'hadoopList',
id : 'id',
fields : [{
name : 'boltId',
type : 'string',
mapping : 'boltId'
}, {
name : 'executors',
type : 'string',
mapping : 'executors'
}, {
name : 'tasks',
type : 'string',
mapping : 'tasks'
},
{
name : 'emitted',
type : 'String',
mapping : 'emitted'
},
{
name : 'transferred',
type : 'String',
mapping : 'transferred'
},
{
name : 'capacity',
type : 'String',
mapping : 'capacity'
},
{
name : 'executeLatency',
type : 'String',
mapping : 'executeLatency'
},
{
name : 'executed',
type : 'String',
mapping : 'executed'
},
{
name : 'processLatency',
type : 'String',
mapping : 'processLatency'
},
{
name : 'acked',
type : 'String',
mapping : 'acked'
},
{
name : 'failed',
type : 'String',
mapping : 'failed'
},
{
name : 'errorHost',
type : 'String',
mapping : 'errorHost'
},
{
name : 'errorPort',
type : 'String',
mapping : 'errorPort'
},
{
name : 'lastError',
type : 'String',
mapping : 'lastError'
}]
})
});
//分发数据
Ext.Ajax.request({
url : listurl,
async:false,
method:"get",
success : function(response) {
var result=Ext.util.JSON.decode(response.responseText);
resultData1 =result.taskList;
//下面分发数据
dstopostats.loadData(result.topology_statsList);
dsspouts.loadData(result.spoutList);
dsbolts.loadData(result.boltList);
},
failure : function() {
Ext.MessageBox.alert("失败", "请求数据失败");
}
});
//
var coltopostats = new Ext.grid.ColumnModel({
columns : [{
header : "Window",
width : 120,
dataIndex:'windowPretty',
sortable : true
},
// {header:"id",width:120,dataIndex:'id',sortable:true},
{
header : "Emitted",
width : 180,
dataIndex : 'emitted',
}, {
header : "Transferred",
width : 120,
dataIndex : 'transferred',
}, {
header : "Complete Latency",
width : 120,
dataIndex : 'completeLatency',
},{
header : "Acked",
width : 120,
dataIndex : 'acked',
sortable : true
}, {
header : "Failed",
width : 120,
dataIndex : 'failed',
//renderer : getDetail,
sortable : true
}
]
});
// server数据表列模式,hadoop1.0
var colspouts = new Ext.grid.ColumnModel({
columns : [{
header : "Id",
width : 280,
dataIndex : 'id',
},
// {header:"id",width:120,dataIndex:'id',sortable:true},
{
header : "executors",
width : 120,
dataIndex : 'executors',
}, {
header : "tasks",
width : 120,
dataIndex : 'tasks',
}, {
header : "emitted",
width : 120,
dataIndex : 'emitted',
}, {
header : "transferred",
width : 120,
dataIndex : 'transferred',
}, {
header : "completeLatency",
width : 120,
dataIndex : 'completeLatency',
}, {
header : "acked",
width : 120,
dataIndex : 'acked',
},{
header : "failed",
width : 120,
dataIndex : 'failed',
}, {
header : "errorHost",
width : 120,
dataIndex : 'errorHost',
}, {
header : "errorPort",
width : 120,
dataIndex : 'errorPort',
}, {
header : "lastError",
width : 120,
dataIndex : 'lastError',
}]
});
// server数据表列模式,hadoop1.0
var colbolts = new Ext.grid.ColumnModel({
columns : [{
header : "Id",
width : 280,
dataIndex : 'boltId',
},
// {header:"id",width:120,dataIndex:'id',sortable:true},
{
header : "Executors",
width : 120,
dataIndex : 'executors',
}, {
header : "Tasks",
width : 120,
dataIndex : 'tasks',
}, {
header : "Emitted",
width : 120,
dataIndex : 'emitted',
}, {
header : "Transferred",
width : 120,
dataIndex : 'transferred',
}, {
header : "Capacity",
width : 120,
dataIndex : 'capacity',
}, {
header : "Execute Latency",
width : 120,
dataIndex : 'executeLatency',
}, {
header : "Executed",
width : 120,
dataIndex : 'executed',
}, {
header : "Process Latency",
width : 120,
dataIndex : 'processLatency',
}, {
header : "Acked",
width : 120,
dataIndex : 'acked',
}, {
header : "Failed",
width : 120,
dataIndex : 'failed',
}, {
header : "ErrorHost",
width : 120,
dataIndex : 'errorHost',
}, {
header : "ErrorPort",
width : 120,
dataIndex : 'errorPort',
}, {
header : "LastError",
width : 120,
dataIndex : 'lastError',
}]
});
// 资源相关的表信息
var topostatsview = new Ext.grid.EditorGridPanel({
title:"Topology stats",
store : dstopostats,
id:'topostatsview',
enableColumnMove : false,
columnLines : true,
enableHdMenu : false,
height : 150,
width : 1700,
cm : coltopostats
//renderTo:"topostatspanel"
});
console.warn("topostatsview:"+topostatsview);
var spoutsview = new Ext.grid.EditorGridPanel({
title:"Spouts(All time)",
store : dsspouts,
id:'spoutsview',
enableColumnMove : false,
columnLines : true,
enableHdMenu : false,
height : 150,
width : 2500,
cm : colspouts
});
console.warn("spoutsview:"+spoutsview);
var boltsview = new Ext.grid.EditorGridPanel({
title:"Bolts (All time)",
store : dsbolts,
enableColumnMove : false,
columnLines : true,
enableHdMenu : false,
height : 150,
width : 2500,
cm : colbolts
});
console.warn("boltsview:"+boltsview);
var topostatspanel = new Ext.Panel({
id : 'topostatspanel',
//region : 'center',
frame : true,
//title : '表单例子',
autoScroll : true,
//layout:"form",
margins : '0 5 5 1',
items : [topostatsview,
spoutsview,boltsview],
//items : [sysinfo],
renderTo:"topostatspanel"
});
Ext.onReady(function(){
var id='<%=request.getParameter("id")%>';
var listurl = "task!topology_stats.action?task.id="+id;
var dstopostats = new Ext.data.Store({
/* proxy : new Ext.data.HttpProxy({
url : listurl
}), */
//proxy也不需要了
reader : new Ext.data.JsonReader({
//root : "sysList",
//root也不需要了
id : 'id',
fields : [{
name : 'windowPretty',
type : 'String',
mapping : 'windowPretty'
},{
name : 'emitted',
type : 'String',
mapping : 'emitted'
}, {
name : 'transferred',
type : 'string',
mapping : 'transferred'
}, {
name : 'completeLatency',
type : 'string',
mapping : 'completeLatency'
},
{
name : 'acked',
type : 'String',
mapping : 'acked'
},
{
name : 'failed',
type : 'String',
mapping : 'failed'
}]
})
});
//dssys.load();
//dssys.loadData(resultData1);
//加载数据,storm supervisor summary
var dsspouts = new Ext.data.Store({
/* proxy : new Ext.data.HttpProxy({
url : listurl
}), */
reader : new Ext.data.JsonReader({
//root : 'hadoopList',
id : 'id',
fields : [{
name : 'spoutId',
type : 'string',
mapping : 'spoutId'
}, {
name : 'executors',
type : 'string',
mapping : 'executors'
}, {
name : 'tasks',
type : 'string',
mapping : 'tasks'
},
{
name : 'emitted',
type : 'String',
mapping : 'emitted'
},
{
name : 'transferred',
type : 'String',
mapping : 'transferred'
},
{
name : 'completeLatency',
type : 'String',
mapping : 'completeLatency'
},
{
name : 'acked',
type : 'String',
mapping : 'acked'
},
{
name : 'failed',
type : 'String',
mapping : 'failed'
},
{
name : 'errorHost',
type : 'String',
mapping : 'errorHost'
},
{
name : 'errorPort',
type : 'String',
mapping : 'errorPort'
},
{
name : 'lastError',
type : 'String',
mapping : 'lastError'
}]
})
});
var dsbolts = new Ext.data.Store({
/* proxy : new Ext.data.HttpProxy({
url : listurl
}), */
reader : new Ext.data.JsonReader({
//root : 'hadoopList',
id : 'id',
fields : [{
name : 'boltId',
type : 'string',
mapping : 'boltId'
}, {
name : 'executors',
type : 'string',
mapping : 'executors'
}, {
name : 'tasks',
type : 'string',
mapping : 'tasks'
},
{
name : 'emitted',
type : 'String',
mapping : 'emitted'
},
{
name : 'transferred',
type : 'String',
mapping : 'transferred'
},
{
name : 'capacity',
type : 'String',
mapping : 'capacity'
},
{
name : 'executeLatency',
type : 'String',
mapping : 'executeLatency'
},
{
name : 'executed',
type : 'String',
mapping : 'executed'
},
{
name : 'processLatency',
type : 'String',
mapping : 'processLatency'
},
{
name : 'acked',
type : 'String',
mapping : 'acked'
},
{
name : 'failed',
type : 'String',
mapping : 'failed'
},
{
name : 'errorHost',
type : 'String',
mapping : 'errorHost'
},
{
name : 'errorPort',
type : 'String',
mapping : 'errorPort'
},
{
name : 'lastError',
type : 'String',
mapping : 'lastError'
}]
})
});
//分发数据
Ext.Ajax.request({
url : listurl,
async:false,
method:"get",
success : function(response) {
var result=Ext.util.JSON.decode(response.responseText);
resultData1 =result.taskList;
//下面分发数据
dstopostats.loadData(result.topology_statsList);
dsspouts.loadData(result.spoutList);
dsbolts.loadData(result.boltList);
},
failure : function() {
Ext.MessageBox.alert("失败", "请求数据失败");
}
});
//
var coltopostats = new Ext.grid.ColumnModel({
columns : [{
header : "Window",
width : 120,
dataIndex:'windowPretty',
sortable : true
},
// {header:"id",width:120,dataIndex:'id',sortable:true},
{
header : "Emitted",
width : 180,
dataIndex : 'emitted',
}, {
header : "Transferred",
width : 120,
dataIndex : 'transferred',
}, {
header : "Complete Latency",
width : 120,
dataIndex : 'completeLatency',
},{
header : "Acked",
width : 120,
dataIndex : 'acked',
sortable : true
}, {
header : "Failed",
width : 120,
dataIndex : 'failed',
//renderer : getDetail,
sortable : true
}
]
});
// server数据表列模式,hadoop1.0
var colspouts = new Ext.grid.ColumnModel({
columns : [{
header : "Id",
width : 280,
dataIndex : 'id',
},
// {header:"id",width:120,dataIndex:'id',sortable:true},
{
header : "executors",
width : 120,
dataIndex : 'executors',
}, {
header : "tasks",
width : 120,
dataIndex : 'tasks',
}, {
header : "emitted",
width : 120,
dataIndex : 'emitted',
}, {
header : "transferred",
width : 120,
dataIndex : 'transferred',
}, {
header : "completeLatency",
width : 120,
dataIndex : 'completeLatency',
}, {
header : "acked",
width : 120,
dataIndex : 'acked',
},{
header : "failed",
width : 120,
dataIndex : 'failed',
}, {
header : "errorHost",
width : 120,
dataIndex : 'errorHost',
}, {
header : "errorPort",
width : 120,
dataIndex : 'errorPort',
}, {
header : "lastError",
width : 120,
dataIndex : 'lastError',
}]
});
// server数据表列模式,hadoop1.0
var colbolts = new Ext.grid.ColumnModel({
columns : [{
header : "Id",
width : 280,
dataIndex : 'boltId',
},
// {header:"id",width:120,dataIndex:'id',sortable:true},
{
header : "Executors",
width : 120,
dataIndex : 'executors',
}, {
header : "Tasks",
width : 120,
dataIndex : 'tasks',
}, {
header : "Emitted",
width : 120,
dataIndex : 'emitted',
}, {
header : "Transferred",
width : 120,
dataIndex : 'transferred',
}, {
header : "Capacity",
width : 120,
dataIndex : 'capacity',
}, {
header : "Execute Latency",
width : 120,
dataIndex : 'executeLatency',
}, {
header : "Executed",
width : 120,
dataIndex : 'executed',
}, {
header : "Process Latency",
width : 120,
dataIndex : 'processLatency',
}, {
header : "Acked",
width : 120,
dataIndex : 'acked',
}, {
header : "Failed",
width : 120,
dataIndex : 'failed',
}, {
header : "ErrorHost",
width : 120,
dataIndex : 'errorHost',
}, {
header : "ErrorPort",
width : 120,
dataIndex : 'errorPort',
}, {
header : "LastError",
width : 120,
dataIndex : 'lastError',
}]
});
// 资源相关的表信息
var topostatsview = new Ext.grid.EditorGridPanel({
title:"Topology stats",
store : dstopostats,
id:'topostatsview',
enableColumnMove : false,
columnLines : true,
enableHdMenu : false,
height : 150,
width : 1700,
cm : coltopostats
//renderTo:"topostatspanel"
});
console.warn("topostatsview:"+topostatsview);
var spoutsview = new Ext.grid.EditorGridPanel({
title:"Spouts(All time)",
store : dsspouts,
id:'spoutsview',
enableColumnMove : false,
columnLines : true,
enableHdMenu : false,
height : 150,
width : 2500,
cm : colspouts
});
console.warn("spoutsview:"+spoutsview);
var boltsview = new Ext.grid.EditorGridPanel({
title:"Bolts (All time)",
store : dsbolts,
enableColumnMove : false,
columnLines : true,
enableHdMenu : false,
height : 150,
width : 2500,
cm : colbolts
});
console.warn("boltsview:"+boltsview);
var topostatspanel = new Ext.Panel({
id : 'topostatspanel',
//region : 'center',
frame : true,
//title : '表单例子',
autoScroll : true,
//layout:"form",
margins : '0 5 5 1',
items : [topostatsview,
spoutsview,boltsview],
//items : [sysinfo],
renderTo:"topostatspanel"
});
});
</script>
<body>
<!-- This is my JSP page. <br> -->
<div id = "topostatspanel"></div>
</body>
</html>
本以为是grid中的数据名,或类型写错,通过每个grid单独测试,都能显示出页面,说明grid是没问题的,后来把renderTo:"topostatspanel"改成renderTo:"topo"页面就好了,遇到这个问题两次了,虽然不知道问什么不能和panel的名字一样