diff --git a/make-fake-data.js b/make-fake-data.js index 54acef5..54ef4e6 100644 --- a/make-fake-data.js +++ b/make-fake-data.js @@ -189,9 +189,9 @@ fs.emptyDirSync("public/fakeAPI/dns"); fs.emptyDirSync("public/fakeAPI/stats"); console.log("Generating new fake API data..."); -write("public/fakeAPI/dns/whitelist", list("white")); -write("public/fakeAPI/dns/blacklist", list("black")); -write("public/fakeAPI/dns/wildlist", list("wild")); +write("public/fakeAPI/dns/whitelist", list()); +write("public/fakeAPI/dns/blacklist", list()); +write("public/fakeAPI/dns/regexlist", list()); write("public/fakeAPI/dns/status", status()); write("public/fakeAPI/stats/overTime/history", historyOverTime(144)); write("public/fakeAPI/stats/overTime/clients", clientsOverTime(144, 5)); diff --git a/public/i18n/en/common.json b/public/i18n/en/common.json index ad505ce..21f2105 100644 --- a/public/i18n/en/common.json +++ b/public/i18n/en/common.json @@ -11,6 +11,5 @@ "Type": "Type", "Action": "Action", "Enabled": "Enabled", - "Disabled": "Disabled", - "Regex": "Regex" + "Disabled": "Disabled" } \ No newline at end of file diff --git a/public/i18n/en/location.json b/public/i18n/en/location.json index 4c9eaf0..d868287 100644 --- a/public/i18n/en/location.json +++ b/public/i18n/en/location.json @@ -6,5 +6,6 @@ "Exact": "Exact", "Wildcard": "Wildcard", "Login": "Login", - "Logout": "Logout" + "Logout": "Logout", + "Regex": "Regex" } \ No newline at end of file diff --git a/src/components/DomainInput.js b/src/components/DomainInput.js index 55857e6..a91be8d 100644 --- a/src/components/DomainInput.js +++ b/src/components/DomainInput.js @@ -49,7 +49,7 @@ class DomainInput extends Component { return (
e.charCode === 13 ? this.onAdd() : null} onChange={this.handleChange} disabled={!api.loggedIn} @@ -72,6 +72,7 @@ class DomainInput extends Component { } DomainInput.propTypes = { + placeholder: PropTypes.string.isRequired, domains: PropTypes.array.isRequired, onAdding: PropTypes.func.isRequired, onAlreadyAdded: PropTypes.func.isRequired, diff --git a/src/components/ListPage.js b/src/components/ListPage.js index 8d4637b..af0ab9c 100644 --- a/src/components/ListPage.js +++ b/src/components/ListPage.js @@ -100,6 +100,7 @@ class ListPage extends Component {

{this.props.title}


({ "1": t("Blocked"), "2": t("Allowed (forwarded)"), "3": t("Allowed (cached)"), - "4": t("Blocked (wildcard)"), + "4": t("Blocked (regex)"), "5": t("Blocked (blacklist)") }); diff --git a/src/containers/Full.js b/src/containers/Full.js index 3616b72..5a9b429 100644 --- a/src/containers/Full.js +++ b/src/containers/Full.js @@ -18,7 +18,7 @@ import Dashboard from '../views/Dashboard'; import QueryLog from '../components/QueryLog'; import Whitelist from "../views/Whitelist"; import Blacklist from "../views/Blacklist"; -import Wildlist from "../views/Wildlist"; +import Regexlist from "../views/Regexlist"; import Login from "../views/Login"; import Logout from "../views/Logout"; import { api } from "../utils"; @@ -36,7 +36,7 @@ export default props => ( - + diff --git a/src/routes.js b/src/routes.js index 314a207..32e329d 100644 --- a/src/routes.js +++ b/src/routes.js @@ -13,7 +13,7 @@ export const routes = t => ({ '/query-log': t('Query Log'), '/whitelist': t('Whitelist'), '/blacklist': `${t('Blacklist')} (${t('Exact')})`, - '/wildlist': `${t('Blacklist')} (${t('Wildcard')})`, + '/regexlist': `${t('Blacklist')} (${t('Regex')})`, '/login': t('Login'), '/logout': t('Logout') }); @@ -49,8 +49,8 @@ export const nav = [ auth: false }, { - name: 'Wildcard', - url: '/wildlist', + name: 'Regex', + url: '/regexlist', icon: 'fa fa-ban', auth: false } diff --git a/src/utils.js b/src/utils.js index 9ec28f8..9f707ea 100644 --- a/src/utils.js +++ b/src/utils.js @@ -93,8 +93,8 @@ export const api = { getBlacklist() { return api.get("dns/blacklist"); }, - getWildlist() { - return api.get("dns/wildlist"); + getRegexlist() { + return api.get("dns/regexlist"); }, addWhitelist(domain) { return api.post("dns/whitelist", { "domain": domain }); @@ -102,8 +102,8 @@ export const api = { addBlacklist(domain) { return api.post("dns/blacklist", { "domain": domain }); }, - addWildlist(domain) { - return api.post("dns/wildlist", { "domain": domain }); + addRegexlist(domain) { + return api.post("dns/regexlist", { "domain": domain }); }, removeWhitelist(domain) { return api.delete("dns/whitelist/" + domain); @@ -111,8 +111,8 @@ export const api = { removeBlacklist(domain) { return api.delete("dns/blacklist/" + domain); }, - removeWildlist(domain) { - return api.delete("dns/wildlist/" + domain); + removeRegexlist(domain) { + return api.delete("dns/regexlist/" + encodeURIComponent(domain)); }, getStatus() { return api.get("dns/status") diff --git a/src/views/Blacklist.js b/src/views/Blacklist.js index 9b9e8aa..3ebc757 100644 --- a/src/views/Blacklist.js +++ b/src/views/Blacklist.js @@ -19,6 +19,7 @@ const Blacklist = props => { return ( { +const Regexlist = props => { const { t } = props; return ( - {t("Note: Only the domain and subdomains of the blocked domain will be blocked.")} -

- )} - add={api.addWildlist} - remove={api.removeWildlist} - refresh={api.getWildlist} + title={`${t("Blacklist")} (${t("Regex")})`} + placeholder={t("Input a regular expression")} + add={api.addRegexlist} + remove={api.removeRegexlist} + refresh={api.getRegexlist} {...props} /> ); }; -export default translate(["location", "lists"])(Wildlist); +export default translate(["location", "lists"])(Regexlist); diff --git a/src/views/Whitelist.js b/src/views/Whitelist.js index 6c30b11..f445d16 100644 --- a/src/views/Whitelist.js +++ b/src/views/Whitelist.js @@ -19,7 +19,7 @@ const Whitelist = props => { return ( {t("Note: Whitelisting a subdomain of a wildcard blocked domain is not possible.")}

} + placeholder={t("Add a domain (example.com or sub.example.com)")} add={api.addWhitelist} remove={api.removeWhitelist} refresh={api.getWhitelist}