servermgrv2 init...

This commit is contained in:
최준흠 2023-07-26 09:33:29 +09:00
parent c5599374bd
commit aa22c0e1f5
6 changed files with 25 additions and 6 deletions

View File

@ -93,6 +93,21 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob', 'BoardController::batchjob'); $routes->post('batchjob', 'BoardController::batchjob');
$routes->get('download/(:num)', 'BoardController::download/$1'); $routes->get('download/(:num)', 'BoardController::download/$1');
}); });
$routes->group('hpilo', static function ($routes) {
$routes->get('', 'HPILOController::index');
$routes->get('excel', 'HPILOController::excel');
$routes->get('insert', 'HPILOController::insert_form');
$routes->post('insert', 'HPILOController::insert');
$routes->get('update/(:num)', 'HPILOController::update_form/$1');
$routes->post('update/(:num)', 'HPILOController::update/$1');
$routes->get('view/(:num)', 'HPILOController::view/$1');
$routes->get('delete/(:num)', 'HPILOController::delete/$1', ['filter' => 'authFilter:master']);
$routes->get('toggle/(:num)/(:hash)', 'HPILOController::toggle/$1/$2');
$routes->post('batchjob', 'HPILOController::batchjob');
$routes->get('console/(:num)', 'HPILOController::console/$1');
$routes->get('reset/(:num)/(:alpha)', 'HPILOController::reset/$1/$2');
$routes->get('reload/(:num)', 'HPILOController::reload/$1');
});
}); });
/* /*
* -------------------------------------------------------------------- * --------------------------------------------------------------------

View File

@ -10,19 +10,21 @@ class HPILOEntity extends BaseEntity
protected $dates = ['created_at', 'updated_at', 'deleted_at']; protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $casts = []; protected $casts = [];
//기본기능
public function getPrimaryKey() public function getPrimaryKey()
{ {
return $this->attributes['uid']; return $this->attributes['uid'];
} }
public function getTitle() public function getTitle()
{ {
return "{$this->attributes['customer']} {$this->attributes['model']}"; return $this->attributes['title'];
} }
public function __toString() public function getStatus()
{ {
return "uid:{$this->attributes['uid']}|{$this->attributes['customer']}|{$this->attributes['model']}"; return $this->attributes['status'];
} }
//추가기능
public function getIP() public function getIP()
{ {
return $this->attributes['ip']; return $this->attributes['ip'];

View File

@ -100,7 +100,7 @@ function getFieldIndex_Row_HPILOHelper($field, $entity, array $fieldFilters, $fi
case 'memory': case 'memory':
return $value . "GB"; return $value . "GB";
break; break;
case 'name': case 'customer':
return anchor(current_url() . '/view/' . $entity->getPrimaryKey(), $value, [...$attributes, "target" => "_self"]); return anchor(current_url() . '/view/' . $entity->getPrimaryKey(), $value, [...$attributes, "target" => "_self"]);
break; break;
case 'upload_file': case 'upload_file':

View File

@ -12,8 +12,8 @@ return [
'model' => "Model", 'model' => "Model",
'processor' => "CPU*갯수", 'processor' => "CPU*갯수",
'memory' => "Memory", 'memory' => "Memory",
'health' => "부품상태", 'health' => "부품",
'power' => "전원상태", 'power' => "전원",
'detail' => "상세내용", 'detail' => "상세내용",
'status' => "상태", 'status' => "상태",
'updated_at' => "수정일", 'updated_at' => "수정일",

View File

@ -7,6 +7,7 @@ use App\Entities\HPILOEntity;
class HPILOModel extends BaseModel class HPILOModel extends BaseModel
{ {
protected $table = "tw_hpilo"; protected $table = "tw_hpilo";
protected $returnType = HPILOEntity::class;
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();

View File

@ -5,6 +5,7 @@
<div id="menu_button">메뉴열기</div> <div id="menu_button">메뉴열기</div>
<div class="accordion"> <div class="accordion">
<?= $this->include($layout['path'] . '/left_menu/base'); ?> <?= $this->include($layout['path'] . '/left_menu/base'); ?>
<?= $this->include($layout['path'] . '/left_menu/hpilo'); ?>
<?= $this->include($layout['path'] . '/left_menu/board'); ?> <?= $this->include($layout['path'] . '/left_menu/board'); ?>
</div> </div>
</div> </div>