Esempio n. 1
0
?>
            <div class="span1" style="padding-top: 60px">
                <button class="btn move-up">&uarr;</button><br/><br/>
                <button class="btn move-down">&darr;</button>
            </div>
        </div>        
    </div>
    <!-- case fields end -->
</div>

<div id="env-fields">
    <div class="row-fluid">
        <?php 
echo CHtml::activeLabel($job, 'machine_id', array('class' => 'span2'));
echo '<div class="span10" id="machine-selector">';
$this->widget('application.extensions.combobox.InputComboBox', array('model' => $job, 'attribute' => 'machine_id', 'data' => Machine::model()->getMachineOptions(), 'options' => array('onSelect' => '', 'onChange' => '', 'allowText' => false, 'showStyle' => true), 'htmlOptions' => array('class' => 'focus span12', 'style' => 'margin-left: 0', 'placeholder' => Yii::t('Job', 'Machine Tip'))));
echo '</div>';
?>
    </div>
    <div class="row-fluid">
        <?php 
echo CHtml::activeLabel($job, 'sudoer', array('class' => 'span2'));
echo CHtml::activeTextField($job, 'sudoer', array('class' => 'focus span4'));
echo CHtml::activeLabel($job, 'timeout', array('class' => 'span2'));
echo CHtml::activeTextField($job, 'timeout', array('class' => 'focus span3'));
echo CHtml::tag('label', array('class' => 'span1'), Yii::t('Run', 'Minutes'));
?>
    </div>
    <div class="row-fluid">
        <?php 
echo CHtml::activeLabel($job, 'crucial', array('class' => 'span2'));
Esempio n. 2
0
        <?php 
$actives = array(false, false, false);
if (preg_match('#^\\S*\\@machine\\%20product\\_id\\:\\(\\)$#', Yii::app()->request->requestUri)) {
    $actives[1] = true;
} else {
    if (preg_match('#^\\S*\\@machine\\%20responsible_username\\:\\(\\=\\=\\%7B' . Yii::app()->user->username . '\\%7D\\)$#', Yii::app()->request->requestUri)) {
        $actives[2] = true;
    } else {
        $actives[0] = true;
    }
}
$this->widget('zii.widgets.CMenu', array('id' => 'sub-menu', 'items' => array(array('label' => Yii::t('Machine', 'Assigned'), 'url' => array('/machine'), 'active' => $actives[0]), array('label' => Yii::t('Machine', 'Unassigned'), 'url' => array('/machine/index/q/@machine product_id:()'), 'active' => $actives[1]), array('label' => Yii::t('TOAST', 'Responsible By Me'), 'url' => array('/machine/index/q/@machine responsible_username:(=={' . Yii::app()->user->username . '})'), 'active' => $actives[2]))));
?>
        <div class="search">
            <?php 
$this->Widget('application.extensions.querybuilder.QueryBuilderWidget', array('name' => 'search', 'options' => array('action' => Yii::app()->getBaseUrl(true) . '/#table#/index', 'cTable' => 'machine', 'queryListUrl' => Yii::app()->getBaseUrl(true) . '/query/getlist', 'createQueryUrl' => Yii::app()->getBaseUrl(true) . '/query/create', 'updateQueryUrl' => Yii::app()->getBaseUrl(true) . '/query/update', 'deleteQueryUrl' => Yii::app()->getBaseUrl(true) . '/query/delete', 'tables' => array('machine' => array('label' => '测试机', 'items' => array('id' => array('label' => 'ID', 'type' => 'text', 'operators' => array('==' => '等于', '-=' => '不等于', '>=' => '大于等于', '>' => '大于', '<' => '小于', '<=' => '小于等于', '=' => '包含', '!=' => '不包含')), 'name' => array('label' => '主机域名', 'type' => 'text', 'operators' => array('' => '含有', '-' => '不含有')), 'type' => array('label' => '类型', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Machine::model()->getTypeOptions()), 'product_id' => array('label' => '所属产品', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Product::getAllProductsList()), 'project_name' => array('label' => '所属项目', 'type' => 'text', 'operators' => array('' => '含有', '-' => '不含有')), 'agent_version' => array('label' => 'Agent版本', 'type' => 'text', 'operators' => array('' => '含有', '-' => '不含有')), 'responsible_username' => array('label' => '负责人', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Yii::app()->user->getUsernameOpts()), 'status' => array('label' => '状态', 'type' => 'select', 'operators' => array('==' => '等于', '-=' => '不等于'), 'data' => Machine::model()->getStatusOptions()), 'update_time' => array('label' => '最后更新时间', 'type' => 'text', 'operators' => array('' => '等于', '-' => '不等于', '>=' => '大于等于', '>' => '大于', '<' => '小于', '<=' => '小于等于'))))))));
?>
        </div>
    </div>    
    <div class="main-list">
        <div class="link-bar">
            <span class="machine-new icon-link"><?php 
