@@ -87,74 +87,61 @@ function initRecommendImageTable() {
8787 width : 60 ,
8888 } ,
8989 {
90- title : "connectionName" ,
91- field : "connectionName" ,
92- headerSort : false ,
93- visible : false
94- } ,
95- {
96- title : "PROVIDER" ,
97- field : "providerName" ,
90+ title : "BASIC" ,
91+ field : "isBasicImage" ,
9892 vertAlign : "middle" ,
9993 hozAlign : "center" ,
100- headerHozAlign : "center" ,
101- headerSort : true ,
10294 maxWidth : 100 ,
103- } ,
104- {
105- title : "REGION" ,
106- field : "regionList" ,
107- vertAlign : "middle" ,
108- hozAlign : "center" ,
95+ headerSort : true ,
10996 formatter : function ( cell ) {
110- var regions = cell . getValue ( ) ;
111- if ( Array . isArray ( regions ) ) {
112- return regions . join ( ", " ) ;
97+ var value = cell . getValue ( ) ;
98+ if ( value === true ) {
99+ return '<span style="color: green; font-weight: bold;">✓</span>' ;
100+ } else {
101+ return '<span style="color: gray;">-</span>' ;
113102 }
114- return regions ;
115103 }
116104 } ,
117- {
118- title : "IMAGE NAME" ,
119- field : "name" ,
120- vertAlign : "middle" ,
121- hozAlign : "left" ,
122- maxWidth : 200 ,
123- } ,
124- {
125- title : "CSP IMAGE" ,
126- field : "cspImageName" ,
127- vertAlign : "middle" ,
128- hozAlign : "center" ,
129- maxWidth : 150 ,
130- } ,
131105 {
132106 title : "OS TYPE" ,
133107 field : "osType" ,
134108 vertAlign : "middle" ,
135109 hozAlign : "center" ,
136- maxWidth : 120 ,
110+ minWidth : 120 ,
111+ headerSort : true ,
137112 } ,
138113 {
139- title : "OS ARCH " ,
140- field : "osArchitecture " ,
114+ title : "IMAGE NAME " ,
115+ field : "name " ,
141116 vertAlign : "middle" ,
142- hozAlign : "center" ,
143- maxWidth : 100 ,
117+ hozAlign : "left" ,
118+ minWidth : 180 ,
119+ headerSort : true ,
144120 } ,
145121 {
146- title : "PLATFORM " ,
147- field : "osPlatform " ,
122+ title : "OS DISTRIBUTION " ,
123+ field : "osDistribution " ,
148124 vertAlign : "middle" ,
149- hozAlign : "center" ,
150- maxWidth : 120 ,
125+ hozAlign : "left" ,
126+ minWidth : 300 ,
127+ tooltip : true ,
128+ headerSort : true ,
151129 } ,
152130 {
153- title : "STATUS " ,
154- field : "imageStatus " ,
131+ title : "GPU " ,
132+ field : "isGPUImage " ,
155133 vertAlign : "middle" ,
156134 hozAlign : "center" ,
157- maxWidth : 100 ,
135+ maxWidth : 80 ,
136+ headerSort : true ,
137+ formatter : function ( cell ) {
138+ var value = cell . getValue ( ) ;
139+ if ( value === true ) {
140+ return '<span style="color: blue; font-weight: bold;">✓</span>' ;
141+ } else {
142+ return '<span style="color: gray;">-</span>' ;
143+ }
144+ }
158145 }
159146 ] ;
160147
@@ -196,32 +183,41 @@ export async function getRecommendImageInfo() {
196183 var isGPUImage = $ ( "#gpu_image_value" ) . val ( )
197184
198185 // 전역 변수에서 정보 가져오기
186+ var specId = window . selectedSpecInfo . id ; // spec의 전체 ID (예: "aws+ap-northeast-2+t2.small")
199187 var provider = window . selectedSpecInfo . provider ;
200188 var region = window . selectedSpecInfo . regionName ;
201189 var connectionName = window . selectedSpecInfo . connectionName ;
202- var osArchitecture = window . selectedSpecInfo . osArchitecture ;
190+
203191 // 현재 workspace/project 정보 가져오기
204192 try {
205193 var selectedWorkspaceProject = await webconsolejs [ "partials/layout/navbar" ] . workspaceProjectInit ( ) ;
206194 var nsId = selectedWorkspaceProject . nsId ;
207195
208- // API 호출을 위한 파라미터 구성
196+ // API 호출을 위한 파라미터 구성 (간단화된 방식)
209197 var searchParams = {
210- includeDeprecatedImage : false ,
211- isGPUImage : isGPUImage === "true" ,
212- isKubernetesImage : false ,
213- isRegisteredByAsset : false ,
214- osArchitecture : osArchitecture ,
215- osType : osType ,
216- providerName : provider . toLowerCase ( ) || "" ,
217- regionName : region || ""
198+ matchedSpecId : specId , // spec ID를 사용하여 provider, region, architecture 자동 매칭
199+ osType : osType
218200 } ;
201+
202+ // GPU 이미지가 필요한 경우에만 추가
203+ if ( isGPUImage === "true" ) {
204+ searchParams . isGPUImage = true ;
205+ }
219206
220207 // 이미지 검색 API 호출
221208 var response = await webconsolejs [ "common/api/services/mci_api" ] . searchImage ( nsId , searchParams ) ;
222209
223210 if ( response . status && response . status . code === 200 ) {
224211 var imageList = response . responseData . imageList || [ ] ;
212+
213+ // 이미지가 없는 경우 안내 메시지
214+ if ( imageList . length === 0 ) {
215+ console . warn ( "No images found for the selected spec and OS type" ) ;
216+ alert ( "No images found for the selected specification and OS type. Please try different criteria." ) ;
217+ safeSetTableData ( [ ] ) ;
218+ return ;
219+ }
220+
225221 // API 응답을 테이블 형식에 맞게 변환
226222 var processedImageList = imageList . map ( function ( image ) {
227223 return {
@@ -235,14 +231,16 @@ export async function getRecommendImageInfo() {
235231 fetchedTime : image . fetchedTime || new Date ( ) . toLocaleString ( ) ,
236232 creationDate : image . creationDate || new Date ( ) . toISOString ( ) ,
237233 osType : image . osType || osType ,
238- osArchitecture : image . osArchitecture || osArchitecture ,
234+ osArchitecture : image . osArchitecture ,
239235 osPlatform : image . osPlatform || "Linux/UNIX" ,
240236 osDistribution : image . osDistribution || "" ,
241- osDiskType : image . osDiskType || "ebs" ,
242- osDiskSizeGB : image . osDiskSizeGB || - 1 ,
243- imageStatus : image . imageStatus || "Available" ,
244- description : image . description || image . name
245- } ;
237+ osDiskType : image . osDiskType || "ebs" ,
238+ osDiskSizeGB : image . osDiskSizeGB || - 1 ,
239+ imageStatus : image . imageStatus || "Available" ,
240+ description : image . description || image . name ,
241+ isBasicImage : image . isBasicImage || false ,
242+ isGPUImage : image . isGPUImage || false
243+ } ;
246244 } ) ;
247245
248246 recommendImageListObj = processedImageList ;
0 commit comments