Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

feat(dashboard): provisioning UI for integration instances (#575)

Yudhi Armyndharise074fb837147
diff --git a/dashboard/src/components/PluginInstances.css b/dashboard/src/components/PluginInstances.css
new file mode 100644
index 000000000..555770fb3
--- /dev/null
+++ b/dashboard/src/components/PluginInstances.css
@@ -0,0 +1,116 @@
+.plugin-instances {
+ display: flex;
+ flex-direction: column;
+ gap: 1rem;
+}
+.plugin-instances .pi-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ gap: 1rem;
+}
+.plugin-instances .pi-desc {
+ color: var(--text-muted);
+ margin: 0;
+ flex: 1;
+}
+.plugin-instances .pi-loading {
+ display: flex;
+ justify-content: center;
+ padding: 2rem;
+}
+.plugin-instances .pi-empty {
+ text-align: center;
+ color: var(--text-muted);
+ padding: 2rem 1rem;
+}
+.plugin-instances .pi-list {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+}
+.plugin-instances .pi-row {
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+ padding: 0.75rem;
+ border: 1px solid var(--border);
+ border-radius: 8px;
+}
+.plugin-instances .pi-main {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+}
+.plugin-instances .pi-id {
+ font-weight: 600;
+}
+.plugin-instances .pi-scope {
+ font-size: 0.8rem;
+ color: var(--text-muted);
+}
+.plugin-instances .pi-url {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ min-width: 0;
+}
+.plugin-instances .pi-url code {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+.plugin-instances .pi-badge {
+ font-size: 0.75rem;
+ padding: 0.15rem 0.5rem;
+ border-radius: 999px;
+ white-space: nowrap;
+}
+.plugin-instances .pi-badge.on {
+ background: var(--success-bg, #dcfce7);
+ color: var(--success, #16a34a);
+}
+.plugin-instances .pi-badge.off {
+ background: var(--bg-secondary);
+ color: var(--text-muted);
+}
+.plugin-instances .pi-actions {
+ display: flex;
+ gap: 0.25rem;
+ margin-left: auto;
+}
+.plugin-instances .pi-hint {
+ font-size: 0.8rem;
+ color: var(--text-muted);
+ margin: 0.25rem 0 0.75rem;
+}
+.plugin-instances .pi-secret {
+ display: flex;
+ gap: 0.5rem;
+ align-items: center;
+ margin-bottom: 0.5rem;
+}
+.plugin-instances .pi-secret code {
+ flex: 1;
+ padding: 0.75rem;
+ background: var(--bg-secondary);
+ border-radius: 6px;
+ word-break: break-all;
+}
+.plugin-instances .pi-error {
+ color: var(--danger, #e5484d);
+ font-size: 0.85rem;
+ margin-top: 0.5rem;
+}
+.plugin-instances .pi-confirm-icon {
+ display: flex;
+ justify-content: center;
+ color: var(--danger, #e5484d);
+ margin-bottom: 0.75rem;
+}
+.plugin-instances textarea {
+ width: 100%;
+ min-height: 96px;
+ font-family: monospace;
+}
diff --git a/dashboard/src/components/PluginInstances.tsx b/dashboard/src/components/PluginInstances.tsx
new file mode 100644
index 000000000..1dd66d5f5
--- /dev/null
+++ b/dashboard/src/components/PluginInstances.tsx
@@ -0,0 +1,363 @@
+import { useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { Plus, Copy, Check, RefreshCw, Pencil, Trash2, X, Loader2, Power, AlertTriangle } from 'lucide-react';
+import type { InstanceView, MintedInstance } from '../services/api';
+import {
+ usePluginInstancesQuery,
+ useCreateInstanceMutation,
+ useRegenerateInstanceSecretMutation,
+ useUpdateInstanceMutation,
+ useDeleteInstanceMutation,
+} from '../hooks/queries';
+import { isValidInstanceId, parseInstanceConfig } from '../utils/instanceForm';
+import { copyToClipboard } from '../utils/clipboard';
+import { useToast } from './Toast';
+import './PluginInstances.css';
+
+const emptyForm = { instanceId: '', sessionScope: '', verifyToken: '', config: '' };
+
+export function PluginInstances({ pluginId }: { pluginId: string }) {
+ const { t } = useTranslation();
+ const toast = useToast();
+ const { data: instances = [], isLoading, isError } = usePluginInstancesQuery(pluginId, true);
+ const createM = useCreateInstanceMutation(pluginId);
+ const regenM = useRegenerateInstanceSecretMutation(pluginId);
+ const updateM = useUpdateInstanceMutation(pluginId);
+ const deleteM = useDeleteInstanceMutation(pluginId);
+
+ const [showForm, setShowForm] = useState(false);
+ const [form, setForm] = useState(emptyForm);
+ const [formError, setFormError] = useState<string | null>(null);
+ const [minted, setMinted] = useState<MintedInstance | null>(null); // secret-shown-once view
+ const [mintedKind, setMintedKind] = useState<'created' | 'regenerated'>('created');
+ const [editing, setEditing] = useState<InstanceView | null>(null);
+ const [editForm, setEditForm] = useState({ sessionScope: '', config: '' });
+ const [editError, setEditError] = useState<string | null>(null);
+ const [confirm, setConfirm] = useState<{ type: 'delete' | 'regenerate'; inst: InstanceView } | null>(null);
+ const [copied, setCopied] = useState<string | null>(null);
+
+ const copy = async (text: string, id: string) => {
+ if (await copyToClipboard(text)) {
+ setCopied(id);
+ setTimeout(() => setCopied(null), 2000);
+ }
+ };
+
+ const openCreate = () => {
+ setForm(emptyForm);
+ setFormError(null);
+ setShowForm(true);
+ };
+
+ const submitCreate = async () => {
+ if (!isValidInstanceId(form.instanceId)) {
+ setFormError(t('plugins.instances.errors.invalidId'));
+ return;
+ }
+ const parsed = parseInstanceConfig(form.config);
+ if (!parsed.ok) {
+ setFormError(t('plugins.instances.errors.invalidJson'));
+ return;
+ }
+ try {
+ const created = await createM.mutateAsync({
+ instanceId: form.instanceId,
+ sessionScope: form.sessionScope.trim() || undefined,
+ verifyToken: form.verifyToken.trim() || undefined,
+ config: parsed.value,
+ });
+ setShowForm(false);
+ setForm(emptyForm);
+ setMintedKind('created');
+ setMinted(created);
+ toast.success(t('plugins.instances.toasts.created'), created.instanceId);
+ } catch (err) {
+ const e = err as Error & { status?: number };
+ setFormError(e.status === 409 ? t('plugins.instances.errors.duplicateId') : e.message);
+ }
+ };
+
+ const toggleEnabled = async (inst: InstanceView) => {
+ try {
+ await updateM.mutateAsync({ instanceId: inst.instanceId, body: { enabled: !inst.enabled } });
+ toast.success(t('plugins.instances.toasts.updated'), inst.instanceId);
+ } catch (err) {
+ toast.error(t('plugins.instances.toasts.actionFailed'), (err as Error).message);
+ }
+ };
+
+ const openEdit = (inst: InstanceView) => {
+ setEditing(inst);
+ setEditForm({
+ sessionScope: inst.sessionScope ?? '',
+ config: inst.config ? JSON.stringify(inst.config, null, 2) : '',
+ });
+ setEditError(null);
+ };
+
+ const submitEdit = async () => {
+ if (!editing) return;
+ const parsed = parseInstanceConfig(editForm.config);
+ if (!parsed.ok) {
+ setEditError(t('plugins.instances.errors.invalidJson'));
+ return;
+ }
+ try {
+ await updateM.mutateAsync({
+ instanceId: editing.instanceId,
+ // Blank → omit (leave scope unchanged); mirrors create. Sending '' would corrupt an
+ // all-sessions (null) instance into a literal empty scope the backend never clears.
+ body: { sessionScope: editForm.sessionScope.trim() || undefined, config: parsed.value ?? {} },
+ });
+ setEditing(null);
+ toast.success(t('plugins.instances.toasts.updated'), editing.instanceId);
+ } catch (err) {
+ setEditError((err as Error).message);
+ }
+ };
+
+ const runConfirm = async () => {
+ if (!confirm) return;
+ const { type, inst } = confirm;
+ setConfirm(null);
+ try {
+ if (type === 'delete') {
+ await deleteM.mutateAsync(inst.instanceId);
+ toast.success(t('plugins.instances.toasts.deleted'), inst.instanceId);
+ } else {
+ const res = await regenM.mutateAsync(inst.instanceId);
+ setMintedKind('regenerated');
+ setMinted(res);
+ toast.success(t('plugins.instances.toasts.secretRegenerated'), inst.instanceId);
+ }
+ } catch (err) {
+ toast.error(t('plugins.instances.toasts.actionFailed'), (err as Error).message);
+ }
+ };
+
+ return (
+ <div className="plugin-instances">
+ <div className="pi-header">
+ <p className="pi-desc">{t('plugins.instances.description')}</p>
+ <button className="btn-primary" onClick={openCreate}>
+ <Plus size={16} />
+ {t('plugins.instances.create')}
+ </button>
+ </div>
+
+ {isLoading ? (
+ <div className="pi-loading">
+ <Loader2 className="animate-spin" size={24} />
+ </div>
+ ) : isError ? (
+ <p className="pi-error">{t('plugins.instances.loadError')}</p>
+ ) : instances.length === 0 ? (
+ <p className="pi-empty">{t('plugins.instances.empty')}</p>
+ ) : (
+ <div className="pi-list">
+ {instances.map(inst => (
+ <div key={inst.id} className="pi-row">
+ <div className="pi-main">
+ <span className="pi-id">{inst.instanceId}</span>
+ <span className="pi-scope">{inst.sessionScope || t('plugins.instances.allSessions')}</span>
+ </div>
+ {inst.ingressUrls[0] && (
+ <div className="pi-url">
+ <code title={inst.ingressUrls[0].url}>{inst.ingressUrls[0].url}</code>
+ <button
+ className="icon-btn-sm"
+ onClick={() => void copy(inst.ingressUrls[0].url, `url-${inst.id}`)}
+ title={t('plugins.instances.actions.copy')}
+ >
+ {copied === `url-${inst.id}` ? <Check size={14} /> : <Copy size={14} />}
+ </button>
+ </div>
+ )}
+ <span className={`pi-badge ${inst.enabled ? 'on' : 'off'}`}>
+ {inst.enabled ? t('plugins.instances.enabled') : t('plugins.instances.disabled')}
+ </span>
+ <div className="pi-actions">
+ <button className="icon-btn" onClick={() => void toggleEnabled(inst)} title={t(`plugins.instances.actions.${inst.enabled ? 'disable' : 'enable'}`)}>
+ <Power size={16} />
+ </button>
+ <button className="icon-btn" onClick={() => setConfirm({ type: 'regenerate', inst })} title={t('plugins.instances.actions.regenerate')}>
+ <RefreshCw size={16} />
+ </button>
+ <button className="icon-btn" onClick={() => openEdit(inst)} title={t('plugins.instances.actions.edit')}>
+ <Pencil size={16} />
+ </button>
+ <button className="icon-btn danger" onClick={() => setConfirm({ type: 'delete', inst })} title={t('plugins.instances.actions.delete')}>
+ <Trash2 size={16} />
+ </button>
+ </div>
+ </div>
+ ))}
+ </div>
+ )}
+
+ {/* Create modal — form, or the secret-shown-once view after mint */}
+ {showForm && (
+ <div className="modal-overlay" onClick={() => setShowForm(false)}>
+ <div className="modal" onClick={e => e.stopPropagation()}>
+ <div className="modal-header">
+ <h2>{t('plugins.instances.create')}</h2>
+ <button className="btn-icon" onClick={() => setShowForm(false)}>
+ <X size={20} />
+ </button>
+ </div>
+ <div className="modal-body plugin-instances">
+ <label>{t('plugins.instances.form.instanceId')}</label>
+ <input
+ type="text"
+ value={form.instanceId}
+ placeholder={t('plugins.instances.form.instanceIdPlaceholder')}
+ onChange={e => setForm({ ...form, instanceId: e.target.value })}
+ />
+ <p className="pi-hint">{t('plugins.instances.form.instanceIdHint')}</p>
+ <label>{t('plugins.instances.form.sessionScope')}</label>
+ <input
+ type="text"
+ value={form.sessionScope}
+ placeholder={t('plugins.instances.form.sessionScopePlaceholder')}
+ onChange={e => setForm({ ...form, sessionScope: e.target.value })}
+ />
+ <label>{t('plugins.instances.form.verifyToken')}</label>
+ <input
+ type="text"
+ value={form.verifyToken}
+ placeholder={t('plugins.instances.form.verifyTokenPlaceholder')}
+ onChange={e => setForm({ ...form, verifyToken: e.target.value })}
+ />
+ <label>{t('plugins.instances.form.config')}</label>
+ <textarea
+ value={form.config}
+ placeholder={t('plugins.instances.form.configPlaceholder')}
+ onChange={e => setForm({ ...form, config: e.target.value })}
+ />
+ {formError && <p className="pi-error">{formError}</p>}
+ </div>
+ <div className="modal-footer">
+ <button className="btn-secondary" onClick={() => setShowForm(false)}>
+ {t('common.cancel')}
+ </button>
+ <button className="btn-primary" onClick={() => void submitCreate()} disabled={createM.isPending || !form.instanceId}>
+ {createM.isPending ? <Loader2 className="animate-spin" size={16} /> : t('common.create')}
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Secret-shown-once modal (after create or regenerate) */}
+ {minted && (
+ <div className="modal-overlay" onClick={() => setMinted(null)}>
+ <div className="modal" onClick={e => e.stopPropagation()}>
+ <div className="modal-header">
+ <h2>
+ {mintedKind === 'regenerated'
+ ? t('plugins.instances.regenerate.title')
+ : t('plugins.instances.created.title')}
+ </h2>
+ <button className="btn-icon" onClick={() => setMinted(null)}>
+ <X size={20} />
+ </button>
+ </div>
+ <div className="modal-body plugin-instances">
+ <p className="pi-hint">{t('plugins.instances.created.hint')}</p>
+ <label>{t('plugins.instances.created.secret')}</label>
+ <div className="pi-secret">
+ <code>{minted.secret}</code>
+ <button className="btn-primary" onClick={() => void copy(minted.secret, 'secret')}>
+ {copied === 'secret' ? <Check size={16} /> : <Copy size={16} />}
+ </button>
+ </div>
+ <label>{t('plugins.instances.created.ingressUrls')}</label>
+ {minted.ingressUrls.map(u => (
+ <div key={u.route} className="pi-secret">
+ <code>{u.url}</code>
+ <button className="btn-primary" onClick={() => void copy(u.url, `mint-${u.route}`)}>
+ {copied === `mint-${u.route}` ? <Check size={16} /> : <Copy size={16} />}
+ </button>
+ </div>
+ ))}
+ </div>
+ <div className="modal-footer">
+ <button className="btn-secondary" onClick={() => setMinted(null)}>
+ {t('common.close')}
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Edit modal — sessionScope + config */}
+ {editing && (
+ <div className="modal-overlay" onClick={() => setEditing(null)}>
+ <div className="modal" onClick={e => e.stopPropagation()}>
+ <div className="modal-header">
+ <h2>{t('plugins.instances.edit.title', { id: editing.instanceId })}</h2>
+ <button className="btn-icon" onClick={() => setEditing(null)}>
+ <X size={20} />
+ </button>
+ </div>
+ <div className="modal-body plugin-instances">
+ <label>{t('plugins.instances.form.sessionScope')}</label>
+ <input
+ type="text"
+ value={editForm.sessionScope}
+ placeholder={t('plugins.instances.form.sessionScopePlaceholder')}
+ onChange={e => setEditForm({ ...editForm, sessionScope: e.target.value })}
+ />
+ <label>{t('plugins.instances.form.config')}</label>
+ <textarea
+ value={editForm.config}
+ placeholder={t('plugins.instances.form.configPlaceholder')}
+ onChange={e => setEditForm({ ...editForm, config: e.target.value })}
+ />
+ {editError && <p className="pi-error">{editError}</p>}
+ </div>
+ <div className="modal-footer">
+ <button className="btn-secondary" onClick={() => setEditing(null)}>
+ {t('common.cancel')}
+ </button>
+ <button className="btn-primary" onClick={() => void submitEdit()} disabled={updateM.isPending}>
+ {updateM.isPending ? <Loader2 className="animate-spin" size={16} /> : t('plugins.instances.actions.save')}
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+
+ {/* Confirm modal — delete or regenerate */}
+ {confirm && (
+ <div className="modal-overlay" onClick={() => setConfirm(null)}>
+ <div className="modal confirm-modal" onClick={e => e.stopPropagation()}>
+ <div className="modal-header">
+ <h2>{t(`plugins.instances.${confirm.type}.title`)}</h2>
+ <button className="btn-icon" onClick={() => setConfirm(null)}>
+ <X size={20} />
+ </button>
+ </div>
+ <div className="modal-body plugin-instances">
+ <div className="pi-confirm-icon">
+ <AlertTriangle size={40} />
+ </div>
+ <p>{t(`plugins.instances.${confirm.type}.confirm`, { id: confirm.inst.instanceId })}</p>
+ </div>
+ <div className="modal-footer">
+ <button className="btn-secondary" onClick={() => setConfirm(null)}>
+ {t('common.cancel')}
+ </button>
+ <button
+ className={confirm.type === 'delete' ? 'btn-danger' : 'btn-primary'}
+ onClick={() => void runConfirm()}
+ >
+ {t(`plugins.instances.${confirm.type}.action`)}
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/dashboard/src/hooks/queries.ts b/dashboard/src/hooks/queries.ts
index f0b538fc8..f98abdb50 100644
--- a/dashboard/src/hooks/queries.ts
+++ b/dashboard/src/hooks/queries.ts
@@ -7,11 +7,14 @@ import {
auditApi,
infraApi,
pluginsApi,
+ pluginInstancesApi,
statsApi,
type Webhook,
type WebhookFilters,
type TemplatePayload,
type StatsPeriod,
+ type CreateInstanceInput,
+ type UpdateInstanceInput,
} from '../services/api';
// ── Query Keys ────────────────────────────────────────────────────────
@@ -28,6 +31,7 @@ export const queryKeys = {
['logs', params] as const,
infraStatus: ['infra', 'status'] as const,
plugins: ['plugins'] as const,
+ pluginInstances: (pluginId: string) => ['plugins', pluginId, 'instances'] as const,
engines: ['engines'] as const,
currentEngine: ['engines', 'current'] as const,
statsOverview: ['stats', 'overview'] as const,
@@ -255,6 +259,56 @@ export function usePluginsQuery() {
});
}
+export function usePluginInstancesQuery(pluginId: string, enabled: boolean) {
+ return useQuery({
+ queryKey: queryKeys.pluginInstances(pluginId),
+ queryFn: () => pluginInstancesApi.list(pluginId),
+ enabled,
+ staleTime: 30_000,
+ });
+}
+
+export function useCreateInstanceMutation(pluginId: string) {
+ const queryClient = useQueryClient();
+ return useMutation({
+ mutationFn: (body: CreateInstanceInput) => pluginInstancesApi.create(pluginId, body),
+ onSuccess: () => {
+ void queryClient.invalidateQueries({ queryKey: queryKeys.pluginInstances(pluginId) });
+ },
+ });
+}
+
+export function useRegenerateInstanceSecretMutation(pluginId: string) {
+ const queryClient = useQueryClient();
+ return useMutation({
+ mutationFn: (instanceId: string) => pluginInstancesApi.regenerateSecret(pluginId, instanceId),
+ onSuccess: () => {
+ void queryClient.invalidateQueries({ queryKey: queryKeys.pluginInstances(pluginId) });
+ },
+ });
+}
+
+export function useUpdateInstanceMutation(pluginId: string) {
+ const queryClient = useQueryClient();
+ return useMutation({
+ mutationFn: (params: { instanceId: string; body: UpdateInstanceInput }) =>
+ pluginInstancesApi.update(pluginId, params.instanceId, params.body),
+ onSuccess: () => {
+ void queryClient.invalidateQueries({ queryKey: queryKeys.pluginInstances(pluginId) });
+ },
+ });
+}
+
+export function useDeleteInstanceMutation(pluginId: string) {
+ const queryClient = useQueryClient();
+ return useMutation({
+ mutationFn: (instanceId: string) => pluginInstancesApi.remove(pluginId, instanceId),
+ onSuccess: () => {
+ void queryClient.invalidateQueries({ queryKey: queryKeys.pluginInstances(pluginId) });
+ },
+ });
+}
+
export function useEnginesQuery() {
return useQuery({
queryKey: queryKeys.engines,
diff --git a/dashboard/src/i18n/locales/ar.json b/dashboard/src/i18n/locales/ar.json
index aac9e5b04..d7aa5ecd7 100644
--- a/dashboard/src/i18n/locales/ar.json
+++ b/dashboard/src/i18n/locales/ar.json
@@ -778,6 +778,65 @@
"selectSession": "اختر جلسة…",
"saveOverride": "حفظ التجاوز",
"clearOverride": "مسح التجاوز"
+ },
+ "instances": {
+ "title": "المثيلات",
+ "description": "أنشئ مثيلات لكل حساب لهذا التكامل. كل مثيل له مفتاح توقيع سري وعنوان دخول خاص به.",
+ "create": "إنشاء مثيل",
+ "empty": "لا توجد مثيلات بعد. أنشئ مثيلًا للحصول على عنوان دخول ومفتاح سري.",
+ "loadError": "فشل تحميل المثيلات.",
+ "allSessions": "جميع الجلسات",
+ "enabled": "مُمكَّن",
+ "disabled": "مُعطَّل",
+ "form": {
+ "instanceId": "معرّف المثيل",
+ "instanceIdPlaceholder": "مثال: acme-support",
+ "instanceIdHint": "أحرف وأرقام وشرطات وشرطات سفلية فقط (بحد أقصى 64 حرفًا).",
+ "sessionScope": "نطاق الجلسة (اختياري)",
+ "sessionScopePlaceholder": "اتركه فارغًا لجميع الجلسات",
+ "verifyToken": "رمز التحقق (اختياري)",
+ "verifyTokenPlaceholder": "الرمز الذي يُرجعه المزوّد عند التحقق",
+ "config": "التكوين (JSON اختياري)",
+ "configPlaceholder": "{ }"
+ },
+ "created": {
+ "title": "تم إنشاء المثيل",
+ "hint": "انسخ المفتاح السري الآن — لن يُعرض مرة أخرى.",
+ "secret": "مفتاح التوقيع السري",
+ "ingressUrls": "عنوان (عناوين) الدخول"
+ },
+ "regenerate": {
+ "title": "إعادة إنشاء المفتاح السري",
+ "confirm": "هل تريد إعادة إنشاء المفتاح السري لـ {{id}}؟ سيتوقف المفتاح الحالي عن العمل فورًا.",
+ "action": "إعادة الإنشاء"
+ },
+ "edit": { "title": "تعديل {{id}}" },
+ "delete": {
+ "title": "حذف المثيل",
+ "confirm": "هل تريد حذف المثيل {{id}}؟ سيتوقف عنوان الدخول والمفتاح السري الخاصان به عن العمل فورًا.",
+ "action": "حذف"
+ },
+ "actions": {
+ "regenerate": "إعادة إنشاء المفتاح السري",
+ "edit": "تعديل",
+ "delete": "حذف",
+ "copy": "نسخ",
+ "save": "حفظ",
+ "enable": "تمكين",
+ "disable": "تعطيل"
+ },
+ "errors": {
+ "invalidId": "يجب أن يتكوّن معرّف المثيل من أحرف وأرقام وشرطات أو شرطات سفلية فقط (بحد أقصى 64 حرفًا).",
+ "invalidJson": "يجب أن يكون التكوين بصيغة JSON صحيحة.",
+ "duplicateId": "يوجد مثيل بهذا المعرّف مسبقًا."
+ },
+ "toasts": {
+ "created": "تم إنشاء المثيل",
+ "updated": "تم تحديث المثيل",
+ "deleted": "تم حذف المثيل",
+ "secretRegenerated": "تم إعادة إنشاء المفتاح السري",
+ "actionFailed": "فشل الإجراء"
+ }
}
}
}
diff --git a/dashboard/src/i18n/locales/en.json b/dashboard/src/i18n/locales/en.json
index f58f1fab6..46165ed60 100644
--- a/dashboard/src/i18n/locales/en.json
+++ b/dashboard/src/i18n/locales/en.json
@@ -774,6 +774,65 @@
"selectSession": "Select a session…",
"saveOverride": "Save override",
"clearOverride": "Clear override"
+ },
+ "instances": {
+ "title": "Instances",
+ "description": "Provision per-account instances for this integration. Each instance has its own signing secret and ingress URL.",
+ "create": "Create instance",
+ "empty": "No instances yet. Create one to get an ingress URL and secret.",
+ "loadError": "Failed to load instances.",
+ "allSessions": "All sessions",
+ "enabled": "Enabled",
+ "disabled": "Disabled",
+ "form": {
+ "instanceId": "Instance ID",
+ "instanceIdPlaceholder": "e.g. acme-support",
+ "instanceIdHint": "Letters, numbers, hyphens, underscores (max 64).",
+ "sessionScope": "Session scope (optional)",
+ "sessionScopePlaceholder": "Leave blank for all sessions",
+ "verifyToken": "Verify token (optional)",
+ "verifyTokenPlaceholder": "Token the provider echoes on verification",
+ "config": "Config (optional JSON)",
+ "configPlaceholder": "{ }"
+ },
+ "created": {
+ "title": "Instance created",
+ "hint": "Copy the secret now — it is shown only once.",
+ "secret": "Signing secret",
+ "ingressUrls": "Ingress URL(s)"
+ },
+ "regenerate": {
+ "title": "Regenerate secret",
+ "confirm": "Regenerate the signing secret for {{id}}? The current secret stops working immediately.",
+ "action": "Regenerate"
+ },
+ "edit": { "title": "Edit {{id}}" },
+ "delete": {
+ "title": "Delete instance",
+ "confirm": "Delete instance {{id}}? Its ingress URL and secret stop working immediately.",
+ "action": "Delete"
+ },
+ "actions": {
+ "regenerate": "Regenerate secret",
+ "edit": "Edit",
+ "delete": "Delete",
+ "copy": "Copy",
+ "save": "Save",
+ "enable": "Enable",
+ "disable": "Disable"
+ },
+ "errors": {
+ "invalidId": "Instance ID must be letters, numbers, hyphens or underscores (max 64).",
+ "invalidJson": "Config must be valid JSON.",
+ "duplicateId": "An instance with that ID already exists."
+ },
+ "toasts": {
+ "created": "Instance created",
+ "updated": "Instance updated",
+ "deleted": "Instance deleted",
+ "secretRegenerated": "Secret regenerated",
+ "actionFailed": "Action failed"
+ }
}
}
}
diff --git a/dashboard/src/i18n/locales/es.json b/dashboard/src/i18n/locales/es.json
index 125e957ae..1c902ed73 100644
--- a/dashboard/src/i18n/locales/es.json
+++ b/dashboard/src/i18n/locales/es.json
@@ -774,6 +774,65 @@
"selectSession": "Selecciona una sesión…",
"saveOverride": "Guardar anulación",
"clearOverride": "Borrar anulación"
+ },
+ "instances": {
+ "title": "Instancias",
+ "description": "Aprovisiona instancias por cuenta para esta integración. Cada instancia tiene su propio secreto de firma y URL de entrada.",
+ "create": "Crear instancia",
+ "empty": "Aún no hay instancias. Crea una para obtener una URL de entrada y un secreto.",
+ "loadError": "Error al cargar las instancias.",
+ "allSessions": "Todas las sesiones",
+ "enabled": "Habilitada",
+ "disabled": "Deshabilitada",
+ "form": {
+ "instanceId": "ID de instancia",
+ "instanceIdPlaceholder": "p. ej. acme-support",
+ "instanceIdHint": "Letras, números, guiones y guiones bajos (máx. 64).",
+ "sessionScope": "Ámbito de sesión (opcional)",
+ "sessionScopePlaceholder": "Déjalo en blanco para todas las sesiones",
+ "verifyToken": "Token de verificación (opcional)",
+ "verifyTokenPlaceholder": "Token que el proveedor devuelve al verificar",
+ "config": "Configuración (JSON opcional)",
+ "configPlaceholder": "{ }"
+ },
+ "created": {
+ "title": "Instancia creada",
+ "hint": "Copia el secreto ahora — solo se muestra una vez.",
+ "secret": "Secreto de firma",
+ "ingressUrls": "URL(s) de entrada"
+ },
+ "regenerate": {
+ "title": "Regenerar secreto",
+ "confirm": "¿Regenerar el secreto de firma de {{id}}? El secreto actual dejará de funcionar de inmediato.",
+ "action": "Regenerar"
+ },
+ "edit": { "title": "Editar {{id}}" },
+ "delete": {
+ "title": "Eliminar instancia",
+ "confirm": "¿Eliminar la instancia {{id}}? Su URL de entrada y secreto dejarán de funcionar de inmediato.",
+ "action": "Eliminar"
+ },
+ "actions": {
+ "regenerate": "Regenerar secreto",
+ "edit": "Editar",
+ "delete": "Eliminar",
+ "copy": "Copiar",
+ "save": "Guardar",
+ "enable": "Habilitar",
+ "disable": "Deshabilitar"
+ },
+ "errors": {
+ "invalidId": "El ID de instancia debe contener letras, números, guiones o guiones bajos (máx. 64).",
+ "invalidJson": "La configuración debe ser JSON válido.",
+ "duplicateId": "Ya existe una instancia con ese ID."
+ },
+ "toasts": {
+ "created": "Instancia creada",
+ "updated": "Instancia actualizada",
+ "deleted": "Instancia eliminada",
+ "secretRegenerated": "Secreto regenerado",
+ "actionFailed": "La acción falló"
+ }
}
}
}
diff --git a/dashboard/src/i18n/locales/fr.json b/dashboard/src/i18n/locales/fr.json
index 22a4e7545..231b2487f 100644
--- a/dashboard/src/i18n/locales/fr.json
+++ b/dashboard/src/i18n/locales/fr.json
@@ -774,6 +774,65 @@
"selectSession": "Sélectionnez une session…",
"saveOverride": "Enregistrer le remplacement",
"clearOverride": "Effacer le remplacement"
+ },
+ "instances": {
+ "title": "Instances",
+ "description": "Provisionnez des instances par compte pour cette intégration. Chaque instance dispose de son propre secret de signature et de sa propre URL d'entrée.",
+ "create": "Créer une instance",
+ "empty": "Aucune instance pour le moment. Créez-en une pour obtenir une URL d'entrée et un secret.",
+ "loadError": "Échec du chargement des instances.",
+ "allSessions": "Toutes les sessions",
+ "enabled": "Activée",
+ "disabled": "Désactivée",
+ "form": {
+ "instanceId": "ID de l'instance",
+ "instanceIdPlaceholder": "p. ex. acme-support",
+ "instanceIdHint": "Lettres, chiffres, tirets, underscores (64 max).",
+ "sessionScope": "Portée de session (facultatif)",
+ "sessionScopePlaceholder": "Laissez vide pour toutes les sessions",
+ "verifyToken": "Jeton de vérification (facultatif)",
+ "verifyTokenPlaceholder": "Jeton renvoyé par le fournisseur lors de la vérification",
+ "config": "Configuration (JSON facultatif)",
+ "configPlaceholder": "{ }"
+ },
+ "created": {
+ "title": "Instance créée",
+ "hint": "Copiez le secret maintenant — il ne sera affiché qu'une seule fois.",
+ "secret": "Secret de signature",
+ "ingressUrls": "URL(s) d'entrée"
+ },
+ "regenerate": {
+ "title": "Régénérer le secret",
+ "confirm": "Régénérer le secret de signature pour {{id}} ? Le secret actuel arrêtera de fonctionner immédiatement.",
+ "action": "Régénérer"
+ },
+ "edit": { "title": "Modifier {{id}}" },
+ "delete": {
+ "title": "Supprimer l'instance",
+ "confirm": "Supprimer l'instance {{id}} ? Son URL d'entrée et son secret arrêteront de fonctionner immédiatement.",
+ "action": "Supprimer"
+ },
+ "actions": {
+ "regenerate": "Régénérer le secret",
+ "edit": "Modifier",
+ "delete": "Supprimer",
+ "copy": "Copier",
+ "save": "Enregistrer",
+ "enable": "Activer",
+ "disable": "Désactiver"
+ },
+ "errors": {
+ "invalidId": "L'ID de l'instance doit contenir des lettres, des chiffres, des tirets ou des underscores (64 max).",
+ "invalidJson": "La configuration doit être un JSON valide.",
+ "duplicateId": "Une instance avec cet ID existe déjà."
+ },
+ "toasts": {
+ "created": "Instance créée",
+ "updated": "Instance mise à jour",
+ "deleted": "Instance supprimée",
+ "secretRegenerated": "Secret régénéré",
+ "actionFailed": "L'action a échoué"
+ }
}
}
}
diff --git a/dashboard/src/i18n/locales/he.json b/dashboard/src/i18n/locales/he.json
index 0e56f53ec..02fa86466 100644
--- a/dashboard/src/i18n/locales/he.json
+++ b/dashboard/src/i18n/locales/he.json
@@ -775,6 +775,65 @@
"selectSession": "בחירת session…",
"saveOverride": "שמירת דריסה",
"clearOverride": "ניקוי דריסה"
+ },
+ "instances": {
+ "title": "מופעים",
+ "description": "הקצו מופעים לכל חשבון עבור אינטגרציה זו. לכל מופע יש מפתח חתימה סודי וכתובת URL לקליטה משלו.",
+ "create": "יצירת מופע",
+ "empty": "אין עדיין מופעים. צרו מופע כדי לקבל כתובת URL וסוד.",
+ "loadError": "טעינת המופעים נכשלה.",
+ "allSessions": "כל ה-Sessions",
+ "enabled": "מופעל",
+ "disabled": "מושבת",
+ "form": {
+ "instanceId": "מזהה מופע",
+ "instanceIdPlaceholder": "לדוגמה: acme-support",
+ "instanceIdHint": "אותיות, מספרים, מקפים וקווים תחתונים (עד 64 תווים).",
+ "sessionScope": "טווח session (אופציונלי)",
+ "sessionScopePlaceholder": "השאירו ריק לכל ה-Sessions",
+ "verifyToken": "טוקן אימות (אופציונלי)",
+ "verifyTokenPlaceholder": "הטוקן שהספק מחזיר בעת האימות",
+ "config": "תצורה (JSON אופציונלי)",
+ "configPlaceholder": "{ }"
+ },
+ "created": {
+ "title": "המופע נוצר",
+ "hint": "העתיקו את הסוד כעת — הוא מוצג רק פעם אחת.",
+ "secret": "מפתח חתימה סודי",
+ "ingressUrls": "כתובת/כתובות URL לקליטה"
+ },
+ "regenerate": {
+ "title": "יצירת סוד מחדש",
+ "confirm": "ליצור מחדש את מפתח החתימה הסודי של {{id}}? הסוד הנוכחי יפסיק לעבוד באופן מיידי.",
+ "action": "יצירה מחדש"
+ },
+ "edit": { "title": "עריכת {{id}}" },
+ "delete": {
+ "title": "מחיקת מופע",
+ "confirm": "למחוק את המופע {{id}}? כתובת ה-URL והסוד שלו יפסיקו לעבוד באופן מיידי.",
+ "action": "מחיקה"
+ },
+ "actions": {
+ "regenerate": "יצירת סוד מחדש",
+ "edit": "עריכה",
+ "delete": "מחיקה",
+ "copy": "העתקה",
+ "save": "שמירה",
+ "enable": "הפעלה",
+ "disable": "השבתה"
+ },
+ "errors": {
+ "invalidId": "מזהה המופע חייב לכלול אותיות, מספרים, מקפים או קווים תחתונים (עד 64 תווים).",
+ "invalidJson": "התצורה חייבת להיות JSON תקין.",
+ "duplicateId": "כבר קיים מופע עם מזהה זה."
+ },
+ "toasts": {
+ "created": "המופע נוצר",
+ "updated": "המופע עודכן",
+ "deleted": "המופע נמחק",
+ "secretRegenerated": "הסוד נוצר מחדש",
+ "actionFailed": "הפעולה נכשלה"
+ }
}
}
}
diff --git a/dashboard/src/i18n/locales/it.json b/dashboard/src/i18n/locales/it.json
index 7db90d1b5..b93e5a0f7 100644
--- a/dashboard/src/i18n/locales/it.json
+++ b/dashboard/src/i18n/locales/it.json
@@ -774,6 +774,65 @@
"selectSession": "Seleziona una sessione…",
"saveOverride": "Salva override",
"clearOverride": "Rimuovi override"
+ },
+ "instances": {
+ "title": "Istanze",
+ "description": "Effettua il provisioning di istanze per account per questa integrazione. Ogni istanza ha il proprio segreto di firma e URL di ingresso.",
+ "create": "Crea istanza",
+ "empty": "Nessuna istanza ancora. Creane una per ottenere un URL di ingresso e un segreto.",
+ "loadError": "Impossibile caricare le istanze.",
+ "allSessions": "Tutte le sessioni",
+ "enabled": "Abilitata",
+ "disabled": "Disabilitata",
+ "form": {
+ "instanceId": "ID istanza",
+ "instanceIdPlaceholder": "es. acme-support",
+ "instanceIdHint": "Lettere, numeri, trattini e underscore (max 64).",
+ "sessionScope": "Ambito sessione (opzionale)",
+ "sessionScopePlaceholder": "Lascia vuoto per tutte le sessioni",
+ "verifyToken": "Token di verifica (opzionale)",
+ "verifyTokenPlaceholder": "Token che il provider restituisce durante la verifica",
+ "config": "Configurazione (JSON opzionale)",
+ "configPlaceholder": "{ }"
+ },
+ "created": {
+ "title": "Istanza creata",
+ "hint": "Copia subito il segreto — viene mostrato solo una volta.",
+ "secret": "Segreto di firma",
+ "ingressUrls": "URL di ingresso"
+ },
+ "regenerate": {
+ "title": "Rigenera segreto",
+ "confirm": "Rigenerare il segreto di firma per {{id}}? Il segreto attuale smetterà di funzionare immediatamente.",
+ "action": "Rigenera"
+ },
+ "edit": { "title": "Modifica {{id}}" },
+ "delete": {
+ "title": "Elimina istanza",
+ "confirm": "Eliminare l'istanza {{id}}? Il relativo URL di ingresso e segreto smetteranno di funzionare immediatamente.",
+ "action": "Elimina"
+ },
+ "actions": {
+ "regenerate": "Rigenera segreto",
+ "edit": "Modifica",
+ "delete": "Elimina",
+ "copy": "Copia",
+ "save": "Salva",
+ "enable": "Abilita",
+ "disable": "Disabilita"
+ },
+ "errors": {
+ "invalidId": "L'ID istanza deve contenere lettere, numeri, trattini o underscore (max 64).",
+ "invalidJson": "La configurazione deve essere un JSON valido.",
+ "duplicateId": "Esiste già un'istanza con questo ID."
+ },
+ "toasts": {
+ "created": "Istanza creata",
+ "updated": "Istanza aggiornata",
+ "deleted": "Istanza eliminata",
+ "secretRegenerated": "Segreto rigenerato",
+ "actionFailed": "Azione non riuscita"
+ }
}
}
}
diff --git a/dashboard/src/i18n/locales/pt-BR.json b/dashboard/src/i18n/locales/pt-BR.json
index 82bb65d63..5875ec45a 100644
--- a/dashboard/src/i18n/locales/pt-BR.json
+++ b/dashboard/src/i18n/locales/pt-BR.json
@@ -774,6 +774,65 @@
"selectSession": "Selecione uma sessão…",
"saveOverride": "Salvar substituição",
"clearOverride": "Limpar substituição"
+ },
+ "instances": {
+ "title": "Instâncias",
+ "description": "Provisione instâncias por conta para esta integração. Cada instância tem seu próprio segredo de assinatura e URL de entrada.",
+ "create": "Criar instância",
+ "empty": "Ainda não há instâncias. Crie uma para obter uma URL de entrada e um segredo.",
+ "loadError": "Falha ao carregar as instâncias.",
+ "allSessions": "Todas as sessões",
+ "enabled": "Habilitada",
+ "disabled": "Desabilitada",
+ "form": {
+ "instanceId": "ID da instância",
+ "instanceIdPlaceholder": "ex.: acme-support",
+ "instanceIdHint": "Letras, números, hífens e sublinhados (máx. 64).",
+ "sessionScope": "Escopo da sessão (opcional)",
+ "sessionScopePlaceholder": "Deixe em branco para todas as sessões",
+ "verifyToken": "Token de verificação (opcional)",
+ "verifyTokenPlaceholder": "Token que o provedor retorna na verificação",
+ "config": "Configuração (JSON opcional)",
+ "configPlaceholder": "{ }"
+ },
+ "created": {
+ "title": "Instância criada",
+ "hint": "Copie o segredo agora — ele é exibido apenas uma vez.",
+ "secret": "Segredo de assinatura",
+ "ingressUrls": "URL(s) de entrada"
+ },
+ "regenerate": {
+ "title": "Regenerar segredo",
+ "confirm": "Regenerar o segredo de assinatura de {{id}}? O segredo atual deixará de funcionar imediatamente.",
+ "action": "Regenerar"
+ },
+ "edit": { "title": "Editar {{id}}" },
+ "delete": {
+ "title": "Excluir instância",
+ "confirm": "Excluir a instância {{id}}? A URL de entrada e o segredo dela deixarão de funcionar imediatamente.",
+ "action": "Excluir"
+ },
+ "actions": {
+ "regenerate": "Regenerar segredo",
+ "edit": "Editar",
+ "delete": "Excluir",
+ "copy": "Copiar",
+ "save": "Salvar",
+ "enable": "Habilitar",
+ "disable": "Desabilitar"
+ },
+ "errors": {
+ "invalidId": "O ID da instância deve conter letras, números, hífens ou sublinhados (máx. 64).",
+ "invalidJson": "A configuração deve ser um JSON válido.",
+ "duplicateId": "Já existe uma instância com esse ID."
+ },
+ "toasts": {
+ "created": "Instância criada",
+ "updated": "Instância atualizada",
+ "deleted": "Instância excluída",
+ "secretRegenerated": "Segredo regenerado",
+ "actionFailed": "Falha na ação"
+ }
}
}
}
diff --git a/dashboard/src/i18n/locales/te.json b/dashboard/src/i18n/locales/te.json
index 070fb8a12..570536c9c 100644
--- a/dashboard/src/i18n/locales/te.json
+++ b/dashboard/src/i18n/locales/te.json
@@ -774,6 +774,65 @@
"selectSession": "ఒక సెషన్‌ను ఎంచుకోండి…",
"saveOverride": "ఓవర్‌రైడ్‌ను సేవ్ చేయండి",
"clearOverride": "ఓవర్‌రైడ్‌ను క్లియర్ చేయండి"
+ },
+ "instances": {
+ "title": "ఇన్‌స్టాన్స్‌లు",
+ "description": "ఈ ఇంటిగ్రేషన్ కోసం ఖాతా వారీగా ఇన్‌స్టాన్స్‌లను ప్రొవిజన్ చేయండి. ప్రతి ఇన్‌స్టాన్స్‌కు దాని స్వంత సైనింగ్ సీక్రెట్ మరియు ఇన్‌గ్రెస్ URL ఉంటుంది.",
+ "create": "ఇన్‌స్టాన్స్‌ను సృష్టించండి",
+ "empty": "ఇంకా ఇన్‌స్టాన్స్‌లు లేవు. ఇన్‌గ్రెస్ URL మరియు సీక్రెట్ పొందడానికి ఒకటి సృష్టించండి.",
+ "loadError": "ఇన్‌స్టాన్స్‌లను లోడ్ చేయడం విఫలమైంది.",
+ "allSessions": "అన్ని సెషన్‌లు",
+ "enabled": "ప్రారంభించబడింది",
+ "disabled": "నిలిపివేయబడింది",
+ "form": {
+ "instanceId": "ఇన్‌స్టాన్స్ ఐడీ",
+ "instanceIdPlaceholder": "ఉదా. acme-support",
+ "instanceIdHint": "అక్షరాలు, సంఖ్యలు, హైఫన్‌లు, అండర్‌స్కోర్‌లు (గరిష్టంగా 64).",
+ "sessionScope": "సెషన్ స్కోప్ (ఆప్షనల్)",
+ "sessionScopePlaceholder": "అన్ని సెషన్‌ల కోసం ఖాళీగా ఉంచండి",
+ "verifyToken": "వెరిఫై టోకెన్ (ఆప్షనల్)",
+ "verifyTokenPlaceholder": "వెరిఫికేషన్ సమయంలో ప్రొవైడర్ తిప్పి పంపే టోకెన్",
+ "config": "కాన్ఫిగ్ (ఆప్షనల్ JSON)",
+ "configPlaceholder": "{ }"
+ },
+ "created": {
+ "title": "ఇన్‌స్టాన్స్ సృష్టించబడింది",
+ "hint": "సీక్రెట్‌ను ఇప్పుడే కాపీ చేయండి — ఇది ఒక్కసారి మాత్రమే చూపబడుతుంది.",
+ "secret": "సైనింగ్ సీక్రెట్",
+ "ingressUrls": "ఇన్‌గ్రెస్ URL(లు)"
+ },
+ "regenerate": {
+ "title": "సీక్రెట్‌ను రీజెనరేట్ చేయండి",
+ "confirm": "{{id}} కోసం సైనింగ్ సీక్రెట్‌ను రీజెనరేట్ చేయాలా? ప్రస్తుత సీక్రెట్ వెంటనే పనిచేయడం మానేస్తుంది.",
+ "action": "రీజెనరేట్ చేయి"
+ },
+ "edit": { "title": "{{id}}ను ఎడిట్ చేయండి" },
+ "delete": {
+ "title": "ఇన్‌స్టాన్స్‌ను డిలీట్ చేయండి",
+ "confirm": "ఇన్‌స్టాన్స్ {{id}}ను డిలీట్ చేయాలా? దీని ఇన్‌గ్రెస్ URL మరియు సీక్రెట్ వెంటనే పనిచేయడం మానేస్తాయి.",
+ "action": "డిలీట్ చేయి"
+ },
+ "actions": {
+ "regenerate": "సీక్రెట్‌ను రీజెనరేట్ చేయి",
+ "edit": "ఎడిట్ చేయి",
+ "delete": "డిలీట్ చేయి",
+ "copy": "కాపీ చేయి",
+ "save": "సేవ్ చేయి",
+ "enable": "ప్రారంభించు",
+ "disable": "నిలిపివేయి"
+ },
+ "errors": {
+ "invalidId": "ఇన్‌స్టాన్స్ ఐడీలో అక్షరాలు, సంఖ్యలు, హైఫన్‌లు లేదా అండర్‌స్కోర్‌లు మాత్రమే ఉండాలి (గరిష్టంగా 64).",
+ "invalidJson": "కాన్ఫిగ్ చెల్లుబాటు అయ్యే JSON గా ఉండాలి.",
+ "duplicateId": "ఆ ఐడీతో ఇన్‌స్టాన్స్ ఇప్పటికే ఉంది."
+ },
+ "toasts": {
+ "created": "ఇన్‌స్టాన్స్ సృష్టించబడింది",
+ "updated": "ఇన్‌స్టాన్స్ అప్‌డేట్ చేయబడింది",
+ "deleted": "ఇన్‌స్టాన్స్ డిలీట్ చేయబడింది",
+ "secretRegenerated": "సీక్రెట్ రీజెనరేట్ చేయబడింది",
+ "actionFailed": "చర్య విఫలమైంది"
+ }
}
}
}
diff --git a/dashboard/src/i18n/locales/zh-CN.json b/dashboard/src/i18n/locales/zh-CN.json
index 78c45be7b..fc431842e 100644
--- a/dashboard/src/i18n/locales/zh-CN.json
+++ b/dashboard/src/i18n/locales/zh-CN.json
@@ -774,6 +774,65 @@
"selectSession": "选择一个会话…",
"saveOverride": "保存覆盖配置",
"clearOverride": "清除覆盖配置"
+ },
+ "instances": {
+ "title": "实例",
+ "description": "为此集成按账户配置实例。每个实例都有自己的签名密钥和接入 URL。",
+ "create": "创建实例",
+ "empty": "暂无实例。创建一个以获取接入 URL 和密钥。",
+ "loadError": "加载实例失败。",
+ "allSessions": "所有会话",
+ "enabled": "已启用",
+ "disabled": "已禁用",
+ "form": {
+ "instanceId": "实例 ID",
+ "instanceIdPlaceholder": "例如 acme-support",
+ "instanceIdHint": "字母、数字、连字符、下划线(最多 64 个字符)。",
+ "sessionScope": "会话范围(可选)",
+ "sessionScopePlaceholder": "留空表示所有会话",
+ "verifyToken": "验证令牌(可选)",
+ "verifyTokenPlaceholder": "服务商在验证时回传的令牌",
+ "config": "配置(可选 JSON)",
+ "configPlaceholder": "{ }"
+ },
+ "created": {
+ "title": "实例已创建",
+ "hint": "请立即复制密钥——它只会显示一次。",
+ "secret": "签名密钥",
+ "ingressUrls": "接入 URL"
+ },
+ "regenerate": {
+ "title": "重新生成密钥",
+ "confirm": "要重新生成 {{id}} 的签名密钥吗?当前密钥将立即失效。",
+ "action": "重新生成"
+ },
+ "edit": { "title": "编辑 {{id}}" },
+ "delete": {
+ "title": "删除实例",
+ "confirm": "要删除实例 {{id}} 吗?其接入 URL 和密钥将立即失效。",
+ "action": "删除"
+ },
+ "actions": {
+ "regenerate": "重新生成密钥",
+ "edit": "编辑",
+ "delete": "删除",
+ "copy": "复制",
+ "save": "保存",
+ "enable": "启用",
+ "disable": "禁用"
+ },
+ "errors": {
+ "invalidId": "实例 ID 只能包含字母、数字、连字符或下划线(最多 64 个字符)。",
+ "invalidJson": "配置必须是有效的 JSON。",
+ "duplicateId": "已存在具有该 ID 的实例。"
+ },
+ "toasts": {
+ "created": "实例已创建",
+ "updated": "实例已更新",
+ "deleted": "实例已删除",
+ "secretRegenerated": "密钥已重新生成",
+ "actionFailed": "操作失败"
+ }
}
}
}
diff --git a/dashboard/src/i18n/locales/zh-HK.json b/dashboard/src/i18n/locales/zh-HK.json
index 45fc479f8..47a874844 100644
--- a/dashboard/src/i18n/locales/zh-HK.json
+++ b/dashboard/src/i18n/locales/zh-HK.json
@@ -774,6 +774,65 @@
"selectSession": "選擇工作階段…",
"saveOverride": "儲存覆寫",
"clearOverride": "清除覆寫"
+ },
+ "instances": {
+ "title": "執行個體",
+ "description": "為此整合按帳戶佈建執行個體。每個執行個體都有專屬的簽署密鑰和連入 URL。",
+ "create": "建立執行個體",
+ "empty": "尚無執行個體。建立一個即可取得連入 URL 和密鑰。",
+ "loadError": "載入執行個體失敗。",
+ "allSessions": "所有工作階段",
+ "enabled": "已啟用",
+ "disabled": "已停用",
+ "form": {
+ "instanceId": "執行個體 ID",
+ "instanceIdPlaceholder": "例如 acme-support",
+ "instanceIdHint": "字母、數字、連字號、底線(最多 64 個字元)。",
+ "sessionScope": "工作階段範圍(選填)",
+ "sessionScopePlaceholder": "留空表示套用至所有工作階段",
+ "verifyToken": "驗證權杖(選填)",
+ "verifyTokenPlaceholder": "服務商在驗證時回傳的權杖",
+ "config": "設定(選填 JSON)",
+ "configPlaceholder": "{ }"
+ },
+ "created": {
+ "title": "執行個體已建立",
+ "hint": "請立即複製密鑰——只會顯示一次。",
+ "secret": "簽署密鑰",
+ "ingressUrls": "連入 URL"
+ },
+ "regenerate": {
+ "title": "重新產生密鑰",
+ "confirm": "要重新產生 {{id}} 的簽署密鑰嗎?目前的密鑰會立即失效。",
+ "action": "重新產生"
+ },
+ "edit": { "title": "編輯 {{id}}" },
+ "delete": {
+ "title": "刪除執行個體",
+ "confirm": "要刪除執行個體 {{id}} 嗎?其連入 URL 和密鑰會立即失效。",
+ "action": "刪除"
+ },
+ "actions": {
+ "regenerate": "重新產生密鑰",
+ "edit": "編輯",
+ "delete": "刪除",
+ "copy": "複製",
+ "save": "儲存",
+ "enable": "啟用",
+ "disable": "停用"
+ },
+ "errors": {
+ "invalidId": "執行個體 ID 只能包含字母、數字、連字號或底線(最多 64 個字元)。",
+ "invalidJson": "設定必須是有效的 JSON。",
+ "duplicateId": "已存在使用該 ID 的執行個體。"
+ },
+ "toasts": {
+ "created": "執行個體已建立",
+ "updated": "執行個體已更新",
+ "deleted": "執行個體已刪除",
+ "secretRegenerated": "密鑰已重新產生",
+ "actionFailed": "操作失敗"
+ }
}
}
}
diff --git a/dashboard/src/pages/Plugins.tsx b/dashboard/src/pages/Plugins.tsx
index 3e2404b3e..8f4be8d97 100644
--- a/dashboard/src/pages/Plugins.tsx
+++ b/dashboard/src/pages/Plugins.tsx
@@ -31,6 +31,7 @@ import { useDocumentTitle } from '../hooks/useDocumentTitle';
import { usePluginsQuery, useSessionsQuery, queryKeys } from '../hooks/queries';
import { PageHeader } from '../components/PageHeader';
import { useToast } from '../components/Toast';
+import { PluginInstances } from '../components/PluginInstances';
import './Plugins.css';
type PluginType = 'engine' | 'storage' | 'queue' | 'auth' | 'extension';
@@ -530,7 +531,7 @@ export default function Plugins() {
// Derive the open plugin from the LIVE query so the modal (esp. the Sessions tab) reflects the
// latest activeSessions/sessionConfig after a save + invalidate — not a stale open-time snapshot.
const configPlugin = configPluginId ? (plugins.find(p => p.id === configPluginId) ?? null) : null;
- const [configTab, setConfigTab] = useState<'config' | 'sessions'>('config');
+ const [configTab, setConfigTab] = useState<'config' | 'sessions' | 'instances'>('config');
const [savingConfig, setSavingConfig] = useState(false);
// Values for a schema-driven (non-engine) plugin's config form, keyed by configSchema property.
const [schemaConfig, setSchemaConfig] = useState<Record<string, unknown>>({});
@@ -1087,8 +1088,9 @@ export default function Plugins() {
configPlugin &&
(() => {
const lz = localizePlugin(configPlugin, i18n.language);
- // Session-scoped plugins get a Configuration/Sessions tab split; others keep one body.
- const showTabs = configPlugin.sessionScoped !== false;
+ // Session-scoped plugins get a Configuration/Sessions split; ingress-capable plugins add an
+ // Instances tab. Either (or both) turns the modal into a tabbed view.
+ const showTabs = configPlugin.sessionScoped !== false || configPlugin.ingressCapable;
return (
<div className="modal-overlay" onClick={() => setShowConfigModal(false)}>
<div className="modal config-modal" onClick={e => e.stopPropagation()}>
@@ -1107,17 +1109,29 @@ export default function Plugins() {
>
{t('plugins.config.tabConfig')}
</button>
- <button
- className={`modal-tab ${configTab === 'sessions' ? 'active' : ''}`}
- onClick={() => setConfigTab('sessions')}
- >
- {t('plugins.config.tabSessions')}
- </button>
+ {configPlugin.sessionScoped !== false && (
+ <button
+ className={`modal-tab ${configTab === 'sessions' ? 'active' : ''}`}
+ onClick={() => setConfigTab('sessions')}
+ >
+ {t('plugins.config.tabSessions')}
+ </button>
+ )}
+ {configPlugin.ingressCapable && (
+ <button
+ className={`modal-tab ${configTab === 'instances' ? 'active' : ''}`}
+ onClick={() => setConfigTab('instances')}
+ >
+ {t('plugins.instances.title')}
+ </button>
+ )}
</div>
)}
<div className="modal-body">
- {showTabs && configTab === 'sessions' ? (
+ {showTabs && configTab === 'instances' && configPlugin.ingressCapable ? (
+ <PluginInstances pluginId={configPlugin.id} />
+ ) : showTabs && configTab === 'sessions' && configPlugin.sessionScoped !== false ? (
<SessionsTab plugin={configPlugin} />
) : configPlugin.configUi ? (
<PluginConfigUi plugin={configPlugin} />
@@ -1145,8 +1159,10 @@ export default function Plugins() {
<button className="btn-secondary" onClick={() => setShowConfigModal(false)}>
{t('common.close')}
</button>
- {/* The Sessions tab has its own Save/Clear actions; the footer Save is config-tab only. */}
- {showTabs && configTab === 'sessions' ? null : configPlugin.configUi ? null : lz.configSchema &&
+ {/* The Sessions and Instances tabs have their own actions; the footer Save is config-tab only. */}
+ {showTabs && (configTab === 'sessions' || configTab === 'instances')
+ ? null
+ : configPlugin.configUi ? null : lz.configSchema &&
Object.keys(lz.configSchema.properties).length > 0 ? (
<button className="btn-primary" onClick={handleSaveSchemaConfig} disabled={savingConfig}>
{savingConfig ? <Loader2 size={16} className="animate-spin" /> : t('plugins.config.save')}
diff --git a/dashboard/src/services/api.ts b/dashboard/src/services/api.ts
index 86bab07a4..1ce3666bb 100644
--- a/dashboard/src/services/api.ts
+++ b/dashboard/src/services/api.ts
@@ -703,6 +703,8 @@ export interface Plugin {
config: Record<string, unknown>;
builtIn: boolean;
provides: string[];
+ /** Whether this plugin can host provisioned ingress instances (drives the Instances tab). */
+ ingressCapable: boolean;
/** Declared config fields, when the plugin exposes a schema (drives the dashboard config form). */
configSchema?: PluginConfigSchema;
/** When set, the plugin ships a sandboxed-iframe config editor (preferred over configSchema). */
@@ -796,6 +798,64 @@ export const pluginsApi = {
getCurrentEngine: () => request<{ engineType: string }>('/infra/engines/current'),
};
+// =============================================================================
+// Plugin instances API (Integration Fabric provisioning; mirrors src/modules/integration)
+// =============================================================================
+
+export interface IngressUrl {
+ route: string;
+ url: string;
+}
+
+export interface InstanceView {
+ id: string;
+ pluginId: string;
+ instanceId: string;
+ sessionScope: string | null;
+ secret: string; // '***' on reads; plaintext once on create/regenerate
+ verifyToken: string | null;
+ config: Record<string, unknown> | null;
+ enabled: boolean;
+ createdAt: string;
+ updatedAt: string;
+ ingressUrls: IngressUrl[];
+}
+
+export type MintedInstance = InstanceView; // same shape; `secret` carries the plaintext once
+
+export interface CreateInstanceInput {
+ instanceId: string;
+ sessionScope?: string;
+ verifyToken?: string;
+ config?: Record<string, unknown>;
+}
+
+export interface UpdateInstanceInput {
+ enabled?: boolean;
+ sessionScope?: string;
+ config?: Record<string, unknown>;
+}
+
+export const pluginInstancesApi = {
+ list: (pluginId: string) => request<InstanceView[]>(`/integration/plugins/${pluginId}/instances`),
+ create: (pluginId: string, body: CreateInstanceInput) =>
+ request<MintedInstance>(`/integration/plugins/${pluginId}/instances`, {
+ method: 'POST',
+ body: JSON.stringify(body),
+ }),
+ regenerateSecret: (pluginId: string, instanceId: string) =>
+ request<MintedInstance>(`/integration/plugins/${pluginId}/instances/${instanceId}/regenerate-secret`, {
+ method: 'POST',
+ }),
+ update: (pluginId: string, instanceId: string, body: UpdateInstanceInput) =>
+ request<InstanceView>(`/integration/plugins/${pluginId}/instances/${instanceId}`, {
+ method: 'PATCH',
+ body: JSON.stringify(body),
+ }),
+ remove: (pluginId: string, instanceId: string) =>
+ request<void>(`/integration/plugins/${pluginId}/instances/${instanceId}`, { method: 'DELETE' }),
+};
+
// =============================================================================
// Statistics API (mirrors src/modules/stats)
// =============================================================================
diff --git a/dashboard/src/utils/instanceForm.test.ts b/dashboard/src/utils/instanceForm.test.ts
new file mode 100644
index 000000000..f0dbd3958
--- /dev/null
+++ b/dashboard/src/utils/instanceForm.test.ts
@@ -0,0 +1,18 @@
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { isValidInstanceId, parseInstanceConfig } from './instanceForm.ts';
+
+test('isValidInstanceId accepts the backend charset, rejects the rest', () => {
+ assert.equal(isValidInstanceId('acme-support_1'), true);
+ assert.equal(isValidInstanceId(''), false);
+ assert.equal(isValidInstanceId('has space'), false);
+ assert.equal(isValidInstanceId('a'.repeat(65)), false);
+ assert.equal(isValidInstanceId('bad:colon'), false);
+});
+
+test('parseInstanceConfig: blank → undefined, object → parsed, invalid → not ok', () => {
+ assert.deepEqual(parseInstanceConfig(' '), { ok: true, value: undefined });
+ assert.deepEqual(parseInstanceConfig('{"a":1}'), { ok: true, value: { a: 1 } });
+ assert.equal(parseInstanceConfig('nope').ok, false);
+ assert.equal(parseInstanceConfig('[1,2]').ok, false); // array is not a config object
+});
diff --git a/dashboard/src/utils/instanceForm.ts b/dashboard/src/utils/instanceForm.ts
new file mode 100644
index 000000000..e89a7ba43
--- /dev/null
+++ b/dashboard/src/utils/instanceForm.ts
@@ -0,0 +1,19 @@
+export const INSTANCE_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/;
+
+export function isValidInstanceId(id: string): boolean {
+ return INSTANCE_ID_PATTERN.test(id);
+}
+
+type ParseResult = { ok: true; value: Record<string, unknown> | undefined } | { ok: false };
+
+/** Blank → no config (undefined). Otherwise must parse to a plain JSON object. */
+export function parseInstanceConfig(raw: string): ParseResult {
+ if (raw.trim() === '') return { ok: true, value: undefined };
+ try {
+ const parsed: unknown = JSON.parse(raw);
+ if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) return { ok: false };
+ return { ok: true, value: parsed as Record<string, unknown> };
+ } catch {
+ return { ok: false };
+ }
+}
diff --git a/src/modules/plugins/dto/plugin.dto.ts b/src/modules/plugins/dto/plugin.dto.ts
index 144bc320c..1261e06ac 100644
--- a/src/modules/plugins/dto/plugin.dto.ts
+++ b/src/modules/plugins/dto/plugin.dto.ts
@@ -34,6 +34,9 @@ export class PluginDto {
@ApiProperty({ description: 'Features provided by this plugin' })
provides!: string[];
+ @ApiProperty({ description: 'Whether this plugin can host provisioned ingress instances' })
+ ingressCapable!: boolean;
+
@ApiProperty({ description: 'Whether the plugin is scoped to specific sessions (false = global)' })
sessionScoped!: boolean;
diff --git a/src/modules/plugins/plugins.service.spec.ts b/src/modules/plugins/plugins.service.spec.ts
index 2c12a5bcf..dcfa7bbf5 100644
--- a/src/modules/plugins/plugins.service.spec.ts
+++ b/src/modules/plugins/plugins.service.spec.ts
@@ -5,7 +5,7 @@ import AdmZip from 'adm-zip';
import { BadRequestException } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { ModuleRef } from '@nestjs/core';
-import { PluginsService } from './plugins.service';
+import { PluginsService, isIngressCapable } from './plugins.service';
import { PluginLoaderService } from '../../core/plugins/plugin-loader.service';
import { PluginStorageService } from '../../core/plugins/plugin-storage.service';
import { PluginStatus } from '../../core/plugins/plugin.interfaces';
@@ -378,3 +378,17 @@ describe('PluginsService i18n passthrough', () => {
expect(svc.findOne('p').i18n).toBeUndefined();
});
});
+
+describe('isIngressCapable', () => {
+ it('is true when the manifest has an ingress route AND the webhook:ingress permission', () => {
+ expect(isIngressCapable({ ingress: [{ route: 'events' }], permissions: ['webhook:ingress'] })).toBe(true);
+ });
+ it('is false without an ingress route', () => {
+ expect(isIngressCapable({ ingress: [], permissions: ['webhook:ingress'] })).toBe(false);
+ expect(isIngressCapable({ permissions: ['webhook:ingress'] })).toBe(false);
+ });
+ it('is false without the webhook:ingress permission', () => {
+ expect(isIngressCapable({ ingress: [{ route: 'events' }], permissions: [] })).toBe(false);
+ expect(isIngressCapable({ ingress: [{ route: 'events' }] })).toBe(false);
+ });
+});
diff --git a/src/modules/plugins/plugins.service.ts b/src/modules/plugins/plugins.service.ts
index a69ec3eaf..0ce8e157f 100644
--- a/src/modules/plugins/plugins.service.ts
+++ b/src/modules/plugins/plugins.service.ts
@@ -20,6 +20,12 @@ import { annotateCatalog, CatalogEntry, CatalogPlugin } from './catalog';
/** Cap on the catalog JSON download (the catalog is small; this bounds a hostile response). */
const CATALOG_MAX_BYTES = 1 * 1024 * 1024;
+/** A plugin can host provisioned instances iff it declares an ingress route AND the webhook:ingress
+ * permission — mirrors IntegrationInstanceController.assertIngressCapable. */
+export function isIngressCapable(manifest: { ingress?: unknown[]; permissions?: string[] }): boolean {
+ return (manifest.ingress?.length ?? 0) > 0 && (manifest.permissions ?? []).includes('webhook:ingress');
+}
+
@Injectable()
export class PluginsService {
constructor(
@@ -58,6 +64,7 @@ export class PluginsService {
config: redactSecretConfig(plugin.config, plugin.manifest.configSchema),
builtIn: this.pluginLoader.isBuiltIn(plugin.manifest.id),
provides: plugin.manifest.provides ?? [],
+ ingressCapable: isIngressCapable(plugin.manifest),
configSchema: plugin.manifest.configSchema,
configUi: plugin.manifest.configUi,
i18n: plugin.manifest.i18n,
@@ -88,6 +95,7 @@ export class PluginsService {
config: redactSecretConfig(plugin.config, plugin.manifest.configSchema),
builtIn: this.pluginLoader.isBuiltIn(plugin.manifest.id),
provides: plugin.manifest.provides ?? [],
+ ingressCapable: isIngressCapable(plugin.manifest),
configSchema: plugin.manifest.configSchema,
configUi: plugin.manifest.configUi,
i18n: plugin.manifest.i18n,