mirror of https://github.com/jumpserver/jumpserver
Merge branch 'docs' of https://github.com/jumpserver/jumpserver into docs
commit
8e09151a02
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 18 KiB |
@ -0,0 +1 @@
|
||||
<strong>Copyright</strong> 北京堆栈科技有限公司 © 2014-2018
|
@ -1,16 +1,16 @@
|
||||
{% load i18n %}
|
||||
<li id="assets">
|
||||
<a href="{% url 'assets:user-asset-list' %}">
|
||||
<i class="fa fa-files-o"></i><span class="nav-label">{% trans 'My assets' %}</span><span class="label label-info pull-right"></span>
|
||||
<i class="fa fa-files-o" style="width: 14px"></i><span class="nav-label">{% trans 'My assets' %}</span><span class="label label-info pull-right"></span>
|
||||
</a>
|
||||
</li>
|
||||
<li id="users">
|
||||
<a href="{% url 'users:user-profile' %}">
|
||||
<i class="fa fa-user" ></i> <span class="nav-label">{% trans 'Profile' %}</span><span class="label label-info pull-right"></span>
|
||||
<i class="fa fa-user" style="width: 14px"></i> <span class="nav-label">{% trans 'Profile' %}</span><span class="label label-info pull-right"></span>
|
||||
</a>
|
||||
</li>
|
||||
<li >
|
||||
<a href="{% url 'terminal:web-terminal' %}" target="_blank"><i class="fa fa-window-maximize"></i>
|
||||
<a href="{% url 'terminal:web-terminal' %}" target="_blank"><i class="fa fa-window-maximize" style="width: 14px"></i>
|
||||
<span class="nav-label">{% trans 'Web terminal' %}</span>
|
||||
</a>
|
||||
</li>
|
@ -1,20 +1,36 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
|
||||
import datetime
|
||||
|
||||
from celery import shared_task
|
||||
from django.utils import timezone
|
||||
|
||||
from common.celery import register_as_period_task, after_app_ready_start, \
|
||||
after_app_shutdown_clean
|
||||
from .models import Status, Session
|
||||
|
||||
|
||||
CACHE_REFRESH_INTERVAL = 10
|
||||
RUNNING = False
|
||||
|
||||
|
||||
# Todo: 定期清理上报history
|
||||
@shared_task
|
||||
def clean_terminal_history():
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
@register_as_period_task(interval=3600)
|
||||
@after_app_ready_start
|
||||
@after_app_shutdown_clean
|
||||
def delete_terminal_status_period():
|
||||
yesterday = timezone.now() - datetime.timedelta(days=3)
|
||||
Status.objects.filter(date_created__lt=yesterday).delete()
|
||||
|
||||
|
||||
@shared_task
|
||||
@register_as_period_task(interval=3600)
|
||||
@after_app_ready_start
|
||||
@after_app_shutdown_clean
|
||||
def clean_orphan_session():
|
||||
active_sessions = Session.objects.filter(is_finished=False)
|
||||
for session in active_sessions:
|
||||
if not session.terminal.is_active:
|
||||
session.is_finished = True
|
||||
session.save()
|
||||
|
@ -1,21 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
from django.dispatch import Signal
|
||||
|
||||
from django.dispatch import Signal, receiver
|
||||
from django.db.models.signals import post_save
|
||||
|
||||
from common.utils import get_logger
|
||||
from .models import User
|
||||
|
||||
logger = get_logger(__file__)
|
||||
|
||||
|
||||
@receiver(post_save, sender=User)
|
||||
def on_user_created(sender, instance=None, created=False, **kwargs):
|
||||
if created:
|
||||
logger.debug("Receive user `{}` create signal".format(instance.name))
|
||||
from .utils import send_user_created_mail
|
||||
logger.info(" - Sending welcome mail ...".format(instance.name))
|
||||
if instance.email:
|
||||
send_user_created_mail(instance)
|
||||
post_user_create = Signal(providing_args=('user',))
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
|
||||
from django.dispatch import receiver
|
||||
from django.db.models.signals import post_save
|
||||
|
||||
from common.utils import get_logger
|
||||
from .models import User
|
||||
|
||||
logger = get_logger(__file__)
|
||||
|
||||
|
||||
@receiver(post_save, sender=User)
|
||||
def on_user_created(sender, instance=None, created=False, **kwargs):
|
||||
if created:
|
||||
logger.debug("Receive user `{}` create signal".format(instance.name))
|
||||
from .utils import send_user_created_mail
|
||||
logger.info(" - Sending welcome mail ...".format(instance.name))
|
||||
if instance.email:
|
||||
send_user_created_mail(instance)
|
After Width: | Height: | Size: 29 KiB |
Loading…
Reference in new issue