Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the search filter functionality #28

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
9b93e0b
Rewrote backend entirely with correct data structures
gridhead Dec 6, 2020
140f480
Decoupled JavaScript entities from templates
gridhead Dec 6, 2020
18620a0
Initial commit for the graphing overview page
gridhead Dec 6, 2020
986d63b
Updated requirements file
gridhead Dec 6, 2020
edb42b5
Added commandline execution for driver code
gridhead Dec 7, 2020
a286614
Added the SuperVisor preview endpoint
gridhead Dec 8, 2020
cdca665
Rewrote backend driver using AJAX
gridhead Dec 8, 2020
ac00842
Added about and CPU usage sections
gridhead Dec 8, 2020
11487c8
Added live graphs for CPU monitoring
gridhead Dec 8, 2020
31dda53
Include graphing library
gridhead Dec 8, 2020
11d400f
Added streaming CPU times data
gridhead Dec 9, 2020
b597d3a
Switched font assets at local storage
gridhead Dec 10, 2020
51c07f2
Facilitated asset loading from local storage
gridhead Dec 10, 2020
60e3e18
Rewrote simple HTTP server in Go
gridhead Dec 10, 2020
43be449
Added dedicated template for Go HTTP server
gridhead Dec 10, 2020
0dd0db6
Added dedicated template for Python Flask server
gridhead Dec 10, 2020
bc2f095
Cleaned up dependencies and Go template
gridhead Dec 10, 2020
f7dbe58
Disabled logging in both endpoints
gridhead Dec 10, 2020
b84f5ca
Merge pull request #36 from t0xic0der/primary-web-backend
gridhead Dec 10, 2020
42c2088
Corrected Go template location
gridhead Dec 11, 2020
1d58d5d
Included graphing for CPU cycles and statistics
gridhead Dec 11, 2020
eb2650f
Handled exception for when battery information is unavailable
gridhead Dec 11, 2020
217f04b
Included graph rendering for CPU clock speed
gridhead Dec 11, 2020
c12bb93
Merge pull request #37 from t0xic0der/cpu-cycles-graph
gridhead Dec 11, 2020
4599532
Added live graphs for monitoring memory performance
gridhead Dec 11, 2020
1a513d8
Included frontend code for memory performance monitoring
gridhead Dec 11, 2020
4f562fa
Merge pull request #38 from t0xic0der/memory-information
gridhead Dec 11, 2020
41838e3
Added partition data and usage info updater
gridhead Dec 12, 2020
7f10bb3
Included static DOM for disk section
gridhead Dec 12, 2020
b916a17
Merge pull request #39 from t0xic0der/active-disk-information
gridhead Dec 12, 2020
482f967
Updating the search filter functionality
Oct 29, 2020
2eb5609
Delete .gitignore
Oct 29, 2020
e4eaa83
Delete profiles_settings.xml
Oct 29, 2020
9802b88
Delete misc.xml
Oct 29, 2020
a48ff82
Delete modules.xml
Oct 29, 2020
0745adb
Delete sysmon.iml
Oct 29, 2020
0f4ce72
Delete vcs.xml
Oct 29, 2020
9d1fcbd
Delete settings.json
Oct 29, 2020
17cbbee
Delete back.py
Oct 29, 2020
9a05c7e
Revert "Delete back.py"
Oct 29, 2020
0fe111d
Update custpage.html
Oct 31, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added WebStationSYSMON
Binary file not shown.
399 changes: 399 additions & 0 deletions hard.py

Large diffs are not rendered by default.

94 changes: 94 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
##########################################################################
*
* Copyright © 2019-2020 Akashdeep Dhar <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
##########################################################################
*/

package main

import (
"flag"
"fmt"
"net/http"
)

func FR_RED(textobjc string) string {
return "\u001b[31m" + textobjc + "\u001b[0m"
}

func FR_BLUE(textobjc string) string {
return "\u001b[34m" + textobjc + "\u001b[0m"
}

func FR_MAGENTA(textobjc string) string {
return "\u001b[35m" + textobjc + "\u001b[0m"
}

func TX_BOLD(textobjc string) string {
return "\u001b[1m" + textobjc + "\u001b[0m"
}

func GN_TEXT(textobjc string) string {
return " " + textobjc
}

func MainTemplateLoads (wrt http.ResponseWriter, req *http.Request) {
wrt.Header().Set("Content-Type", "text/html")
http.ServeFile(wrt, req, "templates/maingotm.html")
}

func ServeWebInterface (portdata string) {
fmt.Printf(FR_BLUE(TX_BOLD("[ ✓ ] SuperVisor WEB v0.2.0")) + "\n" +
GN_TEXT("Starting web interface at port number " + portdata) + "\n" +
GN_TEXT("Press Ctrl+C to exit") + "\n")
static := http.FileServer(http.Dir("./static"))
http.HandleFunc("/", MainTemplateLoads)
http.Handle("/static/", http.StripPrefix("/static/", static))
var eror error = http.ListenAndServe(":" + portdata, nil)
if eror != nil {
fmt.Printf(FR_RED(TX_BOLD("[ ! ] " + eror.Error())) + "\n")
}
}

