beast-agent 0.23.5 → 0.23.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/renderer/renderer.js +15 -9
package/package.json
CHANGED
package/src/renderer/renderer.js
CHANGED
|
@@ -1962,11 +1962,11 @@ async function renderWaAllow() {
|
|
|
1962
1962
|
const list = await beast.waGetAllow();
|
|
1963
1963
|
let botChoices = [];
|
|
1964
1964
|
try { botChoices = (await beast.botsList()) || []; } catch {}
|
|
1965
|
-
const multiBot = botChoices.length >= 2;
|
|
1966
1965
|
const botSelHtml = (cur) =>
|
|
1967
1966
|
`<select class="perm-select" title="${_t('bot_bind_title')}">` +
|
|
1967
|
+
`<option value="">${_t('bot_sel_empty')}</option>` +
|
|
1968
1968
|
botChoices
|
|
1969
|
-
.map((bb) => `<option value="${bb.id}" ${
|
|
1969
|
+
.map((bb) => `<option value="${bb.id}" ${cur === bb.id ? 'selected' : ''}>${bb.icon} ${escapeHtml(bb.name)}</option>`)
|
|
1970
1970
|
.join('') +
|
|
1971
1971
|
`</select>`;
|
|
1972
1972
|
wrap.innerHTML = '';
|
|
@@ -1980,7 +1980,8 @@ async function renderWaAllow() {
|
|
|
1980
1980
|
const name = String((e && e.name) || '').trim();
|
|
1981
1981
|
const ownerTag = e && e.owner ? ' 👑' : '';
|
|
1982
1982
|
const bot = botChoices.find((bb) => bb.id === (e && e.bot_id));
|
|
1983
|
-
|
|
1983
|
+
/* bağlı olduğu bot her koşulda etikette görünsün */
|
|
1984
|
+
const botTag = bot && e && e.bot_id ? ' → ' + bot.name : '';
|
|
1984
1985
|
return (name ? name + ' ' : '') + (num ? '+' + num : '') + ownerTag + botTag;
|
|
1985
1986
|
};
|
|
1986
1987
|
const waNeedsName = (e) => e !== '*' && String((e && e.name) || '').trim() === '';
|
|
@@ -2076,8 +2077,8 @@ async function renderWaAllow() {
|
|
|
2076
2077
|
});
|
|
2077
2078
|
c.appendChild(selP);
|
|
2078
2079
|
|
|
2079
|
-
/* BOT SİSTEMİ:
|
|
2080
|
-
if (
|
|
2080
|
+
/* BOT SİSTEMİ: bağlı olduğu bot chip'te seçili gelir — buradan değiştirilebilir */
|
|
2081
|
+
if (botChoices.length) {
|
|
2081
2082
|
const selB = document.createElement('span');
|
|
2082
2083
|
selB.innerHTML = botSelHtml(typeof entry === 'object' ? entry.bot_id : undefined);
|
|
2083
2084
|
const sel = selB.firstChild;
|
|
@@ -2246,13 +2247,14 @@ async function renderTgAllow() {
|
|
|
2246
2247
|
const list = await beast.tgGetAllow();
|
|
2247
2248
|
let botChoices = [];
|
|
2248
2249
|
try { botChoices = (await beast.botsList()) || []; } catch {}
|
|
2249
|
-
const multiBot = botChoices.length >= 2;
|
|
2250
2250
|
const tgLabel = (e) => {
|
|
2251
2251
|
if (e === '*') return '* herkes';
|
|
2252
2252
|
if (typeof e === 'string') return e;
|
|
2253
2253
|
const name = String((e && e.name) || '').trim();
|
|
2254
2254
|
const id = String((e && e.id) || '');
|
|
2255
|
-
|
|
2255
|
+
/* bağlı olduğu bot her koşulda etikette görünsün */
|
|
2256
|
+
const bot = e && e.bot_id ? botChoices.find((bb) => bb.id === e.bot_id) : null;
|
|
2257
|
+
return (name ? name + ' ' : '') + id + (bot ? ' → ' + bot.name : '');
|
|
2256
2258
|
};
|
|
2257
2259
|
wrap.innerHTML = '';
|
|
2258
2260
|
if (!list.length) wrap.innerHTML = '<span class="sub">— boş —</span>';
|
|
@@ -2298,11 +2300,15 @@ async function renderTgAllow() {
|
|
|
2298
2300
|
});
|
|
2299
2301
|
c.appendChild(selP);
|
|
2300
2302
|
|
|
2301
|
-
/* BOT SİSTEMİ:
|
|
2302
|
-
if (
|
|
2303
|
+
/* BOT SİSTEMİ: bağlı olduğu bot chip'te seçili gelir — buradan değiştirilebilir */
|
|
2304
|
+
if (botChoices.length) {
|
|
2303
2305
|
const sel = document.createElement('select');
|
|
2304
2306
|
sel.className = 'perm-select';
|
|
2305
2307
|
sel.title = _t('bot_bind_title');
|
|
2308
|
+
const empty = document.createElement('option');
|
|
2309
|
+
empty.value = '';
|
|
2310
|
+
empty.textContent = _t('bot_sel_empty');
|
|
2311
|
+
sel.appendChild(empty);
|
|
2306
2312
|
for (const bb of botChoices) {
|
|
2307
2313
|
const o = document.createElement('option');
|
|
2308
2314
|
o.value = bb.id;
|