diff --git a/luci/graph.js b/luci/graph.js index 8c01062..8afd77e 100644 --- a/luci/graph.js +++ b/luci/graph.js @@ -1102,17 +1102,32 @@ } var hadFocus = pick.input && document.activeElement == pick.input; info.style.display = 'block'; - while (info.firstChild) - info.removeChild(info.firstChild); - info.appendChild(el('button', { 'class': 'mkg-x', title: 'закрыть', onclick: function() { select(null); } }, [ '✕' ])); - info.appendChild(el('h4', { text: kind + ': ' + n.label })); - info.appendChild(el('table', {}, rows)); + var kids = [ + el('button', { 'class': 'mkg-x', title: 'закрыть', onclick: function() { select(null); } }, [ '✕' ]), + el('h4', { text: kind + ': ' + n.label }), + el('table', {}, rows) + ]; if (act && act.saveServices && n.kind == 'group' && svcOf[n.label]) - info.appendChild(editor(svcOf[n.label])); + kids.push(editor(svcOf[n.label])); if (act && act.saveServices && n.kind == 'group' && poolOf[n.label]) - info.appendChild(poolEditor(poolOf[n.label])); - if (act && n.kind == 'group' && L && showLive.checked && L.groups[n.id]) { - info.appendChild(chooser(n)); + kids.push(poolEditor(poolOf[n.label])); + var picking = act && n.kind == 'group' && L && showLive.checked && L.groups[n.id]; + if (picking) + kids.push(chooser(n)); + // the editors stay in place: taken out of the page, an open select closes and a field + // loses focus on every poll; the rest goes around them + Array.prototype.slice.call(info.childNodes).forEach(function(c) { + if (kids.indexOf(c) < 0) + info.removeChild(c); + }); + var at = info.firstChild; + kids.forEach(function(c) { + if (c.parentNode == info) + at = c.nextSibling; + else + info.insertBefore(c, at); + }); + if (picking) { pick.list.scrollTop = pick.scroll; if (hadFocus && pick.input) { pick.input.focus(); diff --git a/router/mihomo-kit.sh b/router/mihomo-kit.sh index 95a6188..3177f10 100755 --- a/router/mihomo-kit.sh +++ b/router/mihomo-kit.sh @@ -2013,7 +2013,7 @@ write_config() { [ -n "${SERVICES:-}" ] && echo "SERVICES=$(q "$SERVICES")" for _s in ${SERVICES:-}; do _k=$(svc_key "$_s") - for v in GEOSITE DOMAINS IPS VIA CHAIN; do + for v in GEOSITE DOMAINS IPS VIA CHAIN SERVER PROVIDER; do eval "_v=\${${_k}_$v:-}" [ -n "$_v" ] && echo "${_k}_$v=$(q "$_v")" done