Skip to content

Commit

Permalink
feat: render push plugins list
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfuboy committed Apr 28, 2022
1 parent 4a955a3 commit 47285e6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
11 changes: 0 additions & 11 deletions src/core/market/browser/src/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,4 @@ export const getList = async () => {
export const getDetail = async (name) => {
const { code, data } = await http.get(`http://106.12.149.147:3333/detail/${name}`).json();
return code === 0 ? [data, null] : [null, { code }];
// console.log('name', name);
// return [
// {
// name: 'eo-module-eagle',
// version: '1.0.0',
// author: 'Eolink',
// main: 'dist/index.js',
// description: 'A eo-module-eagle module of EOAPI-Core.',
// },
// null,
// ];
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,18 @@ export class ExportApiComponent implements OnInit {
constructor(private storage: StorageService) {}
ngOnInit(): void {
const extensionList = window.eo.getModules();
console.log(
'==>',
JSON.stringify(
Object.values([...extensionList]).map((it) => it[1].features),
null,
2
)
);
this.supportList = Object.values([...extensionList])
.map((it) => it[1])
.filter((it) => it.moduleType === 'feature')
.filter((it) => it.features['apimanager.export'])
.map((it: any) => ({
key: it.moduleName,
image: it.logo,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<nz-radio-group [(ngModel)]="exportType">
<label nz-radio-button nzValue="eolink">Eolink</label>
<label nz-radio-button nzValue="zion">Zion</label>
<label nz-radio-button nzValue="apisix">APISix</label>
<label *ngFor="let item of supportList" nz-radio-button [nzValue]="item.key">{{item.title}}</label>
</nz-radio-group>
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@ import { StorageService } from '../../services/storage';
})
export class SyncApiComponent implements OnInit {
exportType: string = 'eolink';
constructor(
private modalRef: NzModalRef,
private storage: StorageService
) { }
supportList: any[] = [];
constructor(private modalRef: NzModalRef, private storage: StorageService) {}

ngOnInit(): void {
const extensionList = window.eo.getModules();
this.supportList = Object.values([...extensionList])
.map((it) => it[1])
.filter((it) => it.moduleType === 'feature')
.filter((it) => it.features['apimanager.sync'])
.map((it: any) => ({
key: it.moduleName,
image: it.logo,
title: it.features['apimanager.sync'].label,
}));
}
submit(){
console.log('export')
submit() {
console.log('sync');
}
}

0 comments on commit 47285e6

Please sign in to comment.