summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/view
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2015-05-26 17:11:41 +0200
committerJo-Philipp Wich <jow@openwrt.org>2015-05-26 17:12:42 +0200
commitfe14cd5a66a26423adcfb2366c1b9e643024fd46 (patch)
treef5864364059b30d0059e6627a81221d8f30edaa9 /modules/luci-base/luasrc/view
parent03610cee3acb5fab9defc2baf2f0e4ff8a9cfd71 (diff)
luci-base: fallback to a simple text editor if uci config cannot be loaded
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'modules/luci-base/luasrc/view')
-rw-r--r--modules/luci-base/luasrc/view/cbi/error.htm19
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/luci-base/luasrc/view/cbi/error.htm b/modules/luci-base/luasrc/view/cbi/error.htm
new file mode 100644
index 000000000..2acb96924
--- /dev/null
+++ b/modules/luci-base/luasrc/view/cbi/error.htm
@@ -0,0 +1,19 @@
+<div class="cbi-map" id="cbi-<%=self.config%>">
+ <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
+ <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
+
+ <p class="alert-message danger">
+ <%: The configuration file could not be loaded due to the following error: %><br />
+ <code><%=pcdata(self.error)%></code>
+ </p>
+
+ <textarea name="cbi.source" style="width:100%; margin-bottom:1em" rows="<%=math.max(self.source:cmatch("\n"), 10)%>"><%=pcdata(self.source)%></textarea>
+
+ <p class="alert-message">
+ <%: Edit the raw configuration data above to fix any error and hit "Save" to reload the page. %>
+ </p>
+
+ <div class="cbi-page-actions">
+ <input class="cbi-button cbi-button-apply" type="submit" name="cbi.save" value="<%:Save%>" />
+ </div>
+</div>