HYProxy-1.0/View/hyproxy_list.php

153 lines
8.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php include('header.php'); ?>
<!-- 载入面板头部文件 -->
<div id="body">
<?php include('hyproxy_category.php'); ?>
<?php
if (!empty($notice)) {
echo '<div style="margin:5px 2px;width:500px;"><p id="' . $status . '">' . $notice . '</p></div>';
}
?>
<p>HYProxy反向代理:</p>
<div id="HYProxy_list">
<table border="0" cellspacing="1" id="STable" style="width:850px;">
<tr>
<th>ID</th>
<th>域名</th>
<th>最后修改</th>
<th>管理</th>
</tr>
<?php
if (!is_array($hyproxy_list) || count($hyproxy_list) < 1) {
?>
<tr>
<td colspan="4" style="padding:10px;">暂无绑定域名。</td>
</tr>
<?php
} else {
foreach ($hyproxy_list as $key => $val) {
?>
<tr>
<th class="i"><?php echo $val['hyproxy_id'];?></th>
<td><a href="http://<?php echo $val['server_name'];?>" target="_blank"><?php echo $val['server_name'];?></a></td>
<td><?php echo date("Y-m-d H:i:s", $val['time']);?></td>
<td><a href="index.php?c=hyproxy&run=<?php echo $val['server_name'];?>&g=<?php echo $val['status'] != 'stop' ? 'stop' : 'start';?>" > <span <?php echo $val['status'] != 'stop' ? 'class="run_start"' : 'class="run_stop"';?>><?php echo $val['status'] != 'stop' ? '运行中' : '已停止' ;?></span> </a> <a href="index.php?c=hyproxy&run_cache=<?php echo $val['server_name'];?>&g=<?php echo $val['proxy_cache'] != '0' ? '0' : '1';?>" > <span <?php echo $val['proxy_cache'] != '0' ? 'class="run_start"' : 'class="run_stop"';?>><?php echo $val['proxy_cache'] != '0' ? '有缓存' : '没缓存' ;?></span> </a> <a href="./index.php?c=hyproxy&admin=<?php echo $val['server_name'];?>" class="button"><span class="cog icon"></span> 管理</a> <a href="./index.php?c=hyproxy&del=<?php echo $val['server_name'];?>" class="button" onClick="return confirm('确认删除域名:<?php echo $val['server_name'];?>?');"><span class="cross icon"></span> 删除</a> </td>
</tr>
<?php
}
}
?>
</table>
<button type="button" class="primary button" onClick="WindowLocation('/index.php?c=hyproxy')"><span class="home icon"></span> 返回列表</button>
<br />
<!-------------------------------------------------------------------------------------------------------->
<?php if (isset($_GET['admin'])) { ?>
<br />
<form action="./index.php?c=hyproxy&admin=<?php echo $_GET['admin'];?>" method="POST" >
<p>编辑反向代理网站:</p>
<table border="0" cellspacing="1" id="STable" style="width:720px;">
<tr>
<th>名称</th>
<th>值</th>
<th>说明</th>
</tr>
<tr>
<td>绑定域名</td>
<td><input type="text" name="" class="input_text disabled" disabled="" value="<?php echo $hyproxy_get['server_name'];?>" />
<input type="hidden" name="server_name" value="<?php echo $hyproxy_get['server_name'];?>" />
<font class="red">*</font></td>
<td>绑定的域名,不需加 http://
<div style="font-size:11px;color:#848484;margin:5px;">(e.g: amysql.com)</div></td>
</tr>
<tr>
<td>默认首页</td>
<td><input type="text" name="index" class="input_text" value="<?php echo $hyproxy_get['index'];?>" />
<input type="hidden" name="index_hidden" value="<?php echo $hyproxy_get['index'];?>" />
<font class="red">*</font></td>
<td>默认首页文件,用半角空格隔开
<div style="font-size:11px;color:#848484;margin:5px;">(e.g: index.php index.html index.htm)</div></td>
</tr>
<tr>
<td>后端域名</td>
<td><input type="text" name="header_host" class="input_text" value="<?php echo $hyproxy_get['header_host'];?>" />
<font class="red">*</font>
<input type="hidden" name="header_host_hidden" class="input_text" value="<?php echo $hyproxy_get['header_host'];?>" />
</td>
<td>被反代的域名;$host为nginx变量,等于绑定的域名.
<div style="font-size:11px;color:#848484;margin:5px;">(e.g: nginx.org)</div></td>
</tr>
<tr>
<td>后端地址</td>
<td><input type="text" name="proxy_pass" class="input_text" value="<?php echo $hyproxy_get['proxy_pass'];?>" />
<font class="red">*</font>
<input type="hidden" name="proxy_pass_hidden" class="input_text" value="<?php echo $hyproxy_get['proxy_pass'];?>" />
</td>
<td>被反代的IP地址或域名
<div style="font-size:11px;color:#848484;margin:5px;">(e.g: http://123.123.123.123:8888)</div></td>
</tr>
<tr>
<th colspan="3" style="padding:10px;text-align:left;"> <button type="submit" class="primary button" name="edit"><span class="check icon"></span>保存</button>
<a href="./index.php?c=hyproxy">取消返回</a> </th>
</tr>
</table>
</form>
<?php } else { ?>
<!-------------------------------------------------------------------------------------------------------->
<br />
<form action="./index.php?c=hyproxy" method="POST" >
<p>新增HYProxy反向代理网站:</p>
<table border="0" cellspacing="1" id="STable" style="width:660px;">
<tr>
<th>名称</th>
<th>值</th>
<th>说明</th>
</tr>
<tr>
<td>绑定域名</td>
<td><input type="text" name="server_name" class="input_text" />
<font class="red">*</font></td>
<td>绑定的域名,不需加 http://
<div style="font-size:11px;color:#848484;margin:5px;">(e.g: amysql.com)</div></td>
</tr>
<tr>
<td>后端地址</td>
<td><input type="text" name="proxy_pass" class="input_text" />
<font class="red">*</font></td>
<td>被反代的IP地址或域名
<div style="font-size:11px;color:#848484;margin:5px;">(e.g: http://123.123.123.123:8888)</div></td>
</tr>
<tr>
<th colspan="3" style="padding:10px;text-align:left;"> <button type="submit" class="primary button" name="submit"><span class="check icon"></span>保存</button></th>
</tr>
</table>
</form>
</div>
<?php } ?>
<div id="notice_message" style="width:880px;">
<h3>» SSH HYProxy</h3>
1) 有步骤提示操作: <br />
ssh执行命令: amh module HYProxy-1.0<br />
然后选择对应的操作选项进行管理。<br />
<br />
2) 或直接操作: <br />
<ul>
<li>HYProxy管理: amh module HYProxy-1.0 [info / install / admin / uninstall / status]</li>
</ul>
3) HYProxy admin管理选项说明 <br />
执行 amh module HYProxy-1.0 admin 提示输入管理参数(例如, list、add,amysql.com,nginx.org等),可以不输入直接回车显示下面选项菜单。
<ul>
<li>list: 列出反向代理网站列表 (ssh命令: amh module HYProxy-1.0 admin list)</li>
<li>make: 生成反向代理网站conf (ssh命令: amh module HYProxy-1.0 admin make,amysql.com)生成amysql.com的conf。不填域名生成所有</li>
<li>add: 新增反向代理网站 (ssh命令: amh module HYProxy-1.0 admin add,amysql.com,nginx.org) amysql,com为绑定域名nginx.org为反代域名。</li>
<li>start: 启动反向代理网站 (ssh命令: amh module HYProxy-1.0 admin start,amysql.com) 启动amysql.com反代网站。</li>
<li>stop: 停止反向代理网站 (ssh命令: amh module HYProxy-1.0 admin stop,amysql.com) 停止amysql.com反代网站。</li>
<li>edit: 编辑反向代理网站 (ssh命令: amh module HYProxy-1.0 admin edit,amysql.com,参数名,参数值,参数值...) amysql.com为绑定域名<br />
其它参数名与值可参考提示使用。</li>
<li>del: 删除反向代理网站 (ssh命令: amh module HYProxy-1.0 admin del,amysql.com) 删除绑定amysql.com反代网站。</li>
</ul>
</div>
</div>
</div>
<?php include('footer.php'); ?>
<!-- 载入面板底部文件 -->