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.

52 lines
1.5 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: 100,
  12. renderer: function( value ){
  13. return new Date(value*1000).format( "Y-m-d H:i:s" );
  14. }
  15. }, {
  16. header: gettext('Duration'),
  17. width: 100,
  18. dataIndex: 'duration'
  19. }, {
  20. header: gettext('Reason'),
  21. width: 500,
  22. dataIndex: 'reason'
  23. }]),
  24. bbar: [{
  25. iconCls: 'x-tbar-loading',
  26. tooltip: gettext('Refresh'),
  27. handler: function(){
  28. this.ownerCt.ownerCt.store.reload();
  29. }
  30. }],
  31. store: new Ext.data.DirectStore({
  32. baseParams: {'server': this.server},
  33. directFn: Mumble.bans,
  34. paramOrder: ['server'],
  35. root: 'data',
  36. fields: ['start', 'address', 'bits', 'duration', 'reason'],
  37. autoLoad: true,
  38. remoteSort: false
  39. }),
  40. viewConfig: { forceFit: true }
  41. });
  42. Ext.ux.LogViewerPanel.superclass.constructor.call( this );
  43. }
  44. Ext.extend( Ext.ux.BanViewerPanel, Ext.grid.EditorGridPanel, {
  45. } );
  46. Ext.reg( 'banViewerPanel', Ext.ux.BanViewerPanel );