Subversion Repositories DevTools

Rev

Rev 7278 | Rev 7280 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7278 Rev 7279
Line 143... Line 143...
143
    Wend
143
    Wend
144
    rsQry.Close()
144
    rsQry.Close()
145
    Set rsQry = Nothing
145
    Set rsQry = Nothing
146
End Sub
146
End Sub
147
 
147
 
148
 
-
 
149
'-------------------------------------------------
148
'-------------------------------------------------
150
' Function:     GetMachHost    
-
 
151
' Description:  Determine the current Display Host Information for a given BMCON_ID
-
 
152
'               Do not show build machines that are no longer 'allowed' unless
149
'   Gnerate a table of build machine information
153
'               it is currently selected.
-
 
154
' Arguments:    abmcon_id   - A BMCON_ID
-
 
155
'
-
 
156
' Returns:      An array with 5 elements in it - to be used in creating a multicolum drop down list
-
 
157
'                   
-
 
158
Function GetMachHost (abmcon_id)
150
Sub DisplayBuildMachines
159
   Dim rsQry, query
151
   Dim rsQry, query
160
 
152
 
-
 
153
    Response.Write "<table id='daemonHost' class='comboBox' width='100%'>"
-
 
154
 
161
   OraDatabase.Parameters.Add "bmcon_id", abmcon_id,            ORAPARM_INPUT, ORATYPE_NUMBER
155
    OraDatabase.Parameters.Add "bmcon_id", bmcon_id,        ORAPARM_INPUT, ORATYPE_NUMBER
162
   OraDatabase.Parameters.Add "rtag_id",  Request("rtag_id"),   ORAPARM_INPUT, ORATYPE_NUMBER
156
    OraDatabase.Parameters.Add "rtag_id",  parRtag_id,      ORAPARM_INPUT, ORATYPE_NUMBER
-
 
157
 
-
 
158
    query = ReadFile( rootPath & "queries\available_build_machines.sql" )
-
 
159
 
-
 
160
    Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
-
 
161
    While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
-
 
162
        Response.Write "<tr class='"& rsQry("state") & "' data-bmconid="& rsQry("bmcon_id") &">"
-
 
163
        Response.Write "<td>" & rsQry("display_name") & "</td>"
-
 
164
        Response.Write "<td>" & rsQry("gbe_value") & "</td>"
-
 
165
        Response.Write "<td style='max-width:300px'>" & rsQry("description") & "</td>"
-
 
166
        Response.Write "</tr>"
-
 
167
 
-
 
168
        rsQry.MoveNext
-
 
169
    Wend
-
 
170
 
-
 
171
    rsQry.Close()
-
 
172
    Set rsQry = Nothing
163
 
173
 
164
   query = ReadFile( rootPath & "queries\available_build_machines.sql" )
174
    OraDatabase.Parameters.Remove "bmcon_id"
-
 
175
    OraDatabase.Parameters.Remove "rtag_id"
-
 
176
 
-
 
177
    Response.Write "</table>"
-
 
178
 
-
 
179
End Sub
165
 
180
 
166
   Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
-
 
167
   If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
-
 
168
      GetMachHost = rsQry.GetRows()
-
 
169
   Else
-
 
170
      GetMachHost = NULL
-
 
171
   End If
-
 
172
 
-
 
173
   rsQry.Close()
-
 
174
   Set rsQry = Nothing
-
 
175
 
-
 
176
   OraDatabase.Parameters.Remove "bmcon_id"
-
 
177
   OraDatabase.Parameters.Remove "rtag_id"
-
 
178
End Function
-
 
179
'--------------------------------------------------------------------------------------------------------------------------
181
'--------------------------------------------------------------------------------------------------------------------------
180
'------------ RUN BEFORE PAGE RENDER ----------
182
'------------ RUN BEFORE PAGE RENDER ----------
181
 
183
 
182
If CBool(Request("action")) Then
184
If CBool(Request("action")) Then
183
 
185
 
Line 269... Line 271...
269
 
271
 
270
        //  Add in two special platforms. NONE and TOOLSET
272
        //  Add in two special platforms. NONE and TOOLSET
271
        AddXrefEntry('TOOLSET', 'ALL');
273
        AddXrefEntry('TOOLSET', 'ALL');
272
        AddXrefEntry('NONE', 'ALL');
274
        AddXrefEntry('NONE', 'ALL');
273
 
275
 
-
 
276
        // Init the Daemon Host Combo
