Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

25
LINES

< > BotCompany Repo | #1027400 // Eleu: Clear Blocked IPs [only on server]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (3889L/20K).

1  
!7
2  
3  
cmodule ClearBlockedIPs > DynSingleFunction {
4  
  transient Set<S> blockedIPs;
5  
  transient JList list;
6  
  
7  
  start {
8  
    // do it on boot because, sadly, during Eleu startup
9  
    // legitimate clients may be blocked
10  
    doIt(); 
11  
    dm_doEveryAndNow(10.0, r getBlockedIPs);
12  
  }
13  
  
14  
  void doIt {
15  
    call(mainMainClass(), 'clearBlockedIPs);
16  
    print("Done!");
17  
  }
18  
19  
  visual centerAndSouthWithMargins(jCenteredSection("Blocked IPs", list = jlist()), super);
20  
21  
  void getBlockedIPs {
22  
    setField(blockedIPs := sortInPlace(cloneList((Cl<S>) getOpt(mainMainClass(), "blockedIPs"))));
23  
    fillListWithStrings(list, blockedIPs);
24  
  }
25  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, mqqgnosmbjvj, podlckwnjdmb, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027400
Snippet name: Eleu: Clear Blocked IPs [only on server]
Eternal ID of this version: #1027400/5
Text MD5: 834a59887d381961fd0cd73b0905ecb3
Transpilation MD5: f0cce6f6cd0ed125fd8b32045a567978
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-07-03 12:22:57
Source code size: 628 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 131 / 106575
Version history: 4 change(s)
Referenced in: [show references]