Fix results binaries

This commit is contained in:
Badlop 2015-02-23 12:54:33 +01:00
parent 537706e9da
commit e9f5cb2c14
1 changed files with 6 additions and 6 deletions

View File

@ -54,9 +54,9 @@ web_page_node(Acc, _, _, _, _) -> Acc.
%%------------------- %%-------------------
get_content(Node, Query, Lang) -> get_content(Node, Query, Lang) ->
Instruct = ?T(<<"Type a command in a textbox and click Execute.">>), Instruct = ?T("Type a command in a textbox and click Execute."),
{{CommandCtl, CommandErl, CommandShell}, Res} = case catch parse_and_execute(Query, Node) of {{CommandCtl, CommandErl, CommandShell}, Res} = case catch parse_and_execute(Query, Node) of
{'EXIT', _} -> {{<<"">>, <<"">>, <<"">>}, Instruct}; {'EXIT', _} -> {{"", "", ""}, Instruct};
Result_tuple -> Result_tuple Result_tuple -> Result_tuple
end, end,
TitleHTML = [ TitleHTML = [
@ -70,21 +70,21 @@ get_content(Node, Query, Lang) ->
[?XE(<<"tr">>, [?XE(<<"tr">>,
[?X(<<"td">>), [?X(<<"td">>),
?XCT(<<"td">>, <<"ejabberd_ctl">>), ?XCT(<<"td">>, <<"ejabberd_ctl">>),
?XE(<<"td">>, [?INPUTS(<<"text">>, <<"commandctl">>, CommandCtl, <<"70">>), ?XE(<<"td">>, [?INPUTS(<<"text">>, <<"commandctl">>, list_to_binary(CommandCtl), <<"70">>),
?INPUTT(<<"submit">>, <<"executectl">>, <<"Execute">>)]) ?INPUTT(<<"submit">>, <<"executectl">>, <<"Execute">>)])
] ]
), ),
?XE(<<"tr">>, ?XE(<<"tr">>,
[?X(<<"td">>), [?X(<<"td">>),
?XCT(<<"td">>, <<"erlang shell">>), ?XCT(<<"td">>, <<"erlang shell">>),
?XE(<<"td">>, [?INPUTS(<<"text">>, <<"commanderl">>, CommandErl, <<"70">>), ?XE(<<"td">>, [?INPUTS(<<"text">>, <<"commanderl">>, list_to_binary(CommandErl), <<"70">>),
?INPUTT(<<"submit">>, <<"executeerl">>, <<"Execute">>)]) ?INPUTT(<<"submit">>, <<"executeerl">>, <<"Execute">>)])
] ]
), ),
?XE(<<"tr">>, ?XE(<<"tr">>,
[?X(<<"td">>), [?X(<<"td">>),
?XCT(<<"td">>, <<"system shell">>), ?XCT(<<"td">>, <<"system shell">>),
?XE(<<"td">>, [?INPUTS(<<"text">>, <<"commandshe">>, CommandShell, <<"70">>), ?XE(<<"td">>, [?INPUTS(<<"text">>, <<"commandshe">>, list_to_binary(CommandShell), <<"70">>),
?INPUTT(<<"submit">>, <<"executeshe">>, <<"Execute">>)]) ?INPUTT(<<"submit">>, <<"executeshe">>, <<"Execute">>)])
] ]
) )
@ -94,7 +94,7 @@ get_content(Node, Query, Lang) ->
ResHTML = ResHTML =
[?XAC(<<"textarea">>, [{<<"wrap">>, <<"off">>}, {<<"style">>, <<"font-family:monospace;">>}, [?XAC(<<"textarea">>, [{<<"wrap">>, <<"off">>}, {<<"style">>, <<"font-family:monospace;">>},
{<<"name">>, <<"result">>}, {<<"rows">>, <<"30">>}, {<<"cols">>, <<"80">>}], {<<"name">>, <<"result">>}, {<<"rows">>, <<"30">>}, {<<"cols">>, <<"80">>}],
Res) list_to_binary(Res))
], ],
TitleHTML ++ CommandHTML ++ ResHTML. TitleHTML ++ CommandHTML ++ ResHTML.