Subversion Repositories DevTools

Rev

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

Rev 7457 Rev 7468
Line 1... Line 1...
1
<%@LANGUAGE="VBSCRIPT"%>
1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
2
<%
3
'=====================================================
3
'=====================================================
4
'   View S3 SYNC State Information
4
'   View S3 SYNC State Information
5
'       form_view_s3Sync_state.asp
5
'       form_view_s3Manifest_state.asp
6
'=====================================================
6
'=====================================================
7
%>
7
%>
8
<%
8
<%
9
Option explicit
9
Option explicit
10
' Good idea to set when using redirect
10
' Good idea to set when using redirect
Line 34... Line 34...
34
'------------ Variable Init -------------------
34
'------------ Variable Init -------------------
35
parRtagId = Request("rtag_id")
35
parRtagId = Request("rtag_id")
36
objPMod.PersistInQryString("rtag_id")
36
objPMod.PersistInQryString("rtag_id")
37
ReleaseMode = GetReleaseMode( Request("rtag_id") )
37
ReleaseMode = GetReleaseMode( Request("rtag_id") )
38
modifyState = "disabled"
38
modifyState = "disabled"
39
bReleaseSyncEnabled = (releaseInfoHash("S3SYNC") = "Y")
39
bReleaseSyncEnabled = (releaseInfoHash("S3MANIFEST") = "Y")
40
 
40
 
41
If releaseIsWritable(ReleaseMode) Then
41
If releaseIsWritable(ReleaseMode) Then
42
    If canActionControlInProject("ConfigureRelease") OR canActionControlInProject("EditNonCriticalInfoForLockedPackage") Then modifyState = ""
42
    If canActionControlInProject("ConfigureRelease") OR canActionControlInProject("EditNonCriticalInfoForLockedPackage") Then modifyState = ""
43
End If
43
End If
44
'----------------------------------------------
44
'----------------------------------------------
Line 48... Line 48...
48
Sub ShowMainPanel
48
Sub ShowMainPanel
49
 %>
49
 %>
50
    <table class="embedded_table" style="margin-bottom:10px; width:70%">
50
    <table class="embedded_table" style="margin-bottom:10px; width:70%">
51
      <tr>
51
      <tr>
52
         <td>
52
         <td>
53
            <span nowrap class="form_ttl">View S3 Sync-enabled packages</span>
53
            <span nowrap class="form_ttl">View Manifest tags</span>
54
            <!-- Section Top Border ---->
54
            <!-- Section Top Border ---->
55
            <div class="rounded_box" style="background: white;">
55
            <div class="rounded_box" style="background: white;">
56
                <!-- Section Body Header ---->
56
                <!-- Section Body Header ---->
57
                <!-- Main Pane -->
57
                <!-- Main Pane -->
58
                <table id="s3synctable" width="100%" class="stripe">
58
                <table id="inManifestTable" width="100%" class="stripe">
59
                    <thead class="body_col">
59
                    <thead class="body_col">
60
                        <tr>
60
                        <tr>
61
                          <th>PV_ID
61
                          <th class=tleft>PV_ID
62
                          <th>Package Name
62
                          <th class=tleft>Package Name
63
                          <th>Package Version
63
                          <th class=tleft>Package Version
64
                          <th>Package Extension
64
                          <th class=tleft>Package Extension
65
                          <th>Short Description
65
                          <th class=tleft>Short Description
66
                          <th>S3 Sync Enabled<%=Quick_Help("f_s3sync")%>
-
 
67
                          <th>S3 Info<%=Quick_Help("f_s3info")%>
66
                          <th class=tleft>In Manifest<%=Quick_Help("f_s3Manifest")%>
68
                        </tr>
67
                        </tr>
69
                    </thead>
68
                    </thead>
70
                    <tbody>
69
                    <tbody>
71
                    </tbody>
70
                    </tbody>
72
                </table>
71
                </table>
73
                <!-- Info / Ajax Progress bar -->
72
                <!-- Info / Ajax Progress bar -->
74
                <div class='bg_dialog body_txt' style='position:relative;min-height:19px;' >
73
                <div class='bg_dialog body_txt' style='position:relative;min-height:19px;' >
75
                    <div style='position: absolute;'><span id='ds_info'></span>
74
                    <div style='position: absolute;'><span id='ds_info'></span>
76
<%If not bReleaseSyncEnabled Then%>
75
<%If not bReleaseSyncEnabled Then%>
77
				<span class='err_alert'>This Release does not have S3 Sync Enabled</span>
76
                    <span class='err_alert'>This Release does not have S3 Manifest Generation Enabled</span>
78
<%End If%>
77
<%End If%>
79
					</div>
78
          </div>
80
 
79
 
81
                    <div>
80
                    <div>
82
                          <button id='ds_refresh'  class='rmbutton' style="display:inline; float:right;">Refresh</button>
