From 0e59c118182a2e755a7964907ab4d3bb9becba9d Mon Sep 17 00:00:00 2001 From: icurfer Date: Sun, 15 Dec 2024 23:58:47 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EC=A0=84=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=ED=91=9C=EA=B8=B0=20=EA=B8=B0=EB=8A=A5=EC=B6=94=EA=B0=80,=20?= =?UTF-8?q?=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC,=20=EB=A7=81=ED=81=AC=20?= =?UTF-8?q?=EB=93=B1=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/ansible_manager/notice.html | 22 +++++++++++++++++ ansible_manager/urls.py | 1 + ansible_manager/views.py | 4 ++++ butler_ddochi/settings.py | 1 + butler_ddochi/version/context_processors.py | 12 ++++++++++ components/templates/components/_footer.html | 24 +++++++++++-------- components/templates/components/_sidebar.html | 5 ---- .../components/_sidebar_ansible.html | 14 +++++++---- version | 2 +- 9 files changed, 64 insertions(+), 21 deletions(-) create mode 100644 ansible_manager/templates/ansible_manager/notice.html create mode 100644 butler_ddochi/version/context_processors.py diff --git a/ansible_manager/templates/ansible_manager/notice.html b/ansible_manager/templates/ansible_manager/notice.html new file mode 100644 index 0000000..6dd7d64 --- /dev/null +++ b/ansible_manager/templates/ansible_manager/notice.html @@ -0,0 +1,22 @@ +{% extends 'components/base.html' %} +{% load static %} +{% block main_area %} +
+
+
+
+

+ 주의 사항

+

+

    +
  • 로그인을 반드시 해야 기능 메뉴가 나타납니다.
  • +
  • 로그인을 하지 않으면 views.py의 함수가 동작하지 않습니다.
  • +
  • 사설 IP대역을 사용해서 제어하려면 솔루션을 동일 네트워크에 직접 배포해야 합니다.
  • +
+

+
+
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/ansible_manager/urls.py b/ansible_manager/urls.py index 6149fbe..77a60f5 100644 --- a/ansible_manager/urls.py +++ b/ansible_manager/urls.py @@ -10,4 +10,5 @@ urlpatterns = [ path('jobs//', views.job_detail, name='job_detail'), path('jobs//run/', views.run_job, name='run_job'), path('jobs//delete/', views.delete_job, name='delete_job'), + path('notice/', views.notice), # 사용전 주의 사항 매뉴얼 ] \ No newline at end of file diff --git a/ansible_manager/views.py b/ansible_manager/views.py index dcdd90e..5f9d9b9 100644 --- a/ansible_manager/views.py +++ b/ansible_manager/views.py @@ -116,3 +116,7 @@ def delete_job(request, job_id): job = get_object_or_404(AnsibleJob, id=job_id, owner=request.user) job.delete() return redirect('ansible_manager:job_list') + + +def notice(request): + return render(request, "ansible_manager/notice.html", {}) diff --git a/butler_ddochi/settings.py b/butler_ddochi/settings.py index 90f5f1d..b089e70 100644 --- a/butler_ddochi/settings.py +++ b/butler_ddochi/settings.py @@ -77,6 +77,7 @@ TEMPLATES = [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + "butler_ddochi.version.context_processors.version_processor", # 추가 ], }, }, diff --git a/butler_ddochi/version/context_processors.py b/butler_ddochi/version/context_processors.py new file mode 100644 index 0000000..716eb8d --- /dev/null +++ b/butler_ddochi/version/context_processors.py @@ -0,0 +1,12 @@ +import os + +def version_processor(request): + version_file_path = os.path.join(os.path.dirname(__file__), "../../version") + + try: + with open(version_file_path, "r", encoding="utf-8") as file: + version = file.read().strip() + except FileNotFoundError: + version = "Version not found" + + return {"version": version} diff --git a/components/templates/components/_footer.html b/components/templates/components/_footer.html index 0696912..2d93475 100644 --- a/components/templates/components/_footer.html +++ b/components/templates/components/_footer.html @@ -4,15 +4,19 @@
-
@@ -32,11 +36,11 @@
Copyright © icurfer 2024 +
-
+ - {% if request.user.is_authenticated and request.user.is_staff %} - + \ No newline at end of file diff --git a/version b/version index a0f4b21..c1e0a49 100644 --- a/version +++ b/version @@ -1 +1 @@ -dev_0.0.18r4-build-test3 \ No newline at end of file +dev_0.0.19 \ No newline at end of file