func ShowAboutInterface () {
fmt.Printf(FR_BLUE(TX_BOLD("[ ✓ ] SuperVisor WEB v0.2.0")) + "\n" +
GN_TEXT("© 2019-2020 Akashdeep Dhar <[email protected]>") + "\n" + "\n" +
FR_BLUE(TX_BOLD("[ i ] About")) + "\n" +
GN_TEXT("An intuitive remotely-accessible system performance ") + "\n" +
GN_TEXT("monitoring and task management tool for servers and ") + "\n" +
GN_TEXT("headless Raspberry Pi setups") + "\n" + "\n" +
FR_BLUE(TX_BOLD("[ i ] Usage")) + "\n" +
GN_TEXT(FR_MAGENTA("-port") + " - " + "Set the port value [0-65536]") + "\n" +
GN_TEXT(FR_MAGENTA("-help") + " - " + "Read about the scriptlet and its creators") + "\n" + "\n" +
FR_BLUE(TX_BOLD("[ i ] Maintainers")) + "\n" +
GN_TEXT(FR_MAGENTA("t0xic0der") + " - " + "Akashdeep Dhar") + "\n" +
GN_TEXT(FR_MAGENTA("shivangswain") + " - " + "Shivang Swain") + "\n")
}

func main() {
var port string
var help bool
flag.StringVar(&port, "port", "9696", "Set the port value [0-65536]")
flag.BoolVar(&help, "help", false, "Read about the scriptlet and its creators")
flag.Parse()
if help == true {
ShowAboutInterface()
} else {
ServeWebInterface(port)
}
}
41 changes: 37 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
import back, click
'''
##########################################################################
*
* Copyright © 2019-2020 Akashdeep Dhar <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
##########################################################################
'''

from flask import Flask, render_template, jsonify

import back
import click
import logging


main = Flask(__name__)
loge = logging.getLogger("werkzeug")
loge.setLevel(logging.ERROR)


@main.route("/termproc/<prociden>/", methods=["GET"])
Expand Down Expand Up @@ -50,6 +76,11 @@ def fetcinfo():
return retnjson


@main.route("/")
def graphing():
return render_template("mainpytm.html")


@main.route("/<thmcolor>/", methods=["GET"])
def custpage(thmcolor="maroon"):
retndata = back.GetOSUnameData()
Expand Down Expand Up @@ -77,14 +108,16 @@ def custpage(thmcolor="maroon"):
@click.version_option(version="0.1.0", prog_name="WebStation SYSMON by t0xic0der")
def mainfunc(portdata, netprotc):
print(" * Starting WebStation SYSMON by t0xic0der...")
print(" * Port number : " + str(portdata))
print(" * Port number : " + str(portdata))
netpdata = ""
if netprotc == "ipprotv6":
print(" * IP version : 6")
print(" * IP version : 6")
netpdata = "::"
elif netprotc == "ipprotv4":
print(" * IP version : 4")
print(" * IP version : 4")
netpdata = "0.0.0.0"
print(" * Logs state : Errors only")
main.config["TEMPLATES_AUTO_RELOAD"] = True
main.run(port=portdata, host=netpdata)


Expand Down
76 changes: 37 additions & 39 deletions static/css3/custfrmt.css
Original file line number Diff line number Diff line change
@@ -1,52 +1,46 @@
@font-face {
font-family: "Barlow-Regular";
src: url("../font/brlw-rlar.woff");
}
/*
##########################################################################
*
* Copyright © 2019-2020 Akashdeep Dhar <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
##########################################################################
*/

@font-face {
font-family: "Barlow-Bold";
src: url("../font/brlw-bold.woff");
font-family: "IBM Plex Sans";
src: url("../font/plex-rlar.ttf");
}

@font-face {
font-family: "Barlow-Italic";
src: url("../font/brlw-ital.woff");
font-family: "IBM Plex Sans";
font-style: italic;
src: url("../font/plex-ital.ttf");
}

@font-face {
font-family: "Barlow-Bold-Italic";
src: url("../font/brlw-bdit.woff");
font-family: "IBM Plex Sans";
font-weight: bold;
src: url("../font/plex-bold.ttf");
}

.headelem {
font-family: "Barlow-Bold";
}

.hugeelem {
font-family: "Barlow-Bold-Italic";
}

.normelem {
font-family: "Barlow-Regular";
}

.italelem {
font-family: "Barlow-Italic";
}

.forggrin {
background-color: rgb(32,192,160);
}

.headcard {
padding-left: 30px;
padding-right: 30px;
padding-top: 10px;
padding-bottom: 10px;
}

.blcktint {
color: #000000;
@font-face {
font-family: "IBM Plex Sans Bold";
font-weight: bold;
font-style: italic;
src: url("../font/plex-bdit.ttf");
}

/* Preventing text-selection and copy-paste */
Expand All @@ -67,4 +61,8 @@

.cuntainer::-webkit-scrollbar {
display: none;
}

.bodyfont {
font-family: 'IBM Plex Sans', sans-serif !important;
}
Loading