Ransomware Rebuild

Ransomware Rebuild

Lonnie.HullLonnie.Hull Posts: 32Questions: 11Answers: 0
edited May 2019 in Free community support

Hello,

I'm trying to rebuild after a ransomware attack that I lost everything on my production / backup servers.

I happen to have a copy of a file that I saved on my desktop.

                   <html>
                       <head>
                    <title>Graphics Department</title>
                   <link rel="shortcut icon" href="\\AIENT02\Webcaster\favicon.ico" />
                   
                   <script type="text/javascript" src="\\aient02/Ksync/Apps/Ksync/DataTables/jquery-1.11.3.min.js"></script>
                   
                   <link rel="stylesheet" type="text/css" href="\\aient02/Ksync/Apps/Ksync/DataTables/jquery.dataTables.css" />
                   
                   <script type="text/javascript" charset="utf8" src="\\aient02/Ksync/Apps/Ksync/DataTables/jquery.dataTables.js"></script>
                   <link rel="stylesheet" type="text/css" href="\\aient02/Ksync/Apps/Ksync/DataTables/select2.min.css" />
                   <script type="text/javascript" src="\\aient02/Ksync/Apps/Ksync/DataTables/select2.min.js"></script>
                   <style>
                   */ div.dataTables_wrapper {
                           margin-bottom: 3em;
                       }
                   .red {
                    background-color: red !important;
                     font-weight: bold;
                   
                   }
                   .green {
                     background-color: ;
                   }
                   .blue {
                     background-color: blue !important;
                   /*
                   </style>
                   
                   <script>$.fn.dataTable.Api.register( 'column().data().sum()', function () {
                       return this.reduce( function (a, b) {
                           var x = parseFloat( a ) || 0;
                           var y = parseFloat( b ) || 0;
                           return x + y;
                       } );
                   } );
                   
                   $(document).ready( function () {
                   
                     var table = $('#example').DataTable({
                               initComplete: function () {
                               count = 0;
                               this.api().columns().every( function () {
                                   var title = this.header();
                                   //replace spaces with dashes
                                   title = $(title).html().replace(/[\W]/g, '-');
                                   var column = this;
                                   var select = $('<select id="' + title + '" class="select2" ></select>')
                                       .appendTo( $(column.footer()).empty() )
                                       .on( 'change', function () {
                                         //Get the "text" property from each selected data 
                                         //regex escape the value and store in array
                                         var data = $.map( $(this).select2('data'), function( value, key ) {
                                           return value.text ? '^' + $.fn.dataTable.util.escapeRegex(value.text) + '$' : null;
                                                    });
                                         
                                         //if no data selected use ""
                                         if (data.length === 0) {
                                           data = [""];
                                         }
                                         
                                         //join array into string with regex or (|)
                                         var val = data.join('|');
                                         
                                         //search for the option(s) selected
                                         column
                                               .search( val ? val : '', true, false )
                                               .draw();
                                       } );
                    
                                   column.data().unique().sort().each( function ( d, j ) {
                                       select.append( '<option value="'+d+'">'+d+'</option>' );
                                   } );
                                 
                                 //use column title as selector and placeholder
                                 $('#' + title).select2({
                                   multiple: true,
                                   closeOnSelect: false,
                                   placeholder: "Select a " + title
                                 });
                                 
                                 //initially clear select otherwise first option is selected
                                 $('.select2').val(null).trigger('change');
                               } );
                         
                       $('<button>Click to sum time of visible rows</button>')
                           .prependTo( '#demo' )
                           .on( 'click', function () {
                               alert( 'Column sum is: '+ table.column( 5, {page:'current'} ).data().sum()+ ' hours' );
                        });
                            }
                    });
                   } );
                   
                   </script>
                   
                       </head>
                       <tbody>
                   <div id="demo"></div>
                   <table id="PROD_ALL" class="display" align="center">
                    <caption>Graphics Production as of {%Current Date Time%}
                           </caption>
                    <thead>
                   '''  <tr>
                            
                                <th>Cycle Code</th>
                                                <th>Product</th>
                                                <th>Job Number</th>
                                                <th>Job Name</th>
                                                <th>Projected Ship Date</th>
                                                <th>Cycle Time</th>
                                                                <th>Step#</th>
                                                <th>Operation Code</th>
                                                <th>Salesman Name</th>
                                                <th>Work Center</th>
                                                
                                                                    
                                        </tr>
                                    </thead>
                                    <tbody>
                   
                   
                                                    <td>10</td>
                                            <td>7F</td>
                                            <td>IN AWN 2</td>
                                            <td>76728-01</td>
                                            <td>MTS-PAN-CLEARANCE-IN</td>
                                            <td>03/21/2019</td>
                                            <td>0.1</td>
                                                        <td>110</td>
                                                        <td>APPLY TO MEDIA</td>
                                            <td>House</td>
                                                        <td>IN HAND APPLY</td>
                                                        <td>-36<td>
                   
                                        </tr>
                   
                   
                                                    <td>10</td>
                                            <td>8F</td>
                                            <td>INREVCL1</td>
                                            <td>76749-03</td>
                                            <td>SL SIGN</td>
                                            <td>04/02/2019</td>
                                            <td>0</td>
                                                        <td>20</td>
                                                        <td>DRAW PLOT PATTERN</td>
                                            <td>Steve</td>
                                                        <td>IN PLOT PATTERN</td>
                                                        <td>-24<td>
                   
                                        </tr>
                   
                   
                                                    <td>10</td>
                                            <td>8F</td>
                                            <td>IN CL 1</td>
                                            <td>76749-04</td>
                                            <td>SL DUAL LIT</td>
                                            <td>04/02/2019</td>
                                            <td>0.65</td>
                                                        <td>50</td>
                                                        <td>APPLY OVERLAMINATE</td>
                                            <td>Steve </td>
                                                        <td>IN ROLLS ROLLER</td>
                                                        <td>-24<td>
                   
                                        </tr>
                                    </tbody>
                                    
                                    <tfoot>
                                                <tr>
                                                <th>Cycle Code</th>
                                                <th>Product</th>
                                                <th>Job Number</th>
                                                <th>Job Name</th>
                                                <th>Projected Ship Date</th>
                                                <th>Cycle Time</th>
                                                                <th>Step#</th>
                                                <th>Operation Code</th>
                                                <th>Salesman Name</th>
                                                                <th>Work Center</th>
                                                                
                                </tr>
                   
                    
                    </tfoot>
                        
                   </table>
                    </body>
                    
                   
                   </html>

This was working with the java scripts and css, but I lost all of them. I'm having issues getting the newer version of DataTable scripts to work. Also, I can't find the select2 files.

I've tried to load the files with no luck. I installed dataTables over a year ago and remember that I had issues then.

Any help would be greatly appreciated.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949

    select2.js is not a Datatables library. You can get it from here:
    https://select2.org/

    Other than select2 what issues are you having? Do you get alert messages or errors in your browser's console?

    Kevin

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @Lonnie.Hull ,

    Yep, as Kevin said, it would be helpful if you could show the errors, or even link to your page or create a test case. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • Lonnie.HullLonnie.Hull Posts: 32Questions: 11Answers: 0
    edited May 2019

    Colin,

    I had everything working and instead of leaving well alone, I have somehow broken it again. The filter function is not showing in the footer now.

    I'm using jquery-3.3.1.min.js, select2.min.css, and select2.min.js

    Below are what livedatatables.net has as defaults in the test environment.

    ttp://code.jquery.com/jquery-1.11.3.min.js
    ttps://nightly.datatables.net/css/jquery.dataTables.css
    ttps://nightly.datatables.net/js/jquery.dataTables.js

    Do you know of any access to the additional files I need so I can build it in the test environment?

    Thanks for all your help.

  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949

    Do you know of any access to the additional files I need so I can build it in the test environment?

    You need to add whatever JS and CSS dependancies you need for your test case. For basic Datatables the defaults are good. You can use the Download Builder to generate the CDNs for any extension you want in the test case. Just make sure to remove any duplicated defaults.

    Kevin

  • Lonnie.HullLonnie.Hull Posts: 32Questions: 11Answers: 0

    kthorngren,

    If looking for a web-based file that I can link to. I don't have access to host the additional files.

  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949
    Answer ✓

    The test case only needs enough to replicate the issue. Sounds like you are having issues with the footer based column searches. You shouldn't need anything but the defaults and maybe select2 if you are needing help with that. The link I provided has the CDN link.

    Kevin

  • Lonnie.HullLonnie.Hull Posts: 32Questions: 11Answers: 0

    Kevin,

    You're correct. I was able to get the local files to load with \ and then / for directories. I then had edited a <tfoot> to <foot>. It works now and my production staff is back up and running.
    Thanks so much for your help on this Kevin and Colin.

This discussion has been closed.