mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
update: stage schema
update: extended model & core std exec
This commit is contained in:
parent
0baa9d048f
commit
1ce023b316
@ -98,7 +98,7 @@ export default [
|
||||
{
|
||||
id: 'login',
|
||||
title: 'Signin',
|
||||
icon: <Icons.LogIn style={{ color: '#5390d9', marginRight: '10px' }} />,
|
||||
icon: <Icons.LogIn style={{ color: '#3a86ff', marginRight: '10px' }} />,
|
||||
attributes: {
|
||||
position: "bottom",
|
||||
require: "guest"
|
||||
|
@ -4,7 +4,7 @@
|
||||
"title": "Comty™",
|
||||
"DevBuild": true,
|
||||
"version": "0.9.26",
|
||||
"stage": "dev-pre",
|
||||
"stage": "dev",
|
||||
"description": "",
|
||||
"author": "RageStudio",
|
||||
"license": "ISC",
|
||||
@ -36,7 +36,7 @@
|
||||
"@material-ui/core": "^4.9.9",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@ragestudio/ycorejs-lib": "^0.1.22",
|
||||
"antd": "^4.6.4",
|
||||
"antd": "^4.6.6",
|
||||
"axios": "^0.19.2",
|
||||
"babel-core": "^6.26.3",
|
||||
"classnames": "^2.2.6",
|
||||
|
@ -167,14 +167,42 @@ export default {
|
||||
plugin = {...plugin, ...rootInit}
|
||||
|
||||
const rootClass = plugin.payload
|
||||
|
||||
let extendedRequire = null
|
||||
|
||||
class extendedPlugin extends rootClass{
|
||||
constructor(props){
|
||||
super(props)
|
||||
}
|
||||
}
|
||||
|
||||
window.PluginGlobals[plugin.uuid] = new extendedPlugin(extended)
|
||||
if( typeof(plugin.requireExtends) !== "undefined" ) {
|
||||
console.log("Extending class with => ", plugin.requireExtends)
|
||||
|
||||
plugin.requireExtends.forEach((e) => {
|
||||
const RequireFrom = e.from
|
||||
const RequireImport = e.import
|
||||
|
||||
const existScheme = typeof(RequireImport) !== "undefined" && typeof(RequireFrom) !== "undefined"
|
||||
if(!existScheme){
|
||||
verbosity.error("Invalid require extension!")
|
||||
return false
|
||||
}
|
||||
|
||||
if (Array.isArray(RequireImport)) {
|
||||
console.log("Require array")
|
||||
RequireImport.forEach((e) => {
|
||||
console.log(`Importing " ${e} " from [ ${RequireFrom} ]`)
|
||||
extendedRequire[e] = require(RequireFrom)
|
||||
})
|
||||
}else{
|
||||
console.log("Require default")
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
window.PluginGlobals[plugin.uuid] = new extendedPlugin({ extended, extendedRequire })
|
||||
|
||||
appInterface.notify.open({
|
||||
message: `${plugin.title} v${plugin.version}`,
|
||||
@ -304,20 +332,20 @@ export default {
|
||||
|
||||
}
|
||||
|
||||
jwt.sign(frame, state.server_key, (err, token) => {
|
||||
if (err) {
|
||||
verbosity.error(err)
|
||||
return false
|
||||
}
|
||||
cookie.set(app_config.session_token_storage, token)
|
||||
sessionStorage.setItem(app_config.session_data_storage, btoa(payload.user_data))
|
||||
state.session_authframe = token
|
||||
})
|
||||
jwt.sign(frame, state.server_key, (err, token) => {
|
||||
if (err) {
|
||||
verbosity.error(err)
|
||||
return false
|
||||
}
|
||||
cookie.set(app_config.session_token_storage, token)
|
||||
sessionStorage.setItem(app_config.session_data_storage, btoa(payload.user_data))
|
||||
state.session_authframe = token
|
||||
})
|
||||
|
||||
appInterface.notify.success('Login done!')
|
||||
router.push('/')
|
||||
state.session_valid = true
|
||||
location.reload()
|
||||
appInterface.notify.success('Login done!')
|
||||
router.push('/')
|
||||
state.session_valid = true
|
||||
location.reload()
|
||||
},
|
||||
handleUpdateData(state){
|
||||
const frame = {
|
||||
|
@ -6,6 +6,7 @@ import { router, verbosity, appInterface } from 'core/libs'
|
||||
import settings from 'core/libs/settings'
|
||||
import { uri_resolver } from 'api/lib'
|
||||
import { DynamicSDCP } from 'core/libs/extension'
|
||||
import * as core from 'core'
|
||||
|
||||
import jwt from 'jsonwebtoken'
|
||||
import cookie from 'cookie_js'
|
||||
@ -14,9 +15,9 @@ import cookie from 'cookie_js'
|
||||
export default {
|
||||
namespace: 'extended',
|
||||
state: {
|
||||
modules: { core, settings, verbosity, router, DynamicSDCP },
|
||||
sidebar: null,
|
||||
contextMenu: null,
|
||||
core: null
|
||||
contextMenu: null
|
||||
},
|
||||
subscriptions: {
|
||||
setup({ dispatch }) {
|
||||
|
@ -19,10 +19,13 @@ export default class CoreDebug extends React.Component {
|
||||
render(){
|
||||
const handleGenerateUUID = () => { console.log(core.generateUUID()) }
|
||||
const handleChange = (e) => { this.setState({ rawPluginInitInput: e.target.value }) }
|
||||
const module3TestString = "https://api.ragestudio.net/std/moduleTest3.js"
|
||||
|
||||
return(
|
||||
<div>
|
||||
<antd.Button onClick={() => handleGenerateUUID()} >generate uuid</antd.Button>
|
||||
<antd.Card>
|
||||
<antd.Button onClick={() => this.setState({ rawPluginInitInput: module3TestString })}> Set MODULE3 TEST </antd.Button>
|
||||
<antd.Input onChange={handleChange} value={this.state.rawPluginInitInput} placeholder="https://api.ragestudio.net/std/example.js" />
|
||||
<antd.Button onClick={() => { this.handleInitPlugin(this.state.rawPluginInitInput) }} > init </antd.Button>
|
||||
</antd.Card>
|
||||
|
Loading…
x
Reference in New Issue
Block a user