-
 
277
		setDaemonHost();
-
 
278
 
274
        // Initial config of visible PLATFORMS
279
        // Initial config of visible PLATFORMS
275
        setbmConId();
280
        setbmConId();
276
 
281
 
-
 
282
        // Initial Focus
-
 
283
		$("#daemonHostDiv").focus();
-
 
284
 
277
    	// Wire up the MachType selector to modify the available PLATFORMS
285
    	// Wire up the MachType selector to modify the available PLATFORMS
278
    	$('#selBmConId').change( setbmConId );
286
    	$('#selBmConId').change( setbmConId );
279
 
287
 
280
        // Wire up the GBE_BUILDFILTER so that user changes are represented
288
        // Wire up the GBE_BUILDFILTER so that user changes are represented
281
    	$('#gbe_buildfilter').change( setbmConId );
289
    	$('#gbe_buildfilter').change( setbmConId );
Line 285... Line 293...
285
        // Operation relies on the fact that
293
        // Operation relies on the fact that
286
        //      Hidden items will not be submitted as a part of the form
294
        //      Hidden items will not be submitted as a part of the form
287
        //      Platforms supported on multiple machines will appear multiple times
295
        //      Platforms supported on multiple machines will appear multiple times
288
        function setbmConId(  )
296
        function setbmConId(  )
