<commit_before><?php
/**
 * Server module for HiPanel.
 *
 * @link      https://github.com/hiqdev/hipanel-module-server
 * @package   hipanel-module-server
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
 */

namespace hipanel\modules\server\menus;

use hipanel\widgets\SimpleOperation;
use hipanel\widgets\BlockModalButton;
use Yii;

class ServerDetailMenu extends \hipanel\menus\AbstractDetailMenu
{
    public $model;

    public $blockReasons;

    public function items()
    {
        $actions = ServerActionsMenu::create([
            'model' => $this->model,
        ])->items();

        $user = Yii::$app->user;

        $items = array_merge($actions, [
            [
                'label' => Yii::t('hipanel:server', 'Resources'),
                'icon' => 'fa-area-chart',
                'url' => ['resources', 'id' => $this->model->id],
                'linkOptions' => [
                    'data-pjax' => 0,
                ],
            ],
            [
                'label' => Yii::t('hipanel:server', 'Renew server'),
                'icon' => 'fa-forward',
                'url' => ['add-to-cart-renewal', 'model_id' => $this->model->id],
                'linkOptions' => [
                    'data-pjax' => 0,
                ],
                'visible' => !empty($this->expires)
            ],
            [
                'label' => SimpleOperation::widget([
                    'model' => $this->model,
                    'scenario' => 'reset-password',
                    'buttonLabel' => '<i class="fa fa-refresh"></i>' . Yii::t('hipanel:server', 'Reset root password'),
                    'buttonClass' => '',
                    'body' => Yii::t('hipanel:server', 'Are you sure you want to reset the root password on {name} server? You will get your new root password on the e-mail.'),
                    'modalHeaderLabel' => Yii::t('hipanel:server', 'Confirm root password resetting'),
                    'modalHeaderOptions' => ['class' => 'label-danger'],
                    'modalFooterLabel' => Yii::t('hipanel:server', 'Reset root password'),
                    'modalFooterLoading' => Yii::t('hipanel:server', 'Resetting...'),
                    'modalFooterClass' => 'btn btn-danger',
                ]),
                'visible' => $this->model->isPwChangeSupported(),
                'encode' => false,<commit_msg>fix renew button<commit_after><?php
/**
 * Server module for HiPanel.
 *
 * @link      https://github.com/hiqdev/hipanel-module-server
 * @package   hipanel-module-server
 * @license   BSD-3-Clause
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
 */

namespace hipanel\modules\server\menus;

use hipanel\widgets\SimpleOperation;
use hipanel\widgets\BlockModalButton;
use Yii;

class ServerDetailMenu extends \hipanel\menus\AbstractDetailMenu
{
    public $model;

    public $blockReasons;

    public function items()
    {
        $actions = ServerActionsMenu::create([
            'model' => $this->model,
        ])->items();

        $user = Yii::$app->user;

        $items = array_merge($actions, [
            [
                'label' => Yii::t('hipanel:server', 'Resources'),
                'icon' => 'fa-area-chart',
                'url' => ['resources', 'id' => $this->model->id],
                'linkOptions' => [
                    'data-pjax' => 0,
                ],
            ],
            [
                'label' => Yii::t('hipanel:server', 'Renew server'),
                'icon' => 'fa-forward',
                'url' => ['add-to-cart-renewal', 'model_id' => $this->model->id],
                'linkOptions' => [
                    'data-pjax' => 0,
                ],
                'visible' => !empty($this->model->expires)
            ],
            [
                'label' => SimpleOperation::widget([
                    'model' => $this->model,
                    'scenario' => 'reset-password',
                    'buttonLabel' => '<i class="fa fa-refresh"></i>' . Yii::t('hipanel:server', 'Reset root password'),
                    'buttonClass' => '',
                    'body' => Yii::t('hipanel:server', 'Are you sure you want to reset the root password on {name} server? You will get your new root password on the e-mail.'),
                    'modalHeaderLabel' => Yii::t('hipanel:server', 'Confirm root password resetting'),
                    'modalHeaderOptions' => ['class' => 'label-danger'],
                    'modalFooterLabel' => Yii::t('hipanel:server', 'Reset root password'),
                    'modalFooterLoading' => Yii::t('hipanel:server', 'Resetting...'),
                    'modalFooterClass' => 'btn btn-danger',
                ]),
                'visible' => $this->model->isPwChangeSupported(),
                'encode' => false,
{'fraction_non_alphanumeric': 0.16556564822460776, 'fraction_numerical': 0.004541701073492981, 'mean_word_length': 1.774914089347079, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 86, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5807199', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1366, 'n_words': 273}