fix data sync

This commit is contained in:
Gabe Yuan
2023-07-31 15:08:51 +08:00
parent 2aef159d9d
commit fed0f6849a
18 changed files with 237 additions and 145 deletions

View File

@@ -22,6 +22,10 @@ export const I18N = {
zh: `规则设置`,
en: `Rules Setting`,
},
sync_setting: {
zh: `同步设置`,
en: `Sync Setting`,
},
about: {
zh: `关于`,
en: `About`,
@@ -94,9 +98,13 @@ export const I18N = {
zh: `添加`,
en: `Add`,
},
advanced_warn: {
zh: `如不明白,谨慎修改!不同的浏览器,选择器规则不一定通用。`,
en: `If you don't understand, modify it carefully! Different browsers, the selector rules are not necessarily universal.`,
sync_warn: {
zh: `数据同步功能只是按修改时间简单覆盖,谨慎使用!`,
en: `The data synchronization function is simply overwritten according to the modification time, use it with caution!`,
},
about_sync_api: {
zh: `查看关于数据同步接口部署`,
en: `View About Data Synchronization Interface Deployment`,
},
style_none: {
zh: ``,
@@ -139,8 +147,8 @@ export const I18N = {
en: `Multiple URLs can be separated by English commas ","`,
},
selector_helper: {
zh: `遵循CSS选择器规则但不同浏览器可能支持不同,有些不同的写法。`,
en: `Follow the CSS selector rules, but different browsers may support different, and some have different ways of writing.`,
zh: `遵循CSS选择器规则但不同浏览器有些不同的写法。`,
en: `Follow the CSS selector rules, but different browsers have some different ways of writing.`,
},
translate_switch: {
zh: `开启翻译`,

View File

@@ -8,7 +8,7 @@ export const APP_LCNAME = APP_NAME.toLowerCase();
export const STOKEY_MSAUTH = `${APP_NAME}_msauth`;
export const STOKEY_SETTING = `${APP_NAME}_setting`;
export const STOKEY_RULES = `${APP_NAME}_rules`;
export const STOKEY_RULES_UPDATE_AT = `${APP_NAME}_rules_update_at`;
export const STOKEY_SYNC = `${APP_NAME}_sync`;
export const KV_HEADER_KEY = "X-KISS-PSK";
export const KV_RULES_KEY = "KT_RULES";
@@ -26,6 +26,7 @@ export const THEME_LIGHT = "light";
export const THEME_DARK = "dark";
export const URL_APP_HOMEPAGE = "https://github.com/fishjar/kiss-translator";
export const URL_KISS_WORKER = "https://github.com/fishjar/kiss-worker";
export const URL_RAW_PREFIX =
"https://raw.githubusercontent.com/fishjar/kiss-translator/master";
export const URL_MICROSOFT_AUTH = "https://edge.microsoft.com/translate/auth";
@@ -135,9 +136,6 @@ export const DEFAULT_SETTING = {
openaiKey: "",
openaiModel: "gpt-4",
openaiPrompt: `You will be provided with a sentence in ${PROMPT_PLACE_FROM}, and your task is to translate it into ${PROMPT_PLACE_TO}.`,
syncUrl: "", // 数据同步接口
syncKey: "", // 数据同步密钥
updateAt: 1, // 更新时间
};
export const DEFAULT_RULES = [
@@ -151,3 +149,12 @@ export const DEFAULT_RULES = [
export const TRANS_MIN_LENGTH = 5; // 最短翻译长度
export const TRANS_MAX_LENGTH = 5000; // 最长翻译长度
export const DEFAULT_SYNC = {
syncUrl: "", // 数据同步接口
syncKey: "", // 数据同步密钥
settingUpdateAt: 0,
settingSyncAt: 0,
rulesUpdateAt: 0,
rulesSyncAt: 0,
};