summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-commands/luasrc/view/commands.htm
diff options
context:
space:
mode:
authorHelge Mader <ma@dev.tdt.de>2020-05-05 15:01:56 +0200
committerHelge Mader <ma@dev.tdt.de>2020-05-11 11:48:21 +0200
commit2c0886b5a74417c8a683d2186dbc3dd9370e2dfa (patch)
tree8a1a6864a8af1fb7fece740c6d44d31fdbf70478 /applications/luci-app-commands/luasrc/view/commands.htm
parent2a94e18d9b71208b19468c7e2d26168b0609601b (diff)
luci-app-commands: show hint in status page if no entry defined yet
Signed-off-by: Helge Mader <ma@dev.tdt.de>
Diffstat (limited to 'applications/luci-app-commands/luasrc/view/commands.htm')
-rw-r--r--applications/luci-app-commands/luasrc/view/commands.htm50
1 files changed, 31 insertions, 19 deletions
diff --git a/applications/luci-app-commands/luasrc/view/commands.htm b/applications/luci-app-commands/luasrc/view/commands.htm
index d60a97c5b7..28b7701faf 100644
--- a/applications/luci-app-commands/luasrc/view/commands.htm
+++ b/applications/luci-app-commands/luasrc/view/commands.htm
@@ -136,28 +136,40 @@
<form method="get" action="<%=pcdata(FULL_REQUEST_URI)%>">
<div class="cbi-map">
<h2 name="content"><%:Custom Commands%></h2>
-
- <fieldset class="cbi-section">
- <% local _, command; for _, command in ipairs(commands) do %>
- <div class="commandbox">
- <h3><%=pcdata(command.name)%></h3>
- <p><%:Command:%> <code><%=pcdata(command.command)%></code></p>
- <% if command.param == "1" then %>
- <p><%:Arguments:%> <input type="text" id="<%=command['.name']%>" /></p>
- <% end %>
- <div>
- <input type="button" value="<%:Run%>" class="cbi-button cbi-button-apply" onclick="command_run('<%=command['.name']%>')" />
- <input type="button" value="<%:Download%>" class="cbi-button cbi-button-download" onclick="command_download('<%=command['.name']%>')" />
- <% if command.public == "1" then %>
- <input type="button" value="<%:Link%>" class="cbi-button cbi-button-link" onclick="command_link('<%=command['.name']%>')" />
- <% end %>
+ <% if #commands == 0 then %>
+ <div class="cbi-section">
+ <div class="table cbi-section-table">
+ <div class="tr cbi-section-table-row">
+ <p>
+ <em><%:This section contains no values yet%></em>
+ </p>
+ </div>
</div>
</div>
- <% end %>
+ <% else %>
+ <fieldset class="cbi-section">
+ <% local _, command; for _, command in ipairs(commands) do %>
+ <div class="commandbox">
+ <h3><%=pcdata(command.name)%></h3>
+ <p><%:Command:%> <code><%=pcdata(command.command)%></code></p>
+ <% if command.param == "1" then %>
+ <p><%:Arguments:%> <input type="text" id="<%=command['.name']%>" /></p>
+ <% end %>
+ <div>
+ <input type="button" value="<%:Run%>" class="cbi-button cbi-button-apply" onclick="command_run('<%=command['.name']%>')" />
+ <input type="button" value="<%:Download%>" class="cbi-button cbi-button-download" onclick="command_download('<%=command['.name']%>')" />
+ <% if command.public == "1" then %>
+ <input type="button" value="<%:Link%>" class="cbi-button cbi-button-link" onclick="command_link('<%=command['.name']%>')" />
+ <% end %>
+ </div>
+ </div>
+ <% end %>
+
+ <br style="clear:both" /><br />
+ <a name="output"></a>
+ </fieldset>
+ <% end %>
- <br style="clear:both" /><br />
- <a name="output"></a>
- </fieldset>
</div>
<fieldset class="cbi-section" style="display:none">