Skip to content

Commit 5554107

Browse files
committed
Merge branch 'release/v1.4' into develop/add-no-csp-option
2 parents 1a22cdf + df6a539 commit 5554107

10 files changed

Lines changed: 202 additions & 53 deletions

File tree

src/locales/ach-UG/translation.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"subscribe": "crwdns7918:0crwdne7918:0",
2121
"logs": "crwdns7920:0crwdne7920:0",
2222
"tools": "crwdns7922:0crwdne7922:0",
23+
"find": "Find",
24+
"replace": "Replace",
2325
"settings": "crwdns7924:0crwdne7924:0",
2426
"hide_main_sidebar": "Collapse sidebar",
2527
"show_main_sidebar": "Expand sidebar",
@@ -219,6 +221,11 @@
219221
"run_once": "crwdns8308:0crwdne8308:0",
220222
"stop": "crwdns8310:0crwdne8310:0",
221223
"edit": "crwdns8312:0crwdne8312:0",
224+
"undo": "Undo",
225+
"redo": "Redo",
226+
"cut": "Cut",
227+
"copy": "Copy",
228+
"paste": "Paste",
222229
"exclude_on": "crwdns8922:0crwdne8922:0",
223230
"exclude_off": "crwdns8924:0crwdne8924:0",
224231
"user_config": "crwdns8320:0crwdne8320:0",

src/locales/de-DE/translation.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"subscribe": "Abonnieren",
2121
"logs": "Protokolle",
2222
"tools": "Werkzeuge",
23+
"find": "Suchen",
24+
"replace": "Ersetzen",
2325
"settings": "Einstellungen",
2426
"hide_main_sidebar": "Seitenleiste einklappen",
2527
"show_main_sidebar": "Seitenleiste ausklappen",
@@ -220,6 +222,11 @@
220222
"run_once": "Einmal ausführen",
221223
"stop": "Stoppen",
222224
"edit": "Bearbeiten",
225+
"undo": "Rückgängig",
226+
"redo": "Wiederherstellen",
227+
"cut": "Ausschneiden",
228+
"copy": "Kopieren",
229+
"paste": "Einfügen",
223230
"exclude_on": "Wiederherstellen auf $0 zur Ausführung",
224231
"exclude_off": "Ausschließen auf $0 zur Ausführung",
225232
"user_config": "Benutzerkonfiguration",

src/locales/en-US/translation.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"subscribe": "Subscribe",
2121
"logs": "Logs",
2222
"tools": "Tools",
23+
"find": "Find",
24+
"replace": "Replace",
2325
"settings": "Settings",
2426
"hide_main_sidebar": "Collapse sidebar",
2527
"show_main_sidebar": "Expand sidebar",
@@ -220,6 +222,11 @@
220222
"run_once": "Run Once",
221223
"stop": "Stop",
222224
"edit": "Edit",
225+
"undo": "Undo",
226+
"redo": "Redo",
227+
"cut": "Cut",
228+
"copy": "Copy",
229+
"paste": "Paste",
223230
"exclude_on": "Reinstate $0's execution",
224231
"exclude_off": "Exclude $0's exeuction",
225232
"user_config": "User Config",

src/locales/ja-JP/translation.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"subscribe": "サブスクライブ",
2121
"logs": "ログ",
2222
"tools": "ツール",
23+
"find": "検索",
24+
"replace": "置換",
2325
"settings": "設定",
2426
"hide_main_sidebar": "サイドバーを折りたたむ",
2527
"show_main_sidebar": "サイドバーを展開",
@@ -220,6 +222,11 @@
220222
"run_once": "一度実行",
221223
"stop": "中止",
222224
"edit": "編集",
225+
"undo": "元に戻す",
226+
"redo": "やり直し",
227+
"cut": "切り取り",
228+
"copy": "コピー",
229+
"paste": "貼り付け",
223230
"exclude_on": "$0の実行を復元",
224231
"exclude_off": "$0の実行を除外",
225232
"user_config": "ユーザー設定",

src/locales/ru-RU/translation.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"subscribe": "Подписаться",
2121
"logs": "Журналы",
2222
"tools": "Инструменты",
23+
"find": "Найти",
24+
"replace": "Заменить",
2325
"settings": "Настройки",
2426
"hide_main_sidebar": "Свернуть боковую панель",
2527
"show_main_sidebar": "Развернуть боковую панель",
@@ -220,6 +222,11 @@
220222
"run_once": "Запустить один раз",
221223
"stop": "Остановить",
222224
"edit": "Редактировать",
225+
"undo": "Отменить",
226+
"redo": "Повторить",
227+
"cut": "Вырезать",
228+
"copy": "Копировать",
229+
"paste": "Вставить",
223230
"exclude_on": "Восстановить в $0 выполнении",
224231
"exclude_off": "Исключить в $0 выполнении",
225232
"user_config": "Конфигурация пользователя",

src/locales/vi-VN/translation.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"subscribe": "Đăng ký",
2121
"logs": "Nhật ký",
2222
"tools": "Công cụ",
23+
"find": "Tìm kiếm",
24+
"replace": "Thay thế",
2325
"settings": "Cài đặt",
2426
"hide_main_sidebar": "Thu gọn thanh bên",
2527
"show_main_sidebar": "Mở rộng thanh bên",
@@ -220,6 +222,11 @@
220222
"run_once": "Chạy một lần",
221223
"stop": "Dừng",
222224
"edit": "Sửa",
225+
"undo": "Hoàn tác",
226+
"redo": "Làm lại",
227+
"cut": "Cắt",
228+
"copy": "Sao chép",
229+
"paste": "Dán",
223230
"exclude_on": "Cho phép chạy lại $0",
224231
"exclude_off": "Loại trừ chạy $0",
225232
"user_config": "Cấu hình người dùng",

src/locales/zh-CN/translation.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"subscribe": "订阅",
2121
"logs": "日志",
2222
"tools": "工具",
23+
"find": "查找",
24+
"replace": "替换",
2325
"settings": "设置",
2426
"hide_main_sidebar": "收起侧边栏",
2527
"show_main_sidebar": "展开侧边栏",
@@ -220,6 +222,11 @@
220222
"run_once": "运行一次",
221223
"stop": "停止",
222224
"edit": "编辑",
225+
"undo": "撤销",
226+
"redo": "重做",
227+
"cut": "剪切",
228+
"copy": "复制",
229+
"paste": "粘贴",
223230
"exclude_on": "恢复在 $0 上执行",
224231
"exclude_off": "排除在 $0 上执行",
225232
"user_config": "用户配置",

src/locales/zh-TW/translation.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"subscribe": "訂閱",
2121
"logs": "紀錄",
2222
"tools": "工具",
23+
"find": "尋找",
24+
"replace": "取代",
2325
"settings": "設定",
2426
"hide_main_sidebar": "摺疊側邊欄",
2527
"show_main_sidebar": "展開側邊欄",
@@ -220,6 +222,11 @@
220222
"run_once": "執行一次",
221223
"stop": "停止",
222224
"edit": "編輯",
225+
"undo": "復原",
226+
"redo": "重做",
227+
"cut": "剪下",
228+
"copy": "複製",
229+
"paste": "貼上",
223230
"exclude_on": "恢復 $0 的執行",
224231
"exclude_off": "排除 $0 的執行",
225232
"user_config": "使用者設定",

src/pages/options/routes/ScriptList/components.tsx

Lines changed: 50 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { TbWorldWww } from "react-icons/tb";
77
import { semTime } from "@App/pkg/utils/dayjs";
88
import { useTranslation } from "react-i18next";
99
import { ListHomeRender } from "../utils";
10-
import { IconEdit, IconLink, IconUserAdd } from "@arco-design/web-react/icon";
10+
import { IconEdit, IconLink, IconSync, IconUserAdd } from "@arco-design/web-react/icon";
1111
import type { SearchType } from "@App/app/service/service_worker/types";
1212
import type { TFunction } from "i18next";
1313
import type { SearchFilterKeyEntry, SearchFilterRequest } from "./SearchFilter";
@@ -133,52 +133,61 @@ HomeCell.displayName = "HomeCell";
133133

134134
export const UpdateTimeCell = React.memo(({ className, script }: { className?: string; script: ScriptLoading }) => {
135135
const { t } = useTranslation();
136-
const { handleClick } = {
137-
handleClick: () => {
138-
if (!script.checkUpdateUrl) {
139-
Message.warning(t("update_not_supported")!);
140-
return;
141-
}
142-
Message.info({
143-
id: "checkupdate",
144-
content: t("checking_for_updates"),
145-
});
146-
scriptClient
147-
.requestCheckUpdate(script.uuid)
148-
.then((res) => {
149-
if (res) {
150-
Message.warning({
151-
id: "checkupdate",
152-
content: t("new_version_available"),
153-
});
154-
} else {
155-
Message.success({
156-
id: "checkupdate",
157-
content: t("latest_version"),
158-
});
159-
}
160-
})
161-
.catch((e) => {
162-
Message.error({
136+
const [checking, setChecking] = React.useState(false);
137+
const handleClick = () => {
138+
if (checking) return;
139+
if (!script.checkUpdateUrl) {
140+
Message.warning(t("update_not_supported")!);
141+
return;
142+
}
143+
Message.info({
144+
id: "checkupdate",
145+
content: t("checking_for_updates"),
146+
});
147+
setChecking(true);
148+
scriptClient
149+
.requestCheckUpdate(script.uuid)
150+
.then((res) => {
151+
if (res) {
152+
Message.warning({
163153
id: "checkupdate",
164-
content: `${t("update_check_failed")}: ${e.message}`,
154+
content: t("new_version_available"),
165155
});
156+
} else {
157+
Message.success({
158+
id: "checkupdate",
159+
content: t("latest_version"),
160+
});
161+
}
162+
})
163+
.catch((e) => {
164+
Message.error({
165+
id: "checkupdate",
166+
content: `${t("update_check_failed")}: ${e.message}`,
166167
});
167-
},
168+
})
169+
.finally(() => {
170+
setChecking(false);
171+
});
168172
};
169173

170174
return (
171-
<Tooltip content={t("check_update")} position="tl">
172-
<Typography.Text
173-
className={className}
174-
style={{
175-
cursor: "pointer",
176-
}}
177-
onClick={handleClick}
178-
>
179-
{script.updatetime && semTime(new Date(script.updatetime))}
180-
</Typography.Text>
181-
</Tooltip>
175+
<Space size={4}>
176+
<Tooltip content={t("check_update")} position="tl">
177+
<Typography.Text className={`tw-cursor-pointer ${className ?? ""}`} onClick={handleClick}>
178+
{script.updatetime && semTime(new Date(script.updatetime))}
179+
</Typography.Text>
180+
</Tooltip>
181+
{script.checkUpdateUrl && (
182+
<Tooltip content={t("check_update")} position="tl">
183+
<IconSync
184+
className={`tw-cursor-pointer tw-opacity-45 hover:tw-opacity-100 tw-transition-opacity ${checking ? "arco-icon-loading tw-opacity-100" : ""}`}
185+
spin={checking}
186+
onClick={handleClick}
187+
/>
188+
</Tooltip>
189+
)}
190+
</Space>
182191
);
183192
});
184193
UpdateTimeCell.displayName = "UpdateTimeCell";

0 commit comments

Comments
 (0)