feat: API Authorization (#251)
* feat: API Authorization * fix: API Group flow * perf(api-group): group select status * build(e2e): delete image --------- Co-authored-by: buqiyuan <1743369777@qq.com>
This commit is contained in:
parent
bf7694dea4
commit
ddf7292ecb
|
@ -1,6 +1,7 @@
|
|||
_cli-tpl/
|
||||
dist/
|
||||
coverage/
|
||||
src/node
|
||||
|
||||
# Logs
|
||||
logs
|
||||
|
|
|
@ -14,11 +14,8 @@ out/
|
|||
/release
|
||||
*.js
|
||||
*.js.map
|
||||
*.webpack.js
|
||||
!patches/*
|
||||
!src/workbench/node/electron/**/*.js
|
||||
!src/workbench/node/request/**/*.js
|
||||
!src/workbench/node/server/**/*.js
|
||||
!src/node/**/*.js
|
||||
!/api/*.js
|
||||
!/scripts/**/*.js
|
||||
!*.config.js
|
||||
|
|
1192
CHANGELOG.md
1192
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
|
@ -117,7 +117,7 @@ yarn start
|
|||
|
||||
```shell
|
||||
|
||||
cd src/workbench/browser&&npm install
|
||||
cd src/browser&&npm install
|
||||
|
||||
yarn start
|
||||
|
||||
|
|
14
api/unit.js
14
api/unit.js
|
@ -1,13 +1,13 @@
|
|||
let _LibsFlowCommon = require('../src/workbench/node/request/unit.js');
|
||||
let _LibsCommon = require('../src/workbench/node/request/libs/common.js');
|
||||
let _LibsFlowCommon = require('../src/node/test-server/request/unit.js');
|
||||
let _LibsCommon = require('../src/node/test-server/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(({ globals,report, history }) => {
|
||||
['general', 'requestInfo', 'resultInfo'].forEach((keyName) => {
|
||||
new _LibsFlowCommon.core().main(reqJSON).then(({ globals, report, history }) => {
|
||||
['general', 'requestInfo', 'resultInfo'].forEach(keyName => {
|
||||
if (typeof history[keyName] === 'string') history[keyName] = JSON.parse(history[keyName]);
|
||||
});
|
||||
res.send(
|
||||
|
@ -15,10 +15,10 @@ module.exports = (req, res) => {
|
|||
action: 'finish',
|
||||
data: {
|
||||
id: req.body.id,
|
||||
globals:globals,
|
||||
globals: globals,
|
||||
report: report,
|
||||
history: history,
|
||||
},
|
||||
history: history
|
||||
}
|
||||
})
|
||||
);
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
files:
|
||||
- source: /src/workbench/browser/src/locale/messages.xlf
|
||||
translation: /src/workbench/browser/src/locale/messages.%two_letters_code%.xlf
|
||||
- source: /src/browser/src/locale/messages.xlf
|
||||
translation: /src/browser/src/locale/messages.%two_letters_code%.xlf
|
||||
project_id_env: CROWDIN_PROJECT_ID
|
||||
api_token_env: CROWDIN_PERSONAL_TOKEN
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const baseUrl = './src/workbench/browser/src/app/shared/services/storage/';
|
||||
const baseUrl = './src/browser/src/app/shared/services/storage/';
|
||||
module.exports = {
|
||||
entry: {
|
||||
// target: ["./test/apiData.ts", "./test/env.ts"]
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
{
|
||||
"name": "postcat",
|
||||
"version": "0.3.2",
|
||||
"version": "0.4.0",
|
||||
"main": "out/app/electron-main/main.js",
|
||||
"description": "A lightweight, extensible API tool",
|
||||
"homepage": "https://github.com/Postcatlab/postcat.git",
|
||||
"author": "Postcat",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"src/workbench/*"
|
||||
"src/node/*",
|
||||
"src/browser"
|
||||
],
|
||||
"scripts": {
|
||||
"prepare": "husky install && electron-builder install-app-deps && node ./scripts/afterInstall.js && npx patch-package",
|
||||
|
@ -108,7 +109,7 @@
|
|||
},
|
||||
"__npminstall_done": false,
|
||||
"node-module-alias": {
|
||||
"eo": "./out"
|
||||
"pc": "./out"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,ts}": [
|
||||
|
|
|
@ -65,9 +65,9 @@ const config: Configuration = {
|
|||
'out/platform/**/*.js*',
|
||||
'out/environment.js',
|
||||
'out/shared/**/*.js*',
|
||||
'src/workbench/browser/dist/**/*',
|
||||
'out/workbench/browser/src/**/*.js*',
|
||||
'out/workbench/node/**/*.js*',
|
||||
'src/browser/dist/**/*',
|
||||
'out/browser/src/**/*.js*',
|
||||
'out/node/test-server/**/*.js*',
|
||||
'out/app/common/**/*',
|
||||
'!**/*.ts'
|
||||
],
|
||||
|
|
|
@ -50,9 +50,9 @@ const config: Configuration = {
|
|||
'out/platform/**/*.js*',
|
||||
'out/environment.js',
|
||||
'out/shared/**/*.js*',
|
||||
'src/workbench/browser/dist/**/*',
|
||||
'out/workbench/browser/src/**/*.js*',
|
||||
'out/workbench/node/**/*.js*',
|
||||
'src/browser/dist/**/*',
|
||||
'out/browser/src/**/*.js*',
|
||||
'out/node/test-server/**/*.js*',
|
||||
'out/app/common/**/*',
|
||||
'!**/*.ts'
|
||||
],
|
||||
|
|
|
@ -114,7 +114,7 @@ const variables = {
|
|||
'--MARGIN': '--margin',
|
||||
'--MR_ICON': '--button-icon-margin'
|
||||
};
|
||||
searchFilesInDirectoryAsync(['../src/workbench/browser/src'], sortByKeylength(variables));
|
||||
searchFilesInDirectoryAsync(['../src/browser/src'], sortByKeylength(variables));
|
||||
//Lazy to await
|
||||
setTimeout(() => {
|
||||
console.log('Replaced Success!\n', replaceSuccess);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
//If stuck,check yarn.lock file,maybe has conflict
|
||||
// upgrade.js
|
||||
const child_process = require('child_process');
|
||||
const pkg = require('../src/workbench/browser/package.json');
|
||||
const pkg = require('../../src/browser/package.json');
|
||||
const filterRegex = /eo-ng-.*/;
|
||||
|
||||
const dependencies = pkg['dependencies'];
|
||||
const dependencyList = Object.keys(dependencies).filter(dependency => filterRegex.test(dependency));
|
||||
child_process.execSync(`cd ../src/workbench/browser&&yarn upgrade ${dependencyList.join('@latest ')}@latest`);
|
||||
child_process.execSync(`cd ../../src/browser&&yarn upgrade ${dependencyList.join('@latest ')}@latest`);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { app } from 'electron';
|
||||
import Store from 'electron-store';
|
||||
|
||||
import { LANGUAGES } from '../../workbench/browser/src/app/core/services/language/language.model';
|
||||
import { LANGUAGES } from '../../browser/src/app/core/services/language/language.model';
|
||||
const store = new Store();
|
||||
class LanguageInstance {
|
||||
private static _instance: LanguageInstance;
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
require('@bqy/node-module-alias/register');
|
||||
import { app, BrowserWindow, ipcMain } from 'electron';
|
||||
import Store from 'electron-store';
|
||||
import { LanguageService } from 'eo/app/electron-main/language.service';
|
||||
import { MockServer } from 'eo/platform/node/mock-server';
|
||||
import { LanguageService } from 'pc/app/electron-main/language.service';
|
||||
import { MockServer } from 'pc/platform/node/mock-server';
|
||||
import portfinder from 'portfinder';
|
||||
|
||||
import { UnitWorkerModule } from '../../node/test-server/electron/main';
|
||||
import socket from '../../node/test-server/server/socketio';
|
||||
import { processEnv } from '../../platform/node/constant';
|
||||
import { ModuleManager } from '../../platform/node/extension-manager/manager';
|
||||
import { proxyOpenExternal } from '../../shared/common/browserView';
|
||||
import { UnitWorkerModule } from '../../workbench/node/electron/main';
|
||||
import socket from '../../workbench/node/server/socketio';
|
||||
import { EoUpdater } from './updater';
|
||||
|
||||
import * as os from 'os';
|
||||
|
@ -98,7 +98,7 @@ class EoBrowserWindow {
|
|||
const file: string =
|
||||
processEnv === 'development'
|
||||
? 'http://localhost:4200'
|
||||
: `file://${path.join(__dirname, `../../../src/workbench/browser/dist/${await LanguageService.getPath()}/index.html`)}`;
|
||||
: `file://${path.join(__dirname, `../../../src/browser/dist/${await LanguageService.getPath()}/index.html`)}`;
|
||||
this.win.loadURL(file);
|
||||
if (['development'].includes(processEnv)) {
|
||||
this.win.webContents.openDevTools({
|
||||
|
|
|
@ -11,8 +11,9 @@ src/**/*.js
|
|||
!src/karma.conf.js
|
||||
!src/assets/font/*.js
|
||||
!src/assets/libs/*.js
|
||||
!build/*.js
|
||||
*.js.map
|
||||
|
||||
!*.webpack.js
|
||||
|
||||
# dependencies
|
||||
node_modules
|
|
@ -29,7 +29,7 @@
|
|||
"src/icon.ico",
|
||||
"src/assets",
|
||||
"src/extensions",
|
||||
{ "glob": "**/*", "input": "../../../node_modules/monaco-editor/min/vs", "output": "/assets/vs/" }
|
||||
{ "glob": "**/*", "input": "../../node_modules/monaco-editor/min/vs", "output": "/assets/vs/" }
|
||||
],
|
||||
"styles": ["src/styles/antd.less", "src/styles.scss"],
|
||||
"scripts": ["src/assets/libs/protocolcheck.js"],
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -24,35 +24,35 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@angular-cli/base-href-webpack": "1.0.16",
|
||||
"@angular/animations": "15.1.3",
|
||||
"@angular/common": "15.1.3",
|
||||
"@angular/compiler": "15.1.3",
|
||||
"@angular/core": "15.1.3",
|
||||
"@angular/forms": "15.1.3",
|
||||
"@angular/language-service": "15.1.3",
|
||||
"@angular/platform-browser": "15.1.3",
|
||||
"@angular/platform-browser-dynamic": "15.1.3",
|
||||
"@angular/router": "15.1.3",
|
||||
"@angular/upgrade": "^15.1.3",
|
||||
"@angular/animations": "15.2.2",
|
||||
"@angular/common": "15.2.2",
|
||||
"@angular/compiler": "15.2.2",
|
||||
"@angular/core": "15.2.2",
|
||||
"@angular/forms": "15.2.2",
|
||||
"@angular/language-service": "15.2.2",
|
||||
"@angular/platform-browser": "15.2.2",
|
||||
"@angular/platform-browser-dynamic": "15.2.2",
|
||||
"@angular/router": "15.2.2",
|
||||
"@angular/upgrade": "^15.2.2",
|
||||
"@micro-zoe/micro-app": "1.0.0-alpha.10",
|
||||
"@xmagic/ngx-wujie": "1.0.0-rc.20",
|
||||
"ajv": "8.12.0",
|
||||
"color": "^4.2.3",
|
||||
"core-js": "3.27.2",
|
||||
"eo-ng-auto-complete": "0.1.11",
|
||||
"eo-ng-auto-complete": "0.1.14",
|
||||
"eo-ng-button": "0.1.10",
|
||||
"eo-ng-checkbox": "0.1.10",
|
||||
"eo-ng-dropdown": "0.1.10",
|
||||
"eo-ng-dropdown": "0.1.14",
|
||||
"eo-ng-feedback": "0.1.10",
|
||||
"eo-ng-input": "0.1.10",
|
||||
"eo-ng-input": "0.1.13",
|
||||
"eo-ng-layout": "0.1.10",
|
||||
"eo-ng-menu": "0.1.10",
|
||||
"eo-ng-radio": "0.1.10",
|
||||
"eo-ng-select": "0.1.10",
|
||||
"eo-ng-select": "0.1.12",
|
||||
"eo-ng-switch": "0.1.10",
|
||||
"eo-ng-table": "0.1.11",
|
||||
"eo-ng-tabs": "0.1.10",
|
||||
"eo-ng-tree": "0.1.10",
|
||||
"eo-ng-table": "0.1.14",
|
||||
"eo-ng-tabs": "0.1.11",
|
||||
"eo-ng-tree": "0.1.16",
|
||||
"is-xml": "0.1.0",
|
||||
"js-beautify": "1.14.7",
|
||||
"lodash-es": "4.17.21",
|
||||
|
@ -65,32 +65,30 @@
|
|||
"rxjs": "7.8.0",
|
||||
"socket.io-client": "4.5.4",
|
||||
"tslib": "^2.5.0",
|
||||
"wujie": "1.0.5",
|
||||
"zone.js": "~0.12.0"
|
||||
"wujie": "1.0.6",
|
||||
"zone.js": "~0.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-builders/custom-webpack": "15.0.0",
|
||||
"@angular-devkit/build-angular": "15.1.4",
|
||||
"@angular-eslint/builder": "15.2.0",
|
||||
"@angular-eslint/eslint-plugin": "15.2.0",
|
||||
"@angular-eslint/eslint-plugin-template": "15.2.0",
|
||||
"@angular-eslint/schematics": "15.2.0",
|
||||
"@angular-eslint/template-parser": "15.2.0",
|
||||
"@angular-devkit/build-angular": "15.2.2",
|
||||
"@angular-eslint/builder": "15.2.1",
|
||||
"@angular-eslint/eslint-plugin": "15.2.1",
|
||||
"@angular-eslint/eslint-plugin-template": "15.2.1",
|
||||
"@angular-eslint/schematics": "15.2.1",
|
||||
"@angular-eslint/template-parser": "15.2.1",
|
||||
"@angular/cli": "15.1.4",
|
||||
"@angular/compiler-cli": "15.1.3",
|
||||
"@angular/localize": "15.1.3",
|
||||
"@ngx-translate/core": "14.0.0",
|
||||
"@ngx-translate/http-loader": "7.0.0",
|
||||
"@types/color": "3.0.3",
|
||||
"@types/jasmine": "4.3.1",
|
||||
"@types/jasminewd2": "2.0.10",
|
||||
"@types/lodash-es": "4.17.6",
|
||||
"@types/markdown-it": "12.2.3",
|
||||
"@types/node": "18.11.18",
|
||||
"@types/node": "18.15.0",
|
||||
"@types/omit-deep-lodash": "1.1.1",
|
||||
"@typescript-eslint/eslint-plugin": "5.50.0",
|
||||
"@typescript-eslint/parser": "5.50.0",
|
||||
"autoprefixer": "10.4.13",
|
||||
"@typescript-eslint/eslint-plugin": "5.54.1",
|
||||
"@typescript-eslint/parser": "5.54.1",
|
||||
"autoprefixer": "10.4.14",
|
||||
"conventional-changelog-cli": "2.2.2",
|
||||
"dexie": "^4.0.1-alpha.7",
|
||||
"jasmine-core": "4.5.0",
|
||||
|
@ -104,8 +102,8 @@
|
|||
"tailwindcss": "3.2.4",
|
||||
"ts-node": "10.9.1",
|
||||
"typescript": "~4.9.5",
|
||||
"webpack": "5.75.0",
|
||||
"webpack-bundle-analyzer": "4.7.0"
|
||||
"webpack": "5.76.0",
|
||||
"webpack-bundle-analyzer": "4.8.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.17.0"
|
|
@ -1,11 +1,13 @@
|
|||
{
|
||||
"/api": {
|
||||
// "targe": "https://postcat.com",
|
||||
"target": "http://52.76.76.88:8080",
|
||||
"secure": false,
|
||||
"changeOrigin": true,
|
||||
"logLevel": "debug"
|
||||
},
|
||||
"/usercenter": {
|
||||
// "targe": "https://postcat.com",
|
||||
"target": "http://52.76.76.88:8080",
|
||||
"secure": false,
|
||||
"changeOrigin": true,
|
|
@ -1,7 +1,7 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
|
||||
import { PageNotFindModule } from 'eo/workbench/browser/src/app/layouts/page-not-found/page-not-find.module';
|
||||
import { PageNotFoundComponent } from 'eo/workbench/browser/src/app/layouts/page-not-found/page-not-found.component';
|
||||
import { PageNotFindModule } from 'pc/browser/src/app/layouts/page-not-found/page-not-find.module';
|
||||
import { PageNotFoundComponent } from 'pc/browser/src/app/layouts/page-not-found/page-not-found.component';
|
||||
|
||||
import { RedirectSharedID } from './pages/services/redirect.services';
|
||||
|
|
@ -7,26 +7,26 @@ import { ReactiveFormsModule } from '@angular/forms';
|
|||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { WarningFill } from '@ant-design/icons-angular/icons';
|
||||
import { EoNgFeedbackTooltipModule, EoNgFeedbackMessageModule } from 'eo-ng-feedback';
|
||||
import { FeatureControlService } from 'eo/workbench/browser/src/app/core/services/feature-control/feature-control.service';
|
||||
import { LanguageService } from 'eo/workbench/browser/src/app/core/services/language/language.service';
|
||||
import { NotificationService } from 'eo/workbench/browser/src/app/core/services/notification.service';
|
||||
import { ExtensionService } from 'eo/workbench/browser/src/app/shared/services/extensions/extension.service';
|
||||
import { GlobalProvider } from 'eo/workbench/browser/src/app/shared/services/globalProvider';
|
||||
import { IndexedDBStorage } from 'eo/workbench/browser/src/app/shared/services/storage/IndexedDB/lib/';
|
||||
import { HttpStorage } from 'eo/workbench/browser/src/app/shared/services/storage/http/lib';
|
||||
import { BaseUrlInterceptor } from 'eo/workbench/browser/src/app/shared/services/storage/http/lib/baseUrl.service';
|
||||
import { APP_CONFIG } from 'eo/workbench/browser/src/environments/environment';
|
||||
import { en_US, NZ_I18N, zh_CN } from 'ng-zorro-antd/i18n';
|
||||
import { NzIconModule } from 'ng-zorro-antd/icon';
|
||||
import { NzModalModule } from 'ng-zorro-antd/modal';
|
||||
import { FeatureControlService } from 'pc/browser/src/app/core/services/feature-control/feature-control.service';
|
||||
import { LanguageService } from 'pc/browser/src/app/core/services/language/language.service';
|
||||
import { NotificationService } from 'pc/browser/src/app/core/services/notification.service';
|
||||
import { ExtensionService } from 'pc/browser/src/app/services/extensions/extension.service';
|
||||
import { GlobalProvider } from 'pc/browser/src/app/services/globalProvider';
|
||||
import { IndexedDBStorage } from 'pc/browser/src/app/services/storage/IndexedDB/lib';
|
||||
import { HttpStorage } from 'pc/browser/src/app/services/storage/http/lib';
|
||||
import { BaseUrlInterceptor } from 'pc/browser/src/app/services/storage/http/lib/baseUrl.service';
|
||||
import { APP_CONFIG } from 'pc/browser/src/environments/environment';
|
||||
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { AppComponent } from './app.component';
|
||||
import { TABLE_PRO_CONFIG } from './components/eo-ui/table-pro/table-pro.token';
|
||||
import { PcConsoleModule } from './components/pc-console/pc-console.module';
|
||||
import { GlobalErrorHandler } from './core/services/errorHandle.service';
|
||||
import { ThemeService } from './core/services/theme/theme.service';
|
||||
import { TABLE_PRO_CONFIG } from './modules/eo-ui/table-pro/table-pro.token';
|
||||
import { PcConsoleModule } from './modules/pc-console/pc-console.module';
|
||||
import { MockService } from './shared/services/mock.service';
|
||||
import { MockService } from './services/mock.service';
|
||||
registerLocaleData(en);
|
||||
registerLocaleData(zh);
|
||||
|
|
@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common';
|
|||
import { NgModule } from '@angular/core';
|
||||
import { EoNgButtonModule } from 'eo-ng-button';
|
||||
import { EoNgDropdownModule } from 'eo-ng-dropdown';
|
||||
import { SharedModule } from 'eo/workbench/browser/src/app/shared/shared.module';
|
||||
import { SharedModule } from 'pc/browser/src/app/shared/shared.module';
|
||||
|
||||
import { EoIconparkIconModule } from '../eo-ui/iconpark-icon/eo-iconpark-icon.module';
|
||||
import { DownloadClientComponent } from './download-client.component';
|
|
@ -4,15 +4,7 @@
|
|||
*/
|
||||
|
||||
import { Direction, Directionality } from '@angular/cdk/bidi';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
ChangeDetectorRef,
|
||||
Component,
|
||||
Input,
|
||||
OnInit,
|
||||
Optional,
|
||||
ViewEncapsulation,
|
||||
} from '@angular/core';
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit, Optional, ViewEncapsulation } from '@angular/core';
|
||||
import { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config';
|
||||
import { NzDestroyService } from 'ng-zorro-antd/core/services';
|
||||
import { BooleanInput } from 'ng-zorro-antd/core/types';
|
||||
|
@ -35,10 +27,10 @@ const NZ_CONFIG_MODULE_NAME: NzConfigKey = 'collapse';
|
|||
'[class.ant-collapse-icon-position-right]': `nzExpandIconPosition === 'right'`,
|
||||
'[class.ant-collapse-ghost]': `nzGhost`,
|
||||
'[class.ant-collapse-borderless]': '!nzBordered',
|
||||
'[class.ant-collapse-rtl]': "dir === 'rtl'",
|
||||
'[class.ant-collapse-rtl]': "dir === 'rtl'"
|
||||
},
|
||||
providers: [NzDestroyService],
|
||||
styleUrls: ['./collapse.component.scss'],
|
||||
styleUrls: ['./collapse.component.scss']
|
||||
})
|
||||
export class EoNgCollapseComponent implements OnInit {
|
||||
readonly _nzModuleName: NzConfigKey = NZ_CONFIG_MODULE_NAME;
|
||||
|
@ -89,8 +81,8 @@ export class EoNgCollapseComponent implements OnInit {
|
|||
click(collapse: EoNgCollapsePanelComponent): void {
|
||||
if (this.nzAccordion && !collapse.nzActive) {
|
||||
this.listOfEoNgCollapsePanelComponent
|
||||
.filter((item) => item !== collapse)
|
||||
.forEach((item) => {
|
||||
.filter(item => item !== collapse)
|
||||
.forEach(item => {
|
||||
if (item.nzActive) {
|
||||
item.nzActive = false;
|
||||
item.nzActiveChange.emit(item.nzActive);
|
|
@ -7,6 +7,6 @@ import { EoIconparkIconComponent } from './eo-iconpark-icon.component';
|
|||
declarations: [EoIconparkIconComponent],
|
||||
imports: [CommonModule],
|
||||
exports: [EoIconparkIconComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
})
|
||||
export class EoIconparkIconModule {}
|
|
@ -144,8 +144,46 @@ export const completions: Array<Omit<languages.CompletionItem, 'range' | 'kind'>
|
|||
// }
|
||||
];
|
||||
|
||||
export const postmanCompletions: Array<Omit<languages.CompletionItem, 'range' | 'kind'>> = [
|
||||
{
|
||||
label: 'pc.request.url',
|
||||
insertText: 'pc.request.url',
|
||||
detail: ''
|
||||
},
|
||||
{
|
||||
label: 'pc.request.headers',
|
||||
insertText: 'pc.request.headers',
|
||||
detail: ''
|
||||
},
|
||||
{
|
||||
label: 'pc.request.headers.add',
|
||||
insertText: 'pc.request.headers.add',
|
||||
detail: ''
|
||||
},
|
||||
{
|
||||
label: 'pc.request.headers.remove',
|
||||
insertText: 'pc.request.headers.remove',
|
||||
detail: ''
|
||||
},
|
||||
{
|
||||
label: 'pc.request.headers.upsert',
|
||||
insertText: 'pc.request.headers.upsert',
|
||||
detail: ''
|
||||
},
|
||||
{
|
||||
label: 'pc.request.method',
|
||||
insertText: 'pc.request.method',
|
||||
detail: ''
|
||||
},
|
||||
{
|
||||
label: 'pc.request.body',
|
||||
insertText: 'pc.request.body',
|
||||
detail: ''
|
||||
}
|
||||
];
|
||||
|
||||
export const getDefaultCompletions = (): Array<Omit<languages.CompletionItem, 'range'>> =>
|
||||
completions.map(item => ({
|
||||
[...completions, ...postmanCompletions].map(item => ({
|
||||
...item,
|
||||
kind: monaco.languages.CompletionItemKind.Function
|
||||
}));
|
|
@ -1,11 +1,11 @@
|
|||
import { Component, Input, Output, EventEmitter, OnChanges, AfterViewInit, OnDestroy, OnInit, ElementRef } from '@angular/core';
|
||||
import { EoNgFeedbackMessageService } from 'eo-ng-feedback';
|
||||
import { ElectronService } from 'eo/workbench/browser/src/app/core/services/electron/electron.service';
|
||||
import type { editor, IDisposable } from 'monaco-editor';
|
||||
import type { JoinedEditorOptions } from 'ng-zorro-antd/code-editor';
|
||||
import { ElectronService } from 'pc/browser/src/app/core/services/electron/electron.service';
|
||||
|
||||
import { ThemeService } from '../../../core/services/theme/theme.service';
|
||||
import { debounce, whatTextType } from '../../../utils/index.utils';
|
||||
import { debounce, whatTextType } from '../../../shared/utils/index.utils';
|
||||
import { getDefaultCompletions } from './defaultCompletions';
|
||||
|
||||
type EventType = 'format' | 'copy' | 'search' | 'replace' | 'type' | 'download' | 'newTab';
|
|
@ -0,0 +1,171 @@
|
|||
/**
|
||||
* Copy from postman source code
|
||||
* package: @postman/script-examples/db.json
|
||||
* sourcemap file:_ar-assets/node_modules/@postman/script-examples
|
||||
* file: https://lively-crescent-175226.postman.co/_ar-assets/CollectionWorkbench-5fc7ac82a3bd34b1.min.js
|
||||
*/
|
||||
const SNIPPETS_PREREQ = [
|
||||
{
|
||||
name: 'Get an environment variable',
|
||||
description: 'Gets an environment variable',
|
||||
code: 'pm.environment.get("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Get a global variable',
|
||||
description: 'Gets a global variable',
|
||||
code: 'pm.globals.get("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Get a variable',
|
||||
description: 'Gets a variable (environment or global)',
|
||||
code: 'pm.variables.get("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Get a collection variable',
|
||||
description: 'Gets a collection variable',
|
||||
code: 'pm.collectionVariables.get("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Set an environment variable',
|
||||
description: 'Sets an environment variable',
|
||||
code: 'pm.environment.set("variable_key", "variable_value");'
|
||||
},
|
||||
{
|
||||
name: 'Set a global variable',
|
||||
description: 'Sets a global variable',
|
||||
code: 'pm.globals.set("variable_key", "variable_value");'
|
||||
},
|
||||
{
|
||||
name: 'Set a collection variable',
|
||||
description: 'Sets a collection variable',
|
||||
code: 'pm.collectionVariables.set("variable_key", "variable_value");'
|
||||
},
|
||||
{
|
||||
name: 'Clear an environment variable',
|
||||
description: 'Clears an environment variable if set',
|
||||
code: 'pm.environment.unset("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Clear a global variable',
|
||||
description: 'Clears a global variable if set',
|
||||
code: 'pm.globals.unset("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Clear a collection variable',
|
||||
description: 'Clears a collection variable if set',
|
||||
code: 'pm.collectionVariables.unset("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Send a request',
|
||||
description: 'Sends a request',
|
||||
code: 'pm.sendRequest("https://postman-echo.com/get", function (err, response) {\n console.log(response.json());\n});'
|
||||
}
|
||||
];
|
||||
|
||||
const SNIPPETS_TEST = [
|
||||
{
|
||||
name: 'Get an environment variable',
|
||||
description: 'Gets an environment variable',
|
||||
code: 'pm.environment.get("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Get a global variable',
|
||||
description: 'Gets a global variable',
|
||||
code: 'pm.globals.get("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Get a variable',
|
||||
description: 'Gets a variable (environment or global)',
|
||||
code: 'pm.variables.get("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Get a collection variable',
|
||||
description: 'Gets a collection variable',
|
||||
code: 'pm.collectionVariables.get("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Set an environment variable',
|
||||
description: 'Sets an environment variable',
|
||||
code: 'pm.environment.set("variable_key", "variable_value");'
|
||||
},
|
||||
{
|
||||
name: 'Set a global variable',
|
||||
description: 'Sets a global variable',
|
||||
code: 'pm.globals.set("variable_key", "variable_value");'
|
||||
},
|
||||
{
|
||||
name: 'Set a collection variable',
|
||||
description: 'Sets a collection variable',
|
||||
code: 'pm.collectionVariables.set("variable_key", "variable_value");'
|
||||
},
|
||||
{
|
||||
name: 'Clear an environment variable',
|
||||
description: 'Clears an environment variable if set',
|
||||
code: 'pm.environment.unset("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Clear a global variable',
|
||||
description: 'Clears a global variable if set',
|
||||
code: 'pm.globals.unset("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Clear a collection variable',
|
||||
description: 'Clears a collection variable if set',
|
||||
code: 'pm.collectionVariables.unset("variable_key");'
|
||||
},
|
||||
{
|
||||
name: 'Send a request',
|
||||
description: 'Sends a request',
|
||||
code: 'pm.sendRequest("https://postman-echo.com/get", function (err, response) {\n console.log(response.json());\n});'
|
||||
},
|
||||
{
|
||||
name: 'Status code: Code is 200',
|
||||
description: 'Write a basic status code check',
|
||||
code: 'pm.test("Status code is 200", function () {\n pm.response.to.have.status(200);\n});'
|
||||
},
|
||||
{
|
||||
name: 'Response body: Contains string',
|
||||
description: 'Write a basic string check in response body',
|
||||
code: 'pm.test("Body matches string", function () {\n pm.expect(pm.response.text()).to.include("string_you_want_to_search");\n});'
|
||||
},
|
||||
{
|
||||
name: 'Response body: JSON value check',
|
||||
description: 'Write a basic json value check',
|
||||
code: 'pm.test("Your test name", function () {\n var jsonData = pm.response.json();\n pm.expect(jsonData.value).to.eql(100);\n});'
|
||||
},
|
||||
{
|
||||
name: 'Response body: Is equal to a string',
|
||||
description: 'Write a response body string check',
|
||||
code: 'pm.test("Body is correct", function () {\n pm.response.to.have.body("response_body_string");\n});'
|
||||
},
|
||||
{
|
||||
name: 'Response headers: Content-Type header check',
|
||||
description: 'Write a basic response header check',
|
||||
code: 'pm.test("Content-Type is present", function () {\n pm.response.to.have.header("Content-Type");\n});'
|
||||
},
|
||||
{
|
||||
name: 'Response time is less than 200ms',
|
||||
description: 'Write a basic response time check',
|
||||
code: 'pm.test("Response time is less than 200ms", function () {\n pm.expect(pm.response.responseTime).to.be.below(200);\n});'
|
||||
},
|
||||
{
|
||||
name: 'Status code: Successful POST request',
|
||||
description: 'Check for successful POST request',
|
||||
code: 'pm.test("Successful POST request", function () {\n pm.expect(pm.response.code).to.be.oneOf([201,202]);\n});'
|
||||
},
|
||||
{
|
||||
name: 'Status code: Code name has string',
|
||||
description: 'Write a basic response code string check',
|
||||
code: 'pm.test("Status code name has string", function () {\n pm.response.to.have.status("Created");\n});'
|
||||
},
|
||||
{
|
||||
name: 'Response body: Convert XML body to a JSON Object',
|
||||
description: 'Convert response body from JSON to XML',
|
||||
code: 'var jsonObject = xml2Json(responseBody);'
|
||||
},
|
||||
{
|
||||
name: 'Use Tiny Validator for JSON data',
|
||||
description: 'Validate response against a schema with Tiny Validator',
|
||||
code: 'var schema = {\n "items": {\n "type": "boolean"\n }\n};\n\nvar data1 = [true, false];\nvar data2 = [true, 123];\n\npm.test(\'Schema is valid\', function() {\n pm.expect(tv4.validate(data1, schema)).to.be.true;\n pm.expect(tv4.validate(data2, schema)).to.be.true;\n});'
|
||||
}
|
||||
];
|
|
@ -6,6 +6,6 @@ import { ShadowDomEncapsulationComponent } from './shadow-dom-encapsulation.comp
|
|||
@NgModule({
|
||||
declarations: [ShadowDomEncapsulationComponent],
|
||||
imports: [CommonModule],
|
||||
exports: [ShadowDomEncapsulationComponent],
|
||||
exports: [ShadowDomEncapsulationComponent]
|
||||
})
|
||||
export class ShadowDomEncapsulationModule {}
|
|
@ -1,11 +1,11 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { EoNgFeedbackMessageService } from 'eo-ng-feedback';
|
||||
import { TabStorageService } from 'eo/workbench/browser/src/app/modules/eo-ui/tab/tab-storage.service';
|
||||
import { storageTab, TabItem, TabOperate } from 'eo/workbench/browser/src/app/modules/eo-ui/tab/tab.model';
|
||||
import { MessageService } from 'eo/workbench/browser/src/app/shared/services/message';
|
||||
import { eoDeepCopy } from 'eo/workbench/browser/src/app/utils/index.utils';
|
||||
import { APP_CONFIG } from 'eo/workbench/browser/src/environments/environment';
|
||||
import { TabStorageService } from 'pc/browser/src/app/components/eo-ui/tab/tab-storage.service';
|
||||
import { storageTab, TabItem, TabOperate } from 'pc/browser/src/app/components/eo-ui/tab/tab.model';
|
||||
import { MessageService } from 'pc/browser/src/app/services/message';
|
||||
import { eoDeepCopy } from 'pc/browser/src/app/shared/utils/index.utils';
|
||||
import { APP_CONFIG } from 'pc/browser/src/environments/environment';
|
||||
|
||||
/**
|
||||
* Tab service operate tabs array add/replace/close...
|
|
@ -1,6 +1,6 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
|
||||
import StorageUtil from '../../../utils/storage/storage.utils';
|
||||
import StorageUtil from '../../../shared/utils/storage/storage.utils';
|
||||
import { storageTab, TabItem } from './tab.model';
|
||||
|
||||
@Injectable()
|
|
@ -1,16 +1,16 @@
|
|||
import { KeyValue } from '@angular/common';
|
||||
import { Component, OnInit, OnDestroy, Input, Output, EventEmitter, TemplateRef } from '@angular/core';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { TabOperateService } from 'eo/workbench/browser/src/app/modules/eo-ui/tab/tab-operate.service';
|
||||
import { TabStorageService } from 'eo/workbench/browser/src/app/modules/eo-ui/tab/tab-storage.service';
|
||||
import { TabItem, TabOperate } from 'eo/workbench/browser/src/app/modules/eo-ui/tab/tab.model';
|
||||
import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service';
|
||||
import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service';
|
||||
import { NzDropdownMenuComponent } from 'ng-zorro-antd/dropdown';
|
||||
import { NzTabsCanDeactivateFn } from 'ng-zorro-antd/tabs';
|
||||
import { TabOperateService } from 'pc/browser/src/app/components/eo-ui/tab/tab-operate.service';
|
||||
import { TabStorageService } from 'pc/browser/src/app/components/eo-ui/tab/tab-storage.service';
|
||||
import { TabItem, TabOperate } from 'pc/browser/src/app/components/eo-ui/tab/tab.model';
|
||||
import { TraceService } from 'pc/browser/src/app/services/trace.service';
|
||||
import { StoreService } from 'pc/browser/src/app/store/state.service';
|
||||
import { filter, Subscription } from 'rxjs';
|
||||
|
||||
import { ModalService } from '../../../shared/services/modal.service';
|
||||
import { ModalService } from '../../../services/modal.service';
|
||||
@Component({
|
||||
selector: 'eo-tab',
|
||||
templateUrl: './tab.component.html',
|
|
@ -32,7 +32,6 @@ export declare interface TabViewComponent {
|
|||
* Emit view component data has been saved
|
||||
*/
|
||||
afterSaved?: EventEmitter<any>;
|
||||
|
||||
/**
|
||||
* Emit view component data has changed event
|
||||
*/
|
||||
|
@ -61,6 +60,10 @@ export type TabItem = {
|
|||
*/
|
||||
id: string;
|
||||
isFixed?: boolean;
|
||||
/**
|
||||
* If true,will not cache tab content
|
||||
*/
|
||||
disabledCache?: boolean;
|
||||
/**
|
||||
* Preview page or edit page
|
||||
*/
|
|
@ -22,9 +22,9 @@ import { EoTabComponent } from './tab.component';
|
|||
EoIconparkIconModule,
|
||||
EoNgDropdownModule,
|
||||
NzSpinModule,
|
||||
NzBadgeModule,
|
||||
NzBadgeModule
|
||||
],
|
||||
providers: [TabOperateService, TabStorageService],
|
||||
exports: [EoTabComponent],
|
||||
exports: [EoTabComponent]
|
||||
})
|
||||
export class EoTabModule {}
|
|
@ -16,9 +16,9 @@ import {
|
|||
} from '@angular/core';
|
||||
import _, { attempt, has, isUndefined, omitBy } from 'lodash-es';
|
||||
|
||||
import { eoDeepCopy } from '../../../utils/index.utils';
|
||||
import StorageUtil from '../../../utils/storage/storage.utils';
|
||||
import { filterTableData, generateQuoteKeyValue, getTreeTotalCount } from '../../../utils/tree/tree.utils';
|
||||
import { eoDeepCopy } from '../../../shared/utils/index.utils';
|
||||
import StorageUtil from '../../../shared/utils/storage/storage.utils';
|
||||
import { filterTableData, generateQuoteKeyValue, getTreeTotalCount } from '../../../shared/utils/tree/tree.utils';
|
||||
import { ColumnItem, IconBtn, TableProSetting } from './table-pro.model';
|
||||
import { TableProConfig, TABLE_PRO_CONFIG, TABLE_PRO_DEFUALT_CONFIG } from './table-pro.token';
|
||||
@Component({
|
|
@ -22,8 +22,8 @@ import { EoTableProComponent } from './table-pro.component';
|
|||
EoNgCheckboxModule,
|
||||
NzPopconfirmModule,
|
||||
EoNgFeedbackTooltipModule,
|
||||
NzInputNumberModule,
|
||||
NzInputNumberModule
|
||||
],
|
||||
exports: [EoTableProComponent],
|
||||
exports: [EoTableProComponent]
|
||||
})
|
||||
export class EoTableProModule {}
|
|
@ -1,17 +1,17 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { FeatureInfo } from 'eo/workbench/browser/src/app/shared/models/extension-manager';
|
||||
import { ExtensionService } from 'eo/workbench/browser/src/app/shared/services/extensions/extension.service';
|
||||
import { Message, MessageService } from 'eo/workbench/browser/src/app/shared/services/message';
|
||||
import { ApiService } from 'eo/workbench/browser/src/app/shared/services/storage/api.service';
|
||||
import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service';
|
||||
import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service';
|
||||
import StorageUtil from 'eo/workbench/browser/src/app/utils/storage/storage.utils';
|
||||
import { has } from 'lodash-es';
|
||||
import { ExtensionService } from 'pc/browser/src/app/services/extensions/extension.service';
|
||||
import { Message, MessageService } from 'pc/browser/src/app/services/message';
|
||||
import { ApiService } from 'pc/browser/src/app/services/storage/api.service';
|
||||
import { TraceService } from 'pc/browser/src/app/services/trace.service';
|
||||
import { FeatureInfo } from 'pc/browser/src/app/shared/models/extension-manager';
|
||||
import StorageUtil from 'pc/browser/src/app/shared/utils/storage/storage.utils';
|
||||
import { StoreService } from 'pc/browser/src/app/store/state.service';
|
||||
import { Subject, takeUntil } from 'rxjs';
|
||||
|
||||
// shit angular-cli 配不明白
|
||||
// import { version } from '../../../../../../../../package.json' assert { type: 'json' };
|
||||
import pkgInfo from '../../../../../../../../package.json';
|
||||
import pkgInfo from '../../../../../../../package.json';
|
||||
|
||||
@Component({
|
||||
selector: 'eo-export-api',
|
|
@ -3,8 +3,8 @@ import { NgModule } from '@angular/core';
|
|||
import { FormsModule } from '@angular/forms';
|
||||
import { EoNgFeedbackTooltipModule } from 'eo-ng-feedback';
|
||||
import { EoNgRadioModule } from 'eo-ng-radio';
|
||||
import { SharedModule } from 'eo/workbench/browser/src/app/shared/shared.module';
|
||||
import { NzUploadModule } from 'ng-zorro-antd/upload';
|
||||
import { SharedModule } from 'pc/browser/src/app/shared/shared.module';
|
||||
|
||||
import { EoIconparkIconModule } from '../eo-ui/iconpark-icon/eo-iconpark-icon.module';
|
||||
import { ExportApiComponent } from './export-api/export-api.component';
|
|
@ -1,17 +1,17 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { EoNgFeedbackMessageService } from 'eo-ng-feedback';
|
||||
import { FeatureInfo } from 'eo/workbench/browser/src/app/shared/models/extension-manager';
|
||||
import { ExtensionService } from 'eo/workbench/browser/src/app/shared/services/extensions/extension.service';
|
||||
import { Message, MessageService } from 'eo/workbench/browser/src/app/shared/services/message';
|
||||
import { ApiService } from 'eo/workbench/browser/src/app/shared/services/storage/api.service';
|
||||
import { parseAndCheckCollections, parseAndCheckEnv } from 'eo/workbench/browser/src/app/shared/services/storage/db/validate/validate';
|
||||
import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service';
|
||||
import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service';
|
||||
import { ExtensionService } from 'pc/browser/src/app/services/extensions/extension.service';
|
||||
import { Message, MessageService } from 'pc/browser/src/app/services/message';
|
||||
import { ApiService } from 'pc/browser/src/app/services/storage/api.service';
|
||||
import { parseAndCheckCollections, parseAndCheckEnv } from 'pc/browser/src/app/services/storage/db/validate/validate';
|
||||
import { TraceService } from 'pc/browser/src/app/services/trace.service';
|
||||
import { FeatureInfo } from 'pc/browser/src/app/shared/models/extension-manager';
|
||||
import { StoreService } from 'pc/browser/src/app/store/state.service';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
||||
import StorageUtil from '../../../utils/storage/storage.utils';
|
||||
import StorageUtil from '../../../shared/utils/storage/storage.utils';
|
||||
|
||||
// const optionList = [
|
||||
// {
|
|
@ -1,6 +1,6 @@
|
|||
import { CollectionTypeEnum, ImportProjectDto } from 'eo/workbench/browser/src/app/shared/services/storage/db/dto/project.dto';
|
||||
import { CollectionTypeEnum, ImportProjectDto } from 'pc/browser/src/app/services/storage/db/dto/project.dto';
|
||||
|
||||
import { convertApiData } from './../../../shared/services/storage/db/dataSource/convert';
|
||||
import { convertApiData } from '../../../services/storage/db/dataSource/convert';
|
||||
|
||||
export const old2new = (params, projectUuid, workSpaceUuid): ImportProjectDto => {
|
||||
const { collections = [], environments } = params;
|
|
@ -1,13 +1,13 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { EoNgFeedbackMessageService } from 'eo-ng-feedback';
|
||||
import { FeatureInfo } from 'eo/workbench/browser/src/app/shared/models/extension-manager';
|
||||
import { ExtensionService } from 'eo/workbench/browser/src/app/shared/services/extensions/extension.service';
|
||||
import { Message, MessageService } from 'eo/workbench/browser/src/app/shared/services/message';
|
||||
import { ApiService } from 'eo/workbench/browser/src/app/shared/services/storage/api.service';
|
||||
import { has } from 'lodash-es';
|
||||
import { ExtensionService } from 'pc/browser/src/app/services/extensions/extension.service';
|
||||
import { Message, MessageService } from 'pc/browser/src/app/services/message';
|
||||
import { ApiService } from 'pc/browser/src/app/services/storage/api.service';
|
||||
import { FeatureInfo } from 'pc/browser/src/app/shared/models/extension-manager';
|
||||
import { Subject, takeUntil } from 'rxjs';
|
||||
|
||||
import packageJson from '../../../../../../../../package.json';
|
||||
import packageJson from '../../../../../../../package.json';
|
||||
|
||||
@Component({
|
||||
selector: 'eo-push-api',
|
|
@ -1,9 +1,9 @@
|
|||
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { EoNgFeedbackMessageService } from 'eo-ng-feedback';
|
||||
import { featuresTipsMap, categoriesTipsMap, ContributionPoints } from 'eo/workbench/browser/src/app/pages/extension/extension.model';
|
||||
import { featuresTipsMap, categoriesTipsMap, ContributionPoints } from 'pc/browser/src/app/pages/components/extension/extension.model';
|
||||
import { Observable, Observer } from 'rxjs';
|
||||
|
||||
import { parserJsonFile } from '../../../utils/index.utils';
|
||||
import { parserJsonFile } from '../../../shared/utils/index.utils';
|
||||
type optionType = {
|
||||
label: string;
|
||||
value: string;
|
|
@ -5,7 +5,9 @@ export const SYNC_API_SCHEMA = {
|
|||
__crontab: {
|
||||
type: 'number',
|
||||
label: $localize`Auto Sync`,
|
||||
'ui:widget': 'radio',
|
||||
ui: {
|
||||
widget: 'radio'
|
||||
},
|
||||
default: 4,
|
||||
required: true,
|
||||
oneOf: [
|
||||
|
@ -38,7 +40,9 @@ export const SYNC_API_SCHEMA = {
|
|||
__formater: {
|
||||
type: 'string',
|
||||
label: $localize`:@@SyncFormat:Format`,
|
||||
'ui:widget': 'radio',
|
||||
ui: {
|
||||
widget: 'radio'
|
||||
},
|
||||
default: '',
|
||||
required: true,
|
||||
oneOf: []
|
|
@ -1,17 +1,17 @@
|
|||
import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { EoNgFeedbackMessageService } from 'eo-ng-feedback';
|
||||
import { EoSchemaFormComponent } from 'eo/workbench/browser/src/app/shared/components/schema-form/schema-form.component';
|
||||
import { FeatureInfo } from 'eo/workbench/browser/src/app/shared/models/extension-manager';
|
||||
import { ExtensionService } from 'eo/workbench/browser/src/app/shared/services/extensions/extension.service';
|
||||
import { Message, MessageService } from 'eo/workbench/browser/src/app/shared/services/message';
|
||||
import { ApiService } from 'eo/workbench/browser/src/app/shared/services/storage/api.service';
|
||||
import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service';
|
||||
import { EffectService } from 'eo/workbench/browser/src/app/shared/store/effect.service';
|
||||
import { StoreService } from 'eo/workbench/browser/src/app/shared/store/state.service';
|
||||
import { debounce } from 'lodash-es';
|
||||
import { ExtensionService } from 'pc/browser/src/app/services/extensions/extension.service';
|
||||
import { Message, MessageService } from 'pc/browser/src/app/services/message';
|
||||
import { ApiService } from 'pc/browser/src/app/services/storage/api.service';
|
||||
import { TraceService } from 'pc/browser/src/app/services/trace.service';
|
||||
import { EoSchemaFormComponent } from 'pc/browser/src/app/shared/components/schema-form/schema-form.component';
|
||||
import { FeatureInfo } from 'pc/browser/src/app/shared/models/extension-manager';
|
||||
import { EffectService } from 'pc/browser/src/app/store/effect.service';
|
||||
import { StoreService } from 'pc/browser/src/app/store/state.service';
|
||||
import { Subject, takeUntil } from 'rxjs';
|
||||
|
||||
import { eoDeepCopy } from '../../../utils/index.utils';
|
||||
import { eoDeepCopy } from '../../../shared/utils/index.utils';
|
||||
import { SYNC_API_SCHEMA } from './schema';
|
||||
|
||||
@Component({
|
||||
|
@ -168,6 +168,7 @@ export class SyncApiComponent implements OnInit, OnChanges {
|
|||
|
||||
if (typeof module[feature.action] !== 'function') return false;
|
||||
const [data, err] = await module[feature.action](this.validateForm?.value);
|
||||
console.log('data', data, err);
|
||||
if (err) {
|
||||
this.eoMessage.error($localize`Sync API from URL error: ${err}`);
|
||||
return 'stayModal';
|
|
@ -1,9 +1,9 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { EoNgFeedbackMessageService } from 'eo-ng-feedback';
|
||||
import { TraceService } from 'eo/workbench/browser/src/app/shared/services/trace.service';
|
||||
import { autorun, reaction } from 'mobx';
|
||||
import { TraceService } from 'pc/browser/src/app/services/trace.service';
|
||||
|
||||
import { StoreService } from '../../shared/store/state.service';
|
||||
import { StoreService } from '../../store/state.service';
|
||||
import { MemberService } from './member.service';
|
||||
|
||||
@Component({
|
|
@ -1,7 +1,7 @@
|
|||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
|
||||
import { APP_CONFIG } from 'eo/workbench/browser/src/environments/environment';
|
||||
import { APP_CONFIG } from 'pc/browser/src/environments/environment';
|
||||
|
||||
import { StoreService } from '../../../shared/store/state.service';
|
||||
import { StoreService } from '../../../store/state.service';
|
||||
import { NpsPositionDirective } from '../nps-mask-postion.directive';
|
||||
|
||||
@Component({
|
||||
|
@ -10,8 +10,8 @@ import { NpsPositionDirective } from '../nps-mask-postion.directive';
|
|||
<!-- <div i18n class="title">How would you rate your experience with the Postcat</div> -->
|
||||
<div class="tips text-tips"></div>
|
||||
</ng-container> `,
|
||||
styleUrls: ['./nps-mask.component.scss'],
|
||||
hostDirectives: [NpsPositionDirective]
|
||||
styleUrls: ['./nps-mask.component.scss']
|
||||
// hostDirectives: [NpsPositionDirective]
|
||||
})
|
||||
export class NpsMaskComponent implements OnInit {
|
||||
/**
|
|
@ -1,6 +1,6 @@
|
|||
import { Directive, ElementRef } from '@angular/core';
|
||||
|
||||
import { TraceService } from '../../shared/services/trace.service';
|
||||
import { TraceService } from '../../services/trace.service';
|
||||
|
||||
@Directive({
|
||||
selector: '[pcNpsPosition]',
|
|
@ -1,7 +1,7 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
import { ThemeService } from '../../../core/services/theme/theme.service';
|
||||
import StorageUtil from '../../../utils/storage/storage.utils';
|
||||
import StorageUtil from '../../../shared/utils/storage/storage.utils';
|
||||
|
||||
@Component({
|
||||
selector: 'pc-debug-theme',
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue