Subversion Repositories DevTools

Rev

Rev 7290 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
7291 dpurdie 5
'|                        view by file                 |
5357 dpurdie 6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
7291 dpurdie 12
Response.Expires = 0    ' always load the page, dont store
5357 dpurdie 13
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<%
20
'------------ ACCESS CONTROL ------------------
21
%>
6181 dpurdie 22
<!--#include file="_access_control_login_optional.asp"-->
5357 dpurdie 23
<!--#include file="_access_control_general.asp"-->
24
<%
25
'------------ Variable Definition -------------
26
Dim rsRep
27
Dim parKeyword
28
Dim parFPkgName, parFPkgVersion
29
Dim FileName
30
Dim sLink
31
'------------ Constants Declaration -----------
32
Const MaxRows = 100
33
'------------ Variable Init -------------------
34
parKeyword = Request("filename")
7290 dpurdie 35
parFPkgName = RequestDefault("fpkgname", "*")
36
parFPkgVersion = RequestDefault("fpkgversion", "*")
5357 dpurdie 37
 
38
'----------------------------------------------
39
%>
40
<%
41
'-----------------------------------------------------------------------------------------------------------------------
42
'-----------------------------------------------------------------------------------------------------------------------
43
%>
44
<%
45
'==================== MAIN LINE ===============================
5957 dpurdie 46
If (parKeyword = "") Then 
47
    Call Destroy_All_Objects
48
    Response.Redirect ("index.asp")
49
End If
5357 dpurdie 50
'==============================================================
7291 dpurdie 51
'----------------------------------------------
52
'
53
Sub InsertJavaScript%>
54
<script type="text/javascript" charset="utf-8">
55
    var table;
56
    $(document).ready(function() {
57
    /* Init DataTables */
7290 dpurdie 58
 
7291 dpurdie 59
        // Format a search string for DataTables
60
        // Convert all * into a %
61
        function formatSearch(str) {
62
            return str.replace(/\*/g,'%');
63
        }
7290 dpurdie 64
 
7291 dpurdie 65
        // Setup - add a text input to each cell within the header row marked with a search class
66
        // Must be done  before the dataTable is created as the DOM is changed 
67
        $('#tfiles .search th').each( function (colIdx) {
68
            var title = $(this).text();
69
            if ( (title) ) {
70
                var el = $('<input id=inp_' + title.toLowerCase() + ' type="search" placeholder="Search ' + title + '" />');
71
                $(this).html(el);
72
                el.on('keyup change', function(ev) {
73
                if (ev.keyCode == 13) { //only on enter keypress (code 13)
74
                    table
75
                        .column(colIdx)
76
                        .search(formatSearch(this.value))
77
                        .draw();
78
                    }
79
                });
80
            }
81
        });
7290 dpurdie 82
 
7291 dpurdie 83
        // Add Jason listeners
84
        $("#tfiles").on('preXhr.dt', function ( e, settings, data ) {
85
            showGlobalProgress();
86
         });
7290 dpurdie 87
 
7291 dpurdie 88
        $("#tfiles").on('xhr.dt', function ( e, settings, data ) {
89
            hideGlobalProgress();
90
         });
7290 dpurdie 91
 
7291 dpurdie 92
        // Create the DataTable
93
        $.fn.dataTable.ext.errMode = function ( settings, helpPage, message ) { 
94
            hideGlobalProgress();
95
            console.log(message);
96
        };
97
 
98
        var w = window,
99
            d = document,
100
            e = d.documentElement,
101
            g = d.getElementsByTagName('body')[0],
102
            x = w.innerWidth || e.clientWidth || g.clientWidth,
103
            y = w.innerHeight|| e.clientHeight|| g.clientHeight;
104
        var theight = y - $('#tfiles').offset().top - 90;
105
//console.log("theight", y , $('#tfiles').offset().top)
106
        table = $("#tfiles").dataTable({
107
            serverSide: true,
108
            deferRender : true,
109
            xxxprocessing: true,
110
            ajax : {
111
                url : "view_by_files_json.asp",
112
                type : "POST",
113
                data : function (o){
114
                           o.filename = formatSearch("<%=parKeyword%>");
115
                }
116
            },
117
            dom: "rti",
118
            scrollY: theight,
119
            scrollCollapse: true,
120
            paging: true,
121
            scroller: {
122
                loadingIndicator: true,
123
                displayBuffer: 9,
124
            },
125
            order: [[ 0, "desc" ]],
126
            info: true,
127
            columns: [
128
                { "visible": false },
129
                { render :  function ( data, type, row, meta ) { 
130
                      var sLink = "<%=dpkg_archiveURL%>" + row[3] + "/" +  row[4] + "/" + row[2] + "/" + row[1];
131
                      sLink = sLink.replace(/\\+/g,'/') ;
132
                      sLink = sLink.replace(/\/+/g,'/') ;
133
                      return '<img src="images/rex_images/ext_blank.gif" border="0" hspace="2" align="absmiddle"><a href="'+sLink+'" class=body_link>'+data+'</a>';
134
                }},
135
                { render :  function ( data, type, row, meta ) {
136
                      if ( data  ) {
137
                          data = data.replace(/\\+/g, '/');
138
                          data = data.replace(/\/+/g,'\\') ;
139
                      }
140
                      return data;
141
                }},null,
142
                { render :  function ( data, type, row, meta ) { return '<a href="dependencies.asp?pv_id='+row[0]+'" class=body_link>'+data+'</a>';}},
143
                null
144
            ],
145
            columnDefs : [
146
                {className: "nowrap", targets : '_all' } 
147
            ],
148
            orderCellsTop : true,
149
            initComplete : function () {
150
            },
151
        }).api();
152
 
153
        //  Transfer the keyword to the 'file' search item
154
        $('#inp_file').val('<%=parKeyword%>');
155
        table.column(1).search( formatSearch("<%=parKeyword%>") );
156
    });