81
                          <button id='ds_refresh'  class='rmbutton' style="display:inline; float:right;">Refresh</button>
83
                          <button id='ds_avail'    class='rmbutton' style="display:inline; float:right;">Show S3 Image</button>
-
 
84
                          <button id='ds_show'     class='rmbutton' style="display:inline; float:right;">Show Sync Enabled</button>
82
                          <button id='ds_show'     class='rmbutton' style="display:inline; float:right;">Show Sync Enabled</button>
85
                          <button id='ds_clearAll' class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Clear All</button>
83
                          <button id='ds_clearAll' class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Clear All</button>
86
                    </div>
84
                    </div>
87
                </div>
85
                </div>
88
            </div>
86
            </div>
Line 106... Line 104...
106
        <!--#include file="_jquery_includes.asp"-->
104
        <!--#include file="_jquery_includes.asp"-->
107
        <!-- TIPS -->
105
        <!-- TIPS -->
108
        <script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
106
        <script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
109
        <script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
107
        <script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
110
        <script language="JavaScript" type="text/javascript">
108
        <script language="JavaScript" type="text/javascript">
111
        formTips.tips.f_s3sync       = stdTip(300, 'S3 SYNC', 'Show packages that are marked to be synced to an S3 bucket' +
109
        formTips.tips.f_s3Manifest       = stdTip(300, 'In Manifest', 'Show packages that are marked to be synced to an S3 bucket' +
112
                                                              '<p>These packages may be processed by CI/CD tools' );
110
                                                              '<p>These packages may be processed by CI/CD tools' );
113
        formTips.tips.f_s3info      = stdTip(300, 'S3 INFO', 'Marked packages currently have s3Transfer.json file.' );
-
 
114
 
-
 
115
        </script>
111
        </script>
116
        <script type="text/javascript" charset="utf-8">
112
        <script type="text/javascript" charset="utf-8">
117
        var table;
113
        var table;
118
        var showHide = false;
114
        var showHide = false;
119
        var showHideImg = false;
-
 
