postcat/api/unit.js
Scarqin c2757a4487
i18n (#90)
* fix: can not navigate to extensions page

* feat: add iconpark

* feat:  sidebar done

* feat: update style

* fix: theme components show in bottom

* feat: homepage almost done

* feat: extension detail readme

* feat: ignore eo-setting

* feat: ignore eo-setting

* feat: extension detail support text

* fix: build error

* feat: mock extension preview in web

* update css style

* feat: extension detail support web preview

* pref: update css style

* feat: update setting component

* feat: update style

* feat: ignore

* remove diver

* feat: add link in github logo

* fix: build ts error

* fix: search extension

* feat: change bind event of click

* fix: setting button can not click

* feat: system setting support web

* fix: flex style issue

* feat: icon button width

* chore: switch data source btn move to setting modal

* feat: i18n

* fix: module inject error

* fix: some css style

* feat: hide cloud icon

* add logo to settingModal

* feat: update settingModal UI

* chore: serve support i18n

* feat: base env

* fix: some error message

* fix: build error

* feat: history done

* feat: done env

* feat: settings logic

* fix: env modal auto open while page load

* pref: api-tabs css style

* fix: api-tabs css style issus

* pref: update settingsModal css style

* fix: set default language

* feat: update env

* feat: add goto env callback

* fix: remote source for web

* fix: remote source for web

* fix: rename API to REST

* feat: fix tips text

* feat: fix icon size

* fix: make api-tabs space evenly

* fix: about component descritions issues

* fix: style of env select position

* fix: settings modal navigate to extension page faile

* feat: modal footer left

* fix: mock some logic

* feat: history icon style

* fix: extension list css style

* update extension css style

* fix: env save failed

* chore: build i18n destop app

* fix: rename event name

* feat: change language

* chore

* test vercel

* test vercel

* delete vercel.json

* fix: lose baseHref

* chore: change angular.json beforeBuild

* fix: 2 bug about env

* perf: extension detail scrollbar style

* feat: add ts.code-snippets

* feat: initial i18n

* fix: open test history

* feat: add uuid in history tab

* fix: custom iconpark component

* test merge

* fix: center plus icon

* fix: setttings should auto save

* translate: en

* feat: change lang

* feat: translate en

* translate en

* translate en

* translate en

* delete package.lock

* fix: root directory run error

* vercel.json

* vercel redirects

* vercel.json

* change

* change

* route by accept-language

* vercel.json

* feat:redirect

* vercel rewrites

* vercel

* chore: translate chinese comment to english

* translate: cn

* push zh.xlf

* fix: manage environment

* translate zh

* fix: some css style issues

* feat: changeLanuage

* delete vercel

* fix: language storage none

* feat: app reload

* fix: initial lanugae

* feat:debug success

* feat: node-server

* feat:web node server

* stash ProxySandbox

* feat: extension i18n

* feat: extension i18n logic

Co-authored-by: buqiyuan <1743369777@qq.com>
Co-authored-by: 夜鹰 <17kungfuboy@gmail.com>
2022-07-13 12:46:00 +08:00

28 lines
856 B
JavaScript

let _LibsFlowCommon = require('../src/workbench/node/request/unit.js');
let _LibsCommon = require('../src/workbench/node/request/libs/common.js');
module.exports = (req, res) => {
console.log('unit.js', req.body);
try {
let reqJSON = req.body.data;
reqJSON.env = _LibsCommon.parseEnv(reqJSON.env);
new _LibsFlowCommon.core().main(reqJSON).then(({ report, history }) => {
['general', 'requestInfo', 'resultInfo'].forEach((keyName) => {
if (typeof history[keyName] === 'string') history[keyName] = JSON.parse(history[keyName]);
});
res.send(
JSON.stringify({
action: 'finish',
data: {
id: ctx.request.body.id,
report: report,
history: history,
},
})
);
});
} catch (e) {
console.error('unit.js', e, req.body);
}
};