-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5be47db
commit b635ae5
Showing
19 changed files
with
335 additions
and
65 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"mac":"04-D4-C4-EC-D0-37","ip":"192.168.1.80","submask":"255.255.255.0","port":"9","mode":"2","remark":"HOME","id":"id_1"},{"mac":"04-D4-C4-EC-D0-37","ip":"192.168.2.250","submask":"255.255.255.0","port":"9","mode":"1","remark":"公司","id":"id_2"},{"mac":"04-D4-C4-EC-D0-37","ip":"192.168.2.2","submask":"255.255.255.0","port":"9","mode":"1","remark":"测试地址2222","id":"1623979477201"}] | ||
[{"mac":"04-D4-C4-EC-D0-37","ip":"192.168.1.80","submask":"255.255.255.0","port":"9","mode":1,"remark":"HOME","id":"id_1"},{"mac":"04-D4-C4-EC-D0-37","ip":"192.168.2.250","submask":"255.255.255.0","port":"9","mode":2,"remark":"公司","id":"id_2"},{"mac":"04-D4-C4-EC-D0-37","ip":"192.168.2.10","submask":"255.255.255.0","port":"7","mode":1,"id":"1624161186390"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"verbose": true, | ||
"ignore": ["*.test.js", "fixtures/*", "node_modules/*", "dist/*", "build/*"], | ||
"exec": "webpack --config ele-webpack.config.js", | ||
"watch": ["src/main.ts"], | ||
"env": { | ||
"NODE_ENV": "development" | ||
}, | ||
"ext": "js,json,ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useMemo } from "react"; | ||
import i18n from "../i18n"; | ||
|
||
export function useI18n(languageKey: string) { | ||
const lanConf = useMemo(() => { | ||
const conf = i18n.find((item) => item.key === languageKey); | ||
if (conf) { | ||
return conf.language; | ||
} | ||
return i18n[0].language; | ||
}, [languageKey]); | ||
|
||
return lanConf; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const languageMap = { | ||
STR_MAC_TIPS: "MAC", | ||
STR_MAC_PLACEHOLDER: "input mac address", | ||
STR_MAC_ERR_MSG: "mac addr,horizontal or colon segmentation", | ||
STR_IP_TIPS: "IP", | ||
STR_IP_PLACEHOLDER: "input ip address", | ||
STR_IP_ERR_MSG: "Invalid IP address", | ||
STR_SUBMASK_TIPS: "SubnetMask", | ||
STR_SUBMASK_PLACEHOLDER: "input subnet-mask", | ||
STR_SUBMASK_ERR_MSG: "Invalid subnet-mask", | ||
STR_PORT_TIPS: "Port", | ||
STR_PORT_PLACEHOLDER: "input port(7 or 9)", | ||
STR_PORT_ERR_MSG: "Invalid port,Allowed values range from 1 to 65535", | ||
STR_MODE_TIPS: "Send Opt", | ||
STR_MODE_PLACEHOLDER: "select network type", | ||
STR_MODE_OPT_1: "internet/vpn", | ||
STR_MODE_OPT_2: "local subnet", | ||
STR_REMARK_TIPS: "Remark", | ||
STR_REMARk_PLACEHOLDER: "input remark,default is IP address", | ||
STR_REMARK_ERR_MSG: "remark too loong,no more than 200", | ||
STR_SAVE_SUCC_MSG: "Save successfully", | ||
STR_SEND_ERR_MSG: "Send failed", | ||
STR_SEND_SUCC_MSG: "Send successfully", | ||
STR_EMPTY: "No configuration", | ||
STR_BTN_DELETE: "Delete", | ||
STR_BTN_ADD: "Add", | ||
STR_BTN_SAVE: "Save", | ||
STR_BTN_WEAKUP: "Weakup", | ||
}; | ||
|
||
export default languageMap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import zhCN from "./zh-CN"; | ||
import en from "./en"; | ||
|
||
export type ConfKey = keyof typeof en; | ||
export type I18nConf = { | ||
[key in ConfKey]: string; | ||
}; | ||
|
||
type IconConf = { | ||
key: string; | ||
title: string; | ||
language: I18nConf; | ||
}; | ||
|
||
const i18n: IconConf[] = [ | ||
{ | ||
key: "en", | ||
title: "English", | ||
language: en, | ||
}, | ||
{ | ||
key: "zh-CN", | ||
title: "简体中文", | ||
language: zhCN, | ||
}, | ||
]; | ||
|
||
export default i18n; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const languageMap = { | ||
STR_MAC_TIPS: "MAC地址", | ||
STR_MAC_PLACEHOLDER: "请输入目标机器MAC地址", | ||
STR_MAC_ERR_MSG: "输入MAC地址,横线或冒号分割", | ||
STR_IP_TIPS: "IP地址", | ||
STR_IP_PLACEHOLDER: "请输入目标机器IP地址", | ||
STR_IP_ERR_MSG: "请有效的IP地址", | ||
STR_SUBMASK_TIPS: "子网掩码", | ||
STR_SUBMASK_PLACEHOLDER: "请输入目标机器子网掩码", | ||
STR_SUBMASK_ERR_MSG: "请输入有效的子网掩码", | ||
STR_PORT_TIPS: "目标端口", | ||
STR_PORT_PLACEHOLDER: "请输入目标端口(通常为7或9)", | ||
STR_PORT_ERR_MSG: "端口无效,请输入1-65535之间的端口号", | ||
STR_MODE_TIPS: "发送模式", | ||
STR_MODE_PLACEHOLDER: "请选择发送模式", | ||
STR_MODE_OPT_1: "广域网/VPN(发送至目标IP)", | ||
STR_MODE_OPT_2: "内网(发送至广播地址)", | ||
STR_REMARK_TIPS: "备注", | ||
STR_REMARk_PLACEHOLDER: "请输入配置备注,默认为IP地址", | ||
STR_REMARK_ERR_MSG: "备注过长,至多200个字符", | ||
STR_SAVE_SUCC_MSG: "保存成功", | ||
STR_SEND_ERR_MSG: "发送失败", | ||
STR_SEND_SUCC_MSG: "唤醒请求已发送", | ||
STR_EMPTY: "暂无配置", | ||
STR_BTN_DELETE: "删除", | ||
STR_BTN_ADD: "新增配置", | ||
STR_BTN_SAVE: "保存", | ||
STR_BTN_WEAKUP: "唤醒", | ||
}; | ||
|
||
export default languageMap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.