{{ item.when }}
-{{ item.title }}
-{{ item.kind_label }} · {{ item.status_label }}
-{{ item.scope }}
-{{ item.summary }}
- {% if item.edit_hint %} -{{ item.edit_hint }}
- {% endif %} - - {% if item.state_labels or item.mission_labels %} -diff --git a/app/static/app.js b/app/static/app.js new file mode 100644 index 0000000..eedf6cd --- /dev/null +++ b/app/static/app.js @@ -0,0 +1,54 @@ +// ─── Sidebar ─── +function initSidebar() { + document.querySelectorAll('.ni[data-pg]').forEach(el => { + el.addEventListener('click', function(e) { + e.preventDefault(); + window.location.href = this.getAttribute('href'); + }); + }); + document.querySelectorAll('.nst').forEach(el => { + el.addEventListener('click', function() { this.classList.toggle('on'); }); + }); +} +initSidebar(); + +// ─── Global Time Control ─── +function openTimeModal() { + const display = document.getElementById('sim-time-display'); + if (!display) return; + const modal = document.getElementById('time-modal'); + const input = document.getElementById('time-input'); + if (modal && input) { + input.value = display.textContent.trim().replace(' ', 'T'); + modal.classList.add('open'); + } +} +function closeTimeModal() { + const modal = document.getElementById('time-modal'); + if (modal) modal.classList.remove('open'); +} +async function applyTime() { + const input = document.getElementById('time-input'); + if (!input || !input.value) return; + await setSimTimeAndReload(input.value.replace('T', ' ') + ':00'); +} +async function shiftTime(days) { + const display = document.getElementById('sim-time-display'); + if (!display) return; + const d = new Date(display.textContent.trim().replace(' ', 'T') + 'Z'); + d.setUTCDate(d.getUTCDate() + days); + await setSimTimeAndReload(d.toISOString().slice(0, 10) + ' 09:00'); +} +async function resetTime() { + await setSimTimeAndReload('2060-03-12 09:00'); +} +async function setSimTimeAndReload(timeStr) { + try { + await fetch('/api/v1/sim-time', { + method: 'POST', + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify({sim_time: timeStr}) + }); + } catch(e) {} + location.reload(); +} diff --git a/app/templates/asset_detail.html b/app/templates/asset_detail.html index 5e11d91..82ec843 100644 --- a/app/templates/asset_detail.html +++ b/app/templates/asset_detail.html @@ -1,231 +1,432 @@ {% extends "base.html" %} -{% from "_datetime_picker_field.html" import datetime_picker_field %} {% block content %} -{% include "_mission_ops_tabs.html" %} -{% include "_mission_preview_header.html" %} +
{{ asset.asset_type }} · {{ 'Retired' if asset.is_retired else 'Active' }}
+Asset Summary
-{{ asset.asset_type }} · {{ asset.program or 'No program assigned' }}
-未来事件
-这里汇总了未来的 Event Point、State Interval,以及当前区间里尚未发生的 State Node。
-{{ item.when }}
-{{ item.kind_label }} · {{ item.status_label }}
-{{ item.scope }}
-{{ item.summary }}
- {% if item.edit_hint %} -{{ item.edit_hint }}
- {% endif %} - - {% if item.state_labels or item.mission_labels %} -当前选定的 Simulation Time 之后还没有排定的事件。
-全部日志
-| Time | -Entry | -Labels | -Action | -
|---|---|---|---|
|
- {{ entry.timestamp }}
- {% if entry.end_timestamp %}
- → {{ entry.end_timestamp }}
- {% endif %}
- {{ entry.location }}
- |
-
- {{ entry.title }}
- {{ entry.mode_label }} · {{ entry.status_label }}
- {{ entry.summary }}
- |
-
- {% if entry.state_labels or entry.mission_labels %}
-
- {% for label in entry.state_labels %}{{ label }}{% endfor %}
- {% for label in entry.mission_labels %}{{ label }}{% endfor %}
-
- {% else %}
- -
- {% endif %}
- |
-
-
- 编辑条目
-
- |
-
调整起止时间,或者重置筛选后重试。
- {% else %} -先为这个资产新增一个 Event Point 或 State Interval。
- {% endif %} -操作
-资产日志
-{{ asset.asset_type }}{% if asset.program %} · {{ asset.program }}{% endif %}
+