Skip to content

Commit 22a1e50

Browse files
committed
Fixed: Fix the issue of the SFTP sidebar displaying incorrectly under different assets
1 parent b8dcd67 commit 22a1e50

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/app/elements/iframe/iframe.component.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { environment } from '@src/environments/environment';
2424
import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
2525
import { FaceService } from '@app/services/face';
2626
import { DrawerStateService } from '@app/services/drawer';
27+
import { Protocol } from '@app/model';
2728

2829
@Component({
2930
standalone: false,
@@ -170,13 +171,17 @@ export class ElementIframeComponent implements OnInit, AfterViewInit, OnDestroy
170171
}
171172

172173
handleIframeEvent() {
174+
let disbaleFileManager: boolean = false;
175+
176+
// 对于没有授权 sftp 协议的资产,不会在 koko 中展示文件管理
177+
if (!this.view.asset.permed_protocols.some((protocol: Protocol) => protocol.name === 'sftp')) {
178+
disbaleFileManager = true;
179+
}
180+
173181
// @ts-ignore
174182
this.ping = setInterval(() => {
175183
this._logger.info(`[Luna] Send PING to: ${this.id}`);
176-
this.iframeWindow.postMessage(
177-
{ name: 'PING', id: this.id, category: this.view.asset.category.value },
178-
'*'
179-
);
184+
this.iframeWindow.postMessage({ name: 'PING', id: this.id, disbaleFileManager }, '*');
180185
}, 500);
181186

182187
// 30s 内未PING通, 则主动关闭

0 commit comments

Comments
 (0)