initial commit
initial commit of all files
This commit is contained in:
parent
748012f50a
commit
a1bcd8e0a3
23 changed files with 13925 additions and 0 deletions
18
Bash/OpenWrt/band.bash
Normal file
18
Bash/OpenWrt/band.bash
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Requires vnstat to be running on target system
|
||||
|
||||
# initial values
|
||||
mtotal=1000 # monthly total in GB for high end cut off
|
||||
dmax=40 # daily max usage value
|
||||
md=`date +%d` # day of the month numerically
|
||||
cmd=$(($dmax * $md)) # computed max daily
|
||||
wif="eth1.2"
|
||||
|
||||
# now vnstat stuff, some of this is specific to openwrt
|
||||
|
||||
vnhourly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $6}'` # total daily usage
|
||||
vnmonthly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $11}'` # monthly total usage
|
||||
|
||||
|
||||
logger "dom $md cm $cmd vnhourly $vnhourly vnmonthly $vnmonthly";
|
14
Bash/Raspberry Pi/bndweb.bash
Normal file
14
Bash/Raspberry Pi/bndweb.bash
Normal file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
|
||||
# step two of my revised band width monitoring system
|
||||
# First script runs on openwrt, queries vnstat, crunches a number or two
|
||||
# and then sends it to syslog, which then sends it to a remote server
|
||||
# said remote server a RPI runs this code to make the result web accessible
|
||||
|
||||
# note log contains a weeks worth of hourly bandwidth logs and we need the most recent
|
||||
# only
|
||||
|
||||
vndat=`cat /var/log/openwrt.log | grep "root: dom" | tail -n 1`;
|
||||
|
||||
echo "$vndat" > /var/www/html/bnd.dat;
|
||||
# echo "$vndat";
|
78
fpc/backup/bandy2.lpi
Normal file
78
fpc/backup/bandy2.lpi
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="11"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="bandy2"/>
|
||||
<Scaled Value="True"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
</XPManifest>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<UseFileFilters Value="True"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="0"/>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="1">
|
||||
<Item1>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="bandy2.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<Target>
|
||||
<Filename Value="bandy2"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
154
fpc/backup/bandy2.lps
Normal file
154
fpc/backup/bandy2.lps
Normal file
|
@ -0,0 +1,154 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectSession>
|
||||
<Version Value="11"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="bandy2.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="-1"/>
|
||||
<TopLine Value="-1"/>
|
||||
<CursorPos X="-1" Y="-1"/>
|
||||
<UsageCount Value="29"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="72"/>
|
||||
<CursorPos X="73" Y="75"/>
|
||||
<UsageCount Value="29"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
<JumpHistory Count="29" HistoryIndex="28">
|
||||
<Position1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="37" Column="26"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="51" Column="13" TopLine="20"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="53" Column="13" TopLine="22"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="54" Column="13" TopLine="23"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="55" Column="13" TopLine="24"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="59" Column="38" TopLine="30"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="60" Column="38" TopLine="31"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="62" Column="38" TopLine="34"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="63" Column="38" TopLine="35"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="65" Column="38" TopLine="37"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="80" Column="14" TopLine="44"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="75" Column="14" TopLine="44"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Column="13"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="88" Column="21" TopLine="52"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="81" Column="3" TopLine="55"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="73" Column="21" TopLine="39"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="77" Column="3" TopLine="48"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="57" Column="34" TopLine="48"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="88" Column="24" TopLine="52"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="72" TopLine="39"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="79" TopLine="43"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="61" Column="27" TopLine="46"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="60" Column="27" TopLine="45"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="94" Column="74" TopLine="60"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="93" Column="74" TopLine="59"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="94" Column="74" TopLine="60"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="101" Column="74" TopLine="67"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="81" Column="94" TopLine="65"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="83" Column="31" TopLine="66"/>
|
||||
</Position29>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="0" ActiveMode=""/>
|
||||
</RunParams>
|
||||
</ProjectSession>
|
||||
</CONFIG>
|
4378
fpc/backup/unit1.lfm
Normal file
4378
fpc/backup/unit1.lfm
Normal file
File diff suppressed because it is too large
Load diff
106
fpc/backup/unit1.pas
Normal file
106
fpc/backup/unit1.pas
Normal file
|
@ -0,0 +1,106 @@
|
|||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
|
||||
fphttpclient, opensslsockets, strutils;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
Button1: TButton;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
Label3: TLabel;
|
||||
Label4: TLabel;
|
||||
Label5: TLabel;
|
||||
Label6: TLabel;
|
||||
Label7: TLabel;
|
||||
Label8: TLabel;
|
||||
Timer1: TTimer;
|
||||
TrayIcon1: TTrayIcon;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure Label7Click(Sender: TObject);
|
||||
procedure Timer1Timer(Sender: TObject);
|
||||
procedure TrayIcon1Click(Sender: TObject);
|
||||
private
|
||||
|
||||
public
|
||||
|
||||
end;
|
||||
|
||||
type
|
||||
|
||||
vnstat = record
|
||||
|
||||
dom: String;
|
||||
cm: String;
|
||||
vnhourly: String;
|
||||
vnmonthly: String;
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
webres: string;
|
||||
vnstats: vnstat;
|
||||
parse: array of string;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
Timer1.Enabled:= true;
|
||||
Button1.Caption:= 'Loading';
|
||||
end;
|
||||
|
||||
procedure TForm1.Label7Click(Sender: TObject);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TForm1.Timer1Timer(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
webres := TFPCustomHTTPClient.SimpleGet('https://192.168.1.113/bnd.dat');
|
||||
parse := splitstring(webres,' ');
|
||||
vnstats.dom := parse[6];
|
||||
vnstats.cm := parse[8];
|
||||
vnstats.vnhourly := parse[10];
|
||||
vnstats.vnmonthly := parse[13];
|
||||
Label2.Caption := vnstats.vnhourly;
|
||||
Label6.Caption := vnstats.vnmonthly;
|
||||
Label4.Caption := vnstats.cm;
|
||||
Label7.Caption:= parse[11] ;
|
||||
Label8.Caption:= parse[14];
|
||||
Button1.Caption := 'Hide';
|
||||
except
|
||||
// Blah
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TForm1.TrayIcon1Click(Sender: TObject);
|
||||
begin
|
||||
Form1.Show;
|
||||
end;
|
||||
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
begin
|
||||
Form1.Hide;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end.
|
||||
|
56
fpc/bandmon.pas
Normal file
56
fpc/bandmon.pas
Normal file
|
@ -0,0 +1,56 @@
|
|||
program bandmon;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses fphttpclient,opensslsockets,sysutils,strutils;
|
||||
|
||||
type
|
||||
|
||||
vnstat = record
|
||||
|
||||
dom: String;
|
||||
cm: String;
|
||||
vnhourly: String;
|
||||
vnmonthly: String;
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
|
||||
webres: string;
|
||||
vnstats: vnstat;
|
||||
parse: array of string;
|
||||
i: integer;
|
||||
|
||||
begin
|
||||
try
|
||||
webres := TFPCustomHTTPClient.SimpleGet('https://192.168.1.113/bnd.dat');
|
||||
Writeln('Response : ',webres);
|
||||
parse := splitstring(webres,' ');
|
||||
except
|
||||
begin
|
||||
// Well damn it might just be a timeout in which case we could poke it again
|
||||
Writeln('It seems we had an error proably a timeout.');
|
||||
end;
|
||||
end;
|
||||
|
||||
// Good so far now
|
||||
vnstats.dom := parse[7];
|
||||
vnstats.cm := parse[9];
|
||||
vnstats.vnhourly := parse[11];
|
||||
vnstats.vnmonthly := parse[14];
|
||||
|
||||
writeln('Debug Parse');
|
||||
|
||||
for i:=Low(parse) to high(parse) do
|
||||
Writeln('Parse ' , i , ' ', parse[i]);
|
||||
|
||||
//Writeln('Debug Parse', parse[ 0 .. length(parse)]);
|
||||
Writeln('Debug ', vnstats.dom);
|
||||
Writeln('Debug ', vnstats.cm);
|
||||
Writeln('Debug ', vnstats.vnhourly);
|
||||
Writeln('Debug ', vnstats.vnmonthly);
|
||||
|
||||
end.
|
||||
|
||||
|
BIN
fpc/bandy2.ico
Normal file
BIN
fpc/bandy2.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 134 KiB |
78
fpc/bandy2.lpi
Normal file
78
fpc/bandy2.lpi
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="11"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="bandy2"/>
|
||||
<Scaled Value="True"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
</XPManifest>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<UseFileFilters Value="True"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="0"/>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="1">
|
||||
<Item1>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="bandy2.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<Target>
|
||||
<Filename Value="bandy2"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
22
fpc/bandy2.lpr
Normal file
22
fpc/bandy2.lpr
Normal file
|
@ -0,0 +1,22 @@
|
|||
program bandy2;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, Unit1
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
RequireDerivedFormResource:=True;
|
||||
Application.Scaled:=True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
154
fpc/bandy2.lps
Normal file
154
fpc/bandy2.lps
Normal file
|
@ -0,0 +1,154 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectSession>
|
||||
<Version Value="11"/>
|
||||
<BuildModes Active="Default"/>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="bandy2.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<WindowIndex Value="-1"/>
|
||||
<TopLine Value="-1"/>
|
||||
<CursorPos X="-1" Y="-1"/>
|
||||
<UsageCount Value="31"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<TopLine Value="70"/>
|
||||
<CursorPos X="28" Y="85"/>
|
||||
<UsageCount Value="31"/>
|
||||
<Loaded Value="True"/>
|
||||
<LoadedDesigner Value="True"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
<JumpHistory Count="29" HistoryIndex="28">
|
||||
<Position1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="37" Column="26"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="51" Column="13" TopLine="20"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="53" Column="13" TopLine="22"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="54" Column="13" TopLine="23"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="55" Column="13" TopLine="24"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="59" Column="38" TopLine="30"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="60" Column="38" TopLine="31"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="62" Column="38" TopLine="34"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="63" Column="38" TopLine="35"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="65" Column="38" TopLine="37"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="80" Column="14" TopLine="44"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="75" Column="14" TopLine="44"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Column="13"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="88" Column="21" TopLine="52"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="81" Column="3" TopLine="55"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="73" Column="21" TopLine="39"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="77" Column="3" TopLine="48"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="57" Column="34" TopLine="48"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="88" Column="24" TopLine="52"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="72" TopLine="39"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="79" TopLine="43"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="61" Column="27" TopLine="46"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="60" Column="27" TopLine="45"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="94" Column="74" TopLine="60"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="93" Column="74" TopLine="59"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="94" Column="74" TopLine="60"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="101" Column="74" TopLine="67"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="81" Column="94" TopLine="65"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<Caret Line="83" Column="31" TopLine="66"/>
|
||||
</Position29>
|
||||
</JumpHistory>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="0" ActiveMode=""/>
|
||||
</RunParams>
|
||||
</ProjectSession>
|
||||
</CONFIG>
|
BIN
fpc/bandy2.res
Normal file
BIN
fpc/bandy2.res
Normal file
Binary file not shown.
BIN
fpc/bandy2.sysprof
Normal file
BIN
fpc/bandy2.sysprof
Normal file
Binary file not shown.
BIN
fpc/capture.syscap
Normal file
BIN
fpc/capture.syscap
Normal file
Binary file not shown.
5
fpc/lib/x86_64-linux/bandy2.compiled
Normal file
5
fpc/lib/x86_64-linux/bandy2.compiled
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<Compiler Value="/usr/bin/fpc" Date="1614890516"/>
|
||||
<Params Value=" -MObjFPC -Scghi -Cg -O1 -g -gl -l -vewnhibq -Fi/home/kake26/Code/FPC/bandy2/lib/x86_64-linux -Fu/usr/lib/lazarus/lcl/units/x86_64-linux/qt5 -Fu/usr/lib/lazarus/lcl/units/x86_64-linux -Fu/usr/lib/lazarus/components/lazutils/lib/x86_64-linux -Fu/usr/lib/lazarus/packager/units/x86_64-linux -Fu/home/kake26/Code/FPC/bandy2/ -FU/home/kake26/Code/FPC/bandy2/lib/x86_64-linux/ -FE/home/kake26/Code/FPC/bandy2/ -o/home/kake26/Code/FPC/bandy2/bandy2 -dLCL -dLCLqt5 bandy2.lpr"/>
|
||||
</CONFIG>
|
BIN
fpc/lib/x86_64-linux/bandy2.o
Normal file
BIN
fpc/lib/x86_64-linux/bandy2.o
Normal file
Binary file not shown.
BIN
fpc/lib/x86_64-linux/bandy2.or
Normal file
BIN
fpc/lib/x86_64-linux/bandy2.or
Normal file
Binary file not shown.
BIN
fpc/lib/x86_64-linux/bandy2.res
Normal file
BIN
fpc/lib/x86_64-linux/bandy2.res
Normal file
Binary file not shown.
4378
fpc/lib/x86_64-linux/unit1.lfm
Normal file
4378
fpc/lib/x86_64-linux/unit1.lfm
Normal file
File diff suppressed because it is too large
Load diff
BIN
fpc/lib/x86_64-linux/unit1.o
Normal file
BIN
fpc/lib/x86_64-linux/unit1.o
Normal file
Binary file not shown.
BIN
fpc/lib/x86_64-linux/unit1.ppu
Normal file
BIN
fpc/lib/x86_64-linux/unit1.ppu
Normal file
Binary file not shown.
4378
fpc/unit1.lfm
Normal file
4378
fpc/unit1.lfm
Normal file
File diff suppressed because it is too large
Load diff
106
fpc/unit1.pas
Normal file
106
fpc/unit1.pas
Normal file
|
@ -0,0 +1,106 @@
|
|||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,
|
||||
fphttpclient, opensslsockets, strutils;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
Button1: TButton;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
Label3: TLabel;
|
||||
Label4: TLabel;
|
||||
Label5: TLabel;
|
||||
Label6: TLabel;
|
||||
Label7: TLabel;
|
||||
Label8: TLabel;
|
||||
Timer1: TTimer;
|
||||
TrayIcon1: TTrayIcon;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure Label7Click(Sender: TObject);
|
||||
procedure Timer1Timer(Sender: TObject);
|
||||
procedure TrayIcon1Click(Sender: TObject);
|
||||
private
|
||||
|
||||
public
|
||||
|
||||
end;
|
||||
|
||||
type
|
||||
|
||||
vnstat = record
|
||||
|
||||
dom: String;
|
||||
cm: String;
|
||||
vnhourly: String;
|
||||
vnmonthly: String;
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
webres: string;
|
||||
vnstats: vnstat;
|
||||
parse: array of string;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
Timer1.Enabled:= true;
|
||||
Button1.Caption:= 'Loading';
|
||||
end;
|
||||
|
||||
procedure TForm1.Label7Click(Sender: TObject);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TForm1.Timer1Timer(Sender: TObject);
|
||||
begin
|
||||
try
|
||||
webres := TFPCustomHTTPClient.SimpleGet('https://192.168.1.113/bnd.dat');
|
||||
parse := splitstring(webres,' ');
|
||||
vnstats.dom := parse[7];
|
||||
vnstats.cm := parse[9];
|
||||
vnstats.vnhourly := parse[11];
|
||||
vnstats.vnmonthly := parse[14];
|
||||
Label2.Caption := vnstats.vnhourly;
|
||||
Label6.Caption := vnstats.vnmonthly;
|
||||
Label4.Caption := vnstats.cm;
|
||||
Label7.Caption:= parse[12] ;
|
||||
Label8.Caption:= parse[15];
|
||||
Button1.Caption := 'Hide';
|
||||
except
|
||||
// Blah
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
procedure TForm1.TrayIcon1Click(Sender: TObject);
|
||||
begin
|
||||
Form1.Show;
|
||||
end;
|
||||
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
begin
|
||||
Form1.Hide;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end.
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue