diff --git a/.github/workflows/ui-layer.yml b/.github/workflows/ui-layer.yml
index 92a9ff9..0ab6fb2 100644
--- a/.github/workflows/ui-layer.yml
+++ b/.github/workflows/ui-layer.yml
@@ -17,7 +17,7 @@ jobs:
- uses: actions/checkout@v4
with:
repository: trakli/webui
- ref: eacbb7ec8f04c0444be272671dee127d3c8b48c1
+ ref: 5caf9d16b0cfb392b2d6ddb42930c98cb4b03caf
path: .host-ui
- uses: actions/setup-node@v4
with:
diff --git a/src/CloudIntegration.php b/src/CloudIntegration.php
index 1979625..52fbf08 100644
--- a/src/CloudIntegration.php
+++ b/src/CloudIntegration.php
@@ -37,8 +37,14 @@ public function isConfigured(): bool
public function ui(): array
{
return [
- 'slots' => ['settings.integrations', 'sidebar.nav'],
+ 'slots' => ['settings.integrations', 'settings.tabs'],
'card' => ['title' => 'Premium', 'cta' => 'Manage plan', 'href' => '/billing'],
+ 'tab' => [
+ 'key' => 'billing',
+ 'title' => 'Plan and billing',
+ 'component' => 'cloud.settings',
+ 'order' => 10,
+ ],
'show_when_unconfigured' => true,
];
}
diff --git a/ui/README.md b/ui/README.md
index 66303fe..02553a7 100644
--- a/ui/README.md
+++ b/ui/README.md
@@ -1,7 +1,7 @@
# Trakli billing UI layer
-Include this directory in the host web UI's `TRAKLI_UI_LAYERS` setting and enable the matching backend plugin. The layer supplies the authenticated `/billing` page, English messages and billing flow tests.
+Include this directory in the host web UI's `TRAKLI_UI_LAYERS` setting and enable the matching backend plugin. The layer supplies the Plan and billing tab in Settings, English messages and billing flow tests. `/billing` redirects to that tab and keeps its query, so checkout and portal returns still arrive.
-Yearly billing is selected by default. Checkout and portal returns retain the existing billing address. Bank management is shown only when a bank UI layer supplies its route.
+Yearly billing is selected by default. Checkout and portal returns retain the existing billing address. Bank management is shown only when a bank UI layer is installed.
Run the host web UI's lint, format, tests and build with this layer enabled. The host provides authentication, API access, components and layout.
diff --git a/ui/components/BillingSettings.vue b/ui/components/BillingSettings.vue
new file mode 100644
index 0000000..ee6f619
--- /dev/null
+++ b/ui/components/BillingSettings.vue
@@ -0,0 +1,536 @@
+
+
{{ t('Plans are not available in your region yet.') }}
+
+
+ {{ t('A {days}-day trial is available once per account.', { days: pricing.trial_days }) }}
+
+
+
+
+
+
+
+
+
diff --git a/ui/i18n/locales/en.json b/ui/i18n/locales/en.json
index ae845f5..2083f4b 100644
--- a/ui/i18n/locales/en.json
+++ b/ui/i18n/locales/en.json
@@ -1,27 +1,40 @@
{
- "A three-day trial is available once per account.": "A three-day trial is available once per account.",
- "Bank": "Bank",
- "Bank connection limit": "Bank connection limit",
+ "A {days}-day trial is available once per account.": "A {days}-day trial is available once per account.",
+ "Active": "Active",
+ "Bank connections": "Bank connections",
"Billing period": "Billing period",
+ "Cancelled": "Cancelled",
"Checkout cancelled. Your current plan is unchanged.": "Checkout cancelled. Your current plan is unchanged.",
+ "Complimentary": "Complimentary",
+ "Could not load your plan": "Could not load your plan",
+ "Custom categories": "Custom categories",
+ "Dismiss": "Dismiss",
+ "Free": "Free",
"Free plan": "Free plan",
+ "Loading your plan": "Loading your plan",
"Manage banks": "Manage banks",
"Manage billing": "Manage billing",
- "Month": "Month",
+ "Monthly": "Monthly",
"Monthly model usage": "Monthly model usage",
- "New custom category limit": "New custom category limit",
- "Paid access active": "Paid access active",
- "Paid through": "Paid through",
+ "Paid plan": "Paid plan",
+ "Paid through {date}": "Paid through {date}",
"Payment confirmation is pending. Refresh your status before connecting a bank.": "Payment confirmation is pending. Refresh your status before connecting a bank.",
+ "Payment confirmed. Paid access is active.": "Payment confirmed. Paid access is active.",
+ "Payment due": "Payment due",
+ "Plan and billing": "Plan and billing",
+ "Plans are not available in your region yet.": "Plans are not available in your region yet.",
"Pricing region": "Pricing region",
"Refresh status": "Refresh status",
- "Resets": "Resets",
- "Subscription status": "Subscription status",
+ "Resets {date} (UTC)": "Resets {date} (UTC)",
+ "Trial": "Trial",
+ "Try again": "Try again",
"Unlimited": "Unlimited",
"Upgrade": "Upgrade",
+ "Upgrade for more room": "Upgrade for more room",
"Upgrade for unlimited wallets, categories and bank connections, plus 100,000 model tokens each month.": "Upgrade for unlimited wallets, categories and bank connections, plus 100,000 model tokens each month.",
- "Wallet limit": "Wallet limit",
- "Year": "Year",
- "Your plan": "Your plan",
+ "Wallets": "Wallets",
+ "Yearly": "Yearly",
+ "per month": "per month",
+ "per year": "per year",
"tokens": "tokens"
}
diff --git a/ui/pages/billing.vue b/ui/pages/billing.vue
index cbf4634..2160875 100644
--- a/ui/pages/billing.vue
+++ b/ui/pages/billing.vue
@@ -1,209 +1,9 @@
-