fix: remove default kiro.rs admin URL

This commit is contained in:
QLHazyCoder
2026-05-19 03:22:14 +08:00
parent 5ddb5ac94d
commit a3c36e6f15
8 changed files with 20 additions and 21 deletions
+2 -6
View File
@@ -913,7 +913,7 @@ const PERSISTED_SETTING_DEFAULTS = {
panelMode: 'cpa',
activeFlowId: DEFAULT_ACTIVE_FLOW_ID,
kiroTargetId: 'kiro-rs',
kiroRsUrl: self.MultiPageFlowRegistry?.DEFAULT_KIRO_RS_URL || 'https://kiro.leftcode.xyz/admin',
kiroRsUrl: String(self.MultiPageFlowRegistry?.DEFAULT_KIRO_RS_URL || '').trim(),
kiroRsKey: '',
vpsUrl: '',
vpsPassword: '',
@@ -2769,11 +2769,7 @@ function normalizePersistentSettingValue(key, value) {
}
return String(value || '').trim().toLowerCase() === 'kiro-rs' ? 'kiro-rs' : 'kiro-rs';
case 'kiroRsUrl':
return String(
value
|| self.MultiPageFlowRegistry?.DEFAULT_KIRO_RS_URL
|| 'https://kiro.leftcode.xyz/admin'
).trim() || 'https://kiro.leftcode.xyz/admin';
return String(value || '').trim();
case 'kiroRsKey':
return String(value || '').trim();
case 'vpsUrl':
+1 -1
View File
@@ -5,7 +5,7 @@
const DEFAULT_OPENAI_TARGET_ID = 'cpa';
const DEFAULT_KIRO_TARGET_ID = 'kiro-rs';
const DEFAULT_KIRO_PUBLICATION_TARGET_ID = 'kiro-rs';
const DEFAULT_KIRO_RS_URL = 'https://kiro.leftcode.xyz/admin';
const DEFAULT_KIRO_RS_URL = '';
const OPENAI_TARGET_IDS = Object.freeze(['cpa', 'sub2api', 'codex2api']);
const SHARED_SERVICE_IDS = Object.freeze(['account', 'email', 'proxy']);
+1 -1
View File
@@ -37,7 +37,7 @@
).trim().toLowerCase() || 'openai';
const defaultOpenAiTargetId = flowRegistry.DEFAULT_OPENAI_TARGET_ID || 'cpa';
const defaultKiroTargetId = flowRegistry.DEFAULT_KIRO_TARGET_ID || 'kiro-rs';
const defaultKiroRsUrl = flowRegistry.DEFAULT_KIRO_RS_URL || 'https://kiro.leftcode.xyz/admin';
const defaultKiroRsUrl = String(flowRegistry.DEFAULT_KIRO_RS_URL || '').trim();
const normalizeFlowId = typeof flowRegistry.normalizeFlowId === 'function'
? flowRegistry.normalizeFlowId
: ((value = '', fallback = defaultFlowId) => {
+5 -2
View File
@@ -243,8 +243,11 @@
</div>
<div class="data-row" id="row-kiro-rs-url" style="display:none;">
<span class="data-label">kiro.rs</span>
<input type="text" id="input-kiro-rs-url" class="data-input"
placeholder="https://kiro.leftcode.xyz/admin" />
<div class="data-inline">
<input type="text" id="input-kiro-rs-url" class="data-input"
placeholder="请输入 kiro.rs 管理地址" />
<button id="btn-open-kiro-rs-github" class="btn btn-ghost btn-xs data-inline-btn" type="button">GitHub</button>
</div>
</div>
<div class="data-row" id="row-kiro-rs-key" style="display:none;">
<span class="data-label">API Key</span>
+7 -8
View File
@@ -173,6 +173,7 @@ const rowCodex2ApiAdminKey = document.getElementById('row-codex2api-admin-key');
const inputCodex2ApiAdminKey = document.getElementById('input-codex2api-admin-key');
const rowKiroRsUrl = document.getElementById('row-kiro-rs-url');
const inputKiroRsUrl = document.getElementById('input-kiro-rs-url');
const btnOpenKiroRsGithub = document.getElementById('btn-open-kiro-rs-github');
const rowKiroRsKey = document.getElementById('row-kiro-rs-key');
const inputKiroRsKey = document.getElementById('input-kiro-rs-key');
const btnTestKiroRs = document.getElementById('btn-test-kiro-rs');
@@ -4256,9 +4257,7 @@ function collectSettingsPayload() {
return Number.isSafeInteger(numeric) && numeric >= 1 ? numeric : 1;
});
const flowRegistryApi = typeof getFlowRegistry === 'function' ? getFlowRegistry() : null;
const defaultKiroRsUrl = String(
flowRegistryApi?.DEFAULT_KIRO_RS_URL || 'https://kiro.leftcode.xyz/admin'
).trim() || 'https://kiro.leftcode.xyz/admin';
const defaultKiroRsUrl = String(flowRegistryApi?.DEFAULT_KIRO_RS_URL || '').trim();
const normalizeKiroTargetIdSafe = typeof normalizeTargetIdForFlow === 'function'
? normalizeTargetIdForFlow
: ((_flowId, targetId = '', fallback = 'kiro-rs') => {
@@ -10034,11 +10033,7 @@ function applySettingsState(state) {
}
inputSub2ApiDefaultProxy.value = state?.sub2apiDefaultProxyName || '';
if (typeof inputKiroRsUrl !== 'undefined' && inputKiroRsUrl) {
inputKiroRsUrl.value = String(
state?.kiroRsUrl
|| getFlowRegistry()?.DEFAULT_KIRO_RS_URL
|| 'https://kiro.leftcode.xyz/admin'
).trim();
inputKiroRsUrl.value = String(state?.kiroRsUrl || '').trim();
}
if (typeof inputKiroRsKey !== 'undefined' && inputKiroRsKey) {
inputKiroRsKey.value = String(state?.kiroRsKey || '');
@@ -13893,6 +13888,10 @@ btnGpcHelperConvertApiKey?.addEventListener('click', () => {
openExternalUrl(GPC_HELPER_PORTAL_URL);
});
btnOpenKiroRsGithub?.addEventListener('click', () => {
openExternalUrl('https://github.com/hank9999/kiro.rs');
});
btnGpcHelperBalance?.addEventListener('click', async () => {
try {
const response = await chrome.runtime.sendMessage({
@@ -134,7 +134,7 @@ const FIVE_SIM_SUPPORTED_COUNTRY_ID_SET = new Set(['indonesia', 'thailand', 'vie
const HERO_SMS_SUPPORTED_COUNTRY_ID_SET = new Set(['6', '52', '10']);
const self = {
MultiPageFlowRegistry: {
DEFAULT_KIRO_RS_URL: 'https://kiro.leftcode.xyz/admin',
DEFAULT_KIRO_RS_URL: '',
normalizeFlowId(value, fallback = 'openai') {
const normalized = String(value || '').trim().toLowerCase();
if (normalized === 'kiro') {
@@ -277,7 +277,7 @@ return {
assert.equal(api.normalizePersistentSettingValue('activeFlowId', 'codex'), 'openai');
assert.equal(api.normalizePersistentSettingValue('activeFlowId', 'kiro'), 'kiro');
assert.equal(api.normalizePersistentSettingValue('kiroTargetId', 'unknown'), 'kiro-rs');
assert.equal(api.normalizePersistentSettingValue('kiroRsUrl', ''), 'https://kiro.leftcode.xyz/admin');
assert.equal(api.normalizePersistentSettingValue('kiroRsUrl', ''), '');
assert.equal(api.normalizePersistentSettingValue('kiroRsKey', ' key-1 '), 'key-1');
assert.equal(api.normalizePersistentSettingValue('phoneSmsProvider', '5SIM'), '5sim');
assert.equal(api.normalizePersistentSettingValue('phoneSmsProvider', 'NEXSMS'), 'nexsms');
@@ -101,7 +101,7 @@ const PERSISTED_SETTING_DEFAULTS = {
ipProxyService: '711proxy',
ipProxyMode: 'account',
kiroTargetId: 'kiro-rs',
kiroRsUrl: 'https://kiro.leftcode.xyz/admin',
kiroRsUrl: '',
kiroRsKey: '',
stepExecutionRangeByFlow: {},
};
@@ -39,6 +39,7 @@ test('sidepanel html exposes flow selector and kiro source fields', () => {
'id="label-source-selector"',
'id="row-step6-cookie-settings"',
'id="row-kiro-rs-url"',
'id="btn-open-kiro-rs-github"',
'id="row-kiro-rs-key"',
'id="btn-test-kiro-rs"',
'id="row-kiro-rs-test-status"',