<!DOCTYPE html>
<html lang="en" data-prefix="{{ prefix }}">
  <head>
    <meta charset="utf-8" />
    <meta name="robots" content="noindex, nofollow" />
    <meta name="googlebot" content="noindex, nofollow" />
    <meta name="baiduspider" content="noindex, nofollow" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, shrink-to-fit=no"
    />
    <title>Embykeeper | 配置编辑</title>
    <meta
      name="description"
      content="Embykeeper: 中文社群规则下用于 Emby 影视服务器签到和保号的自动执行工具"
    />
    <link
      rel="icon"
      type="image/svg+xml"
      sizes="160x160"
      href="{{ prefix }}/assets/img/illustrations/logo-only.svg"
    />
    <link rel="stylesheet" href="{{ prefix }}/assets/bootstrap/css/bootstrap.min.css" />
    <link
      rel="stylesheet"
      href="https://fonts.googleapis.com/css?family=Raleway:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800&amp;display=swap"
    />
    <link rel="stylesheet" href="{{ prefix }}/assets/css/icons.css" />
    <link rel="stylesheet" href="{{ prefix }}/assets/css/styles.css" />
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5.65.16/lib/codemirror.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5.65.16/addon/scroll/simplescrollbars.css">
    <style>
      .CodeMirror {
        font-family: var(--bs-font-monospace);
        font-size: 16px;
        width: 100%;
        height: 100%;
      }
      .CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div {
        width: 7px;
        border-radius: 10px;
        background: rgba(0,0,0,0.2);
      }
      .CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical {
        width: 7px;
        border-radius: 10px;
        background: rgba(0,0,0,0.1);
      }
      .CodeMirror-overlayscroll-horizontal div :hover, .CodeMirror-overlayscroll-vertical div :hover {
        background: rgba(0,0,0,0.2);
      }
      .CodeMirror-overlayscroll-horizontal :hover, .CodeMirror-overlayscroll-vertical :hover{
        background: rgba(0,0,0,0.45);
      }
    </style>
  </head>

  <body>
    <nav
      class="navbar navbar-light navbar-expand-md fixed-top navbar-shrink py-3"
      id="mainNav"
    >
      <div class="container">
        <a class="navbar-brand d-flex align-items-center" href="{{ prefix }}/">
          <span>
            Embykeeper
            <sup>{{ version }}</sup>
          </span>
        </a>
        <button
          data-bs-toggle="collapse"
          class="navbar-toggler"
          data-bs-target="#navcol-1"
        >
          <span class="visually-hidden">Toggle navigation</span>
          <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navcol-1">
          <ul class="navbar-nav mx-auto"></ul>
          <a class="btn btn-primary shadow" role="button" href="{{ prefix }}/console">
            控制台
          </a>
        </div>
      </div>
    </nav>
    <section class="py-5 mt-5">
      <div class="container">
        <div class="d-flex gap-1">
          <div
            class="d-inline-flex reccircle bg-light my-2 px-3 align-items-center"
          >
            <div
              id="status-icon"
              class="small-dot"
              style="border-radius: 50%"
            ></div>
            <div class="text-center">
              <p class="my-0 ms-2">
                配置文件编辑器
              </p>
            </div>
          </div>
          <div
            class="d-none reccircle bg-light my-2 px-3 align-middle"
            id="status-msg-badge"
          >
            <span id="status-msg"></span>
          </div>
        </div>
        <div class="row">
          <div class="col">
            <div class="card p-4" style="border-radius:5px;height:65vh">
              <div id="toml-box" class=" h-100 w-100"></div>
            </div>
          </div>
        </div>
        <div class="d-flex justify-content-between mt-2">
          <button id="save-btn" class="btn btn-primary shadow btn-minor">保存</button>
          <button id="example-btn" class="btn btn-primary shadow btn-minor">示例</button>
        </div>
      </div>
      <div class="modal" tabindex="-1" id="saveModal">
        <div class="modal-dialog modal-lg modal-dialog-centered">
          <div class="modal-content">
            <div class="modal-header">
              <h5 class="modal-title mx-3">保存成功</h5>
              <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
              <p class="mx-3">若您设置了 Telegram 账号, 请回到<a href="{{ prefix }}/console">控制台</a>并点击右上方的重启按钮以登陆各账号.</p>
              <hr>
              <p class="mx-3">否则, 请将下方内容写入托管平台的 <span class="text-info cursor-pointer" id="env-name">EK_CONFIG</span> 环境变量, 否则配置将在重启后丢失.</p>
              <div id="modal-data-box" class="mx-3 my-3 p-3 cursor-pointer">
                <code class="text-dark" id="modal-data"></code>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
    <footer class="text-center py-4">
      <div class="container">
        <div class="row row-cols-1 row-cols-lg-3">
          <div class="col">
            <p class="text-muted my-2">Copyright&nbsp;© 2023 Embykeeper</p>
          </div>
          <div class="col">
            <ul class="list-inline my-2">
              <li class="list-inline-item me-4">
                <a
                  href="https://github.com/emby-keeper/emby-keeper"
                  target="_blank"
                  rel="noopener noreferrer"
                >
                  <div class="bs-icon-circle bs-icon-primary bs-icon">
                    <svg
                      xmlns="http://www.w3.org/2000/svg"
                      width="1em"
                      height="1em"
                      fill="currentColor"
                      viewBox="0 0 16 16"
                      class="bi bi-github"
                    >
                      <path
                        d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"
                      ></path>
                    </svg>
                  </div>
                </a>
              </li>
              <li class="list-inline-item me-4">
                <a
                  href="https://t.me/embykeeper_bot"
                  target="_blank"
                  rel="noopener noreferrer"
                >
                  <div class="bs-icon-circle bs-icon-primary bs-icon">
                    <svg
                      xmlns="http://www.w3.org/2000/svg"
                      width="1em"
                      height="1em"
                      fill="currentColor"
                      viewBox="0 0 16 16"
                      class="bi bi-telegram"
                    >
                      <path
                        d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.287 5.906c-.778.324-2.334.994-4.666 2.01-.378.15-.577.298-.595.442-.03.243.275.339.69.47l.175.055c.408.133.958.288 1.243.294.26.006.549-.1.868-.32 2.179-1.471 3.304-2.214 3.374-2.23.05-.012.12-.026.166.016.047.041.042.12.037.141-.03.129-1.227 1.241-1.846 1.817-.193.18-.33.307-.358.336a8.154 8.154 0 0 1-.188.186c-.38.366-.664.64.015 1.088.327.216.589.393.85.571.284.194.568.387.936.629.093.06.183.125.27.187.331.236.63.448.997.414.214-.02.435-.22.547-.82.265-1.417.786-4.486.906-5.751a1.426 1.426 0 0 0-.013-.315.337.337 0 0 0-.114-.217.526.526 0 0 0-.31-.093c-.3.005-.763.166-2.984 1.09z"
                      ></path>
                    </svg>
                  </div>
                </a>
              </li>
              <li class="list-inline-item">
                <a
                  href="https://afdian.com/a/jackzzs"
                  target="_blank"
                  rel="noopener noreferrer"
                >
                  <div class="bs-icon-circle bs-icon-primary bs-icon">
                    <svg
                      xmlns="http://www.w3.org/2000/svg"
                      width="1em"
                      height="1em"
                      fill="currentColor"
                      viewBox="0 0 16 16"
                      class="bi bi-heart-fill"
                    >
                      <path
                        fill-rule="evenodd"
                        d="M8 1.314C12.438-3.248 23.534 4.735 8 15-7.534 4.736 3.562-3.248 8 1.314z"
                      ></path>
                    </svg>
                  </div>
                </a>
              </li>
            </ul>
          </div>
          <div class="col">
            <ul class="list-inline my-2">
              <li class="list-inline-item">
                <a
                  class="link-primary"
                  href="https://github.com/emby-keeper/emby-keeper/wiki"
                >
                  帮助文件
                </a>
              </li>
              <li class="list-inline-item">
                <a
                  class="link-primary"
                  href="https://github.com/emby-keeper/emby-keeper#%E5%A3%B0%E6%98%8E"
                >
                  使用条款
                </a>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </footer>
    <script src="assets/bootstrap/js/bootstrap.min.js"></script>
    <script src="assets/js/script.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/codemirror@5.65.16/lib/codemirror.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/codemirror@5.65.16/addon/scroll/simplescrollbars.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/codemirror@5.65.16/mode/toml/toml.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/axios@1.7.2/dist/axios.min.js"></script>
    <script src="assets/js/config.js"></script>
  </body>
</html>
