{ "version": "1.0.0", "layout_name": "plugin_settings", "permissions": [ "core.plugins.update" ], "extends": "_admin_base", "meta": { "title": "$t:sirsoft-tosspayments.settings.title", "description": "$t:sirsoft-tosspayments.settings.description" }, "data_sources": [ { "id": "settings", "type": "api", "endpoint": "/api/admin/plugins/{{route.identifier}}/settings", "method": "GET", "auto_fetch": true, "auth_required": true, "initLocal": "form", "refetchOnMount": true } ], "slots": { "content": [ { "id": "plugin_settings_content", "type": "basic", "name": "Div", "blur_until_loaded": "{{_local.isSaving}}", "dataKey": "form", "trackChanges": true, "props": { "className": "p-4 sm:p-6 lg:p-8 bg-gray-50 dark:bg-gray-900 min-h-screen" }, "children": [ { "id": "page_header", "type": "composite", "name": "PageHeader", "props": { "title": "$t:sirsoft-tosspayments.settings.title", "description": "$t:sirsoft-tosspayments.settings.description", "backPath": "/admin/plugins", "backLabel": "$t:admin.plugins.back_to_list" } }, { "id": "validation_error", "type": "basic", "name": "Div", "if": "{{_local.errors}}", "props": { "className": "bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 mt-6" }, "children": [ { "type": "basic", "name": "Div", "props": { "className": "flex gap-3" }, "children": [ { "type": "basic", "name": "Icon", "props": { "name": "triangle-exclamation", "className": "w-5 h-5 text-red-600 dark:text-red-400 flex-shrink-0 mt-0.5" } }, { "type": "basic", "name": "Div", "children": [ { "type": "basic", "name": "H3", "props": { "className": "text-sm font-medium text-red-800 dark:text-red-200" }, "text": "$t:admin.plugins.settings.validation_error" }, { "type": "basic", "name": "Ul", "if": "{{typeof _local.errors === 'object' && Object.keys(_local.errors).length > 0}}", "props": { "className": "mt-2 list-disc list-inside space-y-1" }, "iteration": { "source": "Object.entries(_local.errors ?? {}).flatMap(([field, messages]) => Array.isArray(messages) ? messages : [messages])", "item_var": "message" }, "children": [ { "type": "basic", "name": "Li", "props": { "className": "text-sm text-red-700 dark:text-red-300" }, "text": "{{message}}" } ] } ] } ] } ] }, { "id": "test_mode_card", "type": "basic", "name": "Div", "props": { "className": "mt-6 bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700" }, "children": [ { "type": "basic", "name": "Div", "props": { "className": "p-6" }, "children": [ { "id": "field_test_mode", "type": "basic", "name": "Div", "props": { "className": "flex items-center justify-between" }, "children": [ { "type": "basic", "name": "Div", "children": [ { "type": "basic", "name": "Label", "props": { "className": "block text-sm font-medium text-gray-700 dark:text-gray-300" }, "text": "$t:sirsoft-tosspayments.settings.test_mode" }, { "type": "basic", "name": "P", "props": { "className": "mt-1 text-xs text-gray-500 dark:text-gray-400" }, "text": "$t:sirsoft-tosspayments.settings.test_mode_hint" } ] }, { "type": "composite", "name": "Toggle", "props": { "name": "is_test_mode" } } ] } ] } ] }, { "id": "test_keys_section", "type": "basic", "name": "Div", "props": { "className": "mt-6 bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700" }, "children": [ { "type": "basic", "name": "Div", "props": { "className": "px-6 py-4 border-b border-gray-200 dark:border-gray-700" }, "children": [ { "type": "basic", "name": "H3", "props": { "className": "text-base font-semibold text-gray-900 dark:text-white" }, "text": "$t:sirsoft-tosspayments.settings.section_test_keys" } ] }, { "type": "basic", "name": "Div", "props": { "className": "p-6 space-y-6" }, "children": [ { "id": "field_test_client_key", "type": "basic", "name": "Div", "props": { "className": "grid grid-cols-1 lg:grid-cols-3 gap-4 items-start" }, "children": [ { "type": "basic", "name": "Div", "props": { "className": "lg:col-span-1" }, "children": [ { "type": "basic", "name": "Label", "props": { "className": "block text-sm font-medium text-gray-700 dark:text-gray-300" }, "text": "$t:sirsoft-tosspayments.settings.test_client_key" }, { "type": "basic", "name": "P", "props": { "className": "mt-1 text-xs text-gray-500 dark:text-gray-400" }, "text": "$t:sirsoft-tosspayments.settings.test_client_key_hint" } ] }, { "type": "basic", "name": "Div", "props": { "className": "lg:col-span-2" }, "children": [ { "type": "basic", "name": "Input", "props": { "type": "text", "name": "test_client_key", "placeholder": "test_ck_...", "className": "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent font-mono text-sm" } } ] } ] }, { "id": "field_test_secret_key", "type": "basic", "name": "Div", "props": { "className": "grid grid-cols-1 lg:grid-cols-3 gap-4 items-start" }, "children": [ { "type": "basic", "name": "Div", "props": { "className": "lg:col-span-1" }, "children": [ { "type": "basic", "name": "Label", "props": { "className": "block text-sm font-medium text-gray-700 dark:text-gray-300" }, "text": "$t:sirsoft-tosspayments.settings.test_secret_key" }, { "type": "basic", "name": "P", "props": { "className": "mt-1 text-xs text-gray-500 dark:text-gray-400" }, "text": "$t:sirsoft-tosspayments.settings.test_secret_key_hint" } ] }, { "type": "basic", "name": "Div", "props": { "className": "lg:col-span-2" }, "children": [ { "type": "basic", "name": "Input", "props": { "type": "password", "name": "test_secret_key", "placeholder": "test_sk_...", "className": "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent font-mono text-sm" } } ] } ] } ] } ] }, { "id": "live_keys_section", "type": "basic", "name": "Div", "props": { "className": "mt-6 bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700" }, "children": [ { "type": "basic", "name": "Div", "props": { "className": "px-6 py-4 border-b border-gray-200 dark:border-gray-700" }, "children": [ { "type": "basic", "name": "H3", "props": { "className": "text-base font-semibold text-gray-900 dark:text-white" }, "text": "$t:sirsoft-tosspayments.settings.section_live_keys" } ] }, { "type": "basic", "name": "Div", "props": { "className": "p-6 space-y-6" }, "children": [ { "id": "field_live_client_key", "type": "basic", "name": "Div", "props": { "className": "grid grid-cols-1 lg:grid-cols-3 gap-4 items-start" }, "children": [ { "type": "basic", "name": "Div", "props": { "className": "lg:col-span-1" }, "children": [ { "type": "basic", "name": "Label", "props": { "className": "block text-sm font-medium text-gray-700 dark:text-gray-300" }, "text": "$t:sirsoft-tosspayments.settings.live_client_key" } ] }, { "type": "basic", "name": "Div", "props": { "className": "lg:col-span-2" }, "children": [ { "type": "basic", "name": "Input", "props": { "type": "text", "name": "live_client_key", "placeholder": "live_ck_...", "className": "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent font-mono text-sm" } } ] } ] }, { "id": "field_live_secret_key", "type": "basic", "name": "Div", "props": { "className": "grid grid-cols-1 lg:grid-cols-3 gap-4 items-start" }, "children": [ { "type": "basic", "name": "Div", "props": { "className": "lg:col-span-1" }, "children": [ { "type": "basic", "name": "Label", "props": { "className": "block text-sm font-medium text-gray-700 dark:text-gray-300" }, "text": "$t:sirsoft-tosspayments.settings.live_secret_key" }, { "type": "basic", "name": "P", "props": { "className": "mt-1 text-xs text-gray-500 dark:text-gray-400" }, "text": "$t:sirsoft-tosspayments.settings.live_secret_key_hint" } ] }, { "type": "basic", "name": "Div", "props": { "className": "lg:col-span-2" }, "children": [ { "type": "basic", "name": "Input", "props": { "type": "password", "name": "live_secret_key", "placeholder": "live_sk_...", "className": "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent font-mono text-sm" } } ] } ] } ] } ] }, { "id": "redirect_section", "type": "basic", "name": "Div", "props": { "className": "mt-6 bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700" }, "children": [ { "type": "basic", "name": "Div", "props": { "className": "px-6 py-4 border-b border-gray-200 dark:border-gray-700" }, "children": [ { "type": "basic", "name": "H3", "props": { "className": "text-base font-semibold text-gray-900 dark:text-white" }, "text": "$t:sirsoft-tosspayments.settings.section_redirect" } ] }, { "type": "basic", "name": "Div", "props": { "className": "p-6 space-y-6" }, "children": [ { "id": "field_redirect_success_url", "type": "basic", "name": "Div", "props": { "className": "grid grid-cols-1 lg:grid-cols-3 gap-4 items-start" }, "children": [ { "type": "basic", "name": "Div", "props": { "className": "lg:col-span-1" }, "children": [ { "type": "basic", "name": "Label", "props": { "className": "block text-sm font-medium text-gray-700 dark:text-gray-300" }, "text": "$t:sirsoft-tosspayments.settings.redirect_success_url" }, { "type": "basic", "name": "P", "props": { "className": "mt-1 text-xs text-gray-500 dark:text-gray-400" }, "text": "$t:sirsoft-tosspayments.settings.redirect_success_url_hint" } ] }, { "type": "basic", "name": "Div", "props": { "className": "lg:col-span-2" }, "children": [ { "type": "basic", "name": "Input", "props": { "type": "text", "name": "redirect_success_url", "placeholder": "/shop/orders/{orderId}/complete", "className": "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm" } } ] } ] }, { "id": "field_redirect_fail_url", "type": "basic", "name": "Div", "props": { "className": "grid grid-cols-1 lg:grid-cols-3 gap-4 items-start" }, "children": [ { "type": "basic", "name": "Div", "props": { "className": "lg:col-span-1" }, "children": [ { "type": "basic", "name": "Label", "props": { "className": "block text-sm font-medium text-gray-700 dark:text-gray-300" }, "text": "$t:sirsoft-tosspayments.settings.redirect_fail_url" }, { "type": "basic", "name": "P", "props": { "className": "mt-1 text-xs text-gray-500 dark:text-gray-400" }, "text": "$t:sirsoft-tosspayments.settings.redirect_fail_url_hint" } ] }, { "type": "basic", "name": "Div", "props": { "className": "lg:col-span-2" }, "children": [ { "type": "basic", "name": "Input", "props": { "type": "text", "name": "redirect_fail_url", "placeholder": "/shop/checkout", "className": "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm" } } ] } ] } ] } ] }, { "id": "footer_buttons", "type": "basic", "name": "Div", "props": { "className": "flex justify-end gap-3 mt-6" }, "children": [ { "id": "cancel_button", "type": "basic", "name": "Button", "props": { "className": "px-4 py-2 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 font-medium transition-colors" }, "actions": [ { "type": "click", "handler": "navigate", "params": { "path": "/admin/plugins" } } ], "children": [ { "type": "basic", "name": "Span", "text": "$t:common.cancel" } ] }, { "id": "save_button", "type": "basic", "name": "Button", "props": { "disabled": "{{!_local.hasChanges || _local.isSaving}}", "className": "flex items-center gap-1.5 px-4 py-2 bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded-lg hover:bg-gray-800 dark:hover:bg-gray-100 font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed" }, "actions": [ { "type": "click", "handler": "sequence", "actions": [ { "handler": "setState", "params": { "target": "local", "isSaving": true, "errors": null } }, { "handler": "apiCall", "auth_required": true, "target": "/api/admin/plugins/{{route.identifier}}/settings", "params": { "method": "PUT", "body": "{{_local.form}}" }, "onSuccess": [ { "handler": "setState", "params": { "target": "local", "isSaving": false, "hasChanges": false } }, { "handler": "toast", "params": { "type": "success", "message": "$t:admin.plugins.settings.save_success" } }, { "handler": "refetchDataSource", "params": { "dataSourceId": "settings" } } ], "onError": [ { "handler": "setState", "params": { "target": "local", "isSaving": false, "errors": "{{$error.errors}}" } }, { "handler": "toast", "params": { "type": "error", "message": "$t:admin.plugins.settings.save_error" } } ] } ] } ], "children": [ { "type": "basic", "name": "Icon", "if": "{{_local.isSaving}}", "props": { "name": "spinner", "className": "w-4 h-4 animate-spin" } }, { "type": "basic", "name": "Span", "if": "{{!_local.isSaving}}", "text": "$t:common.save" }, { "type": "basic", "name": "Span", "if": "{{_local.isSaving}}", "text": "$t:common.saving" } ] } ] } ] } ] }, "schema": { "is_test_mode": { "type": "boolean", "default": true, "label": "$t:sirsoft-tosspayments.settings.test_mode", "hint": "$t:sirsoft-tosspayments.settings.test_mode_hint" }, "test_client_key": { "type": "string", "default": "", "label": "$t:sirsoft-tosspayments.settings.test_client_key", "hint": "$t:sirsoft-tosspayments.settings.test_client_key_hint" }, "test_secret_key": { "type": "string", "default": "", "sensitive": true, "label": "$t:sirsoft-tosspayments.settings.test_secret_key", "hint": "$t:sirsoft-tosspayments.settings.test_secret_key_hint" }, "live_client_key": { "type": "string", "default": "", "label": "$t:sirsoft-tosspayments.settings.live_client_key" }, "live_secret_key": { "type": "string", "default": "", "sensitive": true, "label": "$t:sirsoft-tosspayments.settings.live_secret_key", "hint": "$t:sirsoft-tosspayments.settings.live_secret_key_hint" }, "redirect_success_url": { "type": "string", "default": "/shop/orders/{orderId}/complete", "label": "$t:sirsoft-tosspayments.settings.redirect_success_url", "hint": "$t:sirsoft-tosspayments.settings.redirect_success_url_hint" }, "redirect_fail_url": { "type": "string", "default": "/shop/checkout", "label": "$t:sirsoft-tosspayments.settings.redirect_fail_url", "hint": "$t:sirsoft-tosspayments.settings.redirect_fail_url_hint" } } }