How to write a page for SS bash to view traffic on the WEB side

Source: Internet
Author: User

Because just graduated from poor college students, and friends rented a server opened a number of ports to provide SS services, too lazy to configure Ss-panel, used Ss-bash to monitor the traffic of different ports, but each time to wait on the server to see traffic usage, very troublesome, so wrote a simple page to provide WEB access, specific content through this article study it

Because just graduated from poor college students, and friends rented a server opened a number of ports to provide SS services, too lazy to configure Ss-panel, used Ss-bash to monitor the traffic of different ports, but each time to wait on the server to see traffic usage, very troublesome, so wrote a simple page to provide WEB access.

JavaScript version

Use crontab timing to copy the traffic log files to the WEB directory, write a JS script for data processing.

function Successfunction (data) {var allrows = Data.split (/\r?\n|\r/); var table = ' <table class= "Table Table-hover" St Yle= "width:50%; Margin:auto; " > '; for (var singlerow = 0; singlerow < allrows.length; singlerow++) {  if (singlerow = = = 0) {   table + = ' <THEAD&G t; ';   Table + = ' <tr> ';  } else {   table + = ' <tr> ';  }  var rowcells = Allrows[singlerow].split (', ');  for (var Rowcell = 0; Rowcell < rowcells.length; rowcell++) {   if (singlerow = = = 0) {    table + = ' <th class= ' te Xt-right ">";    Table + = Rowcells[rowcell];    Table + = ' </th> ';   } else {    table + = ' <td class= "text-right" > ";    Table + = Rowcells[rowcell];    Table + = ' </td> ';   }  }  if (singlerow = = = 0) {   table + = ' </tr> ';   Table + = ' </thead> ';   Table + = ' <tbody> ';  } else {   table + = ' </tr> ';  }}  Table + = ' </tbody> '; Table + = ' </table> '; $ (' body '). Append (table);}

Home

<! DOCTYPE html>

PHP version

The server is already installed PHP, so it is a matter of course to use PHP.

<! DOCTYPE html>

The above is a small series to introduce to the SS bash to write a WEB page to view traffic, I hope to help you, if you have any questions please give me a message, small series will promptly reply to you. Thank you very much for the support of the Scripting House website!

How to write a page for SS bash to view traffic on the WEB side

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.