Uses 911K of libraries. Click here for Pure Java version (9017L/46K).
1 | !7 |
2 | |
3 | cmodule AgiBlueControlPanel { |
4 | transient JLabel lblStarted; |
5 | transient JButton btnStart; |
6 | S port = "8080"; |
7 | |
8 | visualize { |
9 | if (getOpt(agiProg(), 'webServerPorts) == null) ret jcenteredlabel("Not running agi.blue"); |
10 | |
11 | ret makeForm( |
12 | "Web Server Started:", lblStarted = jlabel(yesNo(started())), |
13 | "HTTP Port:", dm_inputField('port), |
14 | "", " ", |
15 | "", btnStart = setEnabled(!started(), makeBold(jButtonWithInset("Start Web Server", rThread startWebServer))), |
16 | "", " ", |
17 | "", jbutton("Open In Browser", rThread openInBrowser)); |
18 | } |
19 | |
20 | void startWebServer enter { |
21 | set(agiProg(), webServerPorts := new int[] { parseInt(port) }); |
22 | disableButton(btnStart); |
23 | temp tempSetButtonText(btnStart, "Starting..."); |
24 | call(agiProg(), 'startEleu); |
25 | setText(lblStarted, yesNo(started())); |
26 | } |
27 | |
28 | bool started() { ret isTrue(get(agiProg(), 'started)); } |
29 | |
30 | O agiProg() { ret mainProgram(); } |
31 | |
32 | bool warnOnDelete() { true; } |
33 | |
34 | void openInBrowser enter { |
35 | openURLInBrowser("http://localhost:" + parseInt(port)); |
36 | } |
37 | } |
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1023954 |
Snippet name: | agi.blue Control Panel [for standalone version] |
Eternal ID of this version: | #1023954/15 |
Text MD5: | e304c53e2d62e6814458f1dc69b651e6 |
Transpilation MD5: | 18e24943beb62a8587e976a980030989 |
Author: | stefan |
Category: | javax / agi.blue |
Type: | JavaX source code (Dynamic Module) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-07-14 12:28:29 |
Source code size: | 1106 bytes / 37 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 276 / 561 |
Version history: | 14 change(s) |
Referenced in: | [show references] |