echo CHtml::link(Yii::t("TOAST", "Add"), 'javascript:void(0);', array('id' => 'add-machine'));
?>
</span>
        </div>
        <?php 
$this->widget('GridView', array('id' => 'vMachines', 'dataProvider' => $vMachineProvider, 'htmlOptions' => array('class' => 'widget-view'), 'enablePageSize' => true, 'selectionChanged' => 'js:function(id){
                        var selectedID = $.fn.yiiGridView.getSelection(id);
                        if(selectedID.toString().match(/\\d+/))
                            location.href = getRootPath() + "/machine/view/id/" + selectedID;
Esempio n. 3
0
//                        result += "<br />" + data.ip;
//                    if(data.id && data.style)
//                        result = "<div class=\"" + data.style + "\">" + result + "</div>";
//                    return result;
//                }',
//                'formatSelection' => 'js:function(data){
//                    return (data.hostname || data.name);
//                }',
//                'initSelection' => 'js:function (element, callback) {
//                    var id = $("#VCommandRun_machine_id").val();
//                    var name = $("#VCommandRun_machine_name").val();
//                    callback({id: id, hostname: name});
//                }',
//            )
//        ));
$this->widget('application.extensions.combobox.InputComboBox', array('model' => $lastRunInfo, 'attribute' => 'machine_id', 'data' => Machine::model()->getMachineOptions(), 'options' => array('onSelect' => '', 'allowText' => false, 'showStyle' => true), 'htmlOptions' => array('class' => 'focus span9', 'placeholder' => Yii::t('Command', 'Machine Placeholder'))));
?>
    </div>
    <div class="row-fluid">
        <?php 
echo CHtml::activeLabel($lastRunInfo, 'sudoer', array('class' => 'span2'));
echo CHtml::activeTextField($lastRunInfo, 'sudoer', array('class' => 'focus span9'));
?>
    </div>
    <div class="row-fluid">
        <?php 
echo CHtml::activeLabel($lastRunInfo, 'timeout', array('class' => 'span2'));
echo CHtml::activeTextField($lastRunInfo, 'timeout', array('class' => 'focus span8'));
echo CHtml::tag('div', array('class' => 'span2'), Yii::t('Run', 'Minutes'));
?>
    </div>
Esempio n. 4
0
     case 'command_id':
         $oldCommand = Command::model()->findByPk($diffAttr->old);
         if ($oldCommand) {
             $diffAttr->old = $oldCommand->name;
         }
         $newCommand = Command::model()->findByPk($diffAttr->new);
         if ($newCommand) {
             $diffAttr->new = $newCommand->name;
         }
         break;
     case 'machine_id':
         $oldMachine = Machine::model()->findByPk($diffAttr->old);
         if ($oldMachine) {
             $diffAttr->old = $oldMachine->name;
         }
         $newMachine = Machine::model()->findByPk($diffAttr->new);
         if ($newMachine) {
             $diffAttr->new = $newMachine->name;
         }
         break;
     case 'crucial':
         $crucials = Job::model()->getCrucialOptions();
         $diffAttr->old = isset($crucials[$diffAttr->old]) ? $crucials[$diffAttr->old] : NULL;
         $diffAttr->new = isset($crucials[$diffAttr->new]) ? $crucials[$diffAttr->new] : NULL;
         break;
 }
 if ($diffAttr->old === NULL) {
     $diffAttr->old = '[NULL]';
 }
 if ($diffAttr->new === NULL) {
     $diffAttr->new = '[NULL]';