Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/chrome/src/providers/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ export class ProviderManager {
id === this._duplicateProviderId(sourceId) &&
!!sourceConfig &&
this._canDuplicateProvider(sourceId, sourceConfig) &&
sourceConfig.configured === true &&
sourceConfig.type === config.type;
}

Expand Down Expand Up @@ -1304,6 +1305,9 @@ export class ProviderManager {
if (!this._canDuplicateProvider(id, source.config)) {
throw new Error(`Provider cannot be duplicated: ${id}`);
}
if (source.config.configured !== true) {
throw new Error(`Save provider before duplicating it: ${id}`);
}
const duplicateId = this._duplicateProviderId(id);
if (this.providers.has(duplicateId) || [...this.providers.values()].some(provider => provider.config?.duplicateOf === id)) {
throw new Error(`${source.config.label || id} already has a duplicate.`);
Expand Down Expand Up @@ -1361,7 +1365,23 @@ export class ProviderManager {
const duplicatedSourceIds = new Set(
[...this.providers.values()].map(provider => provider.config?.duplicateOf).filter(Boolean),
);
for (const [id, provider] of this.providers) {
const duplicateEntriesBySourceId = new Map();
for (const entry of this.providers) {
const sourceId = entry[1].config?.duplicateOf;
if (sourceId) duplicateEntriesBySourceId.set(sourceId, entry);
}
const orderedEntries = [];
for (const entry of this.providers) {
const [id, provider] = entry;
if (provider.config?.duplicateOf) continue;
orderedEntries.push(entry);
const duplicateEntry = duplicateEntriesBySourceId.get(id);
if (duplicateEntry) orderedEntries.push(duplicateEntry);
}
for (const entry of duplicateEntriesBySourceId.values()) {
if (!this.providers.has(entry[1].config?.duplicateOf)) orderedEntries.push(entry);
}
for (const [id, provider] of orderedEntries) {
const config = provider.config;
const isDuplicate = !!config.duplicateOf;
const hasDuplicate = !isDuplicate && duplicatedSourceIds.has(id);
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/ar.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default {
'st.providers.duplicate': 'نسخ',
'st.providers.duplicate_limit': 'يُسمح بنسخة واحدة فقط',
'st.providers.duplicate_unavailable': 'لا يمكن نسخ مزود الخدمة هذا',
'st.providers.duplicate_inactive': 'احفظ مزود الخدمة هذا قبل نسخه',
'st.providers.remove_duplicate': 'حذف النسخة',
'st.providers.remove_duplicate_confirm': 'هل تريد حذف نسخة مزود الخدمة هذه وإعداداتها المحفوظة؟',
'st.providers.set_active': 'تعيينه نشطًا',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/bn.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ export default {
'st.providers.duplicate': 'ডুপ্লিকেট',
'st.providers.duplicate_limit': 'শুধু একটি ডুপ্লিকেট অনুমোদিত',
'st.providers.duplicate_unavailable': 'এই প্রদানকারীকে ডুপ্লিকেট করা যাবে না',
'st.providers.duplicate_inactive': 'ডুপ্লিকেট করার আগে এই প্রদানকারীটি সংরক্ষণ করুন',
'st.providers.remove_duplicate': 'ডুপ্লিকেট মুছুন',
'st.providers.remove_duplicate_confirm': 'এই ডুপ্লিকেট প্রদানকারী ও এর সংরক্ষিত সেটিংস মুছবেন?',
'st.providers.set_active': "সক্রিয় সেট করুন",
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ export default {
'st.providers.duplicate': 'Duplizieren',
'st.providers.duplicate_limit': 'Es ist nur ein Duplikat zulässig',
'st.providers.duplicate_unavailable': 'Dieser Anbieter kann nicht dupliziert werden',
'st.providers.duplicate_inactive': 'Speichern Sie diesen Anbieter, bevor Sie ihn duplizieren',
'st.providers.remove_duplicate': 'Duplikat entfernen',
'st.providers.remove_duplicate_confirm': 'Diesen duplizierten Anbieter und seine gespeicherte Konfiguration entfernen?',
'st.providers.set_active': 'Als aktiv setzen',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ export default {
'st.providers.duplicate': 'Duplicate',
'st.providers.duplicate_limit': 'Only one duplicate is allowed',
'st.providers.duplicate_unavailable': 'This provider cannot be duplicated',
'st.providers.duplicate_inactive': 'Save this provider before duplicating it',
'st.providers.remove_duplicate': 'Remove duplicate',
'st.providers.remove_duplicate_confirm': 'Remove this duplicate provider and its saved configuration?',
'st.providers.set_active': 'Set Active',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default {
'st.providers.duplicate': 'Duplicar',
'st.providers.duplicate_limit': 'Solo se permite un duplicado',
'st.providers.duplicate_unavailable': 'Este proveedor no se puede duplicar',
'st.providers.duplicate_inactive': 'Guarda este proveedor antes de duplicarlo',
'st.providers.remove_duplicate': 'Eliminar duplicado',
'st.providers.remove_duplicate_confirm': '¿Eliminar este proveedor duplicado y su configuración guardada?',
'st.providers.set_active': 'Establecer activo',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/fa.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ export default {
'st.providers.duplicate': 'تکثیر',
'st.providers.duplicate_limit': 'فقط یک نسخهٔ تکراری مجاز است',
'st.providers.duplicate_unavailable': 'امکان تکثیر این ارائه‌دهنده وجود ندارد',
'st.providers.duplicate_inactive': 'پیش از تکثیر، این ارائه‌دهنده را ذخیره کنید',
'st.providers.remove_duplicate': 'حذف نسخهٔ تکراری',
'st.providers.remove_duplicate_confirm': 'این ارائه‌دهندهٔ تکراری و تنظیمات ذخیره‌شدهٔ آن حذف شود؟',
'st.providers.set_active': "فعال را تنظیم کنید",
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default {
'st.providers.duplicate': 'Dupliquer',
'st.providers.duplicate_limit': 'Un seul doublon est autorisé',
'st.providers.duplicate_unavailable': 'Ce fournisseur ne peut pas être dupliqué',
'st.providers.duplicate_inactive': 'Enregistrez ce fournisseur avant de le dupliquer',
'st.providers.remove_duplicate': 'Supprimer le doublon',
'st.providers.remove_duplicate_confirm': 'Supprimer ce fournisseur dupliqué et sa configuration enregistrée ?',
'st.providers.set_active': 'Définir comme actif',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/he.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ export default {
'st.providers.duplicate': 'שכפול',
'st.providers.duplicate_limit': 'מותר שכפול אחד בלבד',
'st.providers.duplicate_unavailable': 'לא ניתן לשכפל ספק זה',
'st.providers.duplicate_inactive': 'יש לשמור את הספק הזה לפני שכפולו',
'st.providers.remove_duplicate': 'הסרת השכפול',
'st.providers.remove_duplicate_confirm': 'להסיר את הספק המשוכפל ואת ההגדרות השמורות שלו?',
"st.providers.set_active": "הגדר פעיל",
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/hi.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ export default {
'st.providers.duplicate': 'डुप्लिकेट करें',
'st.providers.duplicate_limit': 'केवल एक डुप्लिकेट की अनुमति है',
'st.providers.duplicate_unavailable': 'इस प्रदाता को डुप्लिकेट नहीं किया जा सकता',
'st.providers.duplicate_inactive': 'इस प्रदाता को डुप्लिकेट करने से पहले सहेजें',
'st.providers.remove_duplicate': 'डुप्लिकेट हटाएँ',
'st.providers.remove_duplicate_confirm': 'क्या इस डुप्लिकेट प्रदाता और इसकी सहेजी गई सेटिंग हटानी हैं?',
'st.providers.set_active': "सक्रिय सेट करें",
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default {
'st.providers.duplicate': 'Duplikat',
'st.providers.duplicate_limit': 'Hanya satu duplikat yang diizinkan',
'st.providers.duplicate_unavailable': 'Penyedia ini tidak dapat diduplikasi',
'st.providers.duplicate_inactive': 'Simpan penyedia ini sebelum menduplikasinya',
'st.providers.remove_duplicate': 'Hapus duplikat',
'st.providers.remove_duplicate_confirm': 'Hapus penyedia duplikat ini beserta konfigurasi tersimpannya?',
'st.providers.set_active': 'Jadikan aktif',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default {
'st.providers.duplicate': '複製',
'st.providers.duplicate_limit': '複製は1つだけ作成できます',
'st.providers.duplicate_unavailable': 'このプロバイダーは複製できません',
'st.providers.duplicate_inactive': '複製する前にこのプロバイダーを保存してください',
'st.providers.remove_duplicate': '複製を削除',
'st.providers.remove_duplicate_confirm': 'この複製プロバイダーと保存済み設定を削除しますか?',
'st.providers.set_active': '有効化',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default {
'st.providers.duplicate': '복제',
'st.providers.duplicate_limit': '복제본은 하나만 만들 수 있습니다',
'st.providers.duplicate_unavailable': '이 공급자는 복제할 수 없습니다',
'st.providers.duplicate_inactive': '이 공급자를 복제하기 전에 저장하세요',
'st.providers.remove_duplicate': '복제본 삭제',
'st.providers.remove_duplicate_confirm': '이 복제 공급자와 저장된 설정을 삭제할까요?',
'st.providers.set_active': '활성으로 설정',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/ms.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default {
'st.providers.duplicate': 'Duplikasi',
'st.providers.duplicate_limit': 'Hanya satu duplikasi dibenarkan',
'st.providers.duplicate_unavailable': 'Penyedia ini tidak boleh diduplikasi',
'st.providers.duplicate_inactive': 'Simpan penyedia ini sebelum menduplikasikannya',
'st.providers.remove_duplicate': 'Alih keluar duplikasi',
'st.providers.remove_duplicate_confirm': 'Alih keluar penyedia duplikasi ini dan konfigurasi tersimpannya?',
'st.providers.set_active': 'Jadikan aktif',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ export default {
'st.providers.duplicate': 'Dupliceren',
'st.providers.duplicate_limit': 'Er is slechts één duplicaat toegestaan',
'st.providers.duplicate_unavailable': 'Deze provider kan niet worden gedupliceerd',
'st.providers.duplicate_inactive': 'Sla deze provider op voordat u deze dupliceert',
'st.providers.remove_duplicate': 'Duplicaat verwijderen',
'st.providers.remove_duplicate_confirm': 'Deze gedupliceerde provider en de opgeslagen configuratie verwijderen?',
'st.providers.set_active': 'Actief instellen',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/pl.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ export default {
'st.providers.duplicate': 'Duplikuj',
'st.providers.duplicate_limit': 'Dozwolony jest tylko jeden duplikat',
'st.providers.duplicate_unavailable': 'Tego dostawcy nie można zduplikować',
'st.providers.duplicate_inactive': 'Zapisz tego dostawcę przed jego zduplikowaniem',
'st.providers.remove_duplicate': 'Usuń duplikat',
'st.providers.remove_duplicate_confirm': 'Usunąć tego zduplikowanego dostawcę i jego zapisaną konfigurację?',
'st.providers.set_active': 'Ustaw jako aktywny',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ export default {
'st.providers.duplicate': 'Duplicar',
'st.providers.duplicate_limit': 'Só é permitida uma duplicata',
'st.providers.duplicate_unavailable': 'Este provedor não pode ser duplicado',
'st.providers.duplicate_inactive': 'Salve este provedor antes de duplicá-lo',
'st.providers.remove_duplicate': 'Remover duplicata',
'st.providers.remove_duplicate_confirm': 'Remover este provedor duplicado e a configuração salva?',
'st.providers.set_active': "Definir ativo",
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default {
'st.providers.duplicate': 'Дублировать',
'st.providers.duplicate_limit': 'Разрешён только один дубликат',
'st.providers.duplicate_unavailable': 'Этого провайдера нельзя дублировать',
'st.providers.duplicate_inactive': 'Сохраните этого провайдера перед дублированием',
'st.providers.remove_duplicate': 'Удалить дубликат',
'st.providers.remove_duplicate_confirm': 'Удалить этого дублированного провайдера и его сохранённые настройки?',
'st.providers.set_active': 'Сделать активным',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/th.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default {
'st.providers.duplicate': 'ทำสำเนา',
'st.providers.duplicate_limit': 'อนุญาตให้มีสำเนาได้เพียงหนึ่งรายการ',
'st.providers.duplicate_unavailable': 'ไม่สามารถทำสำเนาผู้ให้บริการนี้ได้',
'st.providers.duplicate_inactive': 'บันทึกผู้ให้บริการนี้ก่อนทำสำเนา',
'st.providers.remove_duplicate': 'ลบสำเนา',
'st.providers.remove_duplicate_confirm': 'ลบผู้ให้บริการสำเนานี้และการตั้งค่าที่บันทึกไว้หรือไม่',
'st.providers.set_active': 'ตั้งเป็นใช้งาน',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/tl.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default {
'st.providers.duplicate': 'I-duplicate',
'st.providers.duplicate_limit': 'Isang duplicate lang ang pinapayagan',
'st.providers.duplicate_unavailable': 'Hindi maaaring i-duplicate ang provider na ito',
'st.providers.duplicate_inactive': 'I-save ang provider na ito bago ito i-duplicate',
'st.providers.remove_duplicate': 'Alisin ang duplicate',
'st.providers.remove_duplicate_confirm': 'Alisin ang duplicate na provider na ito at ang naka-save nitong configuration?',
'st.providers.set_active': 'Itakda Bilang Aktibo',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/tr.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ export default {
'st.providers.duplicate': 'Çoğalt',
'st.providers.duplicate_limit': 'Yalnızca bir kopyaya izin verilir',
'st.providers.duplicate_unavailable': 'Bu sağlayıcı çoğaltılamaz',
'st.providers.duplicate_inactive': 'Çoğaltmadan önce bu sağlayıcıyı kaydedin',
'st.providers.remove_duplicate': 'Kopyayı kaldır',
'st.providers.remove_duplicate_confirm': 'Bu çoğaltılmış sağlayıcı ve kayıtlı yapılandırması kaldırılsın mı?',
'st.providers.set_active': 'Etkinleştir',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/uk.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default {
'st.providers.duplicate': 'Дублювати',
'st.providers.duplicate_limit': 'Дозволено лише один дублікат',
'st.providers.duplicate_unavailable': 'Цього постачальника не можна дублювати',
'st.providers.duplicate_inactive': 'Збережіть цього постачальника перед дублюванням',
'st.providers.remove_duplicate': 'Видалити дублікат',
'st.providers.remove_duplicate_confirm': 'Видалити цього дубльованого постачальника та його збережені налаштування?',
'st.providers.set_active': 'Зробити активним',
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/vi.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ export default {
'st.providers.duplicate': 'Nhân bản',
'st.providers.duplicate_limit': 'Chỉ được phép có một bản sao',
'st.providers.duplicate_unavailable': 'Không thể nhân bản nhà cung cấp này',
'st.providers.duplicate_inactive': 'Lưu nhà cung cấp này trước khi nhân bản',
'st.providers.remove_duplicate': 'Xóa bản sao',
'st.providers.remove_duplicate_confirm': 'Xóa nhà cung cấp nhân bản này và cấu hình đã lưu?',
'st.providers.set_active': "Đặt hoạt động",
Expand Down
1 change: 1 addition & 0 deletions src/chrome/src/ui/locales/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export default {
'st.providers.duplicate': '复制',
'st.providers.duplicate_limit': '最多只能创建一个副本',
'st.providers.duplicate_unavailable': '此服务商不可复制',
'st.providers.duplicate_inactive': '请先保存此服务商,然后再复制',
'st.providers.remove_duplicate': '删除副本',
'st.providers.remove_duplicate_confirm': '要删除此服务商副本及其已保存的配置吗?',
'st.providers.set_active': '设为启用',
Expand Down
2 changes: 1 addition & 1 deletion src/chrome/src/ui/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
.provider-card.collapsed { padding: 12px 16px; }
.provider-card.collapsed .provider-header { margin-bottom: 0; }

.provider-card .btn-duplicate[aria-disabled="true"] { cursor: not-allowed; opacity: 0.48; transform: none; }
.provider-card .btn-duplicate:disabled { cursor: not-allowed; opacity: 0.48; transform: none; }
.provider-header {
display: flex;
align-items: center;
Expand Down
Loading
Loading