]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.webapp/src/main/webapp/argeo-ria-lib/slc/class/org/argeo/slc/ria/SlcExecLoggerApplet.js
2 * A simple Hello World applet for documentation purpose.
3 * The only associated command is the "Close" command.
5 qx
.Class
.define("org.argeo.slc.ria.SlcExecLoggerApplet",
7 extend
: qx
.ui
.container
.Composite
,
8 implement
: [org
.argeo
.ria
.components
.IView
],
10 construct : function(){
12 this.setLayout(new qx
.ui
.layout
.Dock());
18 * The viewPane inside which this applet is added.
24 * Commands definition, see {@link org.argeo.ria.event.CommandsManager#definitions}
29 label
: "Reload Logs",
30 icon
: "resource/slc/view-refresh.png",
31 shortcut
: "Control+r",
35 callback : function(e
){
47 * Called at applet creation. Just registers viewPane.
48 * @param viewPane {org.argeo.ria.components.ViewPane} The viewPane.
50 init : function(viewPane
){
51 this.setView(viewPane
);
60 this.timer
= new qx
.event
.Timer(15000);
61 this.timer
.addListener("interval", this._reloadLogger
, this);
65 addScroll : function(){
73 _createLayout : function(){
74 this.logModel
= new qx
.ui
.table
.model
.Simple();
75 this.logModel
.setColumns(["Date", "Agent Uuid", "Status"]);
76 this.logPane
= new qx
.ui
.table
.Table(this.logModel
, {
77 tableColumnModel: function(obj
){
78 return new qx
.ui
.table
.columnmodel
.Resize(obj
)
81 this.logPane
.setDecorator(null);
83 this.add(this.logPane
, {edge
:'center'});
86 _initLogger : function(){
88 statusBarVisible
: false,
89 showCellFocusIndicator
:false
91 var columnModel
= this.logPane
.getTableColumnModel();
92 columnModel
.getBehavior().setWidth(0, "30%");
93 columnModel
.getBehavior().setWidth(2, "12%");
96 _reloadLogger : function(){
97 var request
= org
.argeo
.slc
.ria
.SlcApi
.getListSlcExecutionsService();
98 request
.addListener("completed", function(response
){
99 var messages
= org
.argeo
.ria
.util
.Element
.selectNodes(response
.getContent(), "//slc:slc-execution");
100 this.logModel
.setData([]);
101 for(var i
=0;i
<messages
.length
;i
++){
102 var message
= messages
[i
];
103 var slcExec
= new org
.argeo
.slc
.ria
.SlcExecutionMessage(message
.getAttribute("uuid"));
104 slcExec
.fromXml(message
);
105 this.logModel
.addRows([
106 [slcExec
.getDate(), slcExec
.getHost()+' ('+slcExec
.getUuid()+')', slcExec
.getStatus()]