mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
electron remote-debugging for dev instace
This commit is contained in:
parent
03829eac5d
commit
51a33b5415
0
.vscode-janus-debug
Normal file
0
.vscode-janus-debug
Normal file
19
.vscode/launch.json
vendored
19
.vscode/launch.json
vendored
@ -1,5 +1,24 @@
|
|||||||
{
|
{
|
||||||
"configurations": [
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Attach by Process ID",
|
||||||
|
"processId": "${command:PickProcess}",
|
||||||
|
"request": "attach",
|
||||||
|
"skipFiles": [
|
||||||
|
"<node_internals>/**"
|
||||||
|
],
|
||||||
|
"type": "pwa-node"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Electron Main",
|
||||||
|
"program": "${workspaceFolder}/main/index.js",
|
||||||
|
"request": "launch",
|
||||||
|
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
|
||||||
|
"skipFiles": [
|
||||||
|
"<node_internals>/**"
|
||||||
|
],
|
||||||
|
"type": "pwa-node"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Launch via NPM",
|
"name": "Launch via NPM",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
|
@ -10,7 +10,9 @@ module.exports = {
|
|||||||
DarkFullLogoPath: '/dark_full_logo.svg',
|
DarkFullLogoPath: '/dark_full_logo.svg',
|
||||||
DarkLogoPath: '/dark_logo.svg',
|
DarkLogoPath: '/dark_logo.svg',
|
||||||
|
|
||||||
|
api_interface: 'https://api.ragestudio.net',
|
||||||
api_prefix: 'ycorejs_apiv3',
|
api_prefix: 'ycorejs_apiv3',
|
||||||
|
|
||||||
app_settings_storage: 'app_settings',
|
app_settings_storage: 'app_settings',
|
||||||
endpoint_global: 'https://comty.pw',
|
endpoint_global: 'https://comty.pw',
|
||||||
proxy_local: 'http://localhost:8000',
|
proxy_local: 'http://localhost:8000',
|
||||||
@ -49,6 +51,7 @@ module.exports = {
|
|||||||
|
|
||||||
// Default Behaviors
|
// Default Behaviors
|
||||||
defaults: {
|
defaults: {
|
||||||
|
app_model: "app",
|
||||||
verbosity: false,
|
verbosity: false,
|
||||||
session_noexpire: false,
|
session_noexpire: false,
|
||||||
search_ontype: false,
|
search_ontype: false,
|
||||||
|
@ -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":"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":"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":"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?"
|
||||||
|
}
|
||||||
]
|
]
|
@ -122,6 +122,7 @@ function createWindow() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (is.dev()) {
|
if (is.dev()) {
|
||||||
|
app.commandLine.appendSwitch('remote-debugging-port', '9222')
|
||||||
globalShortcut.register('CommandOrControl+R', () => {
|
globalShortcut.register('CommandOrControl+R', () => {
|
||||||
mainWindow.reload()
|
mainWindow.reload()
|
||||||
})
|
})
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "umi dev",
|
"start": "umi dev",
|
||||||
|
"debug": "node --inspect-brk ./node_modules/.bin/umi dev",
|
||||||
"postinstall": "electron-builder install-app-deps",
|
"postinstall": "electron-builder install-app-deps",
|
||||||
"electronDev": "concurrently \"electron .\" \"npm start\"",
|
"electronDev": "concurrently \"electron .\" \"npm start\"",
|
||||||
"build": "npm run build:main && npm run build:renderer",
|
"build": "npm run build:main && npm run build:renderer",
|
||||||
|
29
src/core/libs/socket/index.js
Normal file
29
src/core/libs/socket/index.js
Normal file
@ -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: () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,5 @@
|
|||||||
import settings from 'core/libs/settings'
|
import settings from 'core/libs/settings'
|
||||||
import stackTrace from 'stack-trace'
|
import stackTrace from 'stack-trace'
|
||||||
// import path from 'path'
|
|
||||||
const verbosity_enabled = settings('verbosity')
|
const verbosity_enabled = settings('verbosity')
|
||||||
|
|
||||||
export const verbosity = {
|
export const verbosity = {
|
||||||
|
@ -5,7 +5,6 @@ import { user, session } from 'core/helpers'
|
|||||||
import { router, verbosity, appInterface } from 'core/libs'
|
import { router, verbosity, appInterface } from 'core/libs'
|
||||||
import settings from 'core/libs/settings'
|
import settings from 'core/libs/settings'
|
||||||
import { uri_resolver } from 'api/lib'
|
import { uri_resolver } from 'api/lib'
|
||||||
import { connect } from 'umi'
|
|
||||||
|
|
||||||
import jwt from 'jsonwebtoken'
|
import jwt from 'jsonwebtoken'
|
||||||
import cookie from 'cookie_js'
|
import cookie from 'cookie_js'
|
||||||
@ -51,7 +50,6 @@ export default {
|
|||||||
const electron = window.require("electron")
|
const electron = window.require("electron")
|
||||||
dispatch({ type: 'updateState', payload: { electron, embedded: true } })
|
dispatch({ type: 'updateState', payload: { electron, embedded: true } })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
|
||||||
// nothing
|
// nothing
|
||||||
}
|
}
|
||||||
uri_resolver().then(res => {
|
uri_resolver().then(res => {
|
||||||
|
@ -8,12 +8,14 @@ import ApiDebug from './api.js'
|
|||||||
import AntdDebug from './antd.js'
|
import AntdDebug from './antd.js'
|
||||||
import CoreDebug from './core.js'
|
import CoreDebug from './core.js'
|
||||||
import ThemeDebug from './theme.js'
|
import ThemeDebug from './theme.js'
|
||||||
|
import SocketDebug from './socket.js'
|
||||||
|
|
||||||
const debbugers = {
|
const debbugers = {
|
||||||
apiDebug: <ApiDebug />,
|
apiDebug: <ApiDebug />,
|
||||||
antdDebug: <AntdDebug />,
|
antdDebug: <AntdDebug />,
|
||||||
coreDebug: <CoreDebug />,
|
coreDebug: <CoreDebug />,
|
||||||
themeDebug: <ThemeDebug />
|
themeDebug: <ThemeDebug />,
|
||||||
|
socketDebug: <SocketDebug />
|
||||||
}
|
}
|
||||||
|
|
||||||
const { Item } = Menu
|
const { Item } = Menu
|
||||||
@ -37,6 +39,11 @@ const menuMap = {
|
|||||||
<span>
|
<span>
|
||||||
<Icons.Image /> Theme
|
<Icons.Image /> Theme
|
||||||
</span>
|
</span>
|
||||||
|
),
|
||||||
|
socketDebug: (
|
||||||
|
<span>
|
||||||
|
<Icons.Box /> Socket
|
||||||
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +51,7 @@ export default class Debug extends React.Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
selectKey: '',
|
selectKey: 'socketDebug',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
35
src/pages/debug/socket.js
Normal file
35
src/pages/debug/socket.js
Normal file
@ -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(
|
||||||
|
<div>
|
||||||
|
<antd.Card>
|
||||||
|
<antd.List
|
||||||
|
dataSource={this.state.resolvers}
|
||||||
|
renderItem={(e) => {
|
||||||
|
return(
|
||||||
|
<div>
|
||||||
|
* {e.key} => {e.value}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</antd.Card>
|
||||||
|
|
||||||
|
connectedNode: {this.state.connNode}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
@ -16,7 +16,6 @@
|
|||||||
"allowSyntheticDefaultImports": true
|
"allowSyntheticDefaultImports": true
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"mock/**/*",
|
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
"config/**/*",
|
"config/**/*",
|
||||||
".umirc.js",
|
".umirc.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user