mirror of
https://gitee.com/eolink_admin/postcat.git
synced 2024-12-02 11:47:57 +08:00
feat: mock extension preview in web
This commit is contained in:
parent
8d5771a011
commit
1bbedc50c4
@ -14,7 +14,7 @@ export class ExtensionService {
|
||||
this.getInstalledList();
|
||||
}
|
||||
getInstalledList() {
|
||||
this.localModules = window.eo.getModules();
|
||||
this.localModules = window.eo?.getModules()||new Map();
|
||||
this.updateExtensionIDs();
|
||||
}
|
||||
public async requestList() {
|
||||
|
@ -278,7 +278,7 @@ export class SettingComponent implements OnInit {
|
||||
// 获取本地设置
|
||||
this.localSettings = window.eo.getSettings();
|
||||
// const featureList = window.eo.getFeature('configuration');
|
||||
const modules = window.eo.getModules();
|
||||
const modules = window.eo?.getModules();
|
||||
// const extensitonConfigurations = [...modules.values()].filter((n) => n.contributes?.configuration);
|
||||
const extensitonConfigurations = [...modules.values()].filter((n) => n.features?.configuration);
|
||||
const controls = {};
|
||||
|
@ -69,8 +69,10 @@ export class SidebarComponent implements OnInit, OnDestroy {
|
||||
moduleID: '@eo-core-extension',
|
||||
isOffical: true,
|
||||
icon: 'puzzle',
|
||||
activeRoute: this.electron.isElectron ? 'home/extension' : 'home/preview',
|
||||
route: this.electron.isElectron ? 'home/extension/list' : 'home/preview',
|
||||
activeRoute: 'home/extension',
|
||||
route: 'home/extension/list',
|
||||
// activeRoute: this.electron.isElectron ? 'home/extension' : 'home/preview',
|
||||
// route: this.electron.isElectron ? 'home/extension/list' : 'home/preview',
|
||||
},
|
||||
];
|
||||
if (this.electron.isElectron) {
|
||||
|
@ -31,7 +31,7 @@ export class SyncApiComponent implements OnInit {
|
||||
const action = feature.action || null;
|
||||
const module = window.eo.loadFeatureModule(this.currentExtension);
|
||||
// TODO 临时取值方式需要修改
|
||||
const { token: secretKey, projectId } = window.eo.getModuleSettings(
|
||||
const { token: secretKey, projectId } = window.eo?.getModuleSettings(
|
||||
'eoapi-feature-push-eolink.eolink.remoteServer'
|
||||
);
|
||||
if (module && module[action] && typeof module[action] === 'function') {
|
||||
|
Loading…
Reference in New Issue
Block a user