mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/haproxy: show help text when no config file was found
This commit is contained in:
@@ -34,7 +34,13 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
function update_showconf() {
|
||||
ajaxCall(url="/api/haproxy/export/config/", sendData={}, callback=function(data,status) {
|
||||
$("#showconf").text(data['response']);
|
||||
if (data['response'] && data['response'].trim()) {
|
||||
$("#showconf").text(data['response']);
|
||||
} else {
|
||||
conf_help = "<br><span style=\"color: #000000; white-space: pre-wrap; font-family: monospace;\"> {{ lang._('Config file not found. Run a syntax check to create it.') }}</span><br>";
|
||||
$("#showconfempty").append(conf_help);
|
||||
$("#showconf").hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
update_showconf();
|
||||
@@ -116,6 +122,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
<div id="export" class="tab-pane fade in active">
|
||||
<div class="content-box" style="padding-bottom: 1.5em;">
|
||||
<div id="showconfempty"></div>
|
||||
<pre id="showconf"></pre>
|
||||
<div class="col-md-12">
|
||||
<hr />
|
||||
|
||||
Reference in New Issue
Block a user