2015-12-10 23:24:14 +00:00
|
|
|
|
2016-09-26 09:28:47 +00:00
|
|
|
Hedera.Connections = new Class
|
2015-12-10 23:24:14 +00:00
|
|
|
({
|
2016-09-26 09:28:47 +00:00
|
|
|
Extends: Hedera.Form
|
2015-12-10 23:24:14 +00:00
|
|
|
|
2015-12-15 15:22:46 +00:00
|
|
|
,_timeoutId: null
|
|
|
|
|
2017-04-05 14:06:07 +00:00
|
|
|
,onModelStatusChange: function (model)
|
2015-12-10 23:24:14 +00:00
|
|
|
{
|
2015-12-15 15:22:46 +00:00
|
|
|
if (!model.ready)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (this._timeoutId)
|
|
|
|
clearTimeout (this._timeoutId);
|
|
|
|
|
|
|
|
this._timeoutId = setTimeout (this.onRefreshClick.bind (this), 60000);
|
2015-12-10 23:24:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
,deactivate: function ()
|
|
|
|
{
|
2015-12-15 15:22:46 +00:00
|
|
|
clearTimeout (this._timeoutId);
|
2015-12-10 23:24:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
,onRefreshClick: function ()
|
|
|
|
{
|
|
|
|
this.$('sessions').refresh ();
|
|
|
|
}
|
|
|
|
|
2016-12-23 08:57:49 +00:00
|
|
|
,repeaterFunc: function (res, form)
|
2015-12-10 23:24:14 +00:00
|
|
|
{
|
2016-12-23 08:57:49 +00:00
|
|
|
res.$('link').href = this.hash.make ({
|
|
|
|
'form': 'admin/access-log',
|
|
|
|
'user': form.get ('userId')
|
2015-12-10 23:24:14 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
,onChangeUserClick: function (button, form)
|
|
|
|
{
|
2016-10-04 15:27:49 +00:00
|
|
|
this.gui.supplantUser (form.get ('user'),
|
|
|
|
this._onUserSupplant.bind (this));
|
2015-12-10 23:24:14 +00:00
|
|
|
}
|
|
|
|
|
2017-04-05 14:06:07 +00:00
|
|
|
,_onUserSupplant: function ()
|
2015-12-10 23:24:14 +00:00
|
|
|
{
|
2017-04-05 14:06:07 +00:00
|
|
|
this.hash.setAll ({'form': 'ecomerce/orders'});
|
2015-12-10 23:24:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
,sessionsFunc: function ()
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|