서버 운영자 페이지 수정

This commit is contained in:
2018-03-19 00:31:04 +09:00
parent 1c4709ea65
commit efa6cc2889
9 changed files with 167 additions and 112 deletions
+13
View File
@@ -181,3 +181,16 @@ function Entrance_Logout() {
)
});
}
$(function(){
ImportView("body", "../i_popup/Frame.php");
//ImportView("body", FRAME);
Popup_Import();
Popup_Init();
Popup_Update();
Entrance_Import();
Entrance_Init();
Entrance_Update();
});
+21
View File
@@ -1,7 +1,28 @@
var serverAdminTemplate = '\
<tr data-server_name="<%name%>\
<th><%korName%>(<%name%>)</th>\
<td><%status%></td>\
<td><input type="button" value="폐쇄" onclick="Entrance_AdminPost(0);"></td>\
<td><input type="button" value="오픈" onclick="Entrance_AdminPost(2);"></td>\
<td><input type="button" value="리셋" onclick="Entrance_AdminPost(1);"></td>\
<td><input type="button" class="Entrance_ServerAdminListSelectButton2" value="N로그인" onclick="Entrance_AdminNPCLogin();"></td>\
<td><input type="button" value="N생성" onclick="Entrance_AdminNPCCreate();"></td>\
<td><input type="button" value="폐쇄중로그인" onclick="Entrance_AdminClosedLogin();"></td>\
</tr>\
';
$(function(){
Entrance_AdminImport();
Entrance_AdminInit();
Entrance_AdminUpdate();
});
function Entrance_AdminImport() {
}
function Entrance_AdminInit() {
console.log('adminInit');
$("#Entrance_000201").click(Entrance_Donation);
$("#Entrance_000202").click(Entrance_Member);
$("#Entrance_000204").click(Entrance_AdminChangeNotice);
-83
View File
@@ -1,83 +0,0 @@
<?php
// 외부 파라미터
require_once('_common.php');
?>
<script type="text/javascript">
ImportStyle("<?=ROOT;?>"+W+I+ENTRANCE+W+ADMIN+STYLE);
ImportAction("<?=ROOT;?>"+W+I+ENTRANCE+W+ADMIN+ACTION);
Entrance_AdminImport();
Entrance_AdminInit();
Entrance_AdminUpdate();
</script>
<div id="Entrance_0002" class="bg0">
<div id="Entrance_000200" class="bg2">회 원 관 리</div>
<input id="Entrance_000202" type="button" value="회 원 관 리">
<input id="Entrance_000203" type="text" value="<?=$system['NOTICE'];?>">
<input id="Entrance_000204" type="button" value="공 지 변 경">
</div>
<div id="Entrance_0003" class="bg0">
<div id="Entrance_000300" class="bg2">서 버 관 리</div>
<div id="Entrance_000301">
<div id="Entrance_00030000" class="bg1">서버(접속)</div>
<div id="Entrance_00030001" class="bg1">상 태</div>
<div id="Entrance_00030002" class="bg1">선 택</div>
</div>
<div id="Entrance_000302">
<?php
$i = 0;
foreach($severList as $server) {
$settingObj = $server[2];
$serverPath = $settingObj->getBasePath();
$serverDir = $settingObj->getShortName();
//TODO: .htaccess가 서버 오픈에도 사용될 수 있으니 별도의 방법이 필요함
if(!is_dir($serverPath)){
$state = '상태이상, 01';
}
else if(!file_exists($serverPath.'/index.php')){
$state = '상태이상, 02';
}
else if(file_exists($serverPath.'/.htaccess')) {
// 폐쇄중
if($settingObj->isExist()) {
// 폐쇄중, 설정있음
$state = '폐쇄중, 설정있음';
} else {
// 폐쇄중, 설정없음
$state = '폐쇄중, 설정없음';
}
} else{
// 오픈중
if($settingObj->isExist()) {
// 서비스중
$state = '서비스중';
} else {
// 오픈중, 설정없음
$state = '오픈중, 설정없음';
}
}
?>
<div class="Entrance_ServerAdminList">
<div class="Entrance_ServerAdminListServer"><?=$serverDir;?></div>
<div class="Entrance_ServerAdminListState"><?=$state;?></div>
<div class="Entrance_ServerAdminListSelect">
<input type="button" class="Entrance_ServerAdminListSelectButton1" value="폐쇄" onclick="Entrance_AdminPost(<?=$i;?>, 0);">
<input type="button" class="Entrance_ServerAdminListSelectButton1" value="리셋" onclick="Entrance_AdminPost(<?=$i;?>, 1);">
<input type="button" class="Entrance_ServerAdminListSelectButton1" value="오픈" onclick="Entrance_AdminPost(<?=$i;?>, 2);">
<input type="button" class="Entrance_ServerAdminListSelectButton2" value="N로그인" onclick="Entrance_AdminNPCLogin('../<?=$serverDir;?>');">
<input type="button" class="Entrance_ServerAdminListSelectButton2" value="N생성" onclick="Entrance_AdminNPCCreate('../<?=$serverDir;?>');">
<input type="button" class="Entrance_ServerAdminListSelectButton3" value="폐쇄중로그인" onclick="Entrance_AdminClosedLogin('../<?=$serverDir;?>');">
<input type="button" class="Entrance_ServerAdminListSelectButton2" value="119" onclick="Entrance_AdminOpen119('../<?=$serverDir;?>');">
</div>
</div>
<?php
}
?>
</div>
</div>
+5 -9
View File
@@ -1,8 +1,12 @@
@charset "utf-8";
#server_admin_table{
width:100%;
}
#Entrance_0002 {
width: 800px; height: 170px;
position: absolute; top: 304px; left: 0px;
/*position: absolute; top: 304px; left: 0px;*/
}
#Entrance_000200 {
@@ -34,44 +38,36 @@
#Entrance_0003 {
width: 800px; height: 176px;
position: absolute; top: 494px; left: 0px;
}
#Entrance_000300 {
width: 798px; height: 50px;
position: absolute; top: 0px; left: 0px;
font-size: 30px; font-weight: bold;
}
#Entrance_000301 {
width: 798px; height: 20px;
position: absolute; top: 52px; left: 0px;
border: none;
}
#Entrance_00030000 {
width: 98px; height: 20px;
position: absolute; top: 0px; left: 0px;
}
#Entrance_00030001 {
width: 198px; height: 20px;
position: absolute; top: 0px; left: 100px;
}
#Entrance_00030002 {
width: 498px; height: 20px;
position: absolute; top: 0px; left: 300px;
}
#Entrance_00030003 {
width: 118px; height: 20px;
position: absolute; top: 0px; left: 680px;
}
#Entrance_000302 {
width: 798px;
position: absolute; top: 74px; left: 0px;
border: none;
}
+20 -20
View File
@@ -3,10 +3,12 @@ require_once('_common.php');
require_once(ROOT.'/f_config/DB.php');
require_once(ROOT.'/f_config/SESSION.php');
$templates = new League\Plates\Engine('templates');
$db = getRootDB();
$system = $db->queryFirstRow('SELECT `NOTICE` FROM `SYSTEM` WHERE `NO`=1');
$member = $db->queryFirstRow('SELECT ID, GRADE FROM `MEMBER` WHERE `NO` = %i', $SESSION->NoMember());
$userGrade = $member['GRADE'];
?>
<!DOCTYPE html>
<html>
@@ -22,6 +24,8 @@ $member = $db->queryFirstRow('SELECT ID, GRADE FROM `MEMBER` WHERE `NO` = %i', $
<link type="text/css" rel="stylesheet" href='../i_popup/Style.css'>
<link type="text/css" rel="stylesheet" href='../i_entrance/Style.css'>
<!-- 액션 -->
<script type="text/javascript" src='../js/common.js'></script>
<script type="text/javascript" src='../e_lib/jquery-3.2.1.min.js'></script>
@@ -31,36 +35,32 @@ $member = $db->queryFirstRow('SELECT ID, GRADE FROM `MEMBER` WHERE `NO` = %i', $
<script type="text/javascript" src='../i_popup/Action.js'></script>
<script type="text/javascript" src='../i_entrance/Action.js'></script>
<script type="text/javascript">
$(document).ready(Entrance);
function Entrance() {
ImportView("body", "../i_popup/Frame.php");
//ImportView("body", FRAME);
<?php if($userGrade >= 6): ?>
<!-- 운영자 -->
<link type="text/css" rel="stylesheet" href='adminStyle.css'>
<script type="text/javascript" src='adminAction.js'></script>
<?php endif;?>
Popup_Import();
Popup_Init();
Popup_Update();
Entrance_Import();
Entrance_Init();
Entrance_Update();
}
</script>
</head>
<body>
<?php include(MANAGE.W.FRAME); ?>
<?php
if($member['GRADE'] >= 6) {
include(MEMBER.W.FRAME);
include('member/Frame.php');
}
?>
<div id="server_list_container">
<?php
if($userGrade >= 6){
echo $templates->render('global_panel',['notice'=>$system['NOTICE']]);
}
?>
<div id="server_notice"><span style="color:orange;font-size:2em;"><?=$system['NOTICE'];?></span></div>
<?php /*XXX:div라지만 누가봐도 표면 그냥 table인게 낫지 않겠음?*/ ?>
<table id="server_list_table">
<caption class="bg2 section_title with_border">서 버 선 택</caption>
<colgroup>
@@ -105,10 +105,10 @@ if($member['GRADE'] >= 6) {
</div>
</div>
<?php
if($member['GRADE'] >= 6) {
include(ADMIN.INC);
if($userGrade >= 6){
echo $templates->render('server_panel',[]);
//include('adminInc.php');
}
?>
+58
View File
@@ -0,0 +1,58 @@
<?php
// 외부 파라미터
require_once('_common.php');
require_once(ROOT.'/f_config/DB.php');
require_once(ROOT.'/f_config/SESSION.php');
$result = [];
foreach (getServerConfigList() as $server) {
list($serverKorName, $serverColor, $setting) = $server;
$serverPath = $setting->getBasePath();
$serverDir = $setting->getShortName();
//TODO: .htaccess가 서버 오픈에도 사용될 수 있으니 별도의 방법이 필요함
if (!is_dir($serverPath)) {
$state = [
'valid'=>false,
'run'=>false,
'reason'=>'디렉토리 없음'
];
} elseif (!file_exists($serverPath.'/index.php')) {
$state = [
'valid'=>false,
'run'=>false,
'reason'=>'index.php 없음'
];
} elseif (!$setting->isExists()) {
$state = [
'valid'=>false,
'run'=>false,
'reason'=>'설정 파일 없음'
];
} elseif (file_exists($serverPath.'/.htaccess')) {
// 폐쇄중
$state = [
'valid'=>true,
'run'=>false,
'reason'=>'폐쇄됨'
];
} else {
// 오픈중
$state = [
'valid'=>true,
'run'=>true,
'reason'=>'운영중'
];
}
$state = array_merge($state, [
'name' => $serverDir,
'korName' => $serverKorName,
'color' => $serverColor
]);
$result[] = $state;
}
returnJson($result);
+11
View File
@@ -0,0 +1,11 @@
<?php
if(!defined('ROOT')){
define('ROOT', '../..');
}
require_once(ROOT.'/f_config/config.php');
require_once(ROOT.'/f_config/app.php');
require_once(ROOT.'/f_func/func.php');
CustomHeader();
+6
View File
@@ -0,0 +1,6 @@
<div id="Entrance_0002" class="bg0">
<div id="Entrance_000200" class="bg2"> </div>
<input id="Entrance_000202" type="button" value="회 원 관 리">
<input id="Entrance_000203" type="text" value="<?=$notice?>">
<input id="Entrance_000204" type="button" value="공 지 변 경">
</div>
+33
View File
@@ -0,0 +1,33 @@
<table id="server_admin_table">
<caption class="bg2 section_title with_border"> </caption>
<colgroup>
<col style="width:80px;">
<col>
<col style="width:50px;"><!--폐쇄-->
<col style="width:50px;"><!--오픈-->
<col style="width:50px;"><!--리셋-->
<col style="width:50px;"><!--하드리셋-->
<col style="width:50px;"><!--폐쇄중 로그인-->
<col style="width:50px;"><!--119-->
</colgroup>
<thead>
<th class="bg1">서버</th>
<th class="bg1">상태</th>
<th class="bg1" colspan="6">명령 선택</th>
</thead>
<tbody id="sever_admin_list">
</tbody>
</table>
<!--
<div id="Entrance_0003" class="bg0">
<div id="Entrance_000300" class="bg2"> </div>
<div id="Entrance_000301">
<div id="Entrance_00030000" class="bg1">서버(접속)</div>
<div id="Entrance_00030001" class="bg1"> </div>
<div id="Entrance_00030002" class="bg1"> </div>
</div>
<div id="Entrance_000302">
</div>
</div>
-->