diff --git a/src/components/Loader/Loader.less b/src/components/Loader/Loader.less
index 5d5d7628..c2d7e234 100755
--- a/src/components/Loader/Loader.less
+++ b/src/components/Loader/Loader.less
@@ -1,26 +1,17 @@
@import '~theme/index.less';
.wrapper {
- font-family: @__Global_general_font_family;
- color: white;
- line-height: 55px;
- span{
- margin: 0 10px 0 auto;
- }
-
+ user-select: none;
position: absolute;
z-index: 1000;
right: 0;
bottom: 0;
- width: 140px;
- height: 55px;
- display: flex;
- flex-direction: row;
- justify-content: space-around;
+ width: auto;
+ height: 29px;
+
+ margin: 30px;
background-color: #2d2d2dc2;
border-radius: 28px;
- margin: 10px;
-
&.end {
animation: unshow 0.8s linear;
@@ -32,11 +23,9 @@
}
.newloader {
- transform: translate(21px,27px) scale(0.3);
- width: 0px;
- height: 0px;
- margin: 0 45px 0 0;
- position: relative;
+ transform: scale(0.28);
+ width: 54px;
+ height: 23px;
}
.newloader>div {
diff --git a/src/core/index.js b/src/core/index.js
index bce10d70..39280711 100644
--- a/src/core/index.js
+++ b/src/core/index.js
@@ -408,3 +408,26 @@ export function get_value(source,key){
export function iatToString(iat){
return new Date(iat * 1000).toLocaleString()
}
+
+export function extendIDCode(id){
+ num.toString().padStart(4, "0");
+
+}
+
+export function generateUUID( lenght = 6 ){
+ let text = ""
+ const possibleChars = "abcdefghijklmnopqrstuvwxyz0123456789"
+
+ for ( let i = 0; i < 6; i++ )
+ text += possibleChars.charAt ( Math.floor ( Math.random () * possibleChars.length ) )
+
+ return text
+}
+
+ /**
+ * Generate a random string
+ * @returns {string}
+ */
+export function generateRandomId( length = 15 ){
+ return Math.random ().toString ( 36 ).substring ( 0, length );
+}
\ No newline at end of file
diff --git a/src/layouts/PrimaryLayout.js b/src/layouts/PrimaryLayout.js
index 028cf0a6..c6a615f5 100755
--- a/src/layouts/PrimaryLayout.js
+++ b/src/layouts/PrimaryLayout.js
@@ -88,7 +88,7 @@ class PrimaryLayout extends React.Component {
{isActive(currentTheme['backgroundImage'])?
{
+ let url = item;
+ let method = 'GET';
+ const paramsArray = item.split(' ');
+ if (paramsArray.length === 2) {
+ method = paramsArray[0];
+ url = paramsArray[1];
+ }
+ return {
+ method,
+ url,
+ };
+});
+
+let uuid = 2;
+
+export default class RequestPage extends React.Component {
+ paramsForm = React.createRef();
+ bodyDataForm = React.createRef();
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ // Default sets
+ method: 'GET',
+ url: '',
+ ParamsKeys: [1],
+ BodyKeys: [1],
+ result: null,
+ visible: true,
+ };
+ }
+
+ handleRequest = () => {
+ const { method, url } = this.state;
+ let params = {};
+ let body = {};
+
+ this.paramsForm.current
+ .validateFields()
+ .then(values => {
+ if (values) {
+ for (let i in values) {
+ if (i.startsWith('check')) {
+ const index = i.match(/check\[(\d+)\]/)[1];
+ const key = values[`key[${index}]`];
+ params[key] = values[`value[${index}]`];
+ }
+ }
+ }
+ })
+ .catch(errorInfo => {
+ console.log(errorInfo);
+ });
+
+ this.bodyDataForm.current
+ .validateFields()
+ .then(values => {
+ if (values) {
+ for (let i in values) {
+ if (i.startsWith('check')) {
+ const index = i.match(/check\[(\d+)\]/)[1];
+ const key = values[`key[${index}]`];
+ body[key] = values[`value[${index}]`];
+ }
+ }
+ }
+ })
+ .catch(errorInfo => {
+ console.log(errorInfo);
+ });
+ const frame = {
+ method,
+ endpoint: `${method} ${url}`,
+ body,
+ verbose: true
+ }
+ console.log(frame)
+ api_request(frame, (err, res) => {
+ this.setState({
+ result: res,
+ });
+ })
+ };
+
+ handleClickListItem = ({ method, url }) => {
+ this.setState({
+ method,
+ url,
+ keys: [uuid++],
+ result: null,
+ });
+ };
+
+ handleInputChange = e => {
+ this.setState({
+ url: e.target.value,
+ });
+ };
+
+ handleSelectChange = method => {
+ this.setState({
+ method,
+ });
+ };
+
+ handleAddParam = () => {
+ const { ParamsKeys } = this.state;
+ const nextKeys = ParamsKeys.concat(uuid);
+ uuid++;
+ this.setState({
+ ParamsKeys: nextKeys,
+ });
+ };
+
+ handleAddBody = () => {
+ const { BodyKeys } = this.state;
+ const nextKeys = BodyKeys.concat(uuid);
+ uuid++;
+ this.setState({
+ BodyKeys: nextKeys,
+ });
+ };
+
+ handleRemoveParam = key => {
+ const { ParamsKeys } = this.state;
+ this.setState({
+ ParamsKeys: ParamsKeys.filter(item => item !== key),
+ });
+ };
+
+ handleRemoveBody = key => {
+ const { BodyKeys } = this.state;
+ this.setState({
+ BodyKeys: BodyKeys.filter(item => item !== key),
+ });
+ };
+
+ handleVisible = () => {
+ this.setState({
+ visible: !this.state.visible,
+ });
+ };
+
+ render() {
+ const { result, url, method, ParamsKeys, BodyKeys, visible } = this.state;
+
+ return (
+
+
+
+ (
+
+
+
+ {item.method}
+
+
+ {item.url}
+
+ )}
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {result}
+
+
+
+ );
+ }
+}
diff --git a/src/pages/debug/api.less b/src/pages/debug/api.less
new file mode 100644
index 00000000..2e80470c
--- /dev/null
+++ b/src/pages/debug/api.less
@@ -0,0 +1,39 @@
+@import '~theme/index.less';
+
+.result {
+ height: 700px;
+ width: 100%;
+ background: @hover-color;
+ border-color: #ddd;
+ padding: 16px;
+ margin-top: 16px;
+ word-break: break-word;
+ line-height: 2;
+ overflow: scroll;
+}
+
+.requestList {
+ padding-right: 24px;
+ margin-bottom: 24px;
+ .listItem {
+ cursor: pointer;
+ padding-left: 8px;
+ &.lstItemActive {
+ background-color: @hover-color;
+ }
+ .background-hover();
+ }
+}
+
+.paramsBlock {
+ overflow: visible;
+ opacity: 1;
+ height: auto;
+ transition: opacity 0.3s;
+ &.hideParams {
+ width: 0;
+ height: 0;
+ opacity: 0;
+ overflow: hidden;
+ }
+}
diff --git a/src/pages/debug/core.js b/src/pages/debug/core.js
new file mode 100644
index 00000000..4dab82dc
--- /dev/null
+++ b/src/pages/debug/core.js
@@ -0,0 +1,14 @@
+import React from 'react'
+import * as antd from 'antd'
+import * as core from 'core'
+
+export default class CoreDebug extends React.Component {
+ render(){
+ const handleGenerateUUID = () => { console.log(core.generateUUID()) }
+ return(
+
+
handleGenerateUUID()} >generate uuid
+
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/pages/debug/index.js b/src/pages/debug/index.js
index 0df6fbde..30dacf79 100644
--- a/src/pages/debug/index.js
+++ b/src/pages/debug/index.js
@@ -1,357 +1,93 @@
-import React from 'react';
-import {v3_request} from 'api';
-import { api_request } from 'core/libs/v3_model'
-import {
- Row,
- Col,
- Select,
- Form,
- Input,
- Button,
- List,
- Tag,
- Checkbox,
-} from 'antd';
-import classnames from 'classnames';
-import { CloseOutlined } from '@ant-design/icons';
-import endpoints_list from 'config/endpoints';
+import React from 'react'
+import { Menu } from 'antd'
+import * as Icons from 'components/Icons'
-import styles from './index.less';
+import styles from './index.less'
-const { Option } = Select;
-const InputGroup = Input.Group;
-const methods = ['POST', 'GET', 'PUT', 'PATCH', 'DELETE'];
+import ApiDebug from './api.js'
+import AntdDebug from './antd.js'
+import CoreDebug from './core.js'
+import ThemeDebug from './theme.js'
-const methodTagColor = {
- GET: 'green',
- POST: 'orange',
- DELETE: 'red',
- PUT: 'geekblue',
-};
-
-const requests = Object.values(endpoints_list).map(item => {
- let url = item;
- let method = 'GET';
- const paramsArray = item.split(' ');
- if (paramsArray.length === 2) {
- method = paramsArray[0];
- url = paramsArray[1];
- }
- return {
- method,
- url,
- };
-});
-
-let uuid = 2;
-
-class RequestPage extends React.Component {
- paramsForm = React.createRef();
- bodyDataForm = React.createRef();
-
- constructor(props) {
- super(props);
- this.state = {
- // Default sets
- method: 'GET',
- url: '',
- ParamsKeys: [1],
- BodyKeys: [1],
- result: null,
- visible: true,
- };
- }
-
- handleRequest = () => {
- const { method, url } = this.state;
- let params = {};
- let body = {};
-
- this.paramsForm.current
- .validateFields()
- .then(values => {
- if (values) {
- for (let i in values) {
- if (i.startsWith('check')) {
- const index = i.match(/check\[(\d+)\]/)[1];
- const key = values[`key[${index}]`];
- params[key] = values[`value[${index}]`];
- }
- }
- }
- })
- .catch(errorInfo => {
- console.log(errorInfo);
- });
-
- this.bodyDataForm.current
- .validateFields()
- .then(values => {
- if (values) {
- for (let i in values) {
- if (i.startsWith('check')) {
- const index = i.match(/check\[(\d+)\]/)[1];
- const key = values[`key[${index}]`];
- body[key] = values[`value[${index}]`];
- }
- }
- }
- })
- .catch(errorInfo => {
- console.log(errorInfo);
- });
- const frame = {
- method,
- endpoint: `${method} ${url}`,
- body,
- verbose: true
- }
- console.log(frame)
- api_request(frame, (err, res) => {
- this.setState({
- result: res,
- });
- })
- };
-
- handleClickListItem = ({ method, url }) => {
- this.setState({
- method,
- url,
- keys: [uuid++],
- result: null,
- });
- };
-
- handleInputChange = e => {
- this.setState({
- url: e.target.value,
- });
- };
-
- handleSelectChange = method => {
- this.setState({
- method,
- });
- };
-
- handleAddParam = () => {
- const { ParamsKeys } = this.state;
- const nextKeys = ParamsKeys.concat(uuid);
- uuid++;
- this.setState({
- ParamsKeys: nextKeys,
- });
- };
-
- handleAddBody = () => {
- const { BodyKeys } = this.state;
- const nextKeys = BodyKeys.concat(uuid);
- uuid++;
- this.setState({
- BodyKeys: nextKeys,
- });
- };
-
- handleRemoveParam = key => {
- const { ParamsKeys } = this.state;
- this.setState({
- ParamsKeys: ParamsKeys.filter(item => item !== key),
- });
- };
-
- handleRemoveBody = key => {
- const { BodyKeys } = this.state;
- this.setState({
- BodyKeys: BodyKeys.filter(item => item !== key),
- });
- };
-
- handleVisible = () => {
- this.setState({
- visible: !this.state.visible,
- });
- };
-
- render() {
- const { result, url, method, ParamsKeys, BodyKeys, visible } = this.state;
-
- return (
-
-
-
- (
-
-
-
- {item.method}
-
-
- {item.url}
-
- )}
- />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {result}
-
-
-
- );
- }
+const debbugers = {
+ apiDebug:
,
+ antdDebug:
,
+ coreDebug:
,
+ themeDebug:
}
-export default RequestPage;
+const { Item } = Menu
+const menuMap = {
+ apiDebug: (
+
+ V3 Api
+
+ ),
+ antdDebug: (
+
+ Antd
+
+ ),
+ coreDebug: (
+
+ Core
+
+ ),
+ themeDebug: (
+
+ Theme
+
+ ),
+}
+
+export default class Debug extends React.Component {
+ constructor(props) {
+ super(props)
+ this.state = {
+ selectKey: '',
+ }
+ }
+
+ getMenu = () => {
+ return Object.keys(menuMap).map(item => (
+
- {menuMap[item]}
+ ))
+ }
+
+ selectKey = key => {
+ this.setState({
+ selectKey: key,
+ })
+ }
+
+ renderChildren = () => {
+ try {
+ if (!this.state.selectKey) {
+ return
Select an debugger
+ }
+ return debbugers[this.state.selectKey]
+ } catch (error) {
+ return
Select an debugger
+ }
+ }
+
+ render() {
+ const { selectKey } = this.state
+ return (
+
+
+ Debuggers
+
+
+
+
{this.renderChildren()}
+
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/pages/debug/index.less b/src/pages/debug/index.less
index 4ac56a59..0f4504a8 100644
--- a/src/pages/debug/index.less
+++ b/src/pages/debug/index.less
@@ -1,39 +1,47 @@
@import '~theme/index.less';
-.result {
- height: 600px;
+.main {
+ font-family: "Nunito", sans-serif;
+ margin: 20px 0 0;
+ display: flex;
+ flex-direction: column;
width: 100%;
- background: @hover-color;
- border-color: #ddd;
- padding: 16px;
- margin-top: 16px;
- word-break: break-word;
- line-height: 2;
- overflow: scroll;
-}
-
-.requestList {
- padding-right: 24px;
- margin-bottom: 24px;
- .listItem {
- cursor: pointer;
- padding-left: 8px;
- &.lstItemActive {
- background-color: @hover-color;
- }
- .background-hover();
- }
-}
-
-.paramsBlock {
- overflow: visible;
- opacity: 1;
height: auto;
- transition: opacity 0.3s;
- &.hideParams {
- width: 0;
- height: 0;
- opacity: 0;
- overflow: hidden;
+ overflow: auto;
+ color: @__Global_layout_color;
+ background-color: #ffffff;
+ padding: 15px;
+ border-radius: 10px;
+
+ :global {
+ .ant-menu-inline {
+ color: @__Global_layout_color;
+ background-color: transparent;
+ border: none;
+ }
+
+ .ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
+ font-weight: bold;
+ }
+ }
+
+ .debuggerComponent {
+ padding: 15px;
+ }
+
+ :global {
+ .ant-list-item {
+ padding-top: 7px;
+ padding-bottom: 7px;
+ }
+
+ .ant-list-split .ant-list-item {
+ border-bottom: 0;
+ }
+
+ .ant-list-item-meta-title {
+ color: rgba(0, 0, 0, 0.733);
+ font-size: 14px;
+ }
}
}
diff --git a/src/pages/settings/components/base.js b/src/pages/settings/components/base.js
index ed1a2cac..2fb5bedb 100755
--- a/src/pages/settings/components/base.js
+++ b/src/pages/settings/components/base.js
@@ -114,7 +114,7 @@ class Base extends Component {
renderItem={item => (
{item.icon}{item.title}>}
description={item.description}
/>
{this.renderSetting(item)}
diff --git a/src/pages/settings/components/electron/index.js b/src/pages/settings/components/electron/index.js
new file mode 100644
index 00000000..d96a0895
--- /dev/null
+++ b/src/pages/settings/components/electron/index.js
@@ -0,0 +1,11 @@
+import React from 'react'
+
+export default class ElectronSettings extends React.Component{
+ render(){
+ return(
+
+ Electron
+
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/pages/settings/components/theme/index.js b/src/pages/settings/components/theme/index.js
index 47025421..ea3006c7 100644
--- a/src/pages/settings/components/theme/index.js
+++ b/src/pages/settings/components/theme/index.js
@@ -27,7 +27,7 @@ class ThemeConfigurator extends React.Component{
handleUpdate(payload){
if(!this.state.key || !this.props.dispatch) {
- return onError.internal_proccess(`"Config key" or "Dispatcher" is missing`)
+ return onError.internal_proccess(`"Config key" or "App/Dispatcher" is missing`)
}
if (!payload) {
payload = this.state.model
@@ -128,8 +128,8 @@ class BackgroundImage extends ThemeConfigurator{
key: "backgroundImage",
model: { active: false, opacity: null, src: null },
- textColor: this.rgbToScheme(getComputedStyle(document.getElementById("app")).color),
- overlayColor: this.rgbToScheme(getComputedStyle(document.getElementById("app")).backgroundColor),
+ textColor: this.rgbToScheme(getComputedStyle(document.getElementById("root")).color),
+ overlayColor: this.rgbToScheme(getComputedStyle(document.getElementById("root")).backgroundColor),
processing: null,
customURL: '',
diff --git a/src/pages/settings/index.js b/src/pages/settings/index.js
index d2825821..139754d3 100755
--- a/src/pages/settings/index.js
+++ b/src/pages/settings/index.js
@@ -1,7 +1,6 @@
import React from 'react'
import { Menu } from 'antd'
import * as Icons from 'components/Icons'
-import * as Feather from 'feather-reactjs'
import styles from './style.less'
@@ -13,50 +12,57 @@ import Base from './components/base.js'
import AppAbout from './components/about.js'
import Theme from './components/theme'
-const { Item } = Menu
-const menuMap = {
- base: (
-
- General
-
- ),
- theme: (
-
- Theme
-
- ),
- sync: (
-
- Sync™
-
- ),
- security: (
-
- Security & Privacity
-
- ),
- notification: (
-
- Notification
-
- ),
- earnings: (
-
- Earnings
-
- ),
- help: (
-
- Help
-
- ),
- about: (
-
- About
-
- ),
+const Settings = {
+ base: ,
+ about: ,
+ theme: ,
+ earnings: ,
+ security: ,
+ notification:
}
+
+const { Item } = Menu
+
+const menuList = [
+ {
+ key: "base",
+ title: "General",
+ icons: ,
+ },
+ {
+ key: "app",
+ title: "Application",
+ icons: ,
+ require: "embedded"
+ },
+ {
+ key: "theme",
+ title: "Customization",
+ icons: ,
+ },
+ {
+ key: "security",
+ title: "Security & Privacity",
+ icons: ,
+ },
+ {
+ key: "notification",
+ title: "Notification",
+ icons: ,
+ },
+ {
+ key: "help",
+ title: "Help",
+ icons: ,
+ },
+ {
+ key: "about",
+ title: "About",
+ icons: ,
+ },
+]
+
class GeneralSettings extends React.Component {
constructor(props) {
super(props)
@@ -66,8 +72,10 @@ class GeneralSettings extends React.Component {
}
getMenu = () => {
- return Object.keys(menuMap).map(item => (
- - {menuMap[item]}
+ return menuList.map(item => (
+ -
+ {item.icons} {item.title}
+
))
}
@@ -78,24 +86,11 @@ class GeneralSettings extends React.Component {
}
renderChildren = () => {
- const { selectKey } = this.state
- switch (selectKey) {
- case 'base':
- return
- case 'security':
- return
- case 'theme':
- return
- case 'notification':
- return
- case 'about':
- return
- case 'earnings':
- return
- default:
- break
+ if(this.state.selectKey){
+ return Settings[this.state.selectKey]
+ }else{
+ Select an setting
}
- return null
}
render() {
diff --git a/src/pages/settings/style.less b/src/pages/settings/style.less
index 877f1fb7..fda2b036 100755
--- a/src/pages/settings/style.less
+++ b/src/pages/settings/style.less
@@ -5,7 +5,7 @@
margin: 20px 0 0;
display: flex;
width: 100%;
- height: 100%;
+ height: auto;
overflow: auto;
color: @__Global_layout_color;
background-color: #ffffff;
diff --git a/src/theme/base/index.less b/src/theme/base/index.less
index 1d67ec96..e94d9e82 100644
--- a/src/theme/base/index.less
+++ b/src/theme/base/index.less
@@ -39,6 +39,7 @@
#root{
background-color: @AppTheme_global_background!important;
+ color: @AppTheme_global_color!important;
}
.app{
@@ -62,7 +63,6 @@
#app {
-webkit-app-region: no-drag;
overflow: hidden;
- border-radius: 12px;
position: absolute;
bottom: 0;
@@ -103,7 +103,7 @@ body {
line-height: @base-line-height;
font-family: @__Global_texted_font;
- border-radius: 12px;
+ background-color: @AppTheme_global_background!important;
}
@media (max-width: @bp-small){
diff --git a/src/theme/base/layout/Primary_Layout.less b/src/theme/base/layout/Primary_Layout.less
index c7b16d81..f20346da 100644
--- a/src/theme/base/layout/Primary_Layout.less
+++ b/src/theme/base/layout/Primary_Layout.less
@@ -3,5 +3,5 @@
@primary_layout_container_backgroud: @__Global_layout_backgroud;
@primary_layout_container_border-rd: @__Global_layout_border-rd;
-@primary_layout_content_padding: 25px;
+@primary_layout_content_padding: 0 40px 20px 0;