/**
  * Creates a new DcmdTaskServicePool model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate($task_id)
 {
     $task = DcmdTask::findOne($task_id);
     if (Yii::$app->request->post()) {
         $model = new DcmdTaskServicePool();
     } else {
         return $this->render('create', ['task' => $task, 'svr_pool' => $svr_pool]);
     }
     /*if ($model->load(Yii::$app->request->post()) && $model->save()) {
       } else {
           return $this->render('create', [
               'model' => NULL,
               'task' => $task,
           ]);
       }*/
 }
 /**
  * Finds the DcmdTask model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return DcmdTask the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = DcmdTask::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #3
0
 public function getTaskFreeze($task_id)
 {
     $query = DcmdTask::findOne($task_id);
     if ($query->freeze == 1) {
         return true;
     }
     return false;
 }
 public function actionAgentSubtaskOut($task_id, $task_cmd, $subtask_id, $ip)
 {
     $task = DcmdTask::findOne($task_id);
     $task_name = $task->task_name;
     return $this->render('sub_task_output', ['task_id' => $task_id, 'task_cmd' => $task_cmd, 'task_name' => $task_name, 'subtask_id' => $subtask_id, 'ip' => $ip]);
 }