diff --git a/interface/src/components/Projects/Overview/InstallationCode.jsx b/interface/src/components/Projects/Overview/InstallationCode.jsx index 4403515c..3bc0deec 100644 --- a/interface/src/components/Projects/Overview/InstallationCode.jsx +++ b/interface/src/components/Projects/Overview/InstallationCode.jsx @@ -57,7 +57,7 @@ const styles = (theme) => ({ color: '#fff' }, copyIcon: { - height: 20, + height: 20 }, copyButton: { marginRight: 10 @@ -78,7 +78,7 @@ const styles = (theme) => ({ }, codeLight: { backgroundColor: 'rgba(0, 0, 0, 0.15)' - }, + } }) class InstallationCode extends React.Component { @@ -131,7 +131,9 @@ class InstallationCode extends React.Component { avatar={} className={settings.dark ? classes.headerDark : classes.header} action={ - this.copy(code)} className={classes.copyButton}> + this.copy(code)} + className={classes.copyButton}> {this.state.copied ? ( ) : ( diff --git a/src/inject/Websockets.ts b/src/inject/Websockets.ts index ae51793c..b6b7582d 100644 --- a/src/inject/Websockets.ts +++ b/src/inject/Websockets.ts @@ -158,10 +158,16 @@ class Session { */ if (/^core|auth$/.test(topic)) { if (this.session.version === 0) { + /** + * Payload version 0 + */ transport = JSON.stringify({ d: data }) } else { + /** + * Payload version 1 + */ transport = data } } @@ -365,7 +371,6 @@ class Session { } } - /** * Deliver the Injectify Core */ @@ -374,12 +379,26 @@ class Session { * Client has the current version of the Core cached */ variables.__server.cached = true - this.send('core', Transforms.cache(variables, this.session.debug, this.session.project.config.autoexecute)) + this.send( + 'core', + Transforms.cache( + variables, + this.session.debug, + this.session.project.config.autoexecute + ) + ) } else { /** * Core loader */ - this.send('core', Transforms.core(this.core, variables, this.session.project.config.autoexecute)) + this.send( + 'core', + Transforms.core( + this.core, + variables, + this.session.project.config.autoexecute + ) + ) } }) } diff --git a/src/main.ts b/src/main.ts index 5d246a3e..318df106 100644 --- a/src/main.ts +++ b/src/main.ts @@ -315,6 +315,7 @@ MongoClient.connect(config.mongodb, (err, client) => { admins: [], readonly: [] }, + console: {}, config: { autoexecute: `injectify.module('passwords')`, filter: { @@ -1257,22 +1258,28 @@ MongoClient.connect(config.mongodb, (err, client) => { } } if (command === 'autoexecute') { - if (data.project && typeof data.code === 'string' && thisProject.myPermissionLevel < 3) { + if ( + data.project && + typeof data.code === 'string' && + thisProject.myPermissionLevel < 3 + ) { Update(data.project, { $set: { 'config.autoexecute': data.code } - }).then(() => { - socket.emit('notify', { - title: 'Updated', - message: 'Successfully updated code' + }) + .then(() => { + socket.emit('notify', { + title: 'Updated', + message: 'Successfully updated code' + }) }) - }).catch(() => { - socket.emit('err', { - title: 'Error', - message: 'Failed to update code' + .catch(() => { + socket.emit('err', { + title: 'Error', + message: 'Failed to update code' + }) }) - }) } else { socket.emit('err', { title: 'Error',