diff --git a/apps/assets/templates/assets/asset_list.html b/apps/assets/templates/assets/asset_list.html index 553014de2..1c3015523 100644 --- a/apps/assets/templates/assets/asset_list.html +++ b/apps/assets/templates/assets/asset_list.html @@ -319,32 +319,36 @@ function beforeDrag() { return true } -function beforeDrop() { - return true +function beforeDrop(treeId, treeNodes, targetNode, moveType) { + var treeNodesNames = []; + $.each(treeNodes, function (index, value) { + treeNodesNames.push(value.value); + }); + + var msg = "你想移动节点: `" + treeNodesNames.join(",") + "` 到 `" + targetNode.value + "` 下吗?"; + if (confirm(msg)){ + return true + } else { + return false + } } function onDrag(event, treeId, treeNodes) { } function onDrop(event, treeId, treeNodes, targetNode, moveType) { - var treeNodesNames = []; var treeNodesIds = []; $.each(treeNodes, function (index, value) { - treeNodesNames.push(value.value); treeNodesIds.push(value.id); }); - var msg = "你想移动节点: `" + treeNodesNames.join(",") + "` 到 `" + targetNode.value + "` 下吗?"; var the_url = "{% url 'api-assets:node-add-children' pk=DEFAULT_PK %}".replace("{{ DEFAULT_PK }}", targetNode.id); var body = {nodes: treeNodesIds}; - if (confirm(msg)){ - APIUpdateAttr({ - url: the_url, - method: "PUT", - body: JSON.stringify(body) - }) - } - + APIUpdateAttr({ + url: the_url, + method: "PUT", + body: JSON.stringify(body) + }) } function initTree() { diff --git a/apps/assets/views/asset.py b/apps/assets/views/asset.py index e1a9fcb2d..466bf7f4c 100644 --- a/apps/assets/views/asset.py +++ b/apps/assets/views/asset.py @@ -58,8 +58,7 @@ class UserAssetListView(LoginRequiredMixin, TemplateView): def get_context_data(self, **kwargs): context = { - 'app': _('Assets'), - 'action': _('Asset list'), + 'action': _('My assets'), 'system_users': SystemUser.objects.all(), } kwargs.update(context) diff --git a/apps/i18n/zh/LC_MESSAGES/django.po b/apps/i18n/zh/LC_MESSAGES/django.po index 792cb9195..84d9c2ba1 100644 --- a/apps/i18n/zh/LC_MESSAGES/django.po +++ b/apps/i18n/zh/LC_MESSAGES/django.po @@ -84,7 +84,7 @@ msgstr "资产" #: assets/forms/user.py:24 msgid "Password or private key passphrase" -msgstr "密码或秘钥密码" +msgstr "密码或密钥密码" #: assets/forms/user.py:25 assets/models/user.py:30 common/forms.py:113 #: users/forms.py:16 users/forms.py:24 users/templates/users/login.html:56 @@ -683,7 +683,7 @@ msgstr "认证" #: assets/templates/assets/_system_user.html:47 msgid "Auto generate key" -msgstr "自动生成秘钥" +msgstr "自动生成密钥" #: assets/templates/assets/_system_user.html:64 #: assets/templates/assets/asset_create.html:58 @@ -1192,7 +1192,7 @@ msgstr "密码认证" #: common/forms.py:156 msgid "Public key auth" -msgstr "秘钥认证" +msgstr "密钥认证" #: common/forms.py:159 common/templates/common/terminal_setting.html:63 #: terminal/forms.py:30 terminal/models.py:20 @@ -1731,7 +1731,7 @@ msgid "" " " msgstr "" "\n" -" 您的ssh秘钥没有设置或已失效,请点击 链接 更新\n" " " @@ -2329,7 +2329,7 @@ msgstr "将失效用户当前密码,并发送重设密码邮件到用户邮箱 msgid "" "The reset-ssh-public-key E-mail has been sent successfully. Please inform " "the user to update his new ssh public key." -msgstr "重设秘钥邮件将会发送到用户邮箱" +msgstr "重设密钥邮件将会发送到用户邮箱" #: users/templates/users/user_detail.html:350 #: users/templates/users/user_profile.html:140 @@ -2338,7 +2338,7 @@ msgstr "重置SSH密钥" #: users/templates/users/user_detail.html:360 msgid "This will reset the user public key and send a reset mail" -msgstr "将会失效用户当前秘钥,并发送重置邮件到用户邮箱" +msgstr "将会失效用户当前密钥,并发送重置邮件到用户邮箱" #: users/templates/users/user_detail.html:377 #: users/templates/users/user_profile.html:166 @@ -2561,7 +2561,7 @@ msgstr "禁用或失效" #: users/utils.py:154 msgid "Password or SSH public key invalid" -msgstr "密码或秘钥不合法" +msgstr "密码或密钥不合法" #: users/views/group.py:29 msgid "User group list" @@ -2642,7 +2642,7 @@ msgstr "密码更新" #: users/views/user.py:375 msgid "Public key update" -msgstr "秘钥更新" +msgstr "密钥更新" #~ msgid "Help" #~ msgstr "帮助" diff --git a/apps/jumpserver/urls.py b/apps/jumpserver/urls.py index 2eb54d87d..986f9b0cb 100644 --- a/apps/jumpserver/urls.py +++ b/apps/jumpserver/urls.py @@ -4,16 +4,16 @@ from __future__ import unicode_literals from django.conf.urls import url, include from django.conf import settings from django.conf.urls.static import static -from django.views.static import serve as static_serve from rest_framework.schemas import get_schema_view from rest_framework_swagger.renderers import SwaggerUIRenderer, OpenAPIRenderer -from .views import IndexView +from .views import IndexView, LunaView schema_view = get_schema_view(title='Users API', renderer_classes=[OpenAPIRenderer, SwaggerUIRenderer]) urlpatterns = [ url(r'^$', IndexView.as_view(), name='index'), + url(r'^luna/$', LunaView.as_view(), name='luna-error'), url(r'^users/', include('users.urls.views_urls', namespace='users')), url(r'^assets/', include('assets.urls.views_urls', namespace='assets')), url(r'^perms/', include('perms.urls.views_urls', namespace='perms')), diff --git a/apps/jumpserver/views.py b/apps/jumpserver/views.py index d37a3ff26..67fb725c5 100644 --- a/apps/jumpserver/views.py +++ b/apps/jumpserver/views.py @@ -1,4 +1,5 @@ -from django.views.generic import TemplateView +from django.http import HttpResponse +from django.views.generic import TemplateView, View from django.utils import timezone from django.db.models import Count from django.contrib.auth.mixins import LoginRequiredMixin @@ -150,3 +151,12 @@ class IndexView(LoginRequiredMixin, TemplateView): kwargs.update(context) return super(IndexView, self).get_context_data(**kwargs) + + +class LunaView(View): + def get(self, request): + msg = """ + Luna是单独部署的一个程序,你需要部署luna,coco,配置nginx做url分发, + 如果你看到了这个页面,证明你访问的不是nginx监听的端口,祝你好运 + """ + return HttpResponse(msg) \ No newline at end of file diff --git a/apps/static/css/style.css b/apps/static/css/style.css index c02935fb5..1bfc8ed34 100644 --- a/apps/static/css/style.css +++ b/apps/static/css/style.css @@ -3299,7 +3299,7 @@ body.tour-open .animated { border-bottom: 1px solid #e7eaec; } body { - font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + font-family: "open sans", "Helvetica Neue", "微软雅黑", Helvetica, Arial, sans-serif; background-color: #2f4050; font-size: 13px; color: #676a6c; diff --git a/apps/templates/_header_bar.html b/apps/templates/_header_bar.html index 712f2eece..64ef5dec6 100644 --- a/apps/templates/_header_bar.html +++ b/apps/templates/_header_bar.html @@ -62,11 +62,11 @@