diff --git a/.vscode-janus-debug b/.vscode-janus-debug new file mode 100644 index 00000000..e69de29b diff --git a/.vscode/launch.json b/.vscode/launch.json index 2ef6a196..deb5dd57 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,5 +1,24 @@ { "configurations": [ + { + "name": "Attach by Process ID", + "processId": "${command:PickProcess}", + "request": "attach", + "skipFiles": [ + "/**" + ], + "type": "pwa-node" + }, + { + "name": "Electron Main", + "program": "${workspaceFolder}/main/index.js", + "request": "launch", + "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron", + "skipFiles": [ + "/**" + ], + "type": "pwa-node" + }, { "name": "Launch via NPM", "request": "launch", diff --git a/config/index.js b/config/index.js index 774a5a97..139d7b40 100644 --- a/config/index.js +++ b/config/index.js @@ -4,13 +4,15 @@ module.exports = { siteName: 'Comty', copyright: 'RageStudio©', MainPath: '/', - + LogoPath: '/logo.svg', FullLogoPath: '/full_logo.svg', DarkFullLogoPath: '/dark_full_logo.svg', DarkLogoPath: '/dark_logo.svg', + api_interface: 'https://api.ragestudio.net', api_prefix: 'ycorejs_apiv3', + app_settings_storage: 'app_settings', endpoint_global: 'https://comty.pw', proxy_local: 'http://localhost:8000', @@ -49,6 +51,7 @@ module.exports = { // Default Behaviors defaults: { + app_model: "app", verbosity: false, session_noexpire: false, search_ontype: false, diff --git a/globals/settings.json b/globals/settings.json index 5233e302..aa141bed 100644 --- a/globals/settings.json +++ b/globals/settings.json @@ -2,5 +2,12 @@ {"id":"session_noexpire","icon":"Watch","type":"switch","title":"No expire session","description":"Force the app to not expire any session... [Developer]"}, {"id":"search_ontype","icon":"CornerDownRight","type":"switch","title":"Detect input on search bar","description":"Force the app to automaticly search when a type input is detected... [Developer]"}, {"id":"post_hidebar","icon":"Menu","type":"switch","title":"Auto hide postbar","description":"Force the app to hide the post actions (likes, comments ...etc) automaticly... [Developer]"}, - {"id":"verbosity","icon":"Terminal","type":"switch","title":"Enable core verbosity","description":"Show all console logs... [Developer]"} + {"id":"verbosity","icon":"Terminal","type":"switch","title":"Enable core verbosity","description":"Show all console logs... [Developer]"}, + { + "id":"seponetriste", + "icon":"Terminal", + "type":"switch", + "title":"Mayonesa", + "description":"liquiedA?" + } ] \ No newline at end of file diff --git a/main/index.js b/main/index.js index b063f788..981aba0c 100644 --- a/main/index.js +++ b/main/index.js @@ -122,6 +122,7 @@ function createWindow() { }) if (is.dev()) { + app.commandLine.appendSwitch('remote-debugging-port', '9222') globalShortcut.register('CommandOrControl+R', () => { mainWindow.reload() }) diff --git a/package.json b/package.json index e109be5e..cbf72f0a 100755 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ }, "scripts": { "start": "umi dev", + "debug": "node --inspect-brk ./node_modules/.bin/umi dev", "postinstall": "electron-builder install-app-deps", "electronDev": "concurrently \"electron .\" \"npm start\"", "build": "npm run build:main && npm run build:renderer", diff --git a/src/core/libs/socket/index.js b/src/core/libs/socket/index.js new file mode 100644 index 00000000..763dd757 --- /dev/null +++ b/src/core/libs/socket/index.js @@ -0,0 +1,29 @@ +import { uri_resolver } from 'api/lib' +import io from 'socket.io-client' +import { connect } from 'umi' +import settings from 'core/libs/settings' + +@connect(({ app }) => ({ app })) +export default class SocketConnection{ + state = { + model: settings("app_model"), + resolvers: this.props.app.resolvers + } + constructor(){ + console.log(model) + this.opts = { + + } + } + + conn = { + create: () => { + + }, + destroy: () => { + + } + } + +} + diff --git a/src/core/libs/verbosity/index.js b/src/core/libs/verbosity/index.js index 4ac863a9..a7707f2f 100644 --- a/src/core/libs/verbosity/index.js +++ b/src/core/libs/verbosity/index.js @@ -1,6 +1,5 @@ import settings from 'core/libs/settings' import stackTrace from 'stack-trace' -// import path from 'path' const verbosity_enabled = settings('verbosity') export const verbosity = { diff --git a/src/models/app.js b/src/models/app.js index 0bdcacbe..fe0b0e1d 100755 --- a/src/models/app.js +++ b/src/models/app.js @@ -5,7 +5,6 @@ import { user, session } from 'core/helpers' import { router, verbosity, appInterface } from 'core/libs' import settings from 'core/libs/settings' import { uri_resolver } from 'api/lib' -import { connect } from 'umi' import jwt from 'jsonwebtoken' import cookie from 'cookie_js' @@ -51,7 +50,6 @@ export default { const electron = window.require("electron") dispatch({ type: 'updateState', payload: { electron, embedded: true } }) } catch (error) { - console.log(error) // nothing } uri_resolver().then(res => { diff --git a/src/pages/debug/index.js b/src/pages/debug/index.js index 52c45e1c..027652bb 100644 --- a/src/pages/debug/index.js +++ b/src/pages/debug/index.js @@ -8,12 +8,14 @@ import ApiDebug from './api.js' import AntdDebug from './antd.js' import CoreDebug from './core.js' import ThemeDebug from './theme.js' +import SocketDebug from './socket.js' const debbugers = { apiDebug: , antdDebug: , coreDebug: , - themeDebug: + themeDebug: , + socketDebug: } const { Item } = Menu @@ -37,6 +39,11 @@ const menuMap = { Theme + ), + socketDebug: ( + + Socket + ) } @@ -44,7 +51,7 @@ export default class Debug extends React.Component { constructor(props) { super(props) this.state = { - selectKey: '', + selectKey: 'socketDebug', } } diff --git a/src/pages/debug/socket.js b/src/pages/debug/socket.js new file mode 100644 index 00000000..af72f672 --- /dev/null +++ b/src/pages/debug/socket.js @@ -0,0 +1,35 @@ +import React from 'react' +import jwt from 'jsonwebtoken' +import { uri_resolver } from 'api/lib' +import io from 'socket.io-client' +import { connect } from 'umi' +import * as antd from 'antd' +import { objectToArray } from 'core' + +@connect(({ app }) => ({ app })) +export default class SocketDebug extends React.Component{ + state = { + resolvers: objectToArray(this.props.app.resolvers), + connNode: null, + } + render(){ + return( +
+ + { + return( +
+ * {e.key} => {e.value} +
+ ) + }} + /> +
+ + connectedNode: {this.state.connNode} +
+ ) + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 4562cdbb..06df4019 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,6 @@ "allowSyntheticDefaultImports": true }, "include": [ - "mock/**/*", "src/**/*", "config/**/*", ".umirc.js",