forked from verdnatura/hedera-web
46 lines
790 B
JavaScript
46 lines
790 B
JavaScript
|
|
Hedera.Connections = new Class({
|
|
Extends: Hedera.Form
|
|
|
|
,_timeoutId: null
|
|
|
|
,onModelStatusChange: function() {
|
|
if (!this.$('sessions').ready)
|
|
return;
|
|
|
|
if (this._timeoutId)
|
|
clearTimeout(this._timeoutId);
|
|
|
|
this._timeoutId = setTimeout(this.onRefreshClick.bind(this), 60000);
|
|
}
|
|
|
|
,deactivate: function() {
|
|
clearTimeout(this._timeoutId);
|
|
}
|
|
|
|
,onRefreshClick: function() {
|
|
this.$('sessions').refresh();
|
|
}
|
|
|
|
,onAccessLogClick: function(userId) {
|
|
this.hash.set({
|
|
form: 'admin/access-log'
|
|
,user: userId
|
|
});
|
|
}
|
|
|
|
,onChangeUserClick: function(userName) {
|
|
this.gui.supplantUser(userName,
|
|
this._onUserSupplant.bind(this));
|
|
}
|
|
|
|
,_onUserSupplant: function() {
|
|
this.hash.set({form: 'ecomerce/orders'});
|
|
}
|
|
|
|
,sessionsFunc: function() {
|
|
return 1;
|
|
}
|
|
});
|
|
|