예제 #1
0
def update_edit(request):
    ''' edit autotask'''
    if request.method == "POST":
        message = AutomationTaskService.dm_updateautotask(request)
        return HttpResponse(message)
    else:
        pass
    return render_to_response('autotask/autotaskformview_edit.html')
예제 #2
0
def create_add(request):
    ''' create new testtask'''
    if request.method == "POST":
        message = AutomationTaskService.dm_createautotask(request)
        return HttpResponse(message)
    else:
        pass
    return render_to_response('autotask/autotaskformview_test.html')
예제 #3
0
def get_list(request):
    ''' get all autotask list'''
    try:
        autotasklist = list()
        result = AutomationTaskService.vm_getalltasks(request)
        for item in result:
            vm_autotask = VM_AutomationTask(item)
            autotasklist.append(vm_autotask)
    except Exception as ex:
        print(ex)
    return render_to_response('autotask/autolistcontroll.html',
                              {'autotasklist': autotasklist})
예제 #4
0
def stop_task(request):
    autotaskid = int(request.POST["autotaskid"])
    AutomationTaskService.stop_task(autotaskid, request.META['REMOTE_HOST'],
                                    get_remoteip(request))
    return HttpResponse("ID 为: " + str(autotaskid) + "的任务,停止命令,已经发出。请耐心等待。")
예제 #5
0
def delete_autotask(request):
    return HttpResponse(AutomationTaskService.disable_autotask(request))
예제 #6
0
def copy_autotask(request):
    return HttpResponse(AutomationTaskService.copy_autotask(request))
예제 #7
0
def get_autotask_namelist(request):
    return HttpResponse(AutomationTaskService.get_autotask_namelist())
예제 #8
0
def get_autotask_page_counts(request):

    return HttpResponse(
        AutomationTaskService.get_autotask_page_counts(request))
예제 #9
0
def init_autotask_formcontrol(request):
    try:
        result = AutomationTaskService.init_autotask_form_control(request)
    except Exception as ex:
        print(ex)
    return HttpResponse(result)
예제 #10
0
def check_name_exits(request):
    result = AutomationTaskService.check_name_exits(request)
    return HttpResponse(result)
예제 #11
0
def get_mylist(request):
    ''' get all task list'''
    tasklist = AutomationTaskService.vm_getalltasks()
    return render_to_response("autotask/mytasklist.html")