<!doctype html>
<html
  xmlns:th="https://www.thymeleaf.org"
  th:replace="~{modules/layout :: html(content = ~{::content}, showAside = true, pageTitle = null, head = ~{::head})}"
>
  <th:block th:fragment="content">
    <div class="error-page proper-height">
      <th:block th:switch="${error.status}">
        <span th:case="404" class="error-icon icon-[solar--ghost-smile-bold-duotone]"></span>
        <span th:case="403" class="error-icon icon-[solar--lock-keyhole-bold-duotone]"></span>
        <span th:case="401" class="error-icon icon-[solar--user-block-bold-duotone]"></span>
        <span th:case="500" class="error-icon icon-[solar--server-bold-duotone]"></span>
        <span th:case="502" class="error-icon icon-[solar--cloud-cross-bold-duotone]"></span>
        <span th:case="503" class="error-icon icon-[solar--sleeping-circle-bold-duotone]"></span>
        <span th:case="*" class="error-icon icon-[solar--siren-rounded-bold-duotone]"></span>
      </th:block>

      <div class="error-title">
        [<span th:text="${error.status}">500</span>]
        <span th:text="${#strings.defaultString(error.title, '出错了')}">Internal Server Error</span>
      </div>

      <div class="error-hint">
        <th:block th:switch="${error.status}">
          <span th:case="404">页面走丢了，可能已被移除或链接有误</span>
          <span th:case="403">抱歉，您没有权限访问此页面</span>
          <span th:case="401">请先登录后再访问此页面</span>
          <span th:case="400">请求参数有误，请检查后重试</span>
          <span th:case="500">服务器开小差了，请稍后重试</span>
          <span th:case="502">网关连接失败，请稍后重试</span>
          <span th:case="503">服务暂时不可用，正在维护中</span>
          <span th:case="504">请求超时，请检查网络后重试</span>
          <span th:case="*">发生了一些意外情况</span>
        </th:block>
      </div>

      <div th:if="${error.detail != null or error.instance != null}" class="error-codeblock">
        <div class="codeblock-header">
          <span class="codeblock-filename" th:text="${error.type ?: 'error'}">error</span>
        </div>
        <pre
          class="codeblock-content"
        ><code th:if="${error.detail}" th:text="${error.detail}"></code><code th:if="${error.instance}" th:text="${error.instance}"></code></pre>
      </div>

      <div class="error-actions">
        <a href="/" class="error-btn">
          <span class="icon-[ph--house-bold]"></span>
          <span>返回主页</span>
        </a>
        <button onclick="history.back()" class="error-btn error-btn-secondary">
          <span class="icon-[ph--arrow-left-bold]"></span>
          <span>返回上页</span>
        </button>
      </div>
    </div>
  </th:block>
</html>