120
	$(document).ready(function() {
115
        $(document).ready(function() {
121
		/* Init DataTables */
116
            /* Init DataTables */
122
        table = $("#s3synctable").DataTable({
117
            table = $("#inManifestTable").DataTable({
123
            processing: true,
118
            processing: true,
124
            deferRender: true,
119
            deferRender: true,
125
            dom: "frtiS",
120
            dom: "frtiS",
126
            sScrollY: $( document ).height() - 45 - 200 - 15,
121
            sScrollY: $( document ).height() - 45 - 200 - 15,
127
            scrollCollapse: true,
122
            scrollCollapse: true,
128
            retrieve:true,
123
            retrieve:true,
129
            serverSide: true,
124
            serverSide: true,
130
            ajax : {
125
            ajax : {
131
                url : "s3Sync_state_json.asp",
126
                url : "inManifest_state_json.asp",
132
                data : function (o){
127
                data : function (o){
133
                    o.rtag_id = <%=parRtagId%>;
128
                    o.rtag_id = <%=parRtagId%>;
134
                    o.show = showHide;
129
                    o.show = showHide;
135
                    o.showImg = showHideImg;
-
 
136
                },
130
                },
137
                dataSrc : function (json){
131
                dataSrc : function (json){
138
                    //  Process the raw Ajax data
132
                    //  Process the raw Ajax data
139
                    //      Create a checkbox for the state
133
                    //      Create a checkbox for the state
140
                    //      Add a data item to the entry - to allow traceback when saving
134
                    //      Add a data item to the entry - to allow traceback when saving
141
                    $.each(json.data, function(idx,row){
135
                    $.each(json.data, function(idx,row){
142
                        var checked = row[5] == "Y" ? 'checked' : '';
136
                        var checked = row[5] == "Y" ? 'checked' : '';
143
                        row[5] = '<div><input type="checkbox" class=clickable <%=modifyState%> '+ checked + ' data-pvid='+ row[0] +'></div>'
137
                        row[5] = '<div><input type="checkbox" class=clickable <%=modifyState%> '+ checked + ' data-pvid='+ row[0] +'></div>'
144
						
-
 
145
						var hasS3Image = row[6] > 0 ? 'checked' : '';
-
 
146
                        row[6] = '<div><input type="checkbox" disabled '+ hasS3Image + '></div>'
-
 
147
                    });
138
                    });
148
                    return json.data;
139
                    return json.data;
149
                }
140
                }
150
            },
141
            },
151
            ordering: true,
142
            ordering: true,
152
            order: [[ 1, "asc" ]],
143
            order: [[ 1, "asc" ]],
153
            lengthChange : false,
144
            lengthChange : false,
154
 
145
 
155
            scroller : {
146
            scroller : {
156
			    loadingIndicator : true,
147
                loadingIndicator : true,
157
                displayBuffer: 9,
148
                displayBuffer: 9,
158
		    },
149
            },
159
            columns: [
150
            columns: [
160
               { visible : false },
151
               { visible : false },
161
               { width: "10%", className: "dt-nowrap"  },
152
               { width: "10%", className: "dt-nowrap"  },
162
               { width: "10%", className: "dt-nowrap"  },
153
               { width: "10%", className: "dt-nowrap"  },
163
               { width: "1%", className: "dt-nowrap"  },
154
               { width: "1%", className: "dt-nowrap"  },
164
               { width: "60%",orderable: false },
155
               { width: "70%",orderable: false },
165
               { width: "10%",className: "dt-nowrap" },
156
               { width: "10%",className: "dt-nowrap" },
166
               { width: "10%",className: "dt-nowrap" }
-
 
167
           ]
157
           ]
168
        });
158
        });
169
 
159
 
170
    // Wire Up buttons
160
    // Wire Up buttons
171
    $('#ds_refresh').on("click", function(){
161
    $('#ds_refresh').on("click", function(){
Line 176... Line 166...
176
        $(this).text( showHide ? 'Show Sync Enabled' : 'Show All');
166
        $(this).text( showHide ? 'Show Sync Enabled' : 'Show All');
177
        showHide = !showHide;
167
        showHide = !showHide;
178
        table.ajax.reload();        
168
        table.ajax.reload();        
179
    });
169
    });
180
 
170
 
181
    $('#ds_avail').on("click", function(){
-
 
182
        $(this).text( showHideImg ? 'Show S3 Info' : 'Show All');
-
 
183
        showHideImg = !showHideImg;
-
 
184
        table.ajax.reload();        
-
 
185
    });
-
 
186
 
-
 
187
    $('#ds_clearAll').on("click", function(){
171
    $('#ds_clearAll').on("click", function(){
188
        var msg  = 'Are you sure you want to reset the "S3 Sync" flag on all packages in this Release?' +
172
        var msg  = 'Are you sure you want to reset the "S3 Sync" flag on all packages in this Release?' +
189
                   '<p>The flag is a function of the release (unlike the Deployable flag).' +
173
                   '<p>The flag is a function of the release (unlike the Deployable flag).' +
190
                   '<p>Resetting all the flags will not affect other Releases and Projects.';
174
                   '<p>Resetting all the flags will not affect other Releases and Projects.';
191
 
175
 
Line 193... Line 177...
193
            title:'Reset All S3 Sync Flags', 
177
            title:'Reset All S3 Sync Flags', 
194
            button: 'Reset All Flags',
178
            button: 'Reset All Flags',
195
            ok : function(){
179
            ok : function(){
196
                getAjaxData (
180
                getAjaxData (
197
                    "_json_UpdateVersion.asp",
181
                    "_json_UpdateVersion.asp",
198
                    { opr : 'clearAllS3Sync',
182
                    { opr : 'clearAllInManifest',
199
                      rtag_id : <%=parRtagId%>   
183
                      rtag_id : <%=parRtagId%>   
200
                    },
184
                    },
201
                    null,
185
                    null,
202
                    function() {table.ajax.reload();}
186
                    function() {table.ajax.reload();}
203
                    );
187
                    );
Line 207... Line 191...
207
 
191
 
208
    // Process click on checkboxes within the datatable
192
    // Process click on checkboxes within the datatable
209
    //      this - a DOM node
193
    //      this - a DOM node
210
    //      $(this) - The jquery wrapped node
194
    //      $(this) - The jquery wrapped node
211
    //
195
    //
212
    $('#s3synctable').on( 'click', 'tbody td :checkbox', function () {
196
    $('#inManifestTable').on( 'click', 'tbody td :checkbox', function () {
213
        getAjaxData (
197
        getAjaxData (
214
            "_json_UpdateVersion.asp",
198
            "_json_UpdateVersion.asp",
215
            { opr : 'setS3Sync', 
199
            { opr : 'setInManifest', 
216
              rtag_id : <%=parRtagId%> ,  
200
              rtag_id : <%=parRtagId%> ,  
217
              pv_id : $(this).data('pvid'), 
201
              pv_id : $(this).data('pvid'), 
218
              s3sync_state : this.checked ? 'Y' : '-' 
202
              mfState : this.checked ? 'Y' : '-' 
219
            });
203
            });
220
        });
204
      });
221
 
-
 
222
	} );
205
});
223
 
206
 
224
//  getAjaxData - with error processing
207
//  getAjaxData - with error processing
225
//      url - url to fetch
208
//      url - url to fetch
226
//      data    - additional data to pass to ajax request
209
//      data    - additional data to pass to ajax request
227
//      success - function to call on success
210
//      success - function to call on success