22@import org.osgl.Osgl
33@section(moreStyles) {
44< style >
5- body {
6- background-color : # 333 ;
7- color : # bbb ;
8- }
9- # page-title {
10- padding-top : 50px ;
11- padding-bottom : 20px ;
12- border-bottom : 1px solid # 777 ;
13- }
14- dt {
15- font-weight : bold;
16- }
17- dd {
18- margin : 0 ;
19- padding-left : 18px ;
20- }
21- # command-nav {
22- border-right : 1px solid # 777 ;
23- }
24- .command {
25- padding : 12px 10px 12px 20px ;
26- cursor : pointer;
27- }
28- .command : hover {
29- background-color : # 555 ;
30- }
31- .command .active {
32- background-color : # 777 ;
33- color : # 333
34- }
35- .hidden {display : none;}
5+ body {
6+ background-color : # 333 ;
7+ color : # bbb ;
8+ }
9+
10+ # page-title {
11+ padding-top : 50px ;
12+ padding-bottom : 20px ;
13+ border-bottom : 1px solid # 777 ;
14+ }
15+
16+ dt {
17+ font-weight : bold;
18+ }
19+
20+ dd {
21+ margin : 0 ;
22+ padding-left : 18px ;
23+ }
24+
25+ # command-nav {
26+ border-right : 1px solid # 777 ;
27+ }
28+
29+ .command {
30+ padding : 12px 10px 12px 20px ;
31+ cursor : pointer;
32+ }
33+
34+ .command : hover {
35+ background-color : # 555 ;
36+ }
37+
38+ .command .active {
39+ background-color : # 777 ;
40+ color : # 333
41+ }
42+
43+ .hidden {
44+ display : none;
45+ }
46+ .button , button , input [type = "submit" ], input [type = "reset" ], input [type = "button" ] {
47+ color : # aaa
48+ }
49+ .button : hover , button : hover , input [type = "submit" ]: hover , input [type = "reset" ]: hover , input [type = "button" ]: hover ,
50+ .button : focus , button : focus , input [type = "submit" ]: focus , input [type = "reset" ]: focus , input [type = "button" ]: focus {
51+ color : # eee
52+ }
3653</ style >
3754}
3855@args act.cli.CliDispatcher dispatcher
3956
40- @def commandList(List< String > commandList) {
41- < dl class ="command-list ">
57+ @def commandList(List
58+ < String > commandList) {
59+ < dl class ="command-list ">
4260 @for(String cmd: commandList) {
43- @{
44- act.handler.CliHandler handler = dispatcher.handler(cmd);
45- Osgl.T2< String , String > commandLine = handler.commandLine(cmd);
46- }
47- < div class ="command " data-cmd ="@cmd ">
48- < dt >
49- < i class ="fa fa-wrench " aria-hidden ="true "> </ i > @cmd
50- </ dt >
51- < dd >
52- @commandLine._2
53- </ dd >
54- </ div >
61+ @{
62+ act.handler.CliHandler handler = dispatcher.handler(cmd);
63+ Osgl.T2
64+ < String
65+ , String > commandLine = handler.commandLine();
66+ }
67+ < div class ="command " data-cmd ="@cmd ">
68+ < dt >
69+ < i class ="fa fa-wrench " aria-hidden ="true "> </ i > @cmd
70+ </ dt >
71+ < dd >
72+ @commandLine._2
73+ </ dd >
74+ </ div >
5575 } else {
56- < span > No command found ...</ span >
76+ < span > No command found ...</ span >
5777 }
58- </ dl >
59- }
78+ </ dl >
79+ }
6080
61- < div class ="row ">
62- < h1 id ="page-title "> CLI Over HTTP</ h1 >
63- </ div >
64- < div class ="row ">
65- < div class ="four columns " id ="command-nav ">
66- < div id ="app-commands ">
67- < h5 > Application commands</ h5 >
68- @commandList(dispatcher.applicationCommands())
69- </ div >
81+ < div class ="row ">
82+ < h1 id ="page-title "> CLI Over HTTP</ h1 >
83+ </ div >
84+ < div class ="row ">
85+ < div class ="four columns " id ="command-nav ">
86+ < div id ="app-commands ">
87+ < h5 > Application commands</ h5 >
88+ @commandList(dispatcher.applicationCommands())
89+ </ div >
7090
71- < div id ="sys-commands ">
72- < h5 > System commands</ h5 >
73- @commandList(dispatcher.systemCommands())
74- </ div >
75- </ div >
76- < div id ="detail " class ="eight columns ">
77- < p >
78- Click on the command list in the left navigation column to load command panel
79- </ p >
80- </ div >
91+ < div id ="sys-commands ">
92+ < h5 > System commands</ h5 >
93+ @commandList(dispatcher.systemCommands())
94+ </ div >
95+ </ div >
96+ < div id ="detail " class ="eight columns ">
97+ < p >
98+ Click on the command list in the left navigation column to load command panel
99+ </ p >
81100 </ div >
101+ </ div >
82102
83- @section(moreScripts){
84- < script >
103+ @section(moreScripts){
104+ < script >
85105 var curCmd ;
86- $ ( 'div.command' ) . click ( function ( ) {
87- curCmd = $ ( this ) . data ( 'cmd' ) ;
88- $ ( 'div.command' ) . removeClass ( 'active' ) ;
89- $ ( this ) . addClass ( 'active' ) ;
90- $ . get ( '/cmd' , { cmd : curCmd } , function ( detail ) {
91- $ ( '#detail' ) . html ( detail ) . removeClass ( 'hidden' )
92- } )
106+ $ ( 'div.command' ) . click ( function ( ) {
107+ curCmd = $ ( this ) . data ( 'cmd' ) ;
108+ $ ( 'div.command' ) . removeClass ( 'active' ) ;
109+ $ ( this ) . addClass ( 'active' ) ;
110+ $ . get ( '/cmd' , { cmd : curCmd } , function ( detail ) {
111+ $ ( '#detail' ) . html ( detail ) . removeClass ( 'hidden' )
112+ } )
93113 } )
94- </ script >
95- }
114+ </ script >
115+ }
0 commit comments