中控手机端使用独立底栏与卡片总览,电脑端布局保持不变。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -37,9 +37,44 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
<section class="hub-phone-desk hub-phone-chrome">
|
||||
<p class="hub-phone-desk-hint muted">点开后进入该客户端(手机页),不经过中控工作台嵌页。</p>
|
||||
<ul class="hub-phone-desk-list">
|
||||
{% for inst in instances %}
|
||||
<li>
|
||||
<button type="button" class="btn hub-phone-desk-open" data-open-id="{{ inst.id }}">{{ inst.name }}</button>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="muted">无启用实例</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script>
|
||||
(function () {
|
||||
var phone = document.documentElement.classList.contains("hub-phone-html");
|
||||
if (!phone) return;
|
||||
var blank = document.getElementById("desk-open-blank");
|
||||
if (blank && blank.getAttribute("href")) {
|
||||
window.location.replace(blank.getAttribute("href"));
|
||||
return;
|
||||
}
|
||||
document.querySelectorAll(".hub-phone-desk-open[data-open-id]").forEach(function (btn) {
|
||||
btn.addEventListener("click", function () {
|
||||
var id = btn.getAttribute("data-open-id");
|
||||
if (!id) return;
|
||||
fetch("/api/instances/" + encodeURIComponent(id) + "/open_url")
|
||||
.then(function (r) { return r.json(); })
|
||||
.then(function (d) {
|
||||
if (d && d.url) window.location.href = d.url;
|
||||
})
|
||||
.catch(function () {});
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<script>
|
||||
(function () {
|
||||
var KEY = "hub_desk_side_collapsed";
|
||||
var root = document.getElementById("desk-root");
|
||||
|
||||
Reference in New Issue
Block a user