Forked mumble-django project from https://bitbucket.org/Svedrin/mumble-django
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.0 KiB

  1. // kate: space-indent on; indent-width 4; replace-tabs on;
  2. Ext.namespace('Ext.ux');
  3. Ext.ux.BanViewerPanel = function( config ){
  4. Ext.apply( this, config );
  5. Ext.applyIf( this, {
  6. xtype: 'grid',
  7. title: gettext('Bans'),
  8. colModel: new Ext.grid.ColumnModel([{
  9. header: gettext('Timestamp'),
  10. dataIndex: 'start',
  11. width: 150,
  12. renderer: function( value ){
  13. return new Date(value*1000).format( "Y-m-d H:i:s" );
  14. }
  15. }, {
  16. header: gettext('Address'),
  17. width: 250,
  18. dataIndex: 'addrstr',
  19. renderer: function( value, meta, record, rowIdx, colIdx, store ){
  20. return value + "/" + record.data['bits'];
  21. }
  22. }, {
  23. header: gettext('User name'),
  24. width: 150,
  25. dataIndex: 'name'
  26. }, {
  27. header: gettext('Duration'),
  28. width: 100,
  29. dataIndex: 'duration'
  30. }, {
  31. header: gettext('Reason'),
  32. width: 300,
  33. dataIndex: 'reason'
  34. }]),
  35. bbar: [{
  36. iconCls: 'x-tbar-loading',
  37. tooltip: gettext('Refresh'),
  38. handler: function(){
  39. this.ownerCt.ownerCt.store.reload();
  40. }
  41. }],
  42. store: new Ext.data.DirectStore({
  43. baseParams: {'server': this.server},
  44. directFn: Mumble.bans,
  45. paramOrder: ['server'],
  46. root: 'data',
  47. fields: ['start', 'address', 'bits', 'duration', 'reason', 'addrstr', 'name'],
  48. autoLoad: true,
  49. remoteSort: false
  50. }),
  51. viewConfig: { forceFit: true }
  52. });
  53. Ext.ux.LogViewerPanel.superclass.constructor.call( this );
  54. }
  55. Ext.extend( Ext.ux.BanViewerPanel, Ext.grid.EditorGridPanel, {
  56. } );
  57. Ext.reg( 'banViewerPanel', Ext.ux.BanViewerPanel );