Skip to content

Commit

Permalink
Merge pull request #6026 from dotani1111/features/feat_maintenance_mo…
Browse files Browse the repository at this point in the history
…de_in_admin

feat:管理画面へメンテナンスモードを通知する
  • Loading branch information
ji-eunsoo authored Jan 24, 2024
2 parents 134f506 + 5d0424d commit a292087
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Eccube/EventListener/TwigInitializeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ public function setAdminGlobals(RequestEvent $event)
$eccubeNav = $this->getDisplayEccubeNav($eccubeNav, $AuthorityRoles, $baseUrl);
}
$this->twig->addGlobal('eccubeNav', $eccubeNav);
$this->twig->addGlobal('isMaintenance', $this->systemService->isMaintenanceMode());
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/Eccube/Resource/locale/messages.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ admin.common.move_to_confirm_move_only: Move
admin.common.move_to_confirm_save_and_move: Save & Move
admin.common.admin_url_warning: 'Please set the Admin Console URL that is hard to guess for security. You can set it at "<a href="%url%">Security</a>".'
admin.common.restrict_file_upload_info: 'If this feature is used infrequently, disabling it while not in use provides additional security. You can disable this feature by setting the environment variable ECCUBE_RESTRICT_FILE_UPLOAD to 1.'
admin.common.notice_maintenance_mode: 'Currently in maintenance mode.'


# Labels related to entity
Expand Down
1 change: 1 addition & 0 deletions src/Eccube/Resource/locale/messages.ja.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ admin.common.move_to_confirm_move_only: 保存せずに移動
admin.common.move_to_confirm_save_and_move: 保存して移動
admin.common.admin_url_warning: '管理画面URLは、セキュリティのため推測されにくいものを設定してください。「<a href="%url%">セキュリティ管理</a>」から設定できます。'
admin.common.restrict_file_upload_info: 'この機能の利用頻度が低い場合、使用しない間は無効化することでセキュリティを更に向上させることができます。環境変数 ECCUBE_RESTRICT_FILE_UPLOAD を 1 に設定することで機能を無効化することが可能です。'
admin.common.notice_maintenance_mode: '現在メンテナンスモード中です。'


# エンティティに関連するラベル
Expand Down
1 change: 1 addition & 0 deletions src/Eccube/Resource/template/admin/default_frame.twig
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ file that was distributed with this source code.
</div>

{{ include('@admin/alert.twig') }}
{{ include('@admin/info.twig') }}

{% block main %}{% endblock %}

Expand Down
8 changes: 8 additions & 0 deletions src/Eccube/Resource/template/admin/info.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if isMaintenance %}
<div class="alert alert-info alert-dismissible fade show m-3" role="alert">
<i class="fa fa-info-circle fa-fw" aria-hidden="true"></i>
<span class="fw-bold">{{ 'admin.common.notice_maintenance_mode'|trans }}</span>
<button class="btn-close" type="button" data-bs-dismiss="alert" aria-label="Close">
</button>
</div>
{% endif %}

0 comments on commit a292087

Please sign in to comment.