2016-11-06 14:27:43 -07:00

107 lines
3.4 KiB
Plaintext

Icon="ungit.png"
Menu="NetworkServices"
Title="unGit"
---
<? require_once '/usr/local/emhttp/plugins/ungit/include/settings.php';?>
<form markdown="1" id="gform" name="g_settings" action="/update.php" method="POST" target="progressFrame">
<input type="hidden" name="#file" value="ungit/ungit.cfg" />
<input type="hidden" id="command" name="#command" value="" />
Enable unGit Server (<?=$gversion;?>):
: <select id="DAEMON" name="DAEMON" size="1" onChange="checkRUNNING(this.form);">
<?=mk_option($gdaemon, "disable", "No");?>
<?=mk_option($gdaemon, "enable", "Yes");?>
</select>
> Choose to enable unGit Server.
>
> Select Yes to enable, No to disable.
Port:
: <input id="PORT" name="PORT" type="text" class="g-run" style="width:25px" maxlength="4" value="<?=$gport;?>" title="port must be 0-65535, default is 8448" placeholder="Port" >
> Enter Port number of your unGit Server
<input id="DEFAULT" class="g-run" type="submit" value="Default" onClick="resetDATA(this.form)"><input id="BtnConnect" type="button" value="Connect">
: <input id="btnApply" type="submit" value="Apply" style="margin-bottom:8px" onClick="verifyDATA(this.form);"><input type="button" value="Done" onClick="done()">
</form>
<div id="title" ><span class="left"><img class="icon" src="/webGui/icons/log.png"> unGit Log </span></div>
<table class="tablesorter" style="margin-top: -22px;">
<thead>
<th>Logfile</th>
<th>Size</th>
</thead>
<tbody>
<?
$log = '/var/log/ungit';
if(file_exists($log)){
echo "<tr><td style='cursor:pointer;'><a title='$log' onclick=\"openWindow('/webGui/scripts/tail_log&arg1=ungit','unGit Log',600,900);\">$log</a></td><td>"
.filesize($log).'</td></tr>';
}
?>
</tbody>
</table>
<script type="text/javascript" src="/plugins/ungit/js/jquery.mask.js"></script>
<script type="text/javascript">
$(function(){
$('.tabs')
.append("<span class='status'>Status: <?=$gstatus;?> </span>");
// dynamix plugin update api
<?if (function_exists('plugin_update_available') && $version = plugin_update_available('ungit')):?>
showNotice('ungit Notify <?=$version?> available. <a>Update</a>','ungit');
$('#user-notice a').on('click', function () {
$('#user-notice').empty();
});
<?endif;?>
$('#PORT').mask('0000#');
$('#BtnConnect').click(function () {
window.open("<?php echo 'http://',$var['NAME'],':',$gport;?>", '_blank');
});
checkRUNNING(document.g_settings);
});
function resetDATA(form) {
form.PORT.value = 8448;
}
function checkRUNNING(form) {
if ("<?=$grunning;?>" == true){
$('.g-run').prop('disabled', true);
$('#BtnConnect').prop('disabled', false);
form.btnApply.disabled = true;
}else{
$('.g-run').prop('disabled', false);
$('#BtnConnect').prop('disabled', true);
}
if (form.DAEMON.value == 'enable'){
form.command.value = '/usr/local/emhttp/plugins/ungit/scripts/start';
} else {
form.command.value = '/usr/local/emhttp/plugins/ungit/scripts/stop';
form.btnApply.disabled = (form.DAEMON.value == 'enable');
}
}
function verifyDATA(form) {
if (form.PORT.value < 0 || form.PORT.value > 65535 || form.PORT.value == ''){
form.PORT.value = 8448;
}
form.DAEMON.value = form.DAEMON.value.replace(/ /g,"_");
}
/* empty fan log */
function clearFanLOG(){
$.get('/plugins/ungit/include/fanlog_clear.php', {},function() {
$('#fanlog-size').html('0');
});
}
</script>