mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
Compare commits
1 Commits
016994c2eb
...
feature/ed
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3eb26651f7 |
@@ -127,6 +127,7 @@
|
||||
"coriolis-data": "../coriolis-data",
|
||||
"d3": "^5.7.0",
|
||||
"detect-browser": "^3.0.1",
|
||||
"ed-forge": "^1.3.0",
|
||||
"fbemitter": "^2.1.1",
|
||||
"lodash": "^4.17.11",
|
||||
"lz-string": "^1.4.4",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { orbisUpload } from '../utils/ShortenUrl';
|
||||
import { orbisUpload, API_ORBIS_BASE_URL } from '../utils/ShortenUrl';
|
||||
import Persist from '../stores/Persist';
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ export default class ModalOrbis extends TranslatedComponent {
|
||||
* @returns {Object} auth status
|
||||
*/
|
||||
getOrbisAuthStatus() {
|
||||
return fetch('https://orbis.zone/api/checkauth', {
|
||||
return fetch(`${API_ORBIS_BASE_URL}/api/checkauth`, {
|
||||
credentials: 'include',
|
||||
mode: 'cors'
|
||||
})
|
||||
@@ -104,7 +104,7 @@ export default class ModalOrbis extends TranslatedComponent {
|
||||
<label>Orbis auth status: </label>
|
||||
<input value={this.state.authenticatedStatus} readOnly size={25} onFocus={ (e) => e.target.select() }/>
|
||||
<br/><br/>
|
||||
<a className='button' href="https://orbis.zone/api/auth">Log in / signup to Orbis</a>
|
||||
<a className='button' href={`${API_ORBIS_BASE_URL}/api/checkauth`}>Log in / signup to Orbis</a>
|
||||
<br/><br/>
|
||||
<h3 >{translate('Orbis link')}</h3>
|
||||
<input value={this.state.orbisUrl} readOnly size={25} onFocus={ (e) => e.target.select() }/>
|
||||
|
||||
@@ -682,7 +682,32 @@ export default class OutfittingPage extends Page {
|
||||
*/
|
||||
_genOrbis() {
|
||||
const data = {};
|
||||
const {Ship, Module, Factory} = require('ed-forge');
|
||||
const forgeShip = Factory.newShip(this.state.ship.id);
|
||||
console.log(forgeShip);
|
||||
const ship = this.state.ship;
|
||||
const forgeOrder = {
|
||||
0: 'bh',
|
||||
1: 'pp',
|
||||
2: 't',
|
||||
3: 'fsd',
|
||||
4: 'ls',
|
||||
5: 'pd',
|
||||
6: 's',
|
||||
7: 'ft'
|
||||
}
|
||||
ship.standard.forEach((standard, idx) => {
|
||||
console.log(standard)
|
||||
const mod = Factory.newModule(standard.m.symbol, standard.m.class.toString(), standard.m.rating.toString());
|
||||
console.log(mod);
|
||||
const coreIdx = Object.entries(forgeOrder).findIndex(e => e[1] === standard.m.grp);
|
||||
console.log(coreIdx)
|
||||
console.log(forgeShip.getCoreModules())
|
||||
forgeShip.getCoreModules()[coreIdx].setItem(standard.m.symbol);
|
||||
if (standard.m.blueprint) {
|
||||
console.log(standard.m.blueprint)
|
||||
}
|
||||
});
|
||||
ship.coriolisId = ship.id;
|
||||
data.coriolisShip = ship;
|
||||
data.url = window.location.href;
|
||||
|
||||
@@ -105,7 +105,7 @@ function orbisShorten(url, success, error) {
|
||||
}
|
||||
}
|
||||
|
||||
const API_ORBIS = 'https://orbis.zone/api/builds/add';
|
||||
export const API_ORBIS_BASE_URL = process.env.NODE_ENV === 'development' ? 'http://localhost:3030' : 'https://orbis.zone';
|
||||
/**
|
||||
* Upload to Orbis
|
||||
* @param {object} ship The URL to shorten
|
||||
@@ -117,7 +117,7 @@ export function orbisUpload(ship, creds) {
|
||||
if (window.navigator.onLine) {
|
||||
try {
|
||||
agent
|
||||
.post(API_ORBIS)
|
||||
.post(`${API_ORBIS_BASE_URL}/api/builds/add`)
|
||||
.withCredentials()
|
||||
.redirects(0)
|
||||
.set('Content-Type', 'application/json')
|
||||
|
||||
@@ -22,9 +22,6 @@ module.exports = {
|
||||
},
|
||||
optimization: {
|
||||
minimize: false,
|
||||
splitChunks: {
|
||||
chunks: 'all'
|
||||
}
|
||||
},
|
||||
output: {
|
||||
path: path.join(__dirname, 'build'),
|
||||
|
||||
Reference in New Issue
Block a user