mirror of
https://github.com/openwrt/luci.git
synced 2025-12-26 11:16:38 +04:00
luci-app-commands: rewrite to client side rendering
Rewrite the luci-app-command configuration to client side cbi forms and port the server side templates and controller logic to ucode. Also utilize a query string parameter to pass custom arguments. Fixes: #5559 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
{#
|
||||
Copyright 2016 t123yh <t123yh@outlook.com>
|
||||
Copyright 2022 Jo-Philipp Wich <jo@mein.io>
|
||||
Licensed to the public under the Apache License 2.0.
|
||||
-#}
|
||||
|
||||
{%
|
||||
include('header', { blank_page: true, css: `
|
||||
.alert-success {
|
||||
color: #3c763d;
|
||||
background-color: #dff0d8;
|
||||
border-color: #d6e9c6;
|
||||
}
|
||||
|
||||
.alert {
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.alert-warning {
|
||||
color: #8a6d3b;
|
||||
background-color: #fcf8e3;
|
||||
border-color: #faebcc;
|
||||
}
|
||||
` });
|
||||
-%}
|
||||
|
||||
<div class="alert alert-success" role="alert">
|
||||
{% if (exitcode == 0): %}
|
||||
{{ _('Command executed successfully.') }}
|
||||
{% else %}
|
||||
{{ sprintf(_('Command exited with status code %d'), exitcode) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if (length(stdout)): %}
|
||||
<h3>{{ _('Standard Output') }}</h3>
|
||||
<pre>{{ entityencode(stdout) }}</pre>
|
||||
{% endif %}
|
||||
|
||||
{% if (length(stderr)): %}
|
||||
<h3>{{ _('Standard Error') }}</h3>
|
||||
<pre>{{ entityencode(stderr) }}</pre>
|
||||
{% endif %}
|
||||
|
||||
{% include('footer', { blank_page: true }) %}
|
||||
Reference in New Issue
Block a user