Pull request #961: New client dashboard
Merge in DNS/adguard-home from new-client-dashboard to master Squashed commit of the following: commit 7bbd67c1e3d2af62b96bf41bb356cd6b784e473e Merge: 113743a69cd9054cAuthor: Vlad <v.abdulmyanov@adguard.com> Date: Wed Feb 3 16:01:17 2021 +0300 Merge branch 'master' into new-client-dashboard commit 113743a60665e40383d367dc17fa709dc54e4e2e Author: Vlad <v.abdulmyanov@adguard.com> Date: Wed Feb 3 15:45:16 2021 +0300 Remove unneded modal styles commit 04f9d93a9ac17ee046f0d5bedfb2bf5a5e6c0a48 Author: Vlad <v.abdulmyanov@adguard.com> Date: Wed Feb 3 14:19:56 2021 +0300 Consider comments commit 78a96cd8fed8b3e03547e7e45724c23db295f67b Author: Vlad <v.abdulmyanov@adguard.com> Date: Mon Feb 1 18:46:52 2021 +0300 Remove old params for MiniCssExtractPlugin commit 40e5a9b2b1e04036deb70af17f2719eadd0c9c02 Author: Vlad <v.abdulmyanov@adguard.com> Date: Mon Feb 1 18:27:46 2021 +0300 Fix mobile version commit 509cefc308f945b03cafa62bf48257490a0a4be1 Author: Vlad <v.abdulmyanov@adguard.com> Date: Mon Feb 1 18:20:56 2021 +0300 Remove unneeded imports commit d192f39cd2503b8ec942f00ba78fca02cac9fa60 Author: Vlad <v.abdulmyanov@adguard.com> Date: Mon Feb 1 18:20:13 2021 +0300 Finish first version of dashboard commit f82429e53d334874ff7dd0641092ec83c66ab61c Merge: fd91a0a33e0238aaAuthor: Vlad <v.abdulmyanov@adguard.com> Date: Mon Feb 1 17:12:59 2021 +0300 Merge branch 'master' into new-client-dashboard commit fd91a0a3d76c2a052a6548232b75d151d6065b88 Author: Vlad <v.abdulmyanov@adguard.com> Date: Mon Feb 1 17:12:27 2021 +0300 wip commit 237679965052d38acfcd6a72d24b2444cc5b3896 Author: Vlad <v.abdulmyanov@adguard.com> Date: Fri Jan 29 11:18:10 2021 +0300 Finish general settings commit 397a7e10efd34a8d31bb175a5a5a7158338388d4 Author: Vlad <v.abdulmyanov@adguard.com> Date: Thu Jan 28 19:24:03 2021 +0300 Add General settings page commit 486aaa6f3f9ad66f3a0dcfcccad9a32659767e90 Author: Vlad <v.abdulmyanov@adguard.com> Date: Thu Jan 28 14:05:16 2021 +0300 Remove husky commit b895306c0655019ca56ce161e050d83b4e7f5ff1 Merge: a195f1f4154c9c1cAuthor: Vlad <v.abdulmyanov@adguard.com> Date: Thu Jan 28 14:03:37 2021 +0300 Merge branch 'master' into new-client-dashboard commit a195f1f4d46043d9c53dea08734733f9817b95a0 Merge: c45c5fe9 362f390f Author: Vlad <v.abdulmyanov@adguard.com> Date: Wed Jan 27 15:46:18 2021 +0300 Merge branch 'new-client-dashboard' of ssh://bit.adguard.com:7999/dns/adguard-home into new-client-dashboard commit c45c5fe92e6c5c852bec8f512dc46b4cd513156c Author: Vlad <v.abdulmyanov@adguard.com> Date: Wed Jan 27 15:46:01 2021 +0300 wip commit 362f390fd3dcfca75633a8d30a2e54c3c30b4f3d Author: Vladislav Abdulmyanov <v.abdulmyanov@adguard.com> Date: Wed Jan 27 15:45:12 2021 +0300 Pull request #949: + client: add setup guide page Merge in DNS/adguard-home from 2554-setup-guide to new-client-dashboard Squashed commit of the following: commit c240d52e9e5d90429f2018fde808f4d04ccec138 Merge: 256f1056 137b88e4 Author: Ildar Kamalov <ik@adguard.com> Date: Wed Jan 27 14:13:52 2021 +0300 Merge branch 'new-client-dashboard' into 2554-setup-guide commit 256f1056770c67339e93275ab6dc7aaf2c10da0b Author: Ildar Kamalov <ik@adguard.com> Date: Wed Jan 27 14:10:45 2021 +0300 + client: add DNS addresses to the setup guide commit 0ecf91275a16ecc0dca23cae2ae209836fc622d2 Author: Ildar Kamalov <ik@adguard.com> Date: Wed Jan 27 14:00:12 2021 +0300 + client: add setup guide tabs commit 137b88e4253af5be32d542adbe74575ef74805c8 Author: Vlad <v.abdulmyanov@adguard.com> Date: Thu Jan 21 19:17:58 2021 +0300 Add clients top commit c3318e6932d87fdff5f22d76bee12b49f099129a Merge: 2776276b 021eb22f Author: Vlad <v.abdulmyanov@adguard.com> Date: Thu Jan 21 19:15:57 2021 +0300 Merge branch 'new-client-dashboard' of ssh://bit.adguard.com:7999/dns/adguard-home into new-client-dashboard commit 2776276b2e6dc026e1326b02c388fcf7d48d47ff Author: Vlad <v.abdulmyanov@adguard.com> Date: Thu Jan 21 19:15:53 2021 +0300 Add top client info commit 021eb22ff877aec12eb7fab60147a2cc2ddd08b7 Author: Ildar Kamalov <ik@adguard.com> Date: Thu Jan 21 14:13:54 2021 +0300 Merge: client: add sidebar Squashed commit of the following: commit 6885ba953971e68602889fbb3219221f90265421 Author: Ildar Kamalov <ik@adguard.com> Date: Thu Jan 21 13:56:55 2021 +0300 add sidebar mask commit f069bfe8cba2b31355e19a51ca00bf774ee9e560 Author: Ildar Kamalov <ik@adguard.com> Date: Thu Jan 21 13:03:47 2021 +0300 fix store commit 77c8791002887ae022da07dc264d9010576e7bab Merge: d0a6eff6 ea6d54d4 Author: Ildar Kamalov <ik@adguard.com> Date: Thu Jan 21 13:01:04 2021 +0300 Merge branch 'new-client-dashboard' into 2254-sidebar commit d0a6eff67fd74533d63f5d56382085e98ddbb702 Author: Ildar Kamalov <ik@adguard.com> Date: Thu Jan 21 12:47:32 2021 +0300 client: remove unused file commit 9d2424477de85503fe41fa00cc1294cb0c0e7dfa Author: Ildar Kamalov <ik@adguard.com> Date: Thu Jan 21 12:39:13 2021 +0300 client: header commit 9ddea19c136f15b184caa72d7e82738f7d4f3f1f Merge: 797f1248 b694bb05 Author: Ildar Kamalov <ik@adguard.com> Date: Thu Jan 21 10:57:24 2021 +0300 Merge branch 'new-client-dashboard' into 2254-sidebar commit 797f1248df5c1ef8e59c2a9999138f9e05a7adaa Author: Ildar Kamalov <ik@adguard.com> Date: Thu Jan 21 10:51:57 2021 +0300 client: sidebar ... and 14 more commits
This commit is contained in:
47
client2/src/lib/ant/Modal.pcss
Normal file
47
client2/src/lib/ant/Modal.pcss
Normal file
@@ -0,0 +1,47 @@
|
||||
.modal {
|
||||
& .ant-modal-close-x {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
color: var(--black);
|
||||
border-radius: 2px;
|
||||
background-color: var(--white);
|
||||
transition: background-color 0.3s;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: var(--cloud);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: var(--borders-white);
|
||||
}
|
||||
|
||||
& svg {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
@media (--s-viewport) {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
|
||||
& svg {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& .ant-modal-close {
|
||||
top: 11px;
|
||||
right: 8px;
|
||||
|
||||
@media (--s-viewport) {
|
||||
top: 15px;
|
||||
right: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
26
client2/src/lib/ant/Sidebar.pcss
Normal file
26
client2/src/lib/ant/Sidebar.pcss
Normal file
@@ -0,0 +1,26 @@
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
height: 100vh;
|
||||
font-weight: 500;
|
||||
overflow: auto;
|
||||
z-index: 1041;
|
||||
scrollbar-width: none;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (--l-viewport) {
|
||||
position: sticky;
|
||||
z-index: 1040;
|
||||
}
|
||||
|
||||
& .ant-menu-item-group {
|
||||
@media (--m-viewport) {
|
||||
&:last-child {
|
||||
margin-top: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
45
client2/src/lib/ant/Tabs.pcss
Normal file
45
client2/src/lib/ant/Tabs.pcss
Normal file
@@ -0,0 +1,45 @@
|
||||
.tabs {
|
||||
border-radius: 2px;
|
||||
background-color: var(--white);
|
||||
|
||||
& .ant-tabs-tab {
|
||||
padding: 10px 16px;
|
||||
margin-right: 10px;
|
||||
color: var(--gray900);
|
||||
transition: color var(--transition), background var(--transition);
|
||||
|
||||
&.ant-tabs-tab-active {
|
||||
background-color: #E6F4EA;
|
||||
}
|
||||
}
|
||||
|
||||
&.ant-tabs-left > .ant-tabs-nav .ant-tabs-tab {
|
||||
@media (--l-viewport) {
|
||||
min-width: 230px;
|
||||
margin-bottom: 7px;
|
||||
padding: 10px 24px;
|
||||
}
|
||||
}
|
||||
|
||||
&.ant-tabs-left > .ant-tabs-content-holder > .ant-tabs-content > .ant-tabs-tabpane {
|
||||
@media (--l-viewport) {
|
||||
padding: 24px 40px;
|
||||
}
|
||||
}
|
||||
|
||||
& .ant-tabs-nav {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
& .ant-tabs-tabpane {
|
||||
padding: 24px 16px;
|
||||
}
|
||||
|
||||
& .ant-tabs-nav-list {
|
||||
padding: 0 16px;
|
||||
|
||||
@media (--l-viewport) {
|
||||
padding: 24px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,10 @@
|
||||
@text-color: #000;
|
||||
@link-hover-color: #4d995f;
|
||||
@link-active-color: #4d995f;
|
||||
@text-selection-bg: #e7efff;
|
||||
@layout-body-background: #f3f3f3;
|
||||
@layout-header-background: #131313;
|
||||
@menu-dark-submenu-bg: #131313;
|
||||
|
||||
@font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
|
||||
@font-size-base: 14px;
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
@import '~antd/dist/antd.less';
|
||||
@import './ant-overrides.less';
|
||||
|
||||
::selection {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import './Radio.pcss';
|
||||
import './Sidebar.pcss';
|
||||
import './Tabs.pcss';
|
||||
import './Modal.pcss';
|
||||
|
||||
const insertStyles = true;
|
||||
export default insertStyles;
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import qs from 'qs';
|
||||
import AccessListResponse, { IAccessListResponse } from 'Entities/AccessListResponse';
|
||||
import AccessSetRequest, { IAccessSetRequest } from 'Entities/AccessSetRequest';
|
||||
import Client, { IClient } from 'Entities/Client';
|
||||
import ClientDelete, { IClientDelete } from 'Entities/ClientDelete';
|
||||
import ClientUpdate, { IClientUpdate } from 'Entities/ClientUpdate';
|
||||
@@ -8,6 +10,40 @@ import ClientsFindEntry, { IClientsFindEntry } from 'Entities/ClientsFindEntry';
|
||||
// This file was autogenerated. Please do not change.
|
||||
// All changes will be overwrited on commit.
|
||||
export default class ClientsApi {
|
||||
static async accessList(): Promise<IAccessListResponse | Error> {
|
||||
return await fetch(`/control/access/list`, {
|
||||
method: 'GET',
|
||||
}).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
return res.json();
|
||||
} else {
|
||||
return new Error(String(res.status));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
static async accessSet(accesssetrequest: IAccessSetRequest): Promise<number | string[] | Error> {
|
||||
const haveError: string[] = [];
|
||||
const accesssetrequestValid = new AccessSetRequest(accesssetrequest);
|
||||
haveError.push(...accesssetrequestValid.validate());
|
||||
if (haveError.length > 0) {
|
||||
return Promise.resolve(haveError);
|
||||
}
|
||||
return await fetch(`/control/access/set`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(accesssetrequestValid.serialize()),
|
||||
}).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
return res.status;
|
||||
} else {
|
||||
return new Error(String(res.status));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
static async clientsAdd(client: IClient): Promise<number | string[] | Error> {
|
||||
const haveError: string[] = [];
|
||||
const clientValid = new Client(client);
|
||||
|
||||
@@ -2,6 +2,7 @@ import DhcpConfig, { IDhcpConfig } from 'Entities/DhcpConfig';
|
||||
import DhcpSearchResult, { IDhcpSearchResult } from 'Entities/DhcpSearchResult';
|
||||
import DhcpStaticLease, { IDhcpStaticLease } from 'Entities/DhcpStaticLease';
|
||||
import DhcpStatus, { IDhcpStatus } from 'Entities/DhcpStatus';
|
||||
import NetInterfaces, { INetInterfaces } from 'Entities/NetInterfaces';
|
||||
|
||||
// This file was autogenerated. Please do not change.
|
||||
// All changes will be overwrited on commit.
|
||||
@@ -40,6 +41,18 @@ export default class DhcpApi {
|
||||
})
|
||||
}
|
||||
|
||||
static async dhcpInterfaces(): Promise<INetInterfaces | Error> {
|
||||
return await fetch(`/control/dhcp/interfaces`, {
|
||||
method: 'GET',
|
||||
}).then(async (res) => {
|
||||
if (res.status === 200) {
|
||||
return res.json();
|
||||
} else {
|
||||
return new Error(String(res.status));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
static async dhcpRemoveStaticLease(dhcpstaticlease: IDhcpStaticLease): Promise<number | string[] | Error> {
|
||||
const haveError: string[] = [];
|
||||
const dhcpstaticleaseValid = new DhcpStaticLease(dhcpstaticlease);
|
||||
|
||||
@@ -3,9 +3,10 @@ import qs from 'qs';
|
||||
// This file was autogenerated. Please do not change.
|
||||
// All changes will be overwrited on commit.
|
||||
export default class MobileconfigApi {
|
||||
static async mobileConfigDoH(host?: string): Promise<number | Error> {
|
||||
static async mobileConfigDoH(host?: string, client_id?: string): Promise<number | Error> {
|
||||
const queryParams = {
|
||||
host: host,
|
||||
client_id: client_id,
|
||||
}
|
||||
return await fetch(`/control/apple/doh.mobileconfig?${qs.stringify(queryParams, { arrayFormat: 'comma' })}`, {
|
||||
method: 'GET',
|
||||
@@ -18,9 +19,10 @@ export default class MobileconfigApi {
|
||||
})
|
||||
}
|
||||
|
||||
static async mobileConfigDoT(host?: string): Promise<number | Error> {
|
||||
static async mobileConfigDoT(host?: string, client_id?: string): Promise<number | Error> {
|
||||
const queryParams = {
|
||||
host: host,
|
||||
client_id: client_id,
|
||||
}
|
||||
return await fetch(`/control/apple/dot.mobileconfig?${qs.stringify(queryParams, { arrayFormat: 'comma' })}`, {
|
||||
method: 'GET',
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
export const DEFAULT_NOTIFICATION_DURATION = 5;
|
||||
|
||||
export const DHCP_LINK = 'https://github.com/AdguardTeam/AdGuardHome/wiki/DHCP';
|
||||
|
||||
76
client2/src/lib/entities/AccessList.ts
Normal file
76
client2/src/lib/entities/AccessList.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
// This file was autogenerated. Please do not change.
|
||||
// All changes will be overwrited on commit.
|
||||
export interface IAccessList {
|
||||
allowed_clients?: string[];
|
||||
blocked_hosts?: string[];
|
||||
disallowed_clients?: string[];
|
||||
}
|
||||
|
||||
export default class AccessList {
|
||||
readonly _allowed_clients: string[] | undefined;
|
||||
|
||||
/** */
|
||||
get allowedClients(): string[] | undefined {
|
||||
return this._allowed_clients;
|
||||
}
|
||||
|
||||
readonly _blocked_hosts: string[] | undefined;
|
||||
|
||||
/** */
|
||||
get blockedHosts(): string[] | undefined {
|
||||
return this._blocked_hosts;
|
||||
}
|
||||
|
||||
readonly _disallowed_clients: string[] | undefined;
|
||||
|
||||
/** */
|
||||
get disallowedClients(): string[] | undefined {
|
||||
return this._disallowed_clients;
|
||||
}
|
||||
|
||||
constructor(props: IAccessList) {
|
||||
if (props.allowed_clients) {
|
||||
this._allowed_clients = props.allowed_clients;
|
||||
}
|
||||
if (props.blocked_hosts) {
|
||||
this._blocked_hosts = props.blocked_hosts;
|
||||
}
|
||||
if (props.disallowed_clients) {
|
||||
this._disallowed_clients = props.disallowed_clients;
|
||||
}
|
||||
}
|
||||
|
||||
serialize(): IAccessList {
|
||||
const data: IAccessList = {
|
||||
};
|
||||
if (typeof this._allowed_clients !== 'undefined') {
|
||||
data.allowed_clients = this._allowed_clients;
|
||||
}
|
||||
if (typeof this._blocked_hosts !== 'undefined') {
|
||||
data.blocked_hosts = this._blocked_hosts;
|
||||
}
|
||||
if (typeof this._disallowed_clients !== 'undefined') {
|
||||
data.disallowed_clients = this._disallowed_clients;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
validate(): string[] {
|
||||
const validate = {
|
||||
allowed_clients: !this._allowed_clients ? true : this._allowed_clients.reduce((result, p) => result && typeof p === 'string', true),
|
||||
disallowed_clients: !this._disallowed_clients ? true : this._disallowed_clients.reduce((result, p) => result && typeof p === 'string', true),
|
||||
blocked_hosts: !this._blocked_hosts ? true : this._blocked_hosts.reduce((result, p) => result && typeof p === 'string', true),
|
||||
};
|
||||
const isError: string[] = [];
|
||||
Object.keys(validate).forEach((key) => {
|
||||
if (!(validate as any)[key]) {
|
||||
isError.push(key);
|
||||
}
|
||||
});
|
||||
return isError;
|
||||
}
|
||||
|
||||
update(props: Partial<IAccessList>): AccessList {
|
||||
return new AccessList({ ...this.serialize(), ...props });
|
||||
}
|
||||
}
|
||||
6
client2/src/lib/entities/AccessListResponse.ts
Normal file
6
client2/src/lib/entities/AccessListResponse.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import AccessList, { IAccessList } from './AccessList';
|
||||
|
||||
// This file was autogenerated. Please do not change.
|
||||
// All changes will be overwrited on commit.
|
||||
export type IAccessListResponse = IAccessList;
|
||||
export default AccessList;
|
||||
6
client2/src/lib/entities/AccessSetRequest.ts
Normal file
6
client2/src/lib/entities/AccessSetRequest.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import AccessList, { IAccessList } from './AccessList';
|
||||
|
||||
// This file was autogenerated. Please do not change.
|
||||
// All changes will be overwrited on commit.
|
||||
export type IAccessSetRequest = IAccessList;
|
||||
export default AccessList;
|
||||
@@ -1,10 +1,10 @@
|
||||
import NetInterface, { INetInterface } from './NetInterface';
|
||||
import NetInterfaces, { INetInterfaces } from './NetInterfaces';
|
||||
|
||||
// This file was autogenerated. Please do not change.
|
||||
// All changes will be overwrited on commit.
|
||||
export interface IAddressesInfo {
|
||||
dns_port: number;
|
||||
interfaces: { [key: string]: INetInterface };
|
||||
interfaces: INetInterfaces;
|
||||
web_port: number;
|
||||
}
|
||||
|
||||
@@ -23,10 +23,9 @@ export default class AddressesInfo {
|
||||
return typeof dnsPort === 'number';
|
||||
}
|
||||
|
||||
readonly _interfaces: { [key: string]: NetInterface };
|
||||
readonly _interfaces: NetInterfaces;
|
||||
|
||||
/** */
|
||||
get interfaces(): { [key: string]: NetInterface } {
|
||||
get interfaces(): NetInterfaces {
|
||||
return this._interfaces;
|
||||
}
|
||||
|
||||
@@ -46,16 +45,14 @@ export default class AddressesInfo {
|
||||
|
||||
constructor(props: IAddressesInfo) {
|
||||
this._dns_port = props.dns_port;
|
||||
this._interfaces = Object.keys(props.interfaces).reduce((prev, key) => {
|
||||
return { ...prev, [key]: new NetInterface(props.interfaces[key])};
|
||||
},{})
|
||||
this._interfaces = new NetInterfaces(props.interfaces);
|
||||
this._web_port = props.web_port;
|
||||
}
|
||||
|
||||
serialize(): IAddressesInfo {
|
||||
const data: IAddressesInfo = {
|
||||
dns_port: this._dns_port,
|
||||
interfaces: Object.keys(this._interfaces).reduce<Record<string, any>>((prev, key) => ({ ...prev, [key]: this._interfaces[key].serialize() }), {}),
|
||||
interfaces: this._interfaces.serialize(),
|
||||
web_port: this._web_port,
|
||||
};
|
||||
return data;
|
||||
@@ -65,6 +62,7 @@ export default class AddressesInfo {
|
||||
const validate = {
|
||||
dns_port: typeof this._dns_port === 'number',
|
||||
web_port: typeof this._web_port === 'number',
|
||||
interfaces: this._interfaces.validate().length === 0,
|
||||
};
|
||||
const isError: string[] = [];
|
||||
Object.keys(validate).forEach((key) => {
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface IClientFindSubEntry {
|
||||
upstreams?: string[];
|
||||
use_global_blocked_services?: boolean;
|
||||
use_global_settings?: boolean;
|
||||
whois_info?: IWhoisInfo[];
|
||||
whois_info?: IWhoisInfo;
|
||||
}
|
||||
|
||||
export default class ClientFindSubEntry {
|
||||
@@ -98,9 +98,9 @@ export default class ClientFindSubEntry {
|
||||
return this._use_global_settings;
|
||||
}
|
||||
|
||||
readonly _whois_info: WhoisInfo[] | undefined;
|
||||
readonly _whois_info: WhoisInfo | undefined;
|
||||
|
||||
get whoisInfo(): WhoisInfo[] | undefined {
|
||||
get whoisInfo(): WhoisInfo | undefined {
|
||||
return this._whois_info;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ export default class ClientFindSubEntry {
|
||||
this._use_global_settings = props.use_global_settings;
|
||||
}
|
||||
if (props.whois_info) {
|
||||
this._whois_info = props.whois_info.map((p) => new WhoisInfo(p));
|
||||
this._whois_info = new WhoisInfo(props.whois_info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ export default class ClientFindSubEntry {
|
||||
data.use_global_settings = this._use_global_settings;
|
||||
}
|
||||
if (typeof this._whois_info !== 'undefined') {
|
||||
data.whois_info = this._whois_info.map((p) => p.serialize());
|
||||
data.whois_info = this._whois_info.serialize();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
@@ -203,7 +203,7 @@ export default class ClientFindSubEntry {
|
||||
use_global_blocked_services: !this._use_global_blocked_services ? true : typeof this._use_global_blocked_services === 'boolean',
|
||||
blocked_services: !this._blocked_services ? true : this._blocked_services.reduce((result, p) => result && typeof p === 'string', true),
|
||||
upstreams: !this._upstreams ? true : this._upstreams.reduce((result, p) => result && typeof p === 'string', true),
|
||||
whois_info: !this._whois_info ? true : this._whois_info.reduce((result, p) => result && p.validate().length === 0, true),
|
||||
whois_info: !this._whois_info ? true : this._whois_info.validate().length === 0,
|
||||
disallowed: !this._disallowed ? true : typeof this._disallowed === 'boolean',
|
||||
disallowed_rule: !this._disallowed_rule ? true : typeof this._disallowed_rule === 'string' && !this._disallowed_rule ? true : this._disallowed_rule,
|
||||
};
|
||||
|
||||
@@ -1,31 +1,33 @@
|
||||
import ClientFindSubEntry, { IClientFindSubEntry } from './ClientFindSubEntry';
|
||||
|
||||
// This file was autogenerated. Please do not change.
|
||||
// All changes will be overwrited on commit.
|
||||
export interface IClientsFindEntry {
|
||||
[key: string]: IClientFindSubEntry;
|
||||
}
|
||||
|
||||
export default class ClientsFindEntry {
|
||||
readonly data: Record<string, ClientFindSubEntry>;
|
||||
|
||||
constructor(props: IClientsFindEntry) {
|
||||
this.data = Object.entries(props).reduce<Record<string, ClientFindSubEntry>>((prev, [key, value]) => {
|
||||
prev[key] = new ClientFindSubEntry(value!);
|
||||
return prev;
|
||||
}, {})
|
||||
}
|
||||
|
||||
serialize(): IClientsFindEntry {
|
||||
const data: IClientsFindEntry = {
|
||||
};
|
||||
return data;
|
||||
return Object.entries(this.data).reduce<Record<string, IClientFindSubEntry>>((prev, [key, value]) => {
|
||||
prev[key] = value.serialize();
|
||||
return prev;
|
||||
}, {})
|
||||
}
|
||||
|
||||
validate(): string[] {
|
||||
const validate = {
|
||||
};
|
||||
const isError: string[] = [];
|
||||
Object.keys(validate).forEach((key) => {
|
||||
if (!(validate as any)[key]) {
|
||||
isError.push(key);
|
||||
}
|
||||
});
|
||||
return isError;
|
||||
return []
|
||||
}
|
||||
|
||||
update(props: Partial<IClientsFindEntry>): ClientsFindEntry {
|
||||
update(props: IClientsFindEntry): ClientsFindEntry {
|
||||
return new ClientsFindEntry({ ...this.serialize(), ...props });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,8 @@ export default class DhcpSearchResultOtherServer {
|
||||
readonly _found: string | undefined;
|
||||
|
||||
/**
|
||||
* Description: yes|no|error
|
||||
* Description: The result of searching the other DHCP server.
|
||||
*
|
||||
* Example: no
|
||||
*/
|
||||
get found(): string | undefined {
|
||||
|
||||
@@ -16,7 +16,8 @@ export default class DhcpSearchResultStaticIP {
|
||||
readonly _static: string | undefined;
|
||||
|
||||
/**
|
||||
* Description: yes|no|error
|
||||
* Description: The result of determining static IP address.
|
||||
*
|
||||
* Example: yes
|
||||
*/
|
||||
get static(): string | undefined {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
export interface IFilter {
|
||||
enabled: boolean;
|
||||
id: number;
|
||||
lastUpdated: string;
|
||||
last_updated: string;
|
||||
name: string;
|
||||
rulesCount: number;
|
||||
rules_count: number;
|
||||
url: string;
|
||||
}
|
||||
|
||||
@@ -34,14 +34,14 @@ export default class Filter {
|
||||
return typeof id === 'number';
|
||||
}
|
||||
|
||||
readonly _lastUpdated: string;
|
||||
readonly _last_updated: string;
|
||||
|
||||
/**
|
||||
* Description: undefined
|
||||
* Example: 2018-10-30T12:18:57+03:00
|
||||
*/
|
||||
get lastUpdated(): string {
|
||||
return this._lastUpdated;
|
||||
return this._last_updated;
|
||||
}
|
||||
|
||||
static lastUpdatedValidate(lastUpdated: string): boolean {
|
||||
@@ -62,14 +62,14 @@ export default class Filter {
|
||||
return typeof name === 'string' && !!name.trim();
|
||||
}
|
||||
|
||||
readonly _rulesCount: number;
|
||||
readonly _rules_count: number;
|
||||
|
||||
/**
|
||||
* Description: undefined
|
||||
* Example: 5912
|
||||
*/
|
||||
get rulesCount(): number {
|
||||
return this._rulesCount;
|
||||
return this._rules_count;
|
||||
}
|
||||
|
||||
static rulesCountValidate(rulesCount: number): boolean {
|
||||
@@ -94,9 +94,9 @@ export default class Filter {
|
||||
constructor(props: IFilter) {
|
||||
this._enabled = props.enabled;
|
||||
this._id = props.id;
|
||||
this._lastUpdated = props.lastUpdated.trim();
|
||||
this._last_updated = props.last_updated.trim();
|
||||
this._name = props.name.trim();
|
||||
this._rulesCount = props.rulesCount;
|
||||
this._rules_count = props.rules_count;
|
||||
this._url = props.url.trim();
|
||||
}
|
||||
|
||||
@@ -104,9 +104,9 @@ export default class Filter {
|
||||
const data: IFilter = {
|
||||
enabled: this._enabled,
|
||||
id: this._id,
|
||||
lastUpdated: this._lastUpdated,
|
||||
last_updated: this._last_updated,
|
||||
name: this._name,
|
||||
rulesCount: this._rulesCount,
|
||||
rules_count: this._rules_count,
|
||||
url: this._url,
|
||||
};
|
||||
return data;
|
||||
@@ -116,9 +116,9 @@ export default class Filter {
|
||||
const validate = {
|
||||
enabled: typeof this._enabled === 'boolean',
|
||||
id: typeof this._id === 'number',
|
||||
lastUpdated: typeof this._lastUpdated === 'string' && !this._lastUpdated ? true : this._lastUpdated,
|
||||
last_updated: typeof this._last_updated === 'string' && !this._last_updated ? true : this._last_updated,
|
||||
name: typeof this._name === 'string' && !this._name ? true : this._name,
|
||||
rulesCount: typeof this._rulesCount === 'number',
|
||||
rules_count: typeof this._rules_count === 'number',
|
||||
url: typeof this._url === 'string' && !this._url ? true : this._url,
|
||||
};
|
||||
const isError: string[] = [];
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
// This file was autogenerated. Please do not change.
|
||||
// All changes will be overwrited on commit.
|
||||
export interface ILogin {
|
||||
name?: string;
|
||||
password?: string;
|
||||
username?: string;
|
||||
}
|
||||
|
||||
export default class Login {
|
||||
readonly _name: string | undefined;
|
||||
|
||||
/** */
|
||||
get name(): string | undefined {
|
||||
return this._name;
|
||||
}
|
||||
|
||||
readonly _password: string | undefined;
|
||||
|
||||
/** */
|
||||
@@ -13,37 +20,30 @@ export default class Login {
|
||||
return this._password;
|
||||
}
|
||||
|
||||
readonly _username: string | undefined;
|
||||
|
||||
/** */
|
||||
get username(): string | undefined {
|
||||
return this._username;
|
||||
}
|
||||
|
||||
constructor(props: ILogin) {
|
||||
if (typeof props.name === 'string') {
|
||||
this._name = props.name.trim();
|
||||
}
|
||||
if (typeof props.password === 'string') {
|
||||
this._password = props.password.trim();
|
||||
}
|
||||
if (typeof props.username === 'string') {
|
||||
this._username = props.username.trim();
|
||||
}
|
||||
}
|
||||
|
||||
serialize(): ILogin {
|
||||
const data: ILogin = {
|
||||
};
|
||||
if (typeof this._name !== 'undefined') {
|
||||
data.name = this._name;
|
||||
}
|
||||
if (typeof this._password !== 'undefined') {
|
||||
data.password = this._password;
|
||||
}
|
||||
if (typeof this._username !== 'undefined') {
|
||||
data.username = this._username;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
validate(): string[] {
|
||||
const validate = {
|
||||
username: !this._username ? true : typeof this._username === 'string' && !this._username ? true : this._username,
|
||||
name: !this._name ? true : typeof this._name === 'string' && !this._name ? true : this._name,
|
||||
password: !this._password ? true : typeof this._password === 'string' && !this._password ? true : this._password,
|
||||
};
|
||||
const isError: string[] = [];
|
||||
|
||||
@@ -12,7 +12,8 @@ export default class NetInterface {
|
||||
readonly _flags: string;
|
||||
|
||||
/**
|
||||
* Description: undefined
|
||||
* Description: Flags could be any combination of the following values, divided by the "|" character: "up", "broadcast", "loopback", "pointtopoint" and "multicast".
|
||||
*
|
||||
* Example: up|broadcast|multicast
|
||||
*/
|
||||
get flags(): string {
|
||||
|
||||
33
client2/src/lib/entities/NetInterfaces.ts
Normal file
33
client2/src/lib/entities/NetInterfaces.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import NetInterface, { INetInterface } from './NetInterface';
|
||||
|
||||
// This file was autogenerated. Please do not change.
|
||||
// All changes will be overwrited on commit.
|
||||
export interface INetInterfaces {
|
||||
[key: string]: INetInterface;
|
||||
}
|
||||
|
||||
export default class NetInterfaces {
|
||||
readonly data: Record<string, NetInterface>;
|
||||
|
||||
constructor(props: INetInterfaces) {
|
||||
this.data = Object.entries(props).reduce<Record<string, NetInterface>>((prev, [key, value]) => {
|
||||
prev[key] = new NetInterface(value!);
|
||||
return prev;
|
||||
}, {})
|
||||
}
|
||||
|
||||
serialize(): INetInterfaces {
|
||||
return Object.entries(this.data).reduce<Record<string, INetInterface>>((prev, [key, value]) => {
|
||||
prev[key] = value.serialize();
|
||||
return prev;
|
||||
}, {})
|
||||
}
|
||||
|
||||
validate(): string[] {
|
||||
return []
|
||||
}
|
||||
|
||||
update(props: INetInterfaces): NetInterfaces {
|
||||
return new NetInterfaces({ ...this.serialize(), ...props });
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ export interface IQueryLogItem {
|
||||
answer?: IDnsAnswer[];
|
||||
answer_dnssec?: boolean;
|
||||
client?: string;
|
||||
client_id?: string;
|
||||
client_proto?: any;
|
||||
elapsedMs?: string;
|
||||
filterId?: number;
|
||||
@@ -38,13 +39,25 @@ export default class QueryLogItem {
|
||||
readonly _client: string | undefined;
|
||||
|
||||
/**
|
||||
* Description: undefined
|
||||
* Description: The client's IP address.
|
||||
*
|
||||
* Example: 192.168.0.1
|
||||
*/
|
||||
get client(): string | undefined {
|
||||
return this._client;
|
||||
}
|
||||
|
||||
readonly _client_id: string | undefined;
|
||||
|
||||
/**
|
||||
* Description: The client ID, if provided in DOH, DOQ, or DOT.
|
||||
*
|
||||
* Example: cli123
|
||||
*/
|
||||
get clientId(): string | undefined {
|
||||
return this._client_id;
|
||||
}
|
||||
|
||||
readonly _client_proto: any | undefined;
|
||||
|
||||
get clientProto(): any | undefined {
|
||||
@@ -156,6 +169,9 @@ export default class QueryLogItem {
|
||||
if (typeof props.client === 'string') {
|
||||
this._client = props.client.trim();
|
||||
}
|
||||
if (typeof props.client_id === 'string') {
|
||||
this._client_id = props.client_id.trim();
|
||||
}
|
||||
if (props.client_proto) {
|
||||
this._client_proto = props.client_proto;
|
||||
}
|
||||
@@ -206,6 +222,9 @@ export default class QueryLogItem {
|
||||
if (typeof this._client !== 'undefined') {
|
||||
data.client = this._client;
|
||||
}
|
||||
if (typeof this._client_id !== 'undefined') {
|
||||
data.client_id = this._client_id;
|
||||
}
|
||||
if (typeof this._client_proto !== 'undefined') {
|
||||
data.client_proto = this._client_proto;
|
||||
}
|
||||
@@ -252,6 +271,7 @@ export default class QueryLogItem {
|
||||
upstream: !this._upstream ? true : typeof this._upstream === 'string' && !this._upstream ? true : this._upstream,
|
||||
answer_dnssec: !this._answer_dnssec ? true : typeof this._answer_dnssec === 'boolean',
|
||||
client: !this._client ? true : typeof this._client === 'string' && !this._client ? true : this._client,
|
||||
client_id: !this._client_id ? true : typeof this._client_id === 'string' && !this._client_id ? true : this._client_id,
|
||||
elapsedMs: !this._elapsedMs ? true : typeof this._elapsedMs === 'string' && !this._elapsedMs ? true : this._elapsedMs,
|
||||
question: !this._question ? true : this._question.validate().length === 0,
|
||||
filterId: !this._filterId ? true : typeof this._filterId === 'number',
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
// All changes will be overwrited on commit.
|
||||
export interface IServerStatus {
|
||||
dhcp_available?: boolean;
|
||||
dns_address: string;
|
||||
dns_addresses: string[];
|
||||
dns_port: number;
|
||||
http_port: number;
|
||||
language: string;
|
||||
protection_enabled: boolean;
|
||||
querylog_enabled: boolean;
|
||||
running: boolean;
|
||||
version: string;
|
||||
}
|
||||
@@ -18,18 +18,18 @@ export default class ServerStatus {
|
||||
return this._dhcp_available;
|
||||
}
|
||||
|
||||
readonly _dns_address: string;
|
||||
readonly _dns_addresses: string[];
|
||||
|
||||
/**
|
||||
* Description: undefined
|
||||
* Example: 127.0.0.1
|
||||
*/
|
||||
get dnsAddress(): string {
|
||||
return this._dns_address;
|
||||
get dnsAddresses(): string[] {
|
||||
return this._dns_addresses;
|
||||
}
|
||||
|
||||
static dnsAddressValidate(dnsAddress: string): boolean {
|
||||
return typeof dnsAddress === 'string' && !!dnsAddress.trim();
|
||||
static dnsAddressesValidate(dnsAddresses: string[]): boolean {
|
||||
return dnsAddresses.reduce<boolean>((result, p) => result && (typeof p === 'string' && !!p.trim()), true);
|
||||
}
|
||||
|
||||
readonly _dns_port: number;
|
||||
@@ -54,6 +54,28 @@ export default class ServerStatus {
|
||||
return dnsPort >= 1 && dnsPort <= 65535;
|
||||
}
|
||||
|
||||
readonly _http_port: number;
|
||||
|
||||
/**
|
||||
* Description: undefined
|
||||
* Example: 80
|
||||
*/
|
||||
get httpPort(): number {
|
||||
return this._http_port;
|
||||
}
|
||||
|
||||
static get httpPortMinValue() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static get httpPortMaxValue() {
|
||||
return 65535;
|
||||
}
|
||||
|
||||
static httpPortValidate(httpPort: number): boolean {
|
||||
return httpPort >= 1 && httpPort <= 65535;
|
||||
}
|
||||
|
||||
readonly _language: string;
|
||||
|
||||
/**
|
||||
@@ -78,16 +100,6 @@ export default class ServerStatus {
|
||||
return typeof protectionEnabled === 'boolean';
|
||||
}
|
||||
|
||||
readonly _querylog_enabled: boolean;
|
||||
|
||||
get querylogEnabled(): boolean {
|
||||
return this._querylog_enabled;
|
||||
}
|
||||
|
||||
static querylogEnabledValidate(querylogEnabled: boolean): boolean {
|
||||
return typeof querylogEnabled === 'boolean';
|
||||
}
|
||||
|
||||
readonly _running: boolean;
|
||||
|
||||
get running(): boolean {
|
||||
@@ -116,22 +128,22 @@ export default class ServerStatus {
|
||||
if (typeof props.dhcp_available === 'boolean') {
|
||||
this._dhcp_available = props.dhcp_available;
|
||||
}
|
||||
this._dns_address = props.dns_address.trim();
|
||||
this._dns_addresses = props.dns_addresses;
|
||||
this._dns_port = props.dns_port;
|
||||
this._http_port = props.http_port;
|
||||
this._language = props.language.trim();
|
||||
this._protection_enabled = props.protection_enabled;
|
||||
this._querylog_enabled = props.querylog_enabled;
|
||||
this._running = props.running;
|
||||
this._version = props.version.trim();
|
||||
}
|
||||
|
||||
serialize(): IServerStatus {
|
||||
const data: IServerStatus = {
|
||||
dns_address: this._dns_address,
|
||||
dns_addresses: this._dns_addresses,
|
||||
dns_port: this._dns_port,
|
||||
http_port: this._http_port,
|
||||
language: this._language,
|
||||
protection_enabled: this._protection_enabled,
|
||||
querylog_enabled: this._querylog_enabled,
|
||||
running: this._running,
|
||||
version: this._version,
|
||||
};
|
||||
@@ -143,11 +155,11 @@ export default class ServerStatus {
|
||||
|
||||
validate(): string[] {
|
||||
const validate = {
|
||||
dns_address: typeof this._dns_address === 'string' && !this._dns_address ? true : this._dns_address,
|
||||
dns_addresses: this._dns_addresses.reduce((result, p) => result && typeof p === 'string', true),
|
||||
dns_port: this._dns_port >= 1 && this._dns_port <= 65535,
|
||||
http_port: this._http_port >= 1 && this._http_port <= 65535,
|
||||
protection_enabled: typeof this._protection_enabled === 'boolean',
|
||||
dhcp_available: !this._dhcp_available ? true : typeof this._dhcp_available === 'boolean',
|
||||
querylog_enabled: typeof this._querylog_enabled === 'boolean',
|
||||
running: typeof this._running === 'boolean',
|
||||
version: typeof this._version === 'string' && !this._version ? true : this._version,
|
||||
language: typeof this._language === 'string' && !this._language ? true : this._language,
|
||||
|
||||
@@ -107,7 +107,7 @@ export default class Stats {
|
||||
readonly _time_units: string | undefined;
|
||||
|
||||
/**
|
||||
* Description: Time units (hours | days)
|
||||
* Description: Time units
|
||||
* Example: hours
|
||||
*/
|
||||
get timeUnits(): string | undefined {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// All changes will be overwrited on commit.
|
||||
export interface ITopArrayEntry {
|
||||
domain_or_ip?: number;
|
||||
[key: string]: number | undefined;
|
||||
}
|
||||
|
||||
export default class TopArrayEntry {
|
||||
@@ -11,19 +12,20 @@ export default class TopArrayEntry {
|
||||
return this._domain_or_ip;
|
||||
}
|
||||
|
||||
readonly numberData: Record<string, number>;
|
||||
|
||||
constructor(props: ITopArrayEntry) {
|
||||
if (typeof props.domain_or_ip === 'number') {
|
||||
this._domain_or_ip = props.domain_or_ip;
|
||||
}
|
||||
this.numberData = Object.entries(props).reduce<Record<string, number>>((prev, [key, value]) => {
|
||||
prev[key] = value!;
|
||||
return prev;
|
||||
}, {})
|
||||
}
|
||||
|
||||
serialize(): ITopArrayEntry {
|
||||
const data: ITopArrayEntry = {
|
||||
};
|
||||
if (typeof this._domain_or_ip !== 'undefined') {
|
||||
data.domain_or_ip = this._domain_or_ip;
|
||||
}
|
||||
return data;
|
||||
return Object.entries(this.numberData).reduce<Record<string, number>>((prev, [key, value]) => {
|
||||
prev[key] = value;
|
||||
return prev;
|
||||
}, {})
|
||||
}
|
||||
|
||||
validate(): string[] {
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
// This file was autogenerated. Please do not change.
|
||||
// All changes will be overwrited on commit.
|
||||
export interface IUpstreamsConfigResponse {
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export default class UpstreamsConfigResponse {
|
||||
readonly data: Record<string, string>;
|
||||
|
||||
constructor(props: IUpstreamsConfigResponse) {
|
||||
this.data = Object.entries(props).reduce<Record<string, string>>((prev, [key, value]) => {
|
||||
prev[key] = value!;
|
||||
return prev;
|
||||
}, {})
|
||||
}
|
||||
|
||||
serialize(): IUpstreamsConfigResponse {
|
||||
const data: IUpstreamsConfigResponse = {
|
||||
};
|
||||
return data;
|
||||
return Object.entries(this.data).reduce<Record<string, string>>((prev, [key, value]) => {
|
||||
prev[key] = value;
|
||||
return prev;
|
||||
}, {})
|
||||
}
|
||||
|
||||
validate(): string[] {
|
||||
const validate = {
|
||||
};
|
||||
const isError: string[] = [];
|
||||
Object.keys(validate).forEach((key) => {
|
||||
if (!(validate as any)[key]) {
|
||||
isError.push(key);
|
||||
}
|
||||
});
|
||||
return isError;
|
||||
return []
|
||||
}
|
||||
|
||||
update(props: Partial<IUpstreamsConfigResponse>): UpstreamsConfigResponse {
|
||||
update(props: IUpstreamsConfigResponse): UpstreamsConfigResponse {
|
||||
return new UpstreamsConfigResponse({ ...this.serialize(), ...props });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ export interface IVersionInfo {
|
||||
announcement?: string;
|
||||
announcement_url?: string;
|
||||
can_autoupdate?: boolean;
|
||||
disabled: boolean;
|
||||
new_version?: string;
|
||||
}
|
||||
|
||||
@@ -35,6 +36,17 @@ export default class VersionInfo {
|
||||
return this._can_autoupdate;
|
||||
}
|
||||
|
||||
readonly _disabled: boolean;
|
||||
|
||||
/** */
|
||||
get disabled(): boolean {
|
||||
return this._disabled;
|
||||
}
|
||||
|
||||
static disabledValidate(disabled: boolean): boolean {
|
||||
return typeof disabled === 'boolean';
|
||||
}
|
||||
|
||||
readonly _new_version: string | undefined;
|
||||
|
||||
/**
|
||||
@@ -55,6 +67,7 @@ export default class VersionInfo {
|
||||
if (typeof props.can_autoupdate === 'boolean') {
|
||||
this._can_autoupdate = props.can_autoupdate;
|
||||
}
|
||||
this._disabled = props.disabled;
|
||||
if (typeof props.new_version === 'string') {
|
||||
this._new_version = props.new_version.trim();
|
||||
}
|
||||
@@ -62,6 +75,7 @@ export default class VersionInfo {
|
||||
|
||||
serialize(): IVersionInfo {
|
||||
const data: IVersionInfo = {
|
||||
disabled: this._disabled,
|
||||
};
|
||||
if (typeof this._announcement !== 'undefined') {
|
||||
data.announcement = this._announcement;
|
||||
@@ -80,6 +94,7 @@ export default class VersionInfo {
|
||||
|
||||
validate(): string[] {
|
||||
const validate = {
|
||||
disabled: typeof this._disabled === 'boolean',
|
||||
new_version: !this._new_version ? true : typeof this._new_version === 'string' && !this._new_version ? true : this._new_version,
|
||||
announcement: !this._announcement ? true : typeof this._announcement === 'string' && !this._announcement ? true : this._announcement,
|
||||
announcement_url: !this._announcement_url ? true : typeof this._announcement_url === 'string' && !this._announcement_url ? true : this._announcement_url,
|
||||
|
||||
@@ -1,45 +1,31 @@
|
||||
// This file was autogenerated. Please do not change.
|
||||
// All changes will be overwrited on commit.
|
||||
export interface IWhoisInfo {
|
||||
key?: string;
|
||||
[key: string]: string;
|
||||
}
|
||||
|
||||
export default class WhoisInfo {
|
||||
readonly _key: string | undefined;
|
||||
|
||||
get key(): string | undefined {
|
||||
return this._key;
|
||||
}
|
||||
readonly data: Record<string, string>;
|
||||
|
||||
constructor(props: IWhoisInfo) {
|
||||
if (typeof props.key === 'string') {
|
||||
this._key = props.key.trim();
|
||||
}
|
||||
this.data = Object.entries(props).reduce<Record<string, string>>((prev, [key, value]) => {
|
||||
prev[key] = value!;
|
||||
return prev;
|
||||
}, {})
|
||||
}
|
||||
|
||||
serialize(): IWhoisInfo {
|
||||
const data: IWhoisInfo = {
|
||||
};
|
||||
if (typeof this._key !== 'undefined') {
|
||||
data.key = this._key;
|
||||
}
|
||||
return data;
|
||||
return Object.entries(this.data).reduce<Record<string, string>>((prev, [key, value]) => {
|
||||
prev[key] = value;
|
||||
return prev;
|
||||
}, {})
|
||||
}
|
||||
|
||||
validate(): string[] {
|
||||
const validate = {
|
||||
key: !this._key ? true : typeof this._key === 'string' && !this._key ? true : this._key,
|
||||
};
|
||||
const isError: string[] = [];
|
||||
Object.keys(validate).forEach((key) => {
|
||||
if (!(validate as any)[key]) {
|
||||
isError.push(key);
|
||||
}
|
||||
});
|
||||
return isError;
|
||||
return []
|
||||
}
|
||||
|
||||
update(props: Partial<IWhoisInfo>): WhoisInfo {
|
||||
update(props: IWhoisInfo): WhoisInfo {
|
||||
return new WhoisInfo({ ...this.serialize(), ...props });
|
||||
}
|
||||
}
|
||||
|
||||
51
client2/src/lib/theme/Content.module.pcss
Normal file
51
client2/src/lib/theme/Content.module.pcss
Normal file
@@ -0,0 +1,51 @@
|
||||
.content {
|
||||
min-height: 100vh;
|
||||
|
||||
&_auth {
|
||||
@media (--m-viewport) {
|
||||
background-color: var(--gray100);
|
||||
background-image: url('../../assets/img/install.png');
|
||||
background-position: center 20px;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
&_inner {
|
||||
min-height: calc(100vh - var(--header-height));
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 16px;
|
||||
|
||||
@media (--l-viewport) {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
&_auth {
|
||||
max-width: 432px;
|
||||
padding: 24px 16px 40px;
|
||||
|
||||
@media (--m-viewport) {
|
||||
padding: 40px 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.header {
|
||||
margin-bottom: 16px;
|
||||
padding: 0 16px;
|
||||
|
||||
@media (--m-viewport) {
|
||||
margin-bottom: 24px;
|
||||
padding: 0 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
.icons {
|
||||
display: none;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import React, { FC } from 'react';
|
||||
import './Icon.pcss';
|
||||
|
||||
export type IconType =
|
||||
'logo' |
|
||||
'visibility_disable' |
|
||||
'visibility_enable';
|
||||
|
||||
const Icons: FC = () => (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" className="icons">
|
||||
<symbol id="logo" viewBox="0 0 185 57">
|
||||
<g fill="none" fillRule="evenodd">
|
||||
<path fill="#242424" fillRule="nonzero" d="M0.5,15.7348066 L7.2386844,0.154696133 L10.4283283,0.154696133 L17.1670127,15.7348066 L13.5505855,15.7348066 L12.1129994,12.2651934 L5.46416417,12.2651934 L4.02657817,15.7348066 L0.5,15.7348066 Z M6.69958965,9.25966851 L10.877574,9.25966851 L8.78858181,4.24309392 L6.69958965,9.25966851 Z M18.9722792,15.7348066 L18.9722792,0.26519337 L25.104482,0.26519337 C27.5603704,0.26519337 29.5669808,0.99815105 31.1243734,2.4640884 C32.681766,3.93002575 33.4604507,5.77531116 33.4604507,8 C33.4604507,10.2099558 32.6780224,12.0515654 31.1131423,13.5248619 C29.5482622,14.9981584 27.5453955,15.7348066 25.104482,15.7348066 L18.9722792,15.7348066 Z M22.4314705,12.6629834 L25.104482,12.6629834 C26.5271003,12.6629834 27.6726695,12.2320485 28.5412111,11.3701657 C29.4097569,10.508283 29.8440234,9.38490564 29.8440234,8 C29.8440234,6.6298274 29.4060133,5.51013326 28.5299799,4.64088398 C27.6539466,3.7716347 26.5121254,3.33701657 25.104482,3.33701657 L22.4314705,3.33701657 L22.4314705,12.6629834 Z M43.4869121,16 C41.0459987,16 39.0581066,15.2486263 37.5231764,13.7458564 C35.9882462,12.2430864 35.2207926,10.3278201 35.2207926,8 C35.2207926,5.77531116 36.0069646,3.88582729 37.5793321,2.33149171 C39.1516997,0.777156133 41.113386,0 43.4644498,0 C44.8271684,0 45.9802206,0.173110608 46.9236412,0.519337017 C47.8670617,0.865563425 48.7730313,1.39962807 49.6415772,2.12154696 L47.4627359,4.70718232 C46.803839,4.16205989 46.1674141,3.76427381 45.553442,3.51381215 C44.9394699,3.2633505 44.2057051,3.13812155 43.3521384,3.13812155 C42.0942444,3.13812155 41.0272967,3.61325492 40.1512633,4.56353591 C39.27523,5.51381691 38.8372199,6.65929348 38.8372199,8 C38.8372199,9.41437171 39.2827173,10.5856307 40.1737256,11.5138122 C41.0647339,12.4419936 42.2065551,12.9060773 43.5992235,12.9060773 C44.8870674,12.9060773 45.9727335,12.5966882 46.8562543,11.9779006 L46.8562543,9.7679558 L43.3746007,9.7679558 L43.3746007,6.82872928 L50.2031342,6.82872928 L50.2031342,13.5469613 C48.2414185,15.1823286 46.0027002,16 43.4869121,16 Z M60.086538,15.9779006 C57.9451232,15.9779006 56.2754376,15.392271 55.0774493,14.2209945 C53.8794549,13.0497179 53.2804668,11.3443943 53.2804668,9.10497238 L53.2804668,0.26519337 L56.7396581,0.26519337 L56.7396581,9.01657459 C56.7396581,10.2541498 57.0354085,11.2007334 57.6269182,11.8563536 C58.2184279,12.5119738 59.0532677,12.839779 60.1314626,12.839779 C61.2096575,12.839779 62.0444972,12.5230234 62.6360069,11.8895028 C63.2275166,11.2559821 63.5232671,10.335181 63.5232671,9.12707182 L63.5232671,0.26519337 L66.9824584,0.26519337 L66.9824584,8.99447514 C66.9824584,11.2928292 66.3722392,13.0313017 65.1517825,14.2099448 C63.9313257,15.3885878 62.2429278,15.9779006 60.086538,15.9779006 Z M67.9199798,15.7348066 L74.6586642,0.154696133 L77.8483082,0.154696133 L84.5869926,15.7348066 L80.9705653,15.7348066 L79.5329793,12.2651934 L72.884144,12.2651934 L71.446558,15.7348066 L67.9199798,15.7348066 Z M74.1195695,9.25966851 L78.2975538,9.25966851 L76.2085617,4.24309392 L74.1195695,9.25966851 Z M86.3922591,15.7348066 L86.3922591,0.26519337 L93.5801891,0.26519337 C95.5718547,0.26519337 97.0992745,0.788208398 98.1624945,1.83425414 C99.0609902,2.71823646 99.5102314,3.9115947 99.5102314,5.41436464 C99.5102314,7.78638387 98.3871285,9.38489459 96.1408892,10.2099448 L99.9819393,15.7348066 L95.9387286,15.7348066 L92.5244619,10.7845304 L89.8514504,10.7845304 L89.8514504,15.7348066 L86.3922591,15.7348066 Z M89.8514504,7.77900552 L93.3555663,7.77900552 C94.1941623,7.77900552 94.8455619,7.57642928 95.3097847,7.17127072 C95.7740075,6.76611215 96.0061155,6.2246811 96.0061155,5.54696133 C96.0061155,4.82504243 95.7665202,4.27624497 95.2873225,3.90055249 C94.8081247,3.52486 94.1417504,3.33701657 93.2881794,3.33701657 L89.8514504,3.33701657 L89.8514504,7.77900552 Z M102.011829,15.7348066 L102.011829,0.26519337 L108.144031,0.26519337 C110.59992,0.26519337 112.60653,0.99815105 114.163923,2.4640884 C115.721315,3.93002575 116.5,5.77531116 116.5,8 C116.5,10.2099558 115.717572,12.0515654 114.152692,13.5248619 C112.587812,14.9981584 110.584945,15.7348066 108.144031,15.7348066 L102.011829,15.7348066 Z M105.47102,12.6629834 L108.144031,12.6629834 C109.56665,12.6629834 110.712219,12.2320485 111.58076,11.3701657 C112.449306,10.508283 112.883573,9.38490564 112.883573,8 C112.883573,6.6298274 112.445563,5.51013326 111.569529,4.64088398 C110.693496,3.7716347 109.551675,3.33701657 108.144031,3.33701657 L105.47102,3.33701657 L105.47102,12.6629834 Z" transform="translate(67.5 14)" />
|
||||
<path fill="#68BC71" d="M28.4993695,0 C19.5913422,0 8.84603419,2.043769 8.73987156e-06,6.54224924 C8.73987156e-06,16.2577508 -0.122097033,40.4620061 28.4993695,57 C57.1214688,40.4620061 56.9999957,16.2577508 56.9999957,6.54224924 C48.1533375,2.043769 37.4080296,0 28.4993695,0 L28.4993695,0 Z" />
|
||||
<path fill="#67B279" d="M28.4993695,0 L28.4993695,57 C0.736546964,40.9581459 0.0185516086,17.7031064 0.000458427595,7.45516583 L8.73987165e-06,6.54224924 C8.84603419,2.043769 19.5913422,0 28.4993695,0 L28.4993695,0 Z" />
|
||||
<path fill="#FFF" d="M28.2485704,36.6428571 L44.7857143,14.7312121 C43.573906,13.7763263 42.510977,14.450265 41.9258467,14.9720239 L41.9044958,14.9736962 L28.1158485,29.075123 L22.9206532,22.9288475 C20.4422167,20.113802 17.0728126,22.2610406 16.2857143,22.8285092 L28.2485704,36.6428571" />
|
||||
<path fill="#4D4D4D" fillRule="nonzero" d="M70.056,49 L70.056,43.768 L76.072,43.768 L76.072,49 L77.592,49 L77.592,37.576 L76.072,37.576 L76.072,42.488 L70.056,42.488 L70.056,37.576 L68.536,37.576 L68.536,49 L70.056,49 Z M85.92,49.256 C86.8266667,49.256 87.6213333,49.0933333 88.304,48.768 C88.9866667,48.4426667 89.5573333,48.0026667 90.016,47.448 C90.4746667,46.8933333 90.8186667,46.256 91.048,45.536 C91.2773333,44.816 91.392,44.0666667 91.392,43.288 C91.392,42.5093333 91.2773333,41.76 91.048,41.04 C90.8186667,40.32 90.4746667,39.6826667 90.016,39.128 C89.5573333,38.5733333 88.9866667,38.1306667 88.304,37.8 C87.6213333,37.4693333 86.8266667,37.304 85.92,37.304 C85.0133333,37.304 84.2186667,37.4693333 83.536,37.8 C82.8533333,38.1306667 82.2826667,38.5733333 81.824,39.128 C81.3653333,39.6826667 81.0213333,40.32 80.792,41.04 C80.5626667,41.76 80.448,42.5093333 80.448,43.288 C80.448,44.0666667 80.5626667,44.816 80.792,45.536 C81.0213333,46.256 81.3653333,46.8933333 81.824,47.448 C82.2826667,48.0026667 82.8533333,48.4426667 83.536,48.768 C84.2186667,49.0933333 85.0133333,49.256 85.92,49.256 Z M85.92,47.992 C85.2266667,47.992 84.6293333,47.856 84.128,47.584 C83.6266667,47.312 83.216,46.952 82.896,46.504 C82.576,46.056 82.3413333,45.552 82.192,44.992 C82.0426667,44.432 81.968,43.864 81.968,43.288 C81.968,42.712 82.0426667,42.144 82.192,41.584 C82.3413333,41.024 82.576,40.52 82.896,40.072 C83.216,39.624 83.6266667,39.264 84.128,38.992 C84.6293333,38.72 85.2266667,38.584 85.92,38.584 C86.6133333,38.584 87.2106667,38.72 87.712,38.992 C88.2133333,39.264 88.624,39.624 88.944,40.072 C89.264,40.52 89.4986667,41.024 89.648,41.584 C89.7973333,42.144 89.872,42.712 89.872,43.288 C89.872,43.864 89.7973333,44.432 89.648,44.992 C89.4986667,45.552 89.264,46.056 88.944,46.504 C88.624,46.952 88.2133333,47.312 87.712,47.584 C87.2106667,47.856 86.6133333,47.992 85.92,47.992 Z M95.72,49 L95.72,39.496 L95.752,39.496 L99.32,49 L100.616,49 L104.184,39.496 L104.216,39.496 L104.216,49 L105.656,49 L105.656,37.576 L103.576,37.576 L99.96,47.176 L96.36,37.576 L94.28,37.576 L94.28,49 L95.72,49 Z M117.12,49 L117.12,47.72 L110.704,47.72 L110.704,43.768 L116.64,43.768 L116.64,42.488 L110.704,42.488 L110.704,38.856 L117.072,38.856 L117.072,37.576 L109.184,37.576 L109.184,49 L117.12,49 Z" />
|
||||
</g>
|
||||
</symbol>
|
||||
|
||||
<symbol id="visibility_disable" viewBox="0 0 24 24" fill="currentColor" fillRule="evenodd" clipRule="evenodd">
|
||||
<path d="M6.07675 11.0186L5.30088 11.4665C4.88614 11.706 4.35582 11.5639 4.11638 11.1491C3.87693 10.7344 4.01903 10.2041 4.43376 9.96464L5.77791 9.1886C5.82632 9.16065 5.87632 9.1379 5.92724 9.12017C5.94 9.11267 5.95302 9.10545 5.96629 9.09852C6.39087 8.877 6.91464 9.04161 7.13616 9.4662C7.63369 10.4198 9.41088 12.43 12.3523 12.4681C15.2937 12.43 17.0709 10.4198 17.5684 9.4662C17.7899 9.04161 18.3137 8.877 18.7383 9.09852C18.7844 9.1226 18.8275 9.15025 18.8674 9.18096C18.8719 9.18347 18.8764 9.18601 18.8809 9.1886L20.225 9.96464C20.6398 10.2041 20.7818 10.7344 20.5424 11.1491C20.303 11.5639 19.7726 11.706 19.3579 11.4665L18.614 11.037C18.188 11.6053 17.575 12.2431 16.7787 12.7966L17.2222 13.5647C17.4616 13.9794 17.3195 14.5097 16.9048 14.7492C16.4901 14.9886 15.9597 14.8465 15.7203 14.4318L15.2549 13.6258C14.6462 13.8742 13.9706 14.0595 13.2289 14.1469V15.1327C13.2289 15.6116 12.8407 15.9998 12.3618 15.9998C11.8829 15.9998 11.4947 15.6116 11.4947 15.1327V14.1492C10.607 14.0466 9.81358 13.804 9.11589 13.4803L8.56656 14.4318C8.32711 14.8465 7.79679 14.9886 7.38206 14.7492C6.96732 14.5097 6.82523 13.9794 7.06467 13.5647L7.63183 12.5823C6.969 12.0763 6.44978 11.5196 6.07675 11.0186Z" />
|
||||
</symbol>
|
||||
|
||||
<symbol id="visibility_enable" viewBox="0 0 24 24" fill="currentColor">
|
||||
<path fillRule="evenodd" clipRule="evenodd" d="M4 11.9999C4.02485 11.6762 4.15136 11.3586 4.37852 11.0961L4.37907 11.0955C4.47595 10.9837 5.34608 9.99479 6.66752 9.0233C7.95858 8.07415 9.87032 7 12.0213 7C14.1723 7 16.084 8.07415 17.3751 9.0233C18.6965 9.99479 19.5666 10.9837 19.6635 11.0955L19.6676 11.1003C19.8904 11.3598 20.0171 11.6759 20.0422 11.9999C20.0171 12.324 19.8904 12.6402 19.6676 12.8997L19.6635 12.9045C19.5666 13.0163 18.6965 14.0052 17.3751 14.9767C16.084 15.9259 14.1723 17 12.0213 17C9.87032 17 7.95858 15.9259 6.66752 14.9767C5.34608 14.0052 4.47595 13.0163 4.37907 12.9045L4.37852 12.9039C4.15136 12.6414 4.02485 12.3237 4 11.9999ZM18.6435 11.9425C18.6588 11.9603 18.6715 11.9796 18.6815 11.9999C18.6715 12.0203 18.6588 12.0397 18.6435 12.0575C18.5147 12.2061 15.455 15.6908 12.0213 15.6908C8.58758 15.6908 5.52785 12.2061 5.39911 12.0575C5.38362 12.0397 5.37086 12.0202 5.36082 11.9999C5.37086 11.9797 5.38362 11.9603 5.39911 11.9425C5.52785 11.7939 8.58758 8.30924 12.0213 8.30924C15.455 8.30924 18.5147 11.7939 18.6435 11.9425Z" />
|
||||
<circle cx="12" cy="11" r="3" />
|
||||
</symbol>
|
||||
</svg>
|
||||
);
|
||||
|
||||
export default Icons;
|
||||
@@ -1,26 +1,3 @@
|
||||
.layout {
|
||||
min-height: 100vh;
|
||||
background-color: var(--gray100);
|
||||
|
||||
@media (--m-viewport) {
|
||||
background-image: url('../../assets/img/install.png');
|
||||
background-position: center 20px;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
max-width: 432px;
|
||||
margin: 0 auto;
|
||||
padding: 24px 16px 40px;
|
||||
|
||||
@media (--m-viewport) {
|
||||
padding: 40px 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.title,
|
||||
.subtitle,
|
||||
.text {
|
||||
|
||||
@@ -11,4 +11,17 @@
|
||||
&:active {
|
||||
color: var(--green400);
|
||||
}
|
||||
|
||||
&.gray {
|
||||
color: var(--gray900);
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: var(--gray700);
|
||||
}
|
||||
|
||||
&:active {
|
||||
color: var(--gray700);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,8 +22,20 @@
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.code {
|
||||
padding: 3px 5px;
|
||||
font-size: 14px;
|
||||
font-family: var(--font-family-monospace);
|
||||
background-color: var(--gray300);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.danger {
|
||||
text-transform: uppercase;
|
||||
color: var(--red400);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
8
client2/src/lib/theme/colors.ts
Normal file
8
client2/src/lib/theme/colors.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export const colors = {
|
||||
red: '#c23814',
|
||||
orange: '#eb9300',
|
||||
purple: '#b267a0',
|
||||
green: '#67b279',
|
||||
gray300: '#d8d8d8',
|
||||
gray700: '#888888',
|
||||
};
|
||||
@@ -2,12 +2,17 @@ import form from './Form.module.pcss';
|
||||
import text from './Text.module.pcss';
|
||||
import install from './Install.module.pcss';
|
||||
import link from './Link.module.pcss';
|
||||
import content from './Content.module.pcss';
|
||||
|
||||
import { colors } from './colors';
|
||||
|
||||
const theme = {
|
||||
form,
|
||||
chartColors: colors,
|
||||
text,
|
||||
install,
|
||||
link,
|
||||
content,
|
||||
};
|
||||
|
||||
export default theme;
|
||||
|
||||
Reference in New Issue
Block a user