-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added combo2 for Acctount, DbService, Service
Db Deep coding
- Loading branch information
1 parent
bbcab8d
commit 94dd965
Showing
5 changed files
with
151 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace hipanel\modules\hosting\assets\combo2; | ||
|
||
use hipanel\widgets\Combo2Config; | ||
use yii\helpers\ArrayHelper; | ||
|
||
/** | ||
* Class Account | ||
*/ | ||
class Account extends Combo2Config | ||
{ | ||
/** @inheritdoc */ | ||
public $type = 'account'; | ||
|
||
/** @inheritdoc */ | ||
public $_primaryFilter = 'login_like'; | ||
|
||
/** @inheritdoc */ | ||
public $url = '/hosting/account/search'; | ||
|
||
public $_return = ['id', 'client', 'client_id', 'device', 'device_id']; | ||
|
||
public $_rename = ['text' => 'login']; | ||
|
||
public $_filter = [ | ||
'client' => 'client', | ||
'server' => 'server' | ||
]; | ||
|
||
/** @inheritdoc */ | ||
function getConfig ($config = []) { | ||
$config = ArrayHelper::merge([ | ||
'clearWhen' => ['client', 'server'], | ||
'affects' => [ | ||
'client' => 'client', | ||
'server' => 'device' | ||
] | ||
], $config); | ||
|
||
return parent::getConfig($config); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace hipanel\modules\hosting\assets\combo2; | ||
|
||
/** | ||
* Class DbService | ||
*/ | ||
class DbService extends Service { | ||
/** @inheritdoc */ | ||
public $type = 'dbService'; | ||
|
||
/** @inheritdoc */ | ||
public $softType = 'db'; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace hipanel\modules\hosting\assets\combo2; | ||
use hipanel\widgets\Combo2Config; | ||
use yii\helpers\ArrayHelper; | ||
|
||
|
||
/** | ||
* Class Service | ||
*/ | ||
class Service extends Combo2Config | ||
{ | ||
/** @inheritdoc */ | ||
public $type = 'service'; | ||
|
||
/** @inheritdoc */ | ||
public $_primaryFilter = 'name_like'; | ||
|
||
/** @inheritdoc */ | ||
public $url = '/hosting/service/search'; | ||
|
||
/** @inheritdoc */ | ||
public $_return = ['id', 'client', 'client_id', 'device', 'device_id', 'seller', 'seller_id']; | ||
|
||
/** @inheritdoc */ | ||
public $_rename = ['text' => 'name']; | ||
|
||
/** @inheritdoc */ | ||
public $_filter = [ | ||
'client' => 'client', | ||
'server' => 'server' | ||
]; | ||
|
||
public $softType; | ||
|
||
/** @inheritdoc */ | ||
function getConfig ($config = []) { | ||
$config = ArrayHelper::merge([ | ||
'affects' => [ | ||
'seller' => 'seller', | ||
'client' => 'client', | ||
'server' => 'device' | ||
], | ||
'activeWhen' => [ | ||
'server' | ||
] | ||
], $config); | ||
|
||
return parent::getConfig($config); | ||
} | ||
|
||
/** @inheritdoc */ | ||
public function getFilter () { | ||
return ArrayHelper::merge(parent::getFilter(), [ | ||
'soft_type' => ['format' => $this->softType] | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters