New links for clones and keys
This commit is contained in:
1 parent
eca731203f
commit
e2a9865e79
3 files changed
+13
-37
No files matched your search
+2
-2
@@ -74,11 +74,11 @@ export const MasterApp = props => (
|
||||
render={props => <FinancialBeings {...props} auth={auth}/>}
|
||||
/>
|
||||
<Route
|
||||
path='/key-vault'
|
||||
path='/keys'
|
||||
render={props => <KeyVault {...props} auth={auth} />}
|
||||
/>
|
||||
<Route
|
||||
path='/operations'
|
||||
path='/clones'
|
||||
render={props => <Operations {...props} auth={auth} />}
|
||||
/>
|
||||
</Switch>
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
BugReport,
|
||||
People,
|
||||
Group,
|
||||
// Adb,
|
||||
VpnKey,
|
||||
Home,
|
||||
AddCircleOutline
|
||||
@@ -51,26 +50,26 @@ const eventsMenus = {
|
||||
}
|
||||
|
||||
const keyvaultMenus = {
|
||||
title: 'Key Vault',
|
||||
to: '/key-vault',
|
||||
title: 'Keys',
|
||||
to: '/keys',
|
||||
icon: Home,
|
||||
authenticated: true,
|
||||
submenus: [
|
||||
{ title: 'Your keys', to: '/key-vault/browse', icon: VpnKey },
|
||||
{ title: 'Add key', to: '/key-vault/addKey', icon: AddCircleOutline },
|
||||
{ title: 'Your keys', to: '/keys/browse', icon: VpnKey },
|
||||
{ title: 'Add key', to: '/keys/addKey', icon: AddCircleOutline },
|
||||
{ title: 'Report a Bug', to: 'https://github.com/Superalgos/KeyVaultModule/issues/new', icon: BugReport, externalLink: true }
|
||||
]
|
||||
}
|
||||
|
||||
const operationsMenus = {
|
||||
title: 'Operations',
|
||||
to: '/operations',
|
||||
title: 'Clones',
|
||||
to: '/clones',
|
||||
icon: Home,
|
||||
authenticated: true,
|
||||
submenus: [
|
||||
{ title: 'Active clones', to: '/operations/browse', icon: ImportContacts },
|
||||
{ title: 'History', to: '/operations/history', icon: LibraryAdd },
|
||||
{ title: 'Clone a bot', to: '/operations/add', icon: AddCircleOutline },
|
||||
{ title: 'Active Clones', to: '/clones/browse', icon: ImportContacts },
|
||||
{ title: 'History Clones', to: '/clones/history', icon: LibraryAdd },
|
||||
{ title: 'Create Clone', to: '/clones/add', icon: AddCircleOutline },
|
||||
{ title: 'Report a Bug', to: 'https://github.com/Superalgos/OperationsModule/issues/new', icon: BugReport, externalLink: true }
|
||||
]
|
||||
}
|
||||
|
||||
+2
-25
@@ -166,8 +166,8 @@ async function run () {
|
||||
schema,
|
||||
context,
|
||||
formatError: error => {
|
||||
logger.error(`An error ocurred inside a module: ${JSON.stringify(error)}`)
|
||||
return error
|
||||
logger.error('An error ocurred inside a module: %s', error.message)
|
||||
return error.message
|
||||
},
|
||||
formatResponse: response => {
|
||||
logger.debug('Response from Apollo Server: ' + response)
|
||||
@@ -181,29 +181,6 @@ async function run () {
|
||||
}
|
||||
})
|
||||
|
||||
const whitelist = [
|
||||
process.env.PROJECT_SITE_URL,
|
||||
process.env.PLATFORM_URL,
|
||||
process.env.GRAPHQL_API_URL,
|
||||
process.env.TEAMS_API_URL,
|
||||
process.env.USERS_API_URL,
|
||||
process.env.EVENTS_API_URL,
|
||||
process.env.KEYVAULT_API_URL,
|
||||
process.env.FINANCIAL_BEINGS_API_URL,
|
||||
process.env.NOTIFICATIONS_API_URL
|
||||
]
|
||||
|
||||
const corsOptionsDelegate = (req, callback) => {
|
||||
let corsOptions
|
||||
if (whitelist.indexOf(req.header('Origin')) !== -1) {
|
||||
corsOptions = { origin: true, credentials: true }
|
||||
} else {
|
||||
corsOptions = { origin: false, credentials: true }
|
||||
}
|
||||
callback(null, corsOptions)
|
||||
}
|
||||
|
||||
// server.applyMiddleware({ app, cors: corsOptionsDelegate })
|
||||
server.applyMiddleware({ app, cors: { origin: true, credentials: true, methods:'GET,PUT,POST,DELETE,OPTIONS'}})
|
||||
|
||||
app.listen(4100)
|
||||
|
||||
Reference in new issue
Block a user