-
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.
Showing
11 changed files
with
475 additions
and
57 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
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
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
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,22 @@ | ||
<?php | ||
|
||
namespace hipanel\modules\hosting\validators; | ||
use yii\validators\RegularExpressionValidator; | ||
|
||
/** | ||
* Class LoginValidator is used to validate logins of clients | ||
*/ | ||
class DbNameValidator extends RegularExpressionValidator | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public $pattern = '/^[a-z0-9_-]{2,31}$/'; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function init () { | ||
$this->message = \Yii::t('app', '{attribute} should contain only letters, digits, underscores or hyphens and be at least 2 symbols length'); | ||
} | ||
} |
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 | ||
|
||
/* @var $this View */ | ||
/* @var $model frontend\modules\hosting\models\Db */ | ||
/* @var $type string */ | ||
|
||
use hipanel\base\View; | ||
use hipanel\widgets\Combo2; | ||
use hipanel\widgets\PasswordInput; | ||
use yii\helpers\Html; | ||
use yii\bootstrap\ActiveForm; | ||
use yii\helpers\Url; | ||
|
||
?> | ||
<div class="row"> | ||
<div class="col-md-4"> | ||
<div class="box box-danger"> | ||
<div class="box-body"> | ||
<div class="ticket-form" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html"> | ||
<?php $form = ActiveForm::begin([ | ||
'action' => $model->isNewRecord ? Url::to('create') : Url::toRoute([ | ||
'update', | ||
'id' => $model->id | ||
]), | ||
]); | ||
?> | ||
<!-- Properties --> | ||
|
||
<?php | ||
print $form->field($model, 'client')->widget(Combo2::className(), ['type' => 'client']); | ||
print $form->field($model, 'server')->widget(Combo2::className(), ['type' => 'server']); | ||
print $form->field($model, 'account')->widget(Combo2::className(), ['type' => 'account']); | ||
print $form->field($model, 'service_id')->widget(Combo2::className(), ['type' => 'dbService', ]); | ||
|
||
print $form->field($model, 'name'); | ||
print $form->field($model, 'password')->widget(PasswordInput::className()); | ||
|
||
print $form->field($model, 'description'); | ||
?> | ||
|
||
<div class="form-group"> | ||
<?= Html::submitButton(Yii::t('app', 'Create'), ['class' => 'btn btn-primary']) ?> | ||
</div> | ||
|
||
<?php ActiveForm::end(); ?> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<!-- ticket-_form --> | ||
</div> | ||
</div> | ||
|
||
<?php | ||
|
||
$this->registerJs(" | ||
$('#account-sshftp_ips').popover({placement: 'top', trigger: 'focus'}); | ||
"); |
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,13 @@ | ||
<?php | ||
/* @var $this yii\web\View */ | ||
/* @var $model frontend\modules\ticket\models\Thread */ | ||
/* @var $type string */ | ||
|
||
$this->title = $title[$type]; | ||
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Databases'), 'url' => ['index']]; | ||
$this->params['breadcrumbs'][] = $this->title; | ||
?> | ||
|
||
<div class="account-create"> | ||
<?= $this->render('_form', compact('model')) ?> | ||
</div> |
Oops, something went wrong.