1- // const data = {
2- // projectid: 'mzctestPrj',
3- // workspaceid: 'mzctestWs',
4- // usertoken: 'mzctoken'
5- // };
1+ // 동적으로 workspace와 project 정보를 가져오는 함수
2+ function getSoftwareManagerData ( ) {
63
7- // 데모환경에서 사용할 예제 데이터 입니다.
8- const data = {
9- accessToken : "accesstokenExample" ,
10- workspaceInfo : {
11- "id" : "UUID" , // 이부분은 UUID로 별도 정보가 필요할시 해당 ID 를 활용해 IAM 과 연동하시면됩니다.
12- "name" : "ws01" , // Display 용 이름입니다.
13- "description" : "ws01 desc" , // 설명입니다.
14- "created_at" : "UTC" ,
15- "updated_at" : "UTC"
16- } ,
17- projectInfo : {
18- "id" : "UUID" , // 이부분은 UUID로 별도 정보가 필요할시 해당 ID 를 활용해 IAM 과 연동하시면됩니다.
19- "ns_id" : "ns01" , // 텀블벅 연동 ID 입니다.
20- "name" : "ns01" , // Display 용 이름입니다.
21- "description" : "ns01 desc" , // 설명입니다.
22- "created_at" : "UTC" ,
23- "updated_at" : "UTC"
24- } ,
25- requestOperationId : ""
26- } ;
4+ const currentWorkspace = webconsolejs [ "common/api/services/workspace_api" ] . getCurrentWorkspace ( ) ;
5+ const currentProject = webconsolejs [ "common/api/services/workspace_api" ] . getCurrentProject ( ) ;
6+ console . log ( "Current Workspace:" , currentWorkspace ) ;
7+ console . log ( "Current Project:" , currentProject ) ;
8+
9+ const accessToken = webconsolejs [ "common/storage/sessionstorage" ] . getSessionCurrentUserToken ( ) ;
10+
11+ return {
12+ accessToken : accessToken ,
13+ workspaceInfo : {
14+ "id" : currentWorkspace . Id ,
15+ "name" : currentWorkspace . Name ,
16+ } ,
17+ projectInfo : {
18+ "id" : currentProject . Id ,
19+ "ns_id" : currentProject . NsId ,
20+ "name" : currentProject . Name ,
21+ } ,
22+ requestOperationId : ""
23+ } ;
24+ }
2725
2826document . addEventListener ( "DOMContentLoaded" , async function ( ) {
2927 var host = await webconsolejs [ "common/iframe/iframe" ] . GetApiHosts ( "mc-application-manager" )
@@ -32,6 +30,10 @@ document.addEventListener("DOMContentLoaded", async function(){
3230 if ( host . startsWith ( ":" ) ) {
3331 host = `${ domain } ${ host } ` ;
3432 }
35- webconsolejs [ "common/iframe/iframe" ] . addIframe ( "targetIframe-repository" , host + "/web/repository/list" , data )
36- webconsolejs [ "common/iframe/iframe" ] . addIframe ( "targetIframe-sofrwareCatalog" , host + "/web/softwareCatalog/list" , data )
33+
34+ // 동적으로 데이터 가져오기
35+ const data = getSoftwareManagerData ( ) ;
36+
37+ // webconsolejs["common/iframe/iframe"].addIframe("targetIframe-repository", host+"/web/repository/list", data)
38+ webconsolejs [ "common/iframe/iframe" ] . addIframe ( "targetIframe-sofrwareCatalog" , host + "/web/softwareCatalog" , data )
3739} ) ;
0 commit comments