Commit e8a72c8c authored by ibuler's avatar ibuler

[Update] 修改一些翻译

parent 73a99de5
......@@ -1310,7 +1310,7 @@ msgstr "ID"
#: ops/templates/ops/adhoc_detail.html:94 ops/templates/ops/task_list.html:40
msgid "Run times"
msgstr "执行时间"
msgstr "执行次数"
#: ops/templates/ops/adhoc_detail.html:98 ops/templates/ops/task_detail.html:72
msgid "Last run"
......
......@@ -3,11 +3,6 @@
{% load static %}
{% block content_left_head %}
<link href="{% static 'css/plugins/datepicker/datepicker3.css' %}" rel="stylesheet">
<style>
#search_btn {
margin-bottom: 0;
}
</style>
{% endblock %}
......@@ -72,7 +67,6 @@
{% endif %}
</td>
<td class="text-center">
<a href="{% url 'ops:task-run' pk=object.id %}" class="btn btn-xs btn-info">{% trans "Run" %}</a>
<a data-uid="{{ object.id }}" class="btn btn-xs btn-danger btn-del">{% trans "Delete" %}</a>
</td>
</tr>
......
......@@ -15,7 +15,6 @@ urlpatterns = [
url(r'^task/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.TaskDetailView.as_view(), name='task-detail'),
url(r'^task/(?P<pk>[0-9a-zA-Z\-]{36})/adhoc/$', views.TaskAdhocView.as_view(), name='task-adhoc'),
url(r'^task/(?P<pk>[0-9a-zA-Z\-]{36})/history/$', views.TaskHistoryView.as_view(), name='task-history'),
url(r'^task/(?P<pk>[0-9a-zA-Z\-]{36})/run/$', views.TaskRunView.as_view(), name='task-run'),
url(r'^adhoc/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.AdHocDetailView.as_view(), name='adhoc-detail'),
url(r'^adhoc/(?P<pk>[0-9a-zA-Z\-]{36})/history/$', views.AdHocHistoryView.as_view(), name='adhoc-history'),
url(r'^adhoc/history/(?P<pk>[0-9a-zA-Z\-]{36})/$', views.AdHocHistoryDetailView.as_view(), name='adhoc-history-detail'),
......
# ~*~ coding: utf-8 ~*~
from __future__ import unicode_literals
import time
from datetime import datetime
from django.utils.translation import ugettext as _
from django.conf import settings
from django.views.generic import ListView, DetailView, View
from django.utils import timezone
from django.shortcuts import redirect, reverse
from django.views.generic import ListView, DetailView
from common.mixins import DatetimeSearchMixin
from .models import Task, AdHoc, AdHocRunHistory
from ops.tasks import rerun_task
class TaskListView(DatetimeSearchMixin, ListView):
......@@ -87,16 +81,6 @@ class TaskHistoryView(DetailView):
return super().get_context_data(**kwargs)
class TaskRunView(View):
pk_url_kwarg = 'pk'
def get(self, request, *args, **kwargs):
pk = kwargs.get(self.pk_url_kwarg)
rerun_task.delay(pk)
time.sleep(0.5)
return redirect(reverse('ops:task-detail', kwargs={'pk': pk}))
class AdHocDetailView(DetailView):
model = AdHoc
template_name = 'ops/adhoc_detail.html'
......
# -*- coding: utf-8 -*-
#
import threading
import time
from celery import shared_task
from django.core.cache import cache
from django.db.utils import ProgrammingError, OperationalError
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment