From 86c5f0d3d33f39935cddc616d7d9c972f205e0ec Mon Sep 17 00:00:00 2001 From: yumaojun03 <719118794@qq.com> Date: Mon, 19 Dec 2016 00:24:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90cron=E5=92=8Csudo=E7=9A=84lis?= =?UTF-8?q?t=E5=92=8Cdetail=E5=9F=BA=E7=A1=80=EF=BC=8Cansible=20Task?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9B=B4=E4=B8=8A=E5=B1=82=E6=8A=BD=E8=B1=A1?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/models/ansible.py | 16 +- apps/ops/templates/cron/detail.html | 141 ++------------ apps/ops/templates/cron/list.html | 9 +- apps/ops/templates/sudo/detail.html | 141 ++------------ apps/ops/templates/sudo/list.html | 7 +- apps/ops/templates/task/_task.html | 97 ++++++++++ apps/ops/templates/task/create.html | 16 ++ apps/ops/templates/task/detail.html | 282 ++++++++++++++++++++++++++++ apps/ops/templates/task/list.html | 226 ++++++++++++++++++++++ apps/ops/templates/task/update.html | 20 ++ 10 files changed, 689 insertions(+), 266 deletions(-) create mode 100644 apps/ops/templates/task/_task.html create mode 100644 apps/ops/templates/task/create.html create mode 100644 apps/ops/templates/task/detail.html create mode 100644 apps/ops/templates/task/list.html create mode 100644 apps/ops/templates/task/update.html diff --git a/apps/ops/models/ansible.py b/apps/ops/models/ansible.py index 3ebb5d18b..7ebf59476 100644 --- a/apps/ops/models/ansible.py +++ b/apps/ops/models/ansible.py @@ -4,10 +4,12 @@ from __future__ import unicode_literals, absolute_import import logging import json +from assets.models import Asset + from django.db import models from django.utils.translation import ugettext_lazy as _ -__all__ = ["Tasker", "AnsiblePlay", "AnsibleTask", "AnsibleHostResult"] +__all__ = ["Task", "Tasker", "AnsiblePlay", "AnsibleTask", "AnsibleHostResult"] logger = logging.getLogger(__name__) @@ -290,11 +292,9 @@ class AnsibleHostResult(models.Model): print('Error: %s, continue...' % e.message) continue +class Task(models.Model): + name = models.CharField(max_length=128, blank=True, verbose_name=_('Name')) + asset = models.ForeignKey(Asset, null=True, blank=True, related_name='crontables') - - - - - - - + def __unicode__(self): + pass \ No newline at end of file diff --git a/apps/ops/templates/cron/detail.html b/apps/ops/templates/cron/detail.html index b87e17a39..8089f917b 100644 --- a/apps/ops/templates/cron/detail.html +++ b/apps/ops/templates/cron/detail.html @@ -18,20 +18,20 @@