289
        {
297
        {
290
			console.log("Doing stuff");
-
 
291
            var bmConId = $('#selBmConId').children("option:selected").val();
298
            var bmConId = $('#bmcon_id').val();
292
            var table = $('#selPlat');
299
            var table = $('#selPlat');
293
			table.empty();
300
			table.empty();
294
 
301
 
295
			//  Parse the existing GBE_BUILDFILTER so that we can determine any platforms that are not
302
			//  Parse the existing GBE_BUILDFILTER so that we can determine any platforms that are not
296
            //  supported on the selected build machine
303
            //  supported on the selected build machine
297
            //  Convert the GBE_BUILDFILTER into an object for easy processing
304
            //  Convert the GBE_BUILDFILTER into an object for easy processing
298
			var curFilter = {};
305
			var curFilter = {};
299
			var tmpStr = $('#gbe_buildfilter').val().trim().replace(/,/g, ' ').toUpperCase();
-
 
300
            if ( tmpStr.length <= 0 ) {
-
 
301
				tmpStr = 'NONE';
-
 
302
            }
-
 
303
			var curFilterArray = tmpStr.split(/\s+/);
306
			var curFilterArray = getBuildFilter();
304
            for ( i = 0; i < curFilterArray.length; i++ ) {
307
            for ( i = 0; i < curFilterArray.length; i++ ) {
305
				curFilter[curFilterArray[i]] = 1;
308
				curFilter[curFilterArray[i]] = 1;
306
			}
309
			}
307
            $('#gbe_buildfilter').val(Object.keys(curFilter).sort().join(' '));
-
 
308
 
310
 
309
            // Insert platforms supported on selected machine
311
            // Insert platforms supported on selected machine
310
            Object.keys(platformXref).sort().forEach(platform => {
312
            Object.keys(platformXref).sort().forEach(platform => {
311
                if ( platformXref[platform][bmConId] ||  platformXref[platform]['ALL'] ){
313
                if ( platformXref[platform][bmConId] ||  platformXref[platform]['ALL'] ){
312
                    table.append(createPlatformRow(platform, curFilter[platform], undefined));
314
                    table.append(createPlatformRow(platform, curFilter[platform], undefined));
Line 319... Line 321...
319
            Object.keys(curFilter).sort().reverse().forEach(platform => {
321
            Object.keys(curFilter).sort().reverse().forEach(platform => {
320
                if ( platform ) {
322
                if ( platform ) {
321
                    table.prepend(createPlatformRow(platform, true, 'err_alert'));
323
                    table.prepend(createPlatformRow(platform, true, 'err_alert'));
322
                }
324
                }
323
            });
325
            });
-
 
326
 
-
 
327
            setBuildFilter();
324
        }
328
        }
325
 
329
 
326
        // Local function to create a platform row, with checkbox
330
        // Local function to create a platform row, with checkbox
327
        //
331
        //
328
        function createPlatformRow(platform, state, eClass){
332
        function createPlatformRow(platform, state, eClass){
329
            var row = $("<tr/>").addClass('body_txt selPlat').addClass(eClass);
333
            var row = $("<tr/>").addClass('body_txt selPlat').addClass(eClass);
330
            var td = $("<td/>");
334
            var td = $("<td/>");
331
            var item = $("<input/>").attr('type', 'checkbox').css('margin','0px 3px').prop('checked', state).change(updateGbeFilter);
335
            var item = $("<input/>").attr('type', 'checkbox').css('margin','0px 3px').prop('checked', state).change(togglePlatforms);
-
 
336
            if ( platform == 'NONE' ) {
-
 
337
				item.attr('id', 'check_none');
-
 
338
            }
332
            var itemText = $("<span/>").text(platform);
339
            var itemText = $("<span/>").text(platform);
333
            if ( eClass ) {
340
            if ( eClass ) {
334
                itemText.append(' - Not available');
341
                itemText.append(' - Not available');
335
            }
342
            }
336
            td.append(item);
343
            td.append(item);
Line 338... Line 345...
338
            row.append(td);
345
            row.append(td);
339
            return row;
346
            return row;
340
        }
347
        }
341
 
348
 
342
        // Update GBE_BUILDFILTER as the user selects and deselects platforms
349
        // Update GBE_BUILDFILTER as the user selects and deselects platforms
343
        function updateGbeFilter(){
350
        function togglePlatforms(){
344
			var state = this.checked;
351
			var state = this.checked;
345
			var platform = $(this).parent().text().trim();
352
			var platform = $(this).parent().text().trim();
346
			var idx = platform.indexOf(' - ');
353
			var idx = platform.indexOf(' - ');
347
            if ( idx >= 0 )
354
            if ( idx >= 0 )
348
                platform = platform.substring(0, idx );
355
                platform = platform.substring(0, idx );
Line 351... Line 358...
351
            //  Split the string into an array
358
            //  Split the string into an array
352
            //  Always remove the item
359
            //  Always remove the item
353
            //  Append the platform - if adding
360
            //  Append the platform - if adding
354
            //  Sort and reform a space-seperated string
361
            //  Sort and reform a space-seperated string
355
            //
362
            //
356
			var gbeFilter = $('#gbe_buildfilter').val().trim().split(/\s+/);
363
			var gbeFilter = getBuildFilter()
357
            gbeFilter = gbeFilter.filter(e => e !== platform);
364
            gbeFilter = gbeFilter.filter(e => e !== platform);
358
            if ( state ) {
365
            if ( state ) {
359
                gbeFilter.push(platform);
366
                gbeFilter.push(platform);
360
            }
367
            }
361
            
368
            
-
 
369
            setBuildFilter(gbeFilter);
-
 
370
        }
-
 
371
 
-
 
372
        //
-
 
373
        //  Get the current gbe_buildfilter and return an array
-
 
374
        //
-
 
375
        function getBuildFilter() {
-
 
376
            var uniq = [ ...new Set($('#gbe_buildfilter').val().replace(/,/g, ' ').trim().toUpperCase().split(/\s+/)) ];
-
 
377
			return uniq;
-
 
378
        }
-
 
379
 
-
 
380
 
-
 
381
        // Handle the special NONE case
-
 
382
        //      Remove NONE - if there are others
-
 
383
        //      Insert NONE if there are no others
-
 
384
        // Pretty up the GBE_BUIDLFILTER
-
 
385
        //      Sort the list
-
 
386
        //      Force upper case    
-
 
387
        //
-
 
388
        function setBuildFilter(gbeFilter) {
-
 
389
			var hasNone = false;
-
 
390
			var hasOthers = false;
-
 
391
 
-
 
392
            if ( !gbeFilter ) {
-
 
393
                gbeFilter = getBuildFilter();
-
 
394
            }
-
 
395
 
-
 
396
            gbeFilter.forEach (platform => {
-
 
397
                if (platform.length <= 0) {
-
 
398
                } else if ( platform == 'NONE' ) {
-
 
399
					hasNone = true;
-
 
400
                } else if ( platform != 'TOOLSET' ) {
-
 
401
					hasOthers = true;
-
 
402
                }
-
 
403
            });
-
 
404
 
-
 
405
            // Insert NONE, if there are no others
-
 
406
            if ( !hasNone && !hasOthers ) {
-
 
407
				gbeFilter.push('NONE');
362
            gbeFilter = gbeFilter.sort();
408
                gbeFilter = gbeFilter.sort();
-
 
409
                $('#check_none').prop('checked', true);
-
 
410
            }
-
 
411
 
-
 
412
            // Remove NONE, if there are others
-
 
413
            if ( hasNone && hasOthers ) {
-
 
414
				var idx = gbeFilter.indexOf('NONE');
-
 
415
                if ( idx >= 0 ) {
-
 
416
                    gbeFilter.splice(idx, 1);
-
 
417
                }
-
 
418
                $('#check_none').prop('checked', false);
-
 
419
            }
-
 
420
 
-
 
421
            //  Pretty up the display
363
            $('#gbe_buildfilter').val(gbeFilter.join(' '));
422
            $('#gbe_buildfilter').val(gbeFilter.sort().join(' '));
-
 
423
 
-
 
424
        }
-
 
425
 
-
 
426
        //  Multicolumn combo box handling
-
 
427
        //
-
 
428
 
-
 
429
        $('.comboParent').on('keydown',function(e) {
-
 
430
            if(e.which == 13) {
-
 
431
                openComboBox(e, this);
-
 
432
            }
-
 
433
		});
-
 
434
 
-
 
435
		$('.comboParent').click(openComboBox);
-
 
436
 
-
 
437
		$('.comboBox tr').click(function(){
-
 
438
            if ( $(this).hasClass('available') )
-
 
439
            {
-
 
440
                var elp = $(this).closest('.comboContainer').hide();
-
 
441
                $("#daemonHostDiv").focus();
-
 
442
                event.stopImmediatePropagation();
-
 
443
 
-
 
444
                // Capture the data and store it in the parent element
-
 
445
                elp.find('.selected').removeClass('selected');
-
 
446
                $(this).addClass('selected');
-
 
447
 
-
 
448
                var $clone = $(this).clone();
-
 
449
                $('.comboParent table').first().html($clone);
-
 
450
 
-
 
451
                // Update the field that will be submitted
-
 
452
				var bmconid = $(this).data('bmconid');
-
 
453
				$('#bmcon_id').val(bmconid);
-
 
454
                setbmConId();
-
 
455
            }
-
 
456
        });
-
 
457
 
-
 
458
        //  Show the combo box
-
 
459
        //
-
 
460
        function openComboBox(e, that) {
-
 
461
            if ( that == undefined ) {
-
 
462
				that = this;
-
 
463
            }
-
 
464
            var el = $(that).find('.comboContainer:first').show();
-
 
465
            event.stopImmediatePropagation();
-
 
466
            $(document).on('click', function(){
-
 
467
				var elp = $(that).closest('.comboContainer');
-
 
468
                if ( elp.size() <= 0 ) {
-
 
469
                    $('.comboContainer').hide();
-
 
470
                    $("#daemonHostDiv").focus();
-
 
471
                    $(document).off('click');
-
 
472
                    event.stopImmediatePropagation();
-
 
473
                }
-
 
474
            });
-
 
475
        }
-
 
476
 
-
 
477
        //  Init the Deamon Host display.
-
 
478
        //  Select the required data from the tables
-
 
479
        function setDaemonHost() {
-
 
480
			var el = $("#daemonHost").find('.selected');
-
 
481
            if ( el.size() > 0 ) {
-
 
482
                var $clone = el.clone();
-
 
483
                $('#daemonHostDiv table').first().html($clone)
-
 
484
            }
364
        }
485
        }
-
 
486
 
365
    });
487
    });
366
</script>
488
</script>
367
<%End Sub
489
<%End Sub
368
'-------------------------------------------------
490
'-------------------------------------------------
369
%>
491
%>
Line 375... Line 497...
375
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
497
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
376
<link href="images/release_manager_style.css?ver=<%=VixVerNum%>" rel="stylesheet" type="text/css">
498
<link href="images/release_manager_style.css?ver=<%=VixVerNum%>" rel="stylesheet" type="text/css">
377
<script language="JavaScript" src="scripts/common.js?ver=<%=VixVerNum%>"></script>
499
<script language="JavaScript" src="scripts/common.js?ver=<%=VixVerNum%>"></script>
378
<!--#include file="_jquery_includes.asp"-->
500
<!--#include file="_jquery_includes.asp"-->
379
<%Call InsertJavaScript %>
501
<%Call InsertJavaScript %>
-
 
502
<style>
-
 
503
.comboBox {}
-
 
504
.comboParent { position:relative; background:white;}
-
 
505
.comboParent table {border-collapse:collapse;}
-
 
506
.comboParent table td {border:1px solid darkgrey; padding-right: 10px;white-space: nowrap;overflow-x: hidden;}
-
 
507
.comboParent table {color:#000000;font:11px tahoma,sans-serif;text-decoration:none;}
-
 
508
.comboContainer{position:absolute;overflow-y:scroll;background:white; border: 1px solid darkgrey;display:none;top:0px;right:0px;left:0px;}
-
 
509
table.comboBox {border-collapse:collapse;}
-
 
510
table.comboBox  td {border:1px solid darkgrey;padding-right: 10px;white-space: normal}
-
 
511
table.comboBox tr.available:hover {background: #1e90ff;}
-
 
512
table.comboBox tr.selected {background: #d5e8fb;}
-
 
513
table.comboBox tr.disabled {color:grey;}
-
 
514
.icon-down:before {content: "\25BC"; position:absolute;top:2;right:2;font-size:11px}
-
 
515
</style>
380
</head>
516
</head>
381
 
517
 
382
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.bmcon_id.focus();">
518
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" >
383
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
519
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
384
   <tr>
520
   <tr>
385
      <td bgcolor="#FFFFFF" class="body_txt">
521
      <td bgcolor="#FFFFFF" class="body_txt">
386
		<%If bAdd Then%>
522
		<%If bAdd Then%>
387
         Add a new DAEMON
523
         Add a new DAEMON
Line 403... Line 539...
403
      <td>
539
      <td>
404
         <!-- LOCAL ERROR +++++++++++++++++++++++++++++++++++++++++++++++ -->
540
         <!-- LOCAL ERROR +++++++++++++++++++++++++++++++++++++++++++++++ -->
405
         <%Call Messenger ( sMessage , 3, "100%" )%>
541
         <%Call Messenger ( sMessage , 3, "100%" )%>
406
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
542
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
407
         <!--#include file="messages/_msg_inline.asp"-->
543
         <!--#include file="messages/_msg_inline.asp"-->
408
         <table width="50%" border="0">
544
         <table border="0" width='700px'>
409
            <tr>
545
            <tr>
410
               <td><span class="body_txt">Daemon Host</span></td>
546
               <td width=1%><span class="body_txt">Daemon Host</span></td>
411
               <td>
547
               <td>
412
                  <%=objFormComponent.Combo_Multi ( "bmcon_id", GetMachHost(bmcon_id), bShowEmpty, "id=selBmConId class='body_txt'",3,"20,20,50")%>
548
			     <div id='daemonHostDiv' class='comboParent icon-down' tabindex=0 >
-
 
549
					 <table width=100%>
413
               </td>
550
					     <tr>
-
 
551
						 <td>Select Deamon Host</td>
-
 
552
						 </tr>
-
 
553
					 </table>
-
 
554
				 <div class=comboContainer style="height:10em;">
-
 
555
					  <%DisplayBuildMachines%>
-
 
556
				</div>
-
 
557
					 </div>
-
 
558
			   </td>
414
            </tr>
559
            </tr>
415
            <tr>
560
            <tr>
416
               <td><span class="body_txt">Daemon Mode</span></td>
561
               <td><span class="body_txt">Daemon Mode</span></td>
417
               <td>
562
               <td>
418
                 <select name="daemon_mode" class='body_txt'>
563
                 <select name="daemon_mode" class='body_txt'>
Line 452... Line 597...
452
      </td>
597
      </td>
453
   </tr>
598
   </tr>
454
   <%=objPMod.ComposeHiddenTags()%>
599
   <%=objPMod.ComposeHiddenTags()%>
455
   <input type="hidden" name="action" value="true">
600
   <input type="hidden" name="action" value="true">
456
   <input type="hidden" name="base_bmcon_id" value="<%=bmcon_id%>">
601
   <input type="hidden" name="base_bmcon_id" value="<%=bmcon_id%>">
-
 
602
   <input type="hidden" id=bmcon_id name="bmcon_id" value="<%=bmcon_id%>">
457
 <%If NOT bAdd Then%>
603
 <%If NOT bAdd Then%>
458
	 <input type="hidden" name="rcon_id" value="<%=Request("rcon_id")%>">
604
	 <input type="hidden" name="rcon_id" value="<%=Request("rcon_id")%>">
459
 <% End If %>
605
 <% End If %>
460
   <%
606
   <%
461
   Call objFormComponent.FormEnd()
607
   Call objFormComponent.FormEnd()