1678f00c1b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
113 lines
5.9 KiB
HTML
113 lines
5.9 KiB
HTML
{% extends "erp_base.html" %}
|
||
|
||
{% block head_extra %}
|
||
<link rel="stylesheet" href="/static/project.css?v=20261111b" />
|
||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||
{% endblock %}
|
||
|
||
{% block topbar_after_logout %}{% include "project/_help_btn.html" %}{% endblock %}
|
||
|
||
{% block content %}
|
||
{# PC 알림 프로그램(023) — 트레이 프로그램(desktop/notifier) 내려받기, 연결 승인(?code=), 연결된 PC 해제.
|
||
토큰은 프로그램이 받아 PC 에 암호화 저장(Windows DPAPI). 이 화면은 토큰 원문을 보지 않는다. #}
|
||
<div class="pj-wrap pj-inbox-view pj-notifier-view">
|
||
<div class="pj-layout">
|
||
{% with current_pid = 0, side_active = "inbox" %}{% include "project/_side.html" %}{% endwith %}
|
||
|
||
<section class="pj-main">
|
||
<div class="pj-section-head"><h2><a class="pj-notifier-back" href="/project/inbox">수신함</a> › PC 알림 프로그램</h2></div>
|
||
<div class="pj-view pj-inbox-pane pj-notifier-pane">
|
||
{% if not notifier_enabled %}
|
||
<div class="pj-empty">PC 알림 연결이 아직 준비되지 않았습니다(DB 마이그레이션 023 필요).</div>
|
||
{% else %}
|
||
|
||
{% if code %}
|
||
<div class="pj-notifier-card is-link" id="pj-notifier-link" data-code="{{ code }}">
|
||
{% if link and not link.approved_at %}
|
||
<h3>이 PC 를 내 알림에 연결할까요?</h3>
|
||
<p>PC 이름 <b>{{ link.device_name or '-' }}</b> · 연결 코드 <b class="pj-notifier-code">{{ link.code }}</b></p>
|
||
<p class="pj-notifier-note">알림 프로그램 창에 보이는 코드와 같을 때만 연결하세요. 연결하면 그 PC 에
|
||
<b>{{ user.name or user.email }}</b> 님의 태그·업무 배정 알림이 뜹니다.</p>
|
||
<button type="button" class="pj-btn pj-btn-primary" id="pj-notifier-approve">연결</button>
|
||
{% elif link %}
|
||
<h3>이미 연결을 승인했습니다</h3>
|
||
<p class="pj-notifier-note">알림 프로그램이 곧 연결을 마칩니다. 이 창은 닫아도 됩니다.</p>
|
||
{% else %}
|
||
<h3>연결 코드가 없거나 만료되었습니다</h3>
|
||
<p class="pj-notifier-note">연결 코드는 10분 동안만 쓸 수 있습니다. 알림 프로그램에서 [연결]을 다시 누르세요.</p>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
|
||
<div class="pj-notifier-card">
|
||
<h3>설치</h3>
|
||
<ol class="pj-notifier-steps">
|
||
<li>{% if download_ready %}<a class="pj-btn pj-btn-primary pj-btn-sm" href="/project/notifier/download">DBXNotifier.exe 내려받기</a>
|
||
{% else %}관리자에게 <b>DBXNotifier.exe</b> 파일을 받으세요.{% endif %}
|
||
설치 없이 파일 하나로 실행됩니다(Windows 10·11).</li>
|
||
<li>실행하면 화면 오른쪽 아래 트레이에 종 아이콘이 생기고 연결 창이 열립니다. [브라우저에서 연결]을 누르세요.</li>
|
||
<li>열린 이 화면에서 코드를 확인하고 [연결]을 누르면 끝입니다. 트레이 아이콘 메뉴에서 [Windows 시작 시 실행]을 켜 두세요.</li>
|
||
</ol>
|
||
<p class="pj-notifier-note">나를 태그하거나 업무가 배정되면 다른 프로그램을 쓰고 있어도 화면 아래 가운데에 큰 알림 창이 뜹니다.
|
||
[열기]를 누르면 브라우저에서 그 업무가 열립니다.</p>
|
||
</div>
|
||
|
||
<div class="pj-notifier-card">
|
||
<h3>연결된 PC</h3>
|
||
{% if devices %}
|
||
<table class="pj-table pj-notifier-table">
|
||
<thead><tr><th>PC 이름</th><th>연결한 때</th><th>마지막 확인</th><th></th></tr></thead>
|
||
<tbody>
|
||
{% for d in devices %}
|
||
<tr>
|
||
<td>{{ d.device_name or '-' }}</td>
|
||
<td>{{ (d.created_at or '')[:16] | replace('T', ' ') }}</td>
|
||
<td>{{ (d.last_seen_at or '-')[:16] | replace('T', ' ') }}</td>
|
||
<td class="pj-trash-act"><button type="button" class="pj-btn pj-btn-sm pj-notifier-revoke"
|
||
data-id="{{ d.id }}" data-name="{{ d.device_name }}">연결 해제</button></td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
{% else %}
|
||
<p class="pj-notifier-note">연결된 PC 가 없습니다.</p>
|
||
{% endif %}
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</div>
|
||
|
||
{% include "project/_side_modals.html" %}
|
||
{% include "project/_member_tasks_modal.html" %}
|
||
|
||
<script>
|
||
(function () {
|
||
async function post(url, body) {
|
||
const res = await fetch(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body || {}) });
|
||
const data = await res.json().catch(function () { return {}; });
|
||
if (!res.ok) throw new Error(data.detail || ("HTTP " + res.status));
|
||
return data;
|
||
}
|
||
const approve = document.getElementById("pj-notifier-approve");
|
||
if (approve) approve.addEventListener("click", async function () {
|
||
approve.disabled = true;
|
||
try {
|
||
await post("/project/api/notifier/link/approve", { code: document.getElementById("pj-notifier-link").dataset.code });
|
||
location.replace("/project/notifier?code=" + encodeURIComponent(document.getElementById("pj-notifier-link").dataset.code));
|
||
} catch (e) { approve.disabled = false; alert("연결 실패: " + e.message); }
|
||
});
|
||
document.querySelectorAll(".pj-notifier-revoke").forEach(function (b) {
|
||
b.addEventListener("click", async function () {
|
||
if (!confirm((b.dataset.name || "이 PC") + " 의 알림 연결을 해제할까요?")) return;
|
||
b.disabled = true;
|
||
try { await post("/project/api/notifier/devices/" + b.dataset.id + "/revoke"); location.reload(); }
|
||
catch (e) { b.disabled = false; alert("해제 실패: " + e.message); }
|
||
});
|
||
});
|
||
})();
|
||
</script>
|
||
<script src="/static/project.js?v=20261111a" defer></script>
|
||
{% endblock %}
|