diff --git a/.gitignore b/.gitignore
index 753389d1..de893d0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,45 +1,46 @@
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-
-# dependencies
-node_modules
-.pnp
-.pnp.js
-.pnpm-store
-package-lock.json
-
-# testing
-/coverage
-
-# next.js
-/.next
-/out
-
-# production
-/build
-/public/script.js
-/geo
-/dist
-/generated
-/src/generated
-
-# misc
-.DS_Store
-.idea
-.yarn
-*.iml
-*.log
-.vscode
-.tool-versions
-
-# debug
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-
-# local env files
-.env
-.env.*
-*.env.*
-
-*.dev.yml
-
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+node_modules
+.pnp
+.pnp.js
+.pnpm-store
+package-lock.json
+
+# testing
+/coverage
+
+# next.js
+/.next
+/out
+
+# production
+/build
+/public/script.js
+/geo
+/dist
+/generated
+/src/generated
+pm2.yml
+
+# misc
+.DS_Store
+.idea
+.yarn
+*.iml
+*.log
+.vscode
+.tool-versions
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# local env files
+.env
+.env.*
+*.env.*
+
+*.dev.yml
+
diff --git a/next.config.ts b/next.config.ts
index 99dcca0d..1a4e2e0e 100644
--- a/next.config.ts
+++ b/next.config.ts
@@ -8,6 +8,7 @@ const cloudMode = process.env.CLOUD_MODE || '';
const cloudUrl = process.env.CLOUD_URL || '';
const collectApiEndpoint = process.env.COLLECT_API_ENDPOINT || '';
const corsMaxAge = process.env.CORS_MAX_AGE || '';
+const defaultCurrency = process.env.DEFAULT_CURRENCY || '';
const defaultLocale = process.env.DEFAULT_LOCALE || '';
const forceSSL = process.env.FORCE_SSL || '';
const frameAncestors = process.env.ALLOWED_FRAME_URLS || '';
@@ -170,6 +171,7 @@ export default {
cloudMode,
cloudUrl,
currentVersion: pkg.version,
+ defaultCurrency,
defaultLocale,
},
basePath,
diff --git a/public/intl/messages/zh-CN.json b/public/intl/messages/zh-CN.json
index b3d2f3c0..a4ad51fa 100644
--- a/public/intl/messages/zh-CN.json
+++ b/public/intl/messages/zh-CN.json
@@ -5,6 +5,18 @@
"value": "访问代码"
}
],
+ "label.account": [
+ {
+ "type": 0,
+ "value": "账户"
+ }
+ ],
+ "label.action": [
+ {
+ "type": 0,
+ "value": "行为"
+ }
+ ],
"label.actions": [
{
"type": 0,
@@ -35,12 +47,24 @@
"value": "添加描述"
}
],
+ "label.add-link": [
+ {
+ "type": 0,
+ "value": "添加链接"
+ }
+ ],
"label.add-member": [
{
"type": 0,
"value": "添加成员"
}
],
+ "label.add-pixel": [
+ {
+ "type": 0,
+ "value": "添加像素"
+ }
+ ],
"label.add-step": [
{
"type": 0,
@@ -83,12 +107,24 @@
"value": "所有时间段"
}
],
+ "label.analysis": [
+ {
+ "type": 0,
+ "value": "分析"
+ }
+ ],
"label.analytics": [
{
"type": 0,
"value": "分析"
}
],
+ "label.application": [
+ {
+ "type": 0,
+ "value": "应用"
+ }
+ ],
"label.apply": [
{
"type": 0,
@@ -107,6 +143,12 @@
"value": "查看用户如何与您的营销互动,以及是什么促成了转化。"
}
],
+ "label.audience": [
+ {
+ "type": 0,
+ "value": "受众"
+ }
+ ],
"label.average": [
{
"type": 0,
@@ -125,6 +167,12 @@
"value": "之前"
}
],
+ "label.behavior": [
+ {
+ "type": 0,
+ "value": "行为"
+ }
+ ],
"label.boards": [
{
"type": 0,
@@ -173,12 +221,24 @@
"value": "修改密码"
}
],
+ "label.channel": [
+ {
+ "type": 0,
+ "value": "渠道"
+ }
+ ],
"label.channels": [
{
"type": 0,
"value": "渠道"
}
],
+ "label.chart": [
+ {
+ "type": 0,
+ "value": "图表"
+ }
+ ],
"label.cities": [
{
"type": 0,
@@ -203,6 +263,12 @@
"value": "队列"
}
],
+ "label.cohorts": [
+ {
+ "type": 0,
+ "value": "队列"
+ }
+ ],
"label.compare": [
{
"type": 0,
@@ -317,6 +383,12 @@
"value": "创建者"
}
],
+ "label.criteria": [
+ {
+ "type": 0,
+ "value": "条件"
+ }
+ ],
"label.currency": [
{
"type": 0,
@@ -419,6 +491,12 @@
"value": "台式机"
}
],
+ "label.destination-url": [
+ {
+ "type": 0,
+ "value": "目标URL"
+ }
+ ],
"label.details": [
{
"type": 0,
@@ -455,6 +533,12 @@
"value": "唯一ID"
}
],
+ "label.documentation": [
+ {
+ "type": 0,
+ "value": "文档"
+ }
+ ],
"label.does-not-contain": [
{
"type": 0,
@@ -479,6 +563,12 @@
"value": "域名"
}
],
+ "label.download": [
+ {
+ "type": 0,
+ "value": "下载"
+ }
+ ],
"label.dropoff": [
{
"type": 0,
@@ -506,7 +596,7 @@
"label.email": [
{
"type": 0,
- "value": "Email"
+ "value": "邮箱"
}
],
"label.enable-share-url": [
@@ -527,6 +617,12 @@
"value": "入口 URL"
}
],
+ "label.environment": [
+ {
+ "type": 0,
+ "value": "环境"
+ }
+ ],
"label.event": [
{
"type": 0,
@@ -671,6 +767,12 @@
"value": "分组"
}
],
+ "label.growth": [
+ {
+ "type": 0,
+ "value": "增长"
+ }
+ ],
"label.hostname": [
{
"type": 0,
@@ -701,6 +803,12 @@
"value": "通过使用筛选器和划分时间段来更深入地研究数据。"
}
],
+ "label.invalid-url": [
+ {
+ "type": 0,
+ "value": "无效URL"
+ }
+ ],
"label.is": [
{
"type": 0,
@@ -863,12 +971,24 @@
"value": "少于等于"
}
],
+ "label.link": [
+ {
+ "type": 0,
+ "value": "链接"
+ }
+ ],
"label.links": [
{
"type": 0,
"value": "链接"
}
],
+ "label.location": [
+ {
+ "type": 0,
+ "value": "位置"
+ }
+ ],
"label.login": [
{
"type": 0,
@@ -1020,7 +1140,7 @@
"label.online": [
{
"type": 0,
- "value": "Online"
+ "value": "在线"
}
],
"label.organic-search": [
@@ -1165,6 +1285,12 @@
"value": "路径"
}
],
+ "label.pixel": [
+ {
+ "type": 0,
+ "value": "像素"
+ }
+ ],
"label.pixels": [
{
"type": 0,
@@ -1185,6 +1311,12 @@
"value": " 提供支持"
}
],
+ "label.preferences": [
+ {
+ "type": 0,
+ "value": "偏好"
+ }
+ ],
"label.previous": [
{
"type": 0,
@@ -1209,6 +1341,12 @@
"value": "个人资料"
}
],
+ "label.profiles": [
+ {
+ "type": 0,
+ "value": "个人资料"
+ }
+ ],
"label.properties": [
{
"type": 0,
@@ -1248,7 +1386,7 @@
"label.referral": [
{
"type": 0,
- "value": "Referral"
+ "value": "来源"
}
],
"label.referrer": [
@@ -1371,6 +1509,24 @@
"value": "保存"
}
],
+ "label.save-cohort": [
+ {
+ "type": 0,
+ "value": "保存为群组"
+ }
+ ],
+ "label.save-segment": [
+ {
+ "type": 0,
+ "value": "保存为细分"
+ }
+ ],
+ "label.screen": [
+ {
+ "type": 0,
+ "value": "屏幕"
+ }
+ ],
"label.screens": [
{
"type": 0,
@@ -1383,6 +1539,18 @@
"value": "搜索"
}
],
+ "label.segment": [
+ {
+ "type": 0,
+ "value": "细分"
+ }
+ ],
+ "label.segments": [
+ {
+ "type": 0,
+ "value": "细分"
+ }
+ ],
"label.select": [
{
"type": 0,
@@ -1485,6 +1653,24 @@
"value": "总和"
}
],
+ "label.support": [
+ {
+ "type": 0,
+ "value": "支持"
+ }
+ ],
+ "label.switch-account": [
+ {
+ "type": 0,
+ "value": "切换账户"
+ }
+ ],
+ "label.table": [
+ {
+ "type": 0,
+ "value": "表格"
+ }
+ ],
"label.tablet": [
{
"type": 0,
@@ -1635,6 +1821,12 @@
"value": "跟踪代码"
}
],
+ "label.traffic": [
+ {
+ "type": 0,
+ "value": "流量"
+ }
+ ],
"label.transactions": [
{
"type": 0,
@@ -1846,7 +2038,7 @@
"message.bad-request": [
{
"type": 0,
- "value": "Bad request"
+ "value": "请求错误"
}
],
"message.collected-data": [
@@ -1946,7 +2138,7 @@
"message.forbidden": [
{
"type": 0,
- "value": "Forbidden"
+ "value": "禁止访问"
}
],
"message.go-to-settings": [
@@ -2046,13 +2238,13 @@
"message.not-found": [
{
"type": 0,
- "value": "Not found"
+ "value": "未找到"
}
],
"message.nothing-selected": [
{
"type": 0,
- "value": "Nothing selected."
+ "value": "未选择"
}
],
"message.page-not-found": [
@@ -2090,7 +2282,7 @@
"message.sever-error": [
{
"type": 0,
- "value": "Server error"
+ "value": "服务器错误"
}
],
"message.share-url": [
@@ -2158,7 +2350,7 @@
"message.unauthorized": [
{
"type": 0,
- "value": "Unauthorized"
+ "value": "未授权"
}
],
"message.user-deleted": [
diff --git a/public/iso-3166-2.json b/public/iso-3166-2.json
index 347313d7..2b3b5a80 100644
--- a/public/iso-3166-2.json
+++ b/public/iso-3166-2.json
@@ -6,13 +6,13 @@
"AD-06": "Sant Julia de Loria",
"AD-07": "Andorra la Vella",
"AD-08": "Escaldes-Engordany",
- "AE-AJ": "'Ajman",
- "AE-AZ": "Abu Zaby",
- "AE-DU": "Dubayy",
- "AE-FU": "Al Fujayrah",
- "AE-RK": "Ra's al Khaymah",
- "AE-SH": "Ash Shariqah",
- "AE-UQ": "Umm al Qaywayn",
+ "AE-AJ": "Ajman",
+ "AE-AZ": "Abu Dhabi",
+ "AE-DU": "Dubai",
+ "AE-FU": "Al Fujairah",
+ "AE-RK": "Ras al Khaimah",
+ "AE-SH": "Sharjah",
+ "AE-UQ": "Umm al Quwain",
"AF-BAL": "Balkh",
"AF-BAM": "Bamyan",
"AF-BDG": "Badghis",
diff --git a/src/app/(main)/links/LinkEditForm.tsx b/src/app/(main)/links/LinkEditForm.tsx
index 6c10c7f0..e9ad18f4 100644
--- a/src/app/(main)/links/LinkEditForm.tsx
+++ b/src/app/(main)/links/LinkEditForm.tsx
@@ -4,13 +4,14 @@ import {
Form,
FormField,
FormSubmitButton,
+ Grid,
Icon,
Label,
Loading,
Row,
TextField,
} from '@umami/react-zen';
-import { useEffect, useState } from 'react';
+import { useState } from 'react';
import { useConfig, useLinkQuery, useMessages } from '@/components/hooks';
import { useUpdateQuery } from '@/components/hooks/queries/useUpdateQuery';
import { RefreshCw } from '@/components/icons';
@@ -42,7 +43,7 @@ export function LinkEditForm({
const { linksUrl } = useConfig();
const hostUrl = linksUrl || LINKS_URL;
const { data, isLoading } = useLinkQuery(linkId);
- const [slug, setSlug] = useState(generateId());
+ const [defaultSlug] = useState(generateId());
const handleSubmit = async (data: any) => {
await mutateAsync(data, {
@@ -55,14 +56,6 @@ export function LinkEditForm({
});
};
- const handleSlug = () => {
- const slug = generateId();
-
- setSlug(slug);
-
- return slug;
- };
-
const checkUrl = (url: string) => {
if (!isValidUrl(url)) {
return formatMessage(labels.invalidUrl);
@@ -70,19 +63,19 @@ export function LinkEditForm({
return true;
};
- useEffect(() => {
- if (data) {
- setSlug(data.slug);
- }
- }, [data]);
-
if (linkId && isLoading) {
return