aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2019-08-22 18:07:05 +0200
committerBadlop <badlop@process-one.net>2019-08-22 18:35:43 +0200
commit1fd75265d6c28ccae1bb3b2aa53c858984f29053 (patch)
treeedc41ea1ec58652a45a1dcad618ec58f1189e3d4 /src
parentFix call to deprecated ejabberd_config:get_myhosts() (#3000) (diff)
Use select fields to input host in WebAdmin Backup (#3000)
Diffstat (limited to 'src')
-rw-r--r--src/ejabberd_web_admin.erl17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/ejabberd_web_admin.erl b/src/ejabberd_web_admin.erl
index cf0492b95..8d28d4447 100644
--- a/src/ejabberd_web_admin.erl
+++ b/src/ejabberd_web_admin.erl
@@ -1292,9 +1292,7 @@ get_node(global, Node, [<<"backup">>], Query, Lang) ->
[?CT(?T("Export data of users in a host to PIEFXIS "
"files (XEP-0227):")),
?C(<<" ">>),
- ?INPUT(<<"text">>,
- <<"export_piefxis_host_dirhost">>,
- (ejabberd_config:get_myname()))]),
+ make_select_host(Lang, <<"export_piefxis_host_dirhost">>)]),
?XE(<<"td">>,
[?INPUT(<<"text">>,
<<"export_piefxis_host_dirpath">>,
@@ -1308,9 +1306,7 @@ get_node(global, Node, [<<"backup">>], Query, Lang) ->
[?CT(?T("Export all tables as SQL queries "
"to a file:")),
?C(<<" ">>),
- ?INPUT(<<"text">>,
- <<"export_sql_filehost">>,
- (ejabberd_config:get_myname()))]),
+ make_select_host(Lang, <<"export_sql_filehost">>)]),
?XE(<<"td">>,
[?INPUT(<<"text">>,
<<"export_sql_filepath">>,
@@ -1480,6 +1476,15 @@ node_parse_query(Node, Query) ->
end
end.
+make_select_host(Lang, Name) ->
+ ?XAE(<<"select">>,
+ [{<<"name">>, Name}],
+ (lists:map(fun (Host) ->
+ ?XACT(<<"option">>,
+ ([{<<"value">>, Host}]), Host)
+ end,
+ ejabberd_config:get_option(hosts)))).
+
db_storage_select(ID, Opt, Lang) ->
?XAE(<<"select">>,
[{<<"name">>, <<"table", ID/binary>>}],