You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zncstrap/modules/webadmin/tmpl/add_edit_network.tmpl

320 lines
14 KiB

<? AddRow JSLoop HREF=/modfiles/global/webadmin/webadmin.js ?>
<? INC Header.tmpl ?>
<form class="form-horizontal" role="form" action="<? IF Edit ?>editnetwork<? ELSE ?>addnetwork<? ENDIF ?>" method="post">
<? INC _csrf_check.tmpl ?>
<div class="section">
<input type="hidden" name="submitted" value="1" />
<input type="hidden" name="user" value="<? VAR Username ?>" />
<input type="hidden" name="network" value="<? VAR Name ?>" />
<div class="container col-md-10 col-md-offset-1">
<div class="panel with-nav-tabs panel-default">
<div class="panel-heading">
<ul class="nav nav-tabs">
<li class="active"><a href="#netinfotab" data-toggle="tab">Network Info</a></li>
<li><a href="#floodprotab" data-toggle="tab">Flood Protection</a></li>
<li><a href="#charencodetab" data-toggle="tab">Character Encoding</a></li>
<li><a href="#channelstab" data-toggle="tab">Channels</a></li>
<li><a href="#modulestab" data-toggle="tab">Modules</a></li>
</ul>
</div>
<div class="panel-body">
<div class="tab-content">
<!-- Network Info -->
<div class="tab-pane fade in active" id="netinfotab">
<div class="alert alert-warning">To connect to this network from your IRC client, you can set the server password field as follows: <code><? VAR Username ?>/<? IF Edit ?><? VAR Name ?><? ELSE ?>&lt;network&gt;<? ENDIF ?>:&lt;password&gt;</code> or username field as <code><? VAR Username ?>/<? IF Edit ?><? VAR Name ?><? ELSE ?>&lt;network&gt;<? ENDIF ?></code></div>
<div class="alert alert-info">Nick, AltNick, Ident, RealName, BindHost can be left empty to use the value from the user.</div>
<div class="form-group">
<label for="inputNetworkName" class="col-sm-2 control-label">Network Name:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputNetworkName" name="name" value="<? VAR Name ?>" maxlength="20" placeholder="The name of the IRC network">
</div>
</div>
<div class="form-group">
<label for="inputNickname" class="col-sm-2 control-label">Nickname:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputNickname" name="nick" value="<? VAR Nick ?>" maxlength="30" placeholder="Your nickname on IRC.">
</div>
</div>
<div class="form-group">
<label for="inputAltNickname" class="col-sm-2 control-label">Alt. Nickname:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="AltNickname" name="altnick" value="<? VAR AltNick ?>" maxlength="30" placeholder="Your secondary nickname, if the first is not available on IRC.">
</div>
</div>
<div class="form-group">
<label for="inputIdent" class="col-sm-2 control-label">Ident:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputIdent" name="ident" value="<? VAR Ident ?>" maxlength="30" placeholder="Your ident.">
</div>
</div>
<div class="form-group">
<label for="inputRealname" class="col-sm-2 control-label">Realname:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputRealname" name="realname" value="<? VAR RealName ?>" maxlength="128" placeholder="Your real name.">
</div>
</div>
<? IF BindHostEdit ?>
<div class="form-group">
<label for="inputBindHost" class="col-sm-2 control-label">BindHost:</label>
<div class="col-sm-10">
<? IF BindHostLoop ?>
<select class="form-control" name="bindhost">
<option value="">Default</option>
<? LOOP BindHostLoop ?>
<option value="<? VAR BindHost ?>"<? IF Checked ?> selected="selected"<? ENDIF ?>><? VAR BindHost ?></option>
<? ENDLOOP ?>
</select>
<? ELSE ?>
<input class="form-control" type="text" name="bindhost" value="<? VAR BindHost ?>"/>
<? ENDIF ?>
</div>
</div>
<? ENDIF ?>
<div class="form-group">
<label for="inputQuit" class="col-sm-2 control-label">Quit Message:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputQuit" name="quitmsg" value="<? VAR QuitMsg ?>" maxlength="256" placeholder="You may define a Message shown, when you quit IRC.">
</div>
</div>
<div class="form-group">
<label for="inputActive" class="col-sm-2 control-label">Active:</label>
<div class="col-sm-10">
<div class="switch">
<input type="checkbox" value="1" name="doconnect" class="cmn-toggle cmn-toggle-round-flat" id="doconnect_checkbox"<? IF IRCConnectEnabled ?> checked="checked"<? ENDIF ?> />
<label for="doconnect_checkbox"></label>
<span class="help-block">Connect to IRC &amp; automatically re-connect</span>
</div>
</div>
</div>
<div class="form-group" id="servers_plain">
<label for="inputServers" class="col-sm-2 control-label">Servers of this IRC network:</label>
<div class="col-sm-10">
<textarea class="form-control" name="servers" cols="70" rows="5" id="servers_text"><? LOOP ServerLoop ?><? VAR Server ?>
<? ENDLOOP ?></textarea>
<span class="help-block">One server per line, "host [[+]port] [password]", + means SSL</span>
<br/>
</div>
</div>
<div class="form-group" id="servers_js" style="display:none">
<label for="inputServers" class="col-sm-2 control-label">Servers of this IRC network:</label>
<div class="col-sm-10">
<table class="table table-hover">
<thead>
<tr>
<th>Hostname</th>
<th>Port</th>
<th>SSL</th>
<th>Password</th>
<th/>
</tr>
</thead>
<tbody id="servers_tbody">
<tr>
</tr>
</tbody>
</table>
<button type="button" class="btn btn-default" value="Add" id="servers_add">Add New Server</button>
</div>
</div>
<script type="text/javascript">serverlist_init(jQuery);</script>
<div class="form-group">
<label for="inputTrustedSSL" class="col-sm-2 control-label">Trusted SSL fingerprints of this IRC network:</label>
<div class="col-sm-10">
<textarea class="form-control" name="fingerprints" rows="3"><? LOOP TrustedFingerprints ?><? VAR FP ?>
<? ENDLOOP ?></textarea>
<span class="help-block">When these certificates are encountered, checks for hostname, expiration date, CA are skipped</span>
</div>
</div>
</div> <!-- Network Info -->
<!-- Flood Protection -->
<div class="tab-pane fade" id="floodprotab">
<div class="form-group">
<label for="inputFloodpro" class="col-sm-2 control-label">Flood protection:</label>
<div class="col-sm-10">
<div class="switch">
<input type="checkbox" name="floodprotection" id="floodprotection_checkbox" class="cmn-toggle cmn-toggle-round-flat" onchange="floodprotection_change();" <? IF FloodProtection ?>checked="checked"<? ENDIF ?> />
<label for="floodprotection_checkbox"></label>
<span class="help-block">You might enable the flood protection. This prevents `excess flood' errors, which occur, when your IRC bot is command flooded or spammed. After changing this, reconnect ZNC to server</span>
</div>
</div>
</div>
<div class="form-group">
<label for="inputFloodproRate" class="col-sm-2 control-label">Flood protection rate:</label>
<div class="col-sm-10">
<input class="form-control" type="number" name="floodrate" min="0.3" step="0.05" id="floodrate" placeholder="The number of seconds per line." <? IF FloodProtection ?> value="<? VAR FloodRate ?>" <? ELSE ?> value="1.00" disabled="disabled" <? ENDIF ?> />
<span class="help-block">The number of seconds per line. After changing this, reconnect ZNC to server</span>
</div>
</div>
<div class="form-group">
<label for="inputFloodproBurst" class="col-sm-2 control-label">Flood protection burst:</label>
<div class="col-sm-10">
<input type="number" class="form-control" name="floodburst" min="1" id="inputFloodproBurst floodburst" <? IF FloodProtection ?> value="<? VAR FloodBurst ?>" <? ELSE ?> value="4" disabled="disabled" <? ENDIF ?> />
<span class="help-block">Defines the number of lines, which can be sent immediately. After changing this, reconnect ZNC to server</span>
</div>
</div>
<div class="form-group">
<label for="inputChanjoindelay" class="col-sm-2 control-label">Channel join delay:</label>
<div class="col-sm-10">
<input type="number" class="form-control" name="joindelay" min="0" id="inputChanjoindelay joindelay" value="<? VAR JoinDelay ?>" />
<span class="help-block">Defines the delay in seconds, until channels are joined after getting connected</span>
</div>
</div>
<script type="text/javascript">floodprotection_change();</script>
</div> <!-- Flood Protection -->
<!-- Server Encoding -->
<div class="tab-pane fade" id="charencodetab">
<div class="form-group">
<label for="inputChanencode" class="col-sm-2 control-label">Server encoding:</label>
<div class="col-sm-10">
<? INC encoding_settings.tmpl ?>
</div>
</div>
</div> <!-- Server Encoding -->
<!-- Channels -->
<div class="tab-pane fade" id="channelstab">
<? IF !Edit ?>
<span class="info">You will be able to add + modify channels here after you created the network.</span><br />
<? ELSE ?>
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<td><a href="addchan?user=<? VAR Username ESC=URL ?>&amp;network=<? VAR Name ESC=URL ?>" class="btn btn-primary btn-xs">Add</a></td>
<? IF ChannelLoop ?>
<td>Save</td>
<td>Name</td>
<td>CurModes</td>
<td>DefModes</td>
<td>BufferCount</td>
<td>Options</td>
<? ELSE ?>
<td>&lt;- Add a channel (opens in same page)</td>
<? ENDIF ?>
</tr>
</thead>
<tbody>
<? LOOP ChannelLoop SORTASC=Name ?>
<tr>
<td>
<input type="hidden" name="channel" value="<? VAR Name ?>" /> <a href="editchan?user=<? VAR Username ESC=URL ?>&amp;network=<? VAR Network ESC=URL ?>&amp;name=<? VAR Name ESC=URL ?>" class="btn btn-warning btn-xs">Edit</a> <a href="delchan?user=<? VAR Username ESC=URL ?>&amp;network=<? VAR Network ESC=URL ?>&amp;name=<? VAR Name ESC=URL ?>" class="btn btn-danger btn-xs">Del</a>
</td>
<td class="text-center">
<div class="switch">
<input type="checkbox" name="save_<? VAR Name ?>" class="cmn-toggle cmn-toggle-round-flat"<? IF InConfig ?> checked="checked"<? ENDIF ?> />
<label for="save_<? VAR Name ?>"></label>
</div>
</td>
<td><? VAR Name ?></td>
<td><? VAR CurModes ?></td>
<td><? VAR DefModes ?></td>
<td><? VAR BufferCount ?></td>
<td><? VAR Options ?></td>
</tr>
<? ENDLOOP ?>
</tbody>
</table>
<? ENDIF ?>
</div> <!-- Channels -->
<!-- Modules -->
<div class="tab-pane fade" id="modulestab">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<td>Status</td>
<td>Name</td>
<td>Arguments</td>
<td>Description</td>
<td>Global</td>
<td>Networks</td>
</tr>
</thead>
<tbody>
<? LOOP ModuleLoop ?>
<tr>
<td>
<div class="switch">
<input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" class="cmn-toggle cmn-toggle-round-flat" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> />
<label for="lm_<? VAR Name ?>"></label>
</div>
</td>
<td>
<label for="lm_<? VAR Name ?>"> <? IF Wiki ?><a href="http://wiki.znc.in/<? VAR Wiki ?>" target="_blank"><? VAR Name ?></a> <? ELSE ?> <? VAR Name ?> <? ENDIF ?></label>
</td>
<td>
<? IF Disabled ?>
<? VAR Args ?>
<? ELSE ?>
<input class="form-control" class="third" type="text" name="modargs_<? VAR Name ?>" value="<? VAR Args ?>"
<? IF !HasArgs ?> disabled="disabled"<? ENDIF ?>
<? IF ArgsHelpText ?> data-toggle="tooltip" data-placement="top" data-original-title="<? VAR ArgsHelpText ?>"<? ENDIF ?> autocomplete="off"/>
<? ENDIF ?>
</td>
<td><? VAR Description ?></td>
<td>
<? IF CanBeLoadedGlobally ?>
<div class="checkboxSwitchMini">
<input type="checkbox" name="loaded_globally" id="loaded_globally_<? VAR Name ?>" value="<? VAR Name ?>"<? IF LoadedGloabally?> checked="checked" <? ENDIF ?> class="sr-only" disabled="disabled" /> <? ENDIF ?>
<label for="loaded_globally_<? VAR Name ?>"></label>
</div>
<? ENDIF ?>
</td>
<td>
<? IF CanBeLoadedByUser ?>
<div class="checkboxSwitchMini">
<input type="checkbox" name="loaded_by_user" id="loaded_by_user_<? VAR Name ?>" value="<? VAR Name ?>"<? IF LoadedByUser ?> checked="checked" <? ENDIF ?> class="sr-only" disabled="disabled" /> <? ENDIF ?>
<label for="loaded_by_user_<? VAR Name ?>"></label>
</div>
<? ENDIF ?>
</td>
</tr>
<? ENDLOOP ?>
</tbody>
</table>
</div> <!-- Modules -->
<!-- Other Modules -->
<div class="tab-pane fade" id="othermods">
<? LOOP EmbeddedModuleLoop ?>
<? IF Embed ?>
<h3>Module <? VAR ModName ?></h3>
<? INC *Embed ?>
<? ENDIF ?>
<? ENDLOOP ?>
</div> <!-- Other Modules -->
</div>
</div>
<div class="panel-footer text-right">
<input class="btn btn-danger" type="reset" value="Reset">
<input class="btn btn-success" type="submit" name="submit_return" value="<? IF Edit ?>Save<? ELSE ?>Save Network<? ENDIF ?>" />
<input class="btn btn-default" type="submit" name="submit_continue" value="<? IF Edit ?>Save and continue<? ELSE ?>Save and continue<? ENDIF ?>" />
</div>
</div>
</div>
</form>
<? INC Footer.tmpl ?>