157
</script>
158
<%End Sub
159
'----------------------------------------------
160
Sub ShowMainPanel
161
%>
162
    <!-- PACKAGE SEARCH ------------------------------------------------>
163
    <%
164
    ' Format keyword for search
165
    If InStr( parKeyword, "*" ) > 0 Then
166
        ' Use wild cards
167
        FileName = Replace( parKeyword, "*", "%")
168
    Else
169
        ' Wildcard is not used, hence append card to the end for better results
170
        FileName = parKeyword & "%"
171
    End If
172
    %>
173
    <table id=tfiles width="100%" border="0" cellspacing="1" cellpadding="2" class=stdGrey>
174
      <thead>
175
        <tr>
176
            <th width="20%" nowrap>PvId</th>
177
            <th width="20%" nowrap>File<%=Quick_Help("FindFile")%></th>
178
            <th width="40%" nowrap>Path</th>
179
            <th width="20%" nowrap>Package Name</th>
180
            <th width="20%" nowrap>Version</th>
181
            <th width="1%" nowrap>CheckSum&nbsp;(CKSUM)</th>
182
        </tr>
183
        <tr class=search>
184
            <th></th>
185
            <th>File</th>
186
            <th>Path</th>
187
            <th>Package</th>
188
            <th>Version</th>
189
            <th></th>
190
        </tr>
191
     </thead>
192
    </table>
7290 dpurdie 193
<%
194
End Sub
195
%>
5357 dpurdie 196
<html>
7291 dpurdie 197
    <head>
198
    <title>Release Manager</title>
199
    <link rel="shortcut icon" href="<%=FavIcon%>"/>
200
    <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
201
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
202
    <link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
203
    <link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
204
    <script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
205
    <!-- TIPS -->
206
    <script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
207
    <script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
208
    <%bJqueryDataTables = TRUE%>
209
    <!--#include file="_jquery_includes.asp"-->
210
    <!-- DROPDOWN MENUS -->
211
    <!--#include file="_menu_def.asp"-->
212
    <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
213
    <%Call InsertJavaScript%>
214
    </head>
215
    <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
216
    <!-- HEADER -->
217
    <!--#include file="_header.asp"-->
218
    <!-- BODY ---->
219
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
220
            <tr> 
221
                <td width="20%" class='bg_panel'>
222
                <!--#include file="_front_explorer.asp"-->
223
                </td>
224
                <td rowspan="2" valign="top"> 
225
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
226
                        <tr> 
227
                            <td >
228
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
229
                                    <tr> 
230
                                        <td style="width:10px;height:20px"></td>
231
                                        <td class=body_sect>Files</td>
232
                                        <td></td>
233
                                    </tr>
234
                                    <tr> 
235
                                        <td></td>
236
                                        <td><%Call ShowMainPanel%> </td>
237
                                        <td>&nbsp;</td>
238
                                    </tr>
239
                                </table>
240
                            </td>
241
                        </tr>
242
                  </table>
243
                </td>
244
                <td width="11%">&nbsp;</td>
245
            </tr>
246
            <tr> 
247
                <td class='bg_panel_btm' height="350">
248
                    <img src="images/img_gear.gif" width="107" height="107" vspace="20" hspace="30"></td>
249
                <td></td>
250
            </tr>
251
        </table>
252
        <!-- FOOTER -->
253
        <!--#include file="_footer.asp"-->
254
    </body>
5357 dpurdie 255
</html>