aboutsummaryrefslogtreecommitdiff
path: root/apps/dreki/src/funs/dreki_fun_exec.erl
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dreki/src/funs/dreki_fun_exec.erl')
-rw-r--r--apps/dreki/src/funs/dreki_fun_exec.erl28
1 files changed, 28 insertions, 0 deletions
diff --git a/apps/dreki/src/funs/dreki_fun_exec.erl b/apps/dreki/src/funs/dreki_fun_exec.erl
new file mode 100644
index 0000000..d704e80
--- /dev/null
+++ b/apps/dreki/src/funs/dreki_fun_exec.erl
@@ -0,0 +1,28 @@
+-module(dreki_fun_exec).
+-behaviour(dreki_funs).
+-export([schemas/0]).
+
+schemas() ->
+ #{<<"exec">> => #{default_version => <<"1.0">>, <<"1.0">> => schemas('1.0')}}.
+
+schemas('1.0') ->
+ #{
+ version => 'draft-06',
+ title => <<"Execute command">>,
+ type => object,
+ properties => #{
+ <<"id">> => #{type => string,
+ <<"dreki:form">> => #{default => generate_id}},
+ <<"name">> => #{type => string},
+ <<"description">> => #{type => string,
+ <<"dreki:form">> => #{
+ input => textarea,
+ textarea_mode => markdown
+ }},
+ <<"command">> => #{type => string, <<"dreki:form">> => #{
+ input_style => monospace,
+ placeholder => <<"/bin/true">>
+ }}
+ },
+ required => [id, name, command]
+ }.