├── .gitignore ├── Dockerfile ├── LICENSE ├── MANIFEST.in ├── README.md ├── docker-compose.yml ├── pictures ├── legacypc │ ├── 10_diskusej.png │ ├── 11_diskpart.png │ ├── 12_thrmperf.png │ ├── 13_netwaddr.png │ ├── 1_loginmod.png │ ├── 2_overview.png │ ├── 3_insights.png │ ├── 4_proclist.png │ ├── 5_procinfo.png │ ├── 6_cpuuperc.png │ ├── 7_cpuucloc.png │ ├── 8_memoperc.png │ └── 9_battperc.png ├── mainicon.svg └── modernpc │ ├── 01_logepage.png │ ├── 02_dashbord.png │ ├── 03_systdata.png │ ├── 04_proclist.png │ ├── 05_contlist.png │ ├── 06_contdata.png │ ├── 07_contstat.png │ ├── 08_contlogs.png │ ├── 09_conthtop.png │ ├── 10_dockstat.png │ ├── 11_imejlist.png │ ├── 12_imejdata.png │ ├── 13_imejhist.png │ ├── 14_ntwklist.png │ ├── 15_procinfo.png │ ├── 16_ntwkdata.png │ ├── 17_volmlist.png │ └── 18_volmdata.png ├── requirements.txt ├── setup.py ├── src └── svfrontend │ ├── __init__.py │ ├── main.py │ ├── static │ ├── css3 │ │ ├── adminlte.css │ │ ├── custfrmt.css │ │ └── fontsome.css │ ├── font │ │ ├── brcn │ │ │ ├── bdit.ttf │ │ │ ├── bold.ttf │ │ │ ├── ital.ttf │ │ │ └── rlar.ttf │ │ ├── fasm │ │ │ ├── fa-brands-400.eot │ │ │ ├── fa-brands-400.svg │ │ │ ├── fa-brands-400.ttf │ │ │ ├── fa-brands-400.woff │ │ │ ├── fa-brands-400.woff2 │ │ │ ├── fa-regular-400.eot │ │ │ ├── fa-regular-400.svg │ │ │ ├── fa-regular-400.ttf │ │ │ ├── fa-regular-400.woff │ │ │ ├── fa-regular-400.woff2 │ │ │ ├── fa-solid-900.eot │ │ │ ├── fa-solid-900.svg │ │ │ ├── fa-solid-900.ttf │ │ │ ├── fa-solid-900.woff │ │ │ └── fa-solid-900.woff2 │ │ ├── mono │ │ │ ├── bdit.ttf │ │ │ ├── bold.ttf │ │ │ ├── ital.ttf │ │ │ └── rlar.ttf │ │ └── plex │ │ │ ├── bdit.ttf │ │ │ ├── bold.ttf │ │ │ ├── ital.ttf │ │ │ └── rlar.ttf │ ├── imgs │ │ ├── datalogo.png │ │ └── mainicon.svg │ └── jscn │ │ ├── adminlte.js │ │ ├── ansiconv.js │ │ ├── bootstrap.bundle.js │ │ ├── contdata.js │ │ ├── conthtop.js │ │ ├── contlist.js │ │ ├── contlogs.js │ │ ├── contstat.js │ │ ├── dashbard.js │ │ ├── dockstat.js │ │ ├── extermjs.js │ │ ├── globthem.js │ │ ├── imejdata.js │ │ ├── imejlist.js │ │ ├── imejrevs.js │ │ ├── jqryknob.js │ │ ├── jquery.min.js │ │ ├── logepage.js │ │ ├── mtrcdata.js │ │ ├── mtrclist.js │ │ ├── ntwkdata.js │ │ ├── ntwklist.js │ │ ├── proclist.js │ │ ├── smoothie.js │ │ ├── systdata.js │ │ ├── termpage.js │ │ ├── volmdata.js │ │ └── volmlist.js │ └── templates │ ├── conthtop.html │ ├── continfo.html │ ├── contlist.html │ ├── contlogs.html │ ├── contstat.html │ ├── dashbard.html │ ├── dockstat.html │ ├── e403page.html │ ├── e404page.html │ ├── e500page.html │ ├── frameset.html │ ├── imejinfo.html │ ├── imejlist.html │ ├── imejrevs.html │ ├── logepage.html │ ├── manifest.json │ ├── mtrcdata.html │ ├── mtrclist.html │ ├── ntwkinfo.html │ ├── ntwklist.html │ ├── proclist.html │ ├── systdata.html │ ├── termpage.html │ ├── volminfo.html │ └── volmlist.html └── svfrontend.spec /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.8-alpine 2 | ENV PYTHONUNBUFFERED=1 3 | COPY requirements.txt requirements.txt 4 | RUN pip install -r requirements.txt 5 | COPY src/svfrontend svfrontend 6 | WORKDIR /svfrontend 7 | EXPOSE 9696 8 | ENTRYPOINT ["python3", "main.py", "-p", "9696", "-4"] 9 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include src/svfrontend/templates * 2 | recursive-include src/svfrontend/static * -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 |

SuperVisor

6 |

Frontend Service

7 |

Reference frontend service for SuperVisor written in Python

8 | 9 |

10 | 11 | 12 |

13 | 14 |

15 | 16 | 17 | 18 | 19 | 20 |

21 | 22 | ## Note 23 | This project works as a web-interface client for users to view their host system performance, container statistics, 24 | image information, volume information and network details of a container station from the browser applications of their 25 | choice but they need to have the [SuperVisor Driver Service](https://github.com/t0xic0der/supervisor-driver-service/) 26 | running on their server setup and connect to the same with the synchronization URI and passcode provided on the driver 27 | service startup. 28 | 29 | ## Native deployment 30 | 31 | If you use Fedora (32, 33, 34 ELN, Rawhide or above), CentOS (Stream 8 or above), RHEL (8 or above), 32 | Mageia (7, Cauldron or above), OpenSUSE (Leap or Tumbleweed) - you can deploy the frontend service natively using 33 | a COPR. Just execute the following commands in succession to install the service. 34 | 35 | ```shell 36 | # dnf install dnf-plugins-core -y 37 | # dnf copr enable t0xic0der/supervisor -y 38 | # dnf install svfrontend -y 39 | ``` 40 | 41 | ## In action 42 | 43 | ![](https://raw.githubusercontent.com/t0xic0der/t0xic0der/master/supervisor-frontend-service-v1.1.0-beta.gif) 44 | 45 | ## Table of contents 46 | 1. [Home](https://github.com/t0xic0der/supervisor-frontend-service/wiki) 47 | 2. [Installation](https://github.com/t0xic0der/supervisor-frontend-service/wiki/Installation) 48 | 3. [Obtain releases](https://github.com/t0xic0der/supervisor-frontend-service/releases) 49 | 4. [SuperVisor Driver Service](https://github.com/t0xic0der/supervisor-driver-service) 50 | 51 | ## Contribute 52 | You may request for the addition of new features in the [issues](https://github.com/t0xic0der/supervisor-frontend-service/issues) 53 | page but as the project is singlehandedly maintained - it might take time to develop on them. Please consider forking 54 | the repository and contributing to its development. :heart: 55 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | endpoint: 4 | build: . 5 | entrypoint: "python3 main.py -p 9696 -4" 6 | ports: 7 | - "9696:9696" 8 | -------------------------------------------------------------------------------- /pictures/legacypc/10_diskusej.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/10_diskusej.png -------------------------------------------------------------------------------- /pictures/legacypc/11_diskpart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/11_diskpart.png -------------------------------------------------------------------------------- /pictures/legacypc/12_thrmperf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/12_thrmperf.png -------------------------------------------------------------------------------- /pictures/legacypc/13_netwaddr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/13_netwaddr.png -------------------------------------------------------------------------------- /pictures/legacypc/1_loginmod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/1_loginmod.png -------------------------------------------------------------------------------- /pictures/legacypc/2_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/2_overview.png -------------------------------------------------------------------------------- /pictures/legacypc/3_insights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/3_insights.png -------------------------------------------------------------------------------- /pictures/legacypc/4_proclist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/4_proclist.png -------------------------------------------------------------------------------- /pictures/legacypc/5_procinfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/5_procinfo.png -------------------------------------------------------------------------------- /pictures/legacypc/6_cpuuperc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/6_cpuuperc.png -------------------------------------------------------------------------------- /pictures/legacypc/7_cpuucloc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/7_cpuucloc.png -------------------------------------------------------------------------------- /pictures/legacypc/8_memoperc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/8_memoperc.png -------------------------------------------------------------------------------- /pictures/legacypc/9_battperc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/legacypc/9_battperc.png -------------------------------------------------------------------------------- /pictures/mainicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pictures/modernpc/01_logepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/01_logepage.png -------------------------------------------------------------------------------- /pictures/modernpc/02_dashbord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/02_dashbord.png -------------------------------------------------------------------------------- /pictures/modernpc/03_systdata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/03_systdata.png -------------------------------------------------------------------------------- /pictures/modernpc/04_proclist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/04_proclist.png -------------------------------------------------------------------------------- /pictures/modernpc/05_contlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/05_contlist.png -------------------------------------------------------------------------------- /pictures/modernpc/06_contdata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/06_contdata.png -------------------------------------------------------------------------------- /pictures/modernpc/07_contstat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/07_contstat.png -------------------------------------------------------------------------------- /pictures/modernpc/08_contlogs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/08_contlogs.png -------------------------------------------------------------------------------- /pictures/modernpc/09_conthtop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/09_conthtop.png -------------------------------------------------------------------------------- /pictures/modernpc/10_dockstat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/10_dockstat.png -------------------------------------------------------------------------------- /pictures/modernpc/11_imejlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/11_imejlist.png -------------------------------------------------------------------------------- /pictures/modernpc/12_imejdata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/12_imejdata.png -------------------------------------------------------------------------------- /pictures/modernpc/13_imejhist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/13_imejhist.png -------------------------------------------------------------------------------- /pictures/modernpc/14_ntwklist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/14_ntwklist.png -------------------------------------------------------------------------------- /pictures/modernpc/15_procinfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/15_procinfo.png -------------------------------------------------------------------------------- /pictures/modernpc/16_ntwkdata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/16_ntwkdata.png -------------------------------------------------------------------------------- /pictures/modernpc/17_volmlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/17_volmlist.png -------------------------------------------------------------------------------- /pictures/modernpc/18_volmdata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/pictures/modernpc/18_volmdata.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Flask>=1.1.2 2 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import codecs 2 | import os.path 3 | import setuptools 4 | 5 | 6 | # use README.md as readme 7 | def readme(): 8 | with open('README.md') as f: 9 | return f.read() 10 | 11 | 12 | # get __version__ from a file 13 | def read(rel_path): 14 | here = os.path.abspath(os.path.dirname(__file__)) 15 | with codecs.open(os.path.join(here, rel_path), 'r') as fp: 16 | return fp.read() 17 | 18 | 19 | def get_version(rel_path): 20 | for line in read(rel_path).splitlines(): 21 | if line.startswith('__version__'): 22 | delim = '"' if '"' in line else "'" 23 | return line.split(delim)[1] 24 | else: 25 | raise RuntimeError("Unable to find version string.") 26 | 27 | 28 | # setuptools configuration 29 | setuptools.setup( 30 | name='svfrontend', 31 | description='SuperVisor Frontend Service', 32 | long_description=readme(), 33 | long_description_content_type="text/markdown", 34 | url='https://github.com/t0xic0der/supervisor-frontend-service', 35 | author='Akashdeep Dhar', 36 | license='GPLv3', 37 | # extract version from source 38 | version=get_version("src/svfrontend/__init__.py"), 39 | # tell distutils packages are under src directory 40 | package_dir={ 41 | '': 'src', 42 | }, 43 | include_package_data=True, 44 | packages=setuptools.find_packages('src'), 45 | install_requires=[ 46 | 'flask' 47 | ], 48 | # automatically create console scripts 49 | entry_points={ 50 | 'console_scripts': ['svfrontend=svfrontend.main:mainfunc'], 51 | }, 52 | classifiers=[ 53 | 'Development Status :: 4 - Beta', 54 | 'Environment :: Console', 55 | 'Intended Audience :: End Users/Desktop', 56 | 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 57 | 'Natural Language :: English', 58 | 'Programming Language :: Python :: 3', 59 | 'Operating System :: POSIX :: Linux', 60 | 'Topic :: System :: Hardware :: Hardware Drivers', 61 | 'Topic :: Utilities', 62 | ], 63 | ) 64 | -------------------------------------------------------------------------------- /src/svfrontend/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2020 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | """ 21 | 22 | __version__ = "v1.2.0-beta" 23 | -------------------------------------------------------------------------------- /src/svfrontend/static/css3/custfrmt.css: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | /* Barlow Condensed - Declaration */ 23 | 24 | @font-face { 25 | font-family: "Barlow Condensed"; 26 | font-style: normal; 27 | font-weight: normal; 28 | src: url("../font/brcn/rlar.ttf"); 29 | } 30 | 31 | @font-face { 32 | font-family: "Barlow Condensed"; 33 | font-style: italic; 34 | font-weight: normal; 35 | src: url("../font/brcn/ital.ttf"); 36 | } 37 | 38 | @font-face { 39 | font-family: "Barlow Condensed"; 40 | font-style: normal; 41 | font-weight: bold; 42 | src: url("../font/brcn/bold.ttf"); 43 | } 44 | 45 | @font-face { 46 | font-family: "Barlow Condensed"; 47 | font-style: italic; 48 | font-weight: bold; 49 | src: url("../font/brcn/bdit.ttf"); 50 | } 51 | 52 | /* IBM Plex Sans - Declaration */ 53 | 54 | @font-face { 55 | font-family: "IBM Plex Sans"; 56 | font-style: normal; 57 | font-weight: normal; 58 | src: url("../font/plex/rlar.ttf"); 59 | } 60 | 61 | @font-face { 62 | font-family: "IBM Plex Sans"; 63 | font-style: italic; 64 | font-weight: normal; 65 | src: url("../font/plex/ital.ttf"); 66 | } 67 | 68 | @font-face { 69 | font-family: "IBM Plex Sans"; 70 | font-style: normal; 71 | font-weight: bold; 72 | src: url("../font/plex/bold.ttf"); 73 | } 74 | 75 | @font-face { 76 | font-family: "IBM Plex Sans"; 77 | font-style: italic; 78 | font-weight: bold; 79 | src: url("../font/plex/bdit.ttf"); 80 | } 81 | 82 | /* IBM Plex Mono - Declaration */ 83 | 84 | @font-face { 85 | font-family: "IBM Plex Mono"; 86 | font-style: normal; 87 | font-weight: normal; 88 | src: url("../font/mono/rlar.ttf"); 89 | } 90 | 91 | @font-face { 92 | font-family: "IBM Plex Mono"; 93 | font-style: italic; 94 | font-weight: normal; 95 | src: url("../font/mono/ital.ttf"); 96 | } 97 | 98 | @font-face { 99 | font-family: "IBM Plex Mono"; 100 | font-style: normal; 101 | font-weight: bold; 102 | src: url("../font/mono/bold.ttf"); 103 | } 104 | 105 | @font-face { 106 | font-family: "IBM Plex Mono"; 107 | font-style: italic; 108 | font-weight: bold; 109 | src: url("../font/mono/bdit.ttf"); 110 | } 111 | 112 | /* Class properties */ 113 | 114 | .condqant { 115 | font-family: "Barlow Condensed" !important; 116 | } 117 | 118 | .monotext { 119 | font-family: "IBM Plex Mono" !important; 120 | } 121 | -------------------------------------------------------------------------------- /src/svfrontend/static/font/brcn/bdit.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/brcn/bdit.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/brcn/bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/brcn/bold.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/brcn/ital.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/brcn/ital.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/brcn/rlar.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/brcn/rlar.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/fasm/fa-brands-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/fasm/fa-brands-400.eot -------------------------------------------------------------------------------- /src/svfrontend/static/font/fasm/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/fasm/fa-brands-400.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/fasm/fa-brands-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/fasm/fa-brands-400.woff -------------------------------------------------------------------------------- /src/svfrontend/static/font/fasm/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/fasm/fa-brands-400.woff2 -------------------------------------------------------------------------------- /src/svfrontend/static/font/fasm/fa-regular-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/fasm/fa-regular-400.eot -------------------------------------------------------------------------------- /src/svfrontend/static/font/fasm/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/fasm/fa-regular-400.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/fasm/fa-regular-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/fasm/fa-regular-400.woff -------------------------------------------------------------------------------- /src/svfrontend/static/font/fasm/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/fasm/fa-regular-400.woff2 -------------------------------------------------------------------------------- /src/svfrontend/static/font/fasm/fa-solid-900.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/fasm/fa-solid-900.eot -------------------------------------------------------------------------------- /src/svfrontend/static/font/fasm/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/fasm/fa-solid-900.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/fasm/fa-solid-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/fasm/fa-solid-900.woff -------------------------------------------------------------------------------- /src/svfrontend/static/font/fasm/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/fasm/fa-solid-900.woff2 -------------------------------------------------------------------------------- /src/svfrontend/static/font/mono/bdit.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/mono/bdit.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/mono/bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/mono/bold.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/mono/ital.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/mono/ital.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/mono/rlar.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/mono/rlar.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/plex/bdit.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/plex/bdit.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/plex/bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/plex/bold.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/plex/ital.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/plex/ital.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/font/plex/rlar.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/font/plex/rlar.ttf -------------------------------------------------------------------------------- /src/svfrontend/static/imgs/datalogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gridhead/supervisor-frontend-service/42815a8b0c6f83c6e0f3acdb1a150aab9014fb14/src/svfrontend/static/imgs/datalogo.png -------------------------------------------------------------------------------- /src/svfrontend/static/imgs/mainicon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/conthtop.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | async function authenticate_endpoint_access () { 23 | await $.post( 24 | "/credpull/", 25 | {}, 26 | async function (data) { 27 | let retndict = JSON.parse(data) 28 | if (retndict["retnmesg"] === "allow") { 29 | let vsondict = { 30 | "drivloca": retndict["drivloca"], 31 | "sockloca": retndict["sockloca"], 32 | "passcode": retndict["passcode"] 33 | }; 34 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 35 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 36 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 37 | try { 38 | await $.getJSON(drivloca + "testconn", { 39 | "passcode": passcode 40 | }, function (data) { 41 | if (data["retnmesg"] === "allow") { 42 | return true; 43 | } else { 44 | $("#connfail").modal("show"); 45 | return false; 46 | } 47 | }) 48 | } catch (err) { 49 | $("#connfail").modal("show"); 50 | return false; 51 | } 52 | } else { 53 | $("#abstcred").modal("show"); 54 | return false; 55 | } 56 | } 57 | ); 58 | } 59 | 60 | async function populate_container_name_and_status (contiden) { 61 | if (sessionStorage.getItem("vsoniden") !== null) { 62 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 63 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 64 | await $.getJSON(drivloca + "dishcont", { 65 | "passcode": passcode, 66 | "opername": "IDEN", 67 | "contiden": contiden 68 | }, function (data) { 69 | if (data["retnmesg"] === "deny") { 70 | $("#contntfd").modal("show"); 71 | } else { 72 | document.getElementById("contname").innerText = data["name"].substring(0, 25); 73 | if (data["attrs"]["State"]["Status"] === "running") { 74 | document.getElementById("contstat").innerText = data["attrs"]["State"]["Status"].toUpperCase(); 75 | document.getElementById("contstat").classList.add("bg-success"); 76 | } else if (data["attrs"]["State"]["Status"] === "created") { 77 | document.getElementById("contstat").innerText = data["attrs"]["State"]["Status"].toUpperCase(); 78 | document.getElementById("contstat").classList.add("bg-pink"); 79 | } else if (data["attrs"]["State"]["Status"] === "restarting") { 80 | document.getElementById("contstat").innerText = data["attrs"]["State"]["Status"].toUpperCase(); 81 | document.getElementById("contstat").classList.add("bg-orange"); 82 | } else if (data["attrs"]["State"]["Status"] === "paused") { 83 | document.getElementById("contstat").innerText = data["attrs"]["State"]["Status"].toUpperCase(); 84 | document.getElementById("contstat").classList.add("bg-teal"); 85 | } else if (data["attrs"]["State"]["Status"] === "exited") { 86 | document.getElementById("contstat").innerText = data["attrs"]["State"]["Status"].toUpperCase(); 87 | document.getElementById("contstat").classList.add("bg-red"); 88 | } 89 | document.getElementById("contwrap").removeAttribute("hidden"); 90 | } 91 | }); 92 | } 93 | } 94 | 95 | async function refresh_container_process_list_periodically (contiden, rfrstime) { 96 | if (sessionStorage.getItem("vsoniden") !== null) { 97 | while (1) { 98 | await new Promise(r => setTimeout(r, rfrstime * 1000)); 99 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 100 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 101 | await $.getJSON(drivloca + "dishcont", { 102 | "passcode": passcode, 103 | "opername": "HTOP", 104 | "contiden": contiden 105 | }, function (data) { 106 | if (data["retnmesg"] === "deny") { 107 | $("#contntfd").modal("show"); 108 | } else { 109 | document.getElementById("proclist").innerHTML = ""; 110 | for (indx in data["top"]["Processes"]) { 111 | $("#proclist").append( 112 | ` 113 | 114 | ${data["top"]["Processes"][indx][0]} 115 | ${data["top"]["Processes"][indx][1]} 116 | ${data["top"]["Processes"][indx][2]} 117 | ${data["top"]["Processes"][indx][3]} 118 | ${data["top"]["Processes"][indx][4]} 119 | ${data["top"]["Processes"][indx][5]} 120 | ${data["top"]["Processes"][indx][6]} 121 | ${data["top"]["Processes"][indx][7]} 122 | 123 | ` 124 | ); 125 | } 126 | } 127 | }); 128 | } 129 | } 130 | } 131 | 132 | async function container_process_list_operations (contiden) { 133 | let rfrstime = 1; 134 | await authenticate_endpoint_access(); 135 | await populate_container_name_and_status(contiden); 136 | await refresh_container_process_list_periodically(contiden, rfrstime); 137 | } 138 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/contlist.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | async function authenticate_endpoint_access () { 23 | await $.post( 24 | "/credpull/", 25 | {}, 26 | async function (data) { 27 | let retndict = JSON.parse(data) 28 | if (retndict["retnmesg"] === "allow") { 29 | let vsondict = { 30 | "drivloca": retndict["drivloca"], 31 | "sockloca": retndict["sockloca"], 32 | "passcode": retndict["passcode"] 33 | }; 34 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 35 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 36 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 37 | try { 38 | await $.getJSON(drivloca + "testconn", { 39 | "passcode": passcode 40 | }, function (data) { 41 | if (data["retnmesg"] === "allow") { 42 | return true; 43 | } else { 44 | $("#connfail").modal("show"); 45 | return false; 46 | } 47 | }) 48 | } catch (err) { 49 | $("#connfail").modal("show"); 50 | return false; 51 | } 52 | } else { 53 | $("#abstcred").modal("show"); 54 | return false; 55 | } 56 | } 57 | ); 58 | } 59 | 60 | async function initiate_container_attachment (contiden) { 61 | if (sessionStorage.getItem("vsoniden") !== null) { 62 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 63 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 64 | let sockloca = JSON.parse(sessionStorage.getItem("vsoniden"))["sockloca"]; 65 | let atchrqst = sockloca.replace("ws", "http"); 66 | let idenattc = document.getElementById("idenattc").value; 67 | let comdattc = document.getElementById("comdattc").value; 68 | if (idenattc.trim() !== "" && comdattc.trim() !== "") { 69 | await $.getJSON(atchrqst + "atchcons/", { 70 | "contiden": idenattc, 71 | "comdexec": comdattc, 72 | }, function (data) { 73 | if (data["retnmesg"] === "deny") { 74 | $("#connfail").modal("show"); 75 | } else { 76 | document.location.href = "/termpage/" + data["urlpatrn"]; 77 | } 78 | }); 79 | } 80 | } 81 | } 82 | 83 | function open_container_console_attachment_modal (contiden) { 84 | document.getElementById("idenattc").value = contiden; 85 | document.getElementById("comdattc").value = ""; 86 | $("#attcmode").modal("show"); 87 | } 88 | 89 | async function populate_container_list () { 90 | if (sessionStorage.getItem("vsoniden") !== null) { 91 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 92 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 93 | await $.getJSON(drivloca + "dishcont", { 94 | "passcode": passcode, 95 | "opername": "LIST", 96 | }, function (data) { 97 | if (data["retnmesg"] === "deny") { 98 | $("#connfail").modal("show"); 99 | } else { 100 | let contlent = 0; 101 | // Sorting JSON on the basis of key first before populating DOM elements 102 | data = Object.keys(data).sort().reduce( 103 | (obj, key) => { 104 | obj[key] = data[key]; 105 | return obj; 106 | }, {} 107 | ); 108 | for (indx in data) { 109 | $("#contlist").append( 110 | ` 111 |
112 |
113 |
114 | 115 |
116 | ${data[indx]["id"].substring(0,10)} 117 | ${data[indx]["name"]} 118 |
119 |
120 | 139 |
140 |
141 | ` 142 | ) 143 | contlent++; 144 | } 145 | document.getElementById("contnumb").innerText = contlent; 146 | } 147 | }) 148 | } 149 | } 150 | 151 | async function container_list_operations () { 152 | await authenticate_endpoint_access(); 153 | await populate_container_list(); 154 | document.getElementById("contwrap").removeAttribute("hidden"); 155 | } 156 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/contlogs.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | async function authenticate_endpoint_access () { 23 | await $.post( 24 | "/credpull/", 25 | {}, 26 | async function (data) { 27 | let retndict = JSON.parse(data) 28 | if (retndict["retnmesg"] === "allow") { 29 | let vsondict = { 30 | "drivloca": retndict["drivloca"], 31 | "sockloca": retndict["sockloca"], 32 | "passcode": retndict["passcode"] 33 | }; 34 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 35 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 36 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 37 | try { 38 | await $.getJSON(drivloca + "testconn", { 39 | "passcode": passcode 40 | }, function (data) { 41 | if (data["retnmesg"] === "allow") { 42 | return true; 43 | } else { 44 | $("#connfail").modal("show"); 45 | return false; 46 | } 47 | }) 48 | } catch (err) { 49 | $("#connfail").modal("show"); 50 | return false; 51 | } 52 | } else { 53 | $("#abstcred").modal("show"); 54 | return false; 55 | } 56 | } 57 | ); 58 | } 59 | 60 | async function populate_container_logs_periodically (contiden, rfrstime) { 61 | if (sessionStorage.getItem("vsoniden") !== null) { 62 | let ansiconv = new AnsiUp; 63 | while (1) { 64 | await new Promise(r => setTimeout(r, rfrstime * 1000)); 65 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 66 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 67 | await $.getJSON(drivloca + "dishcont", { 68 | "passcode": passcode, 69 | "opername": "LOGS", 70 | "contiden": contiden 71 | }, function (data) { 72 | if (data["retnmesg"] === "deny") { 73 | $("#contntfd").modal("show"); 74 | } else { 75 | if (data["logs"] !== "") { 76 | document.getElementById("logsarea").innerHTML = ansiconv.ansi_to_html(data["logs"]); 77 | document.getElementById("contwrap").removeAttribute("hidden"); 78 | } else { 79 | document.getElementById("logsarea").innerText = "No logs available."; 80 | document.getElementById("contwrap").removeAttribute("hidden"); 81 | } 82 | } 83 | }); 84 | } 85 | } 86 | } 87 | 88 | async function populate_container_name_and_status (contiden) { 89 | if (sessionStorage.getItem("vsoniden") !== null) { 90 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 91 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 92 | await $.getJSON(drivloca + "dishcont", { 93 | "passcode": passcode, 94 | "opername": "IDEN", 95 | "contiden": contiden 96 | }, function (data) { 97 | if (data["retnmesg"] === "deny") { 98 | $("#contntfd").modal("show"); 99 | } else { 100 | document.getElementById("contname").innerText = data["name"].substring(0, 25); 101 | if (data["attrs"]["State"]["Status"] === "running") { 102 | document.getElementById("contstat").innerText = data["attrs"]["State"]["Status"].toUpperCase(); 103 | document.getElementById("contstat").classList.add("bg-success"); 104 | } else if (data["attrs"]["State"]["Status"] === "created") { 105 | document.getElementById("contstat").innerText = data["attrs"]["State"]["Status"].toUpperCase(); 106 | document.getElementById("contstat").classList.add("bg-pink"); 107 | } else if (data["attrs"]["State"]["Status"] === "restarting") { 108 | document.getElementById("contstat").innerText = data["attrs"]["State"]["Status"].toUpperCase(); 109 | document.getElementById("contstat").classList.add("bg-orange"); 110 | } else if (data["attrs"]["State"]["Status"] === "paused") { 111 | document.getElementById("contstat").innerText = data["attrs"]["State"]["Status"].toUpperCase(); 112 | document.getElementById("contstat").classList.add("bg-teal"); 113 | } else if (data["attrs"]["State"]["Status"] === "exited") { 114 | document.getElementById("contstat").innerText = data["attrs"]["State"]["Status"].toUpperCase(); 115 | document.getElementById("contstat").classList.add("bg-red"); 116 | } 117 | } 118 | }); 119 | } 120 | } 121 | 122 | async function container_logging_operations(contiden) { 123 | let rfrstime = 1; 124 | await authenticate_endpoint_access(); 125 | await populate_container_name_and_status(contiden); 126 | await populate_container_logs_periodically(contiden, rfrstime); 127 | } 128 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/dashbard.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | async function populate_container_list() { 23 | if (sessionStorage.getItem("vsoniden") !== null) { 24 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 25 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 26 | await $.getJSON(drivloca + "dishcont", { 27 | "passcode": passcode, 28 | "opername": "LIST", 29 | }, function (data) { 30 | if (data["retnmesg"] === "deny") { 31 | $("#connfail").modal("show"); 32 | } else { 33 | let contlent = 0; 34 | // Sorting JSON on the basis of key first before populating DOM elements 35 | data = Object.keys(data).sort().reduce( 36 | (obj, key) => { 37 | obj[key] = data[key]; 38 | return obj; 39 | }, {} 40 | ); 41 | for (indx in data) { 42 | $("#contlist").append( 43 | ` 44 | 54 | ` 55 | ) 56 | contlent++; 57 | } 58 | document.getElementById("contnumb").innerText = contlent; 59 | } 60 | }) 61 | } 62 | } 63 | 64 | async function populate_image_list() { 65 | if (sessionStorage.getItem("vsoniden") !== null) { 66 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 67 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 68 | await $.getJSON(drivloca + "dishimej", { 69 | "passcode": passcode, 70 | "opername": "LIST", 71 | }, function (data) { 72 | if (data["retnmesg"] === "deny") { 73 | $("#connfail").modal("show"); 74 | } else { 75 | let imejlent = 0; 76 | // Sorting JSON on the basis of key first before populating DOM elements 77 | data = Object.keys(data).sort().reduce( 78 | (obj, key) => { 79 | obj[key] = data[key]; 80 | return obj; 81 | }, {} 82 | ); 83 | for (indx in data) { 84 | $("#imejlist").append( 85 | ` 86 | 96 | ` 97 | ) 98 | imejlent++; 99 | } 100 | document.getElementById("imejnumb").innerText = imejlent; 101 | } 102 | }) 103 | } 104 | } 105 | 106 | async function populate_network_list() { 107 | if (sessionStorage.getItem("vsoniden") !== null) { 108 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 109 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 110 | await $.getJSON(drivloca + "dishntwk", { 111 | "passcode": passcode, 112 | "opername": "LIST", 113 | }, function (data) { 114 | if (data["retnmesg"] === "deny") { 115 | $("#connfail").modal("show"); 116 | } else { 117 | let ntwklent = 0; 118 | // Sorting JSON on the basis of key first before populating DOM elements 119 | data = Object.keys(data).sort().reduce( 120 | (obj, key) => { 121 | obj[key] = data[key]; 122 | return obj; 123 | }, {} 124 | ); 125 | for (indx in data) { 126 | $("#ntwklist").append( 127 | ` 128 | 138 | ` 139 | ) 140 | ntwklent++; 141 | } 142 | document.getElementById("ntwknumb").innerText = ntwklent; 143 | } 144 | }) 145 | } 146 | } 147 | 148 | async function populate_volume_list() { 149 | if (sessionStorage.getItem("vsoniden") !== null) { 150 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 151 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 152 | await $.getJSON(drivloca + "dishvolm", { 153 | "passcode": passcode, 154 | "opername": "LIST", 155 | }, function (data) { 156 | if (data["retnmesg"] === "deny") { 157 | $("#connfail").modal("show"); 158 | } else { 159 | let volmlent = 0; 160 | // Sorting JSON on the basis of key first before populating DOM elements 161 | data = Object.keys(data).sort().reduce( 162 | (obj, key) => { 163 | obj[key] = data[key]; 164 | return obj; 165 | }, {} 166 | ); 167 | for (indx in data) { 168 | $("#volmlist").append( 169 | ` 170 | 180 | ` 181 | ) 182 | volmlent++; 183 | } 184 | document.getElementById("volmnumb").innerText = volmlent; 185 | } 186 | }) 187 | } 188 | } 189 | 190 | async function execute_when_authenticated () { 191 | await populate_container_list(); 192 | await populate_image_list(); 193 | await populate_network_list(); 194 | await populate_volume_list(); 195 | document.getElementById("contwrap").removeAttribute("hidden"); 196 | } 197 | 198 | async function authenticate_endpoint_access () { 199 | await $.post( 200 | "/credpull/", 201 | {}, 202 | async function (data) { 203 | let retndict = JSON.parse(data) 204 | if (retndict["retnmesg"] === "allow") { 205 | let vsondict = { 206 | "drivloca": retndict["drivloca"], 207 | "sockloca": retndict["sockloca"], 208 | "passcode": retndict["passcode"] 209 | }; 210 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 211 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 212 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 213 | try { 214 | await $.getJSON(drivloca + "testconn", { 215 | "passcode": passcode 216 | }, function (data) { 217 | if (data["retnmesg"] === "allow") { 218 | execute_when_authenticated(); 219 | return true; 220 | } else { 221 | $("#connfail").modal("show"); 222 | return false; 223 | } 224 | }) 225 | } catch (err) { 226 | $("#connfail").modal("show"); 227 | return false; 228 | } 229 | } else { 230 | $("#abstcred").modal("show"); 231 | return false; 232 | } 233 | } 234 | ); 235 | } 236 | 237 | async function dashboard_operations() { 238 | await authenticate_endpoint_access(); 239 | } 240 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/globthem.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | function show_theming_modal () { 23 | if (sessionStorage.getItem("colriden") === null) { 24 | $("#abstcred").modal("show"); 25 | return false; 26 | } else { 27 | $("#custmode").modal("show"); 28 | } 29 | } 30 | 31 | function show_toast_notification (icontype, ttletext, conttext) { 32 | $(document).Toasts( 33 | "create", { 34 | title: ttletext, 35 | body: conttext, 36 | autohide: true, 37 | autoremove: true, 38 | icon: icontype, 39 | delay: 2500, 40 | class: "m-2" 41 | } 42 | ); 43 | } 44 | 45 | async function enable_light_mode() { 46 | let colriden = JSON.parse(sessionStorage.getItem("colriden")); 47 | if (colriden["darkmode"] === 1) { 48 | await $.post( 49 | "/lightset/", 50 | { 51 | "darkmode": "STOP" 52 | }, 53 | function (data) { 54 | if (JSON.parse(data)["retnmesg"] === "allow") { 55 | colriden["darkmode"] = 0; 56 | sessionStorage.setItem("colriden", JSON.stringify(colriden)); 57 | show_toast_notification( 58 | "fas fa-check-circle", 59 | "Illuminance applied", 60 | "Please refresh the page to ensure that the changes for light mode take effect" 61 | ); 62 | } else { 63 | colriden["darkmode"] = 0; 64 | sessionStorage.setItem("colriden", JSON.stringify(colriden)); 65 | show_toast_notification( 66 | "fas fa-exclamation-circle", 67 | "Restart your session", 68 | "Illumination was reset to the default mode due to an improper server response" 69 | ); 70 | } 71 | } 72 | ) 73 | } else { 74 | show_toast_notification( 75 | "fas fa-exclamation-circle", 76 | "Illuminance failed", 77 | "Light mode is already active so the changes for it could not be applied again" 78 | ); 79 | } 80 | $("#custmode").modal("hide"); 81 | } 82 | 83 | async function enable_dark_mode() { 84 | let colriden = JSON.parse(sessionStorage.getItem("colriden")); 85 | if (colriden["darkmode"] === 0) { 86 | await $.post( 87 | "/lightset/", 88 | { 89 | "darkmode": "STRT" 90 | }, 91 | function (data) { 92 | if (JSON.parse(data)["retnmesg"] === "allow") { 93 | colriden["darkmode"] = 1; 94 | sessionStorage.setItem("colriden", JSON.stringify(colriden)); 95 | show_toast_notification( 96 | "fas fa-check-circle", 97 | "Illuminance applied", 98 | "Please refresh the page to ensure that the changes for dark mode take effect" 99 | ); 100 | } else { 101 | colriden["darkmode"] = 0; 102 | sessionStorage.setItem("colriden", JSON.stringify(colriden)); 103 | show_toast_notification( 104 | "fas fa-exclamation-circle", 105 | "Restart your session", 106 | "Illumination was reset to the default mode due to an improper server response" 107 | ); 108 | } 109 | } 110 | ) 111 | } else { 112 | show_toast_notification( 113 | "fas fa-exclamation-circle", 114 | "Illuminance failed", 115 | "Dark mode is already active so the changes for it could not be applied again" 116 | ); 117 | } 118 | $("#custmode").modal("hide"); 119 | } 120 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/imejdata.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | async function authenticate_endpoint_access () { 23 | await $.post( 24 | "/credpull/", 25 | {}, 26 | async function (data) { 27 | let retndict = JSON.parse(data) 28 | if (retndict["retnmesg"] === "allow") { 29 | let vsondict = { 30 | "drivloca": retndict["drivloca"], 31 | "sockloca": retndict["sockloca"], 32 | "passcode": retndict["passcode"] 33 | }; 34 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 35 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 36 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 37 | try { 38 | await $.getJSON(drivloca + "testconn", { 39 | "passcode": passcode 40 | }, function (data) { 41 | if (data["retnmesg"] === "allow") { 42 | return true; 43 | } else { 44 | $("#connfail").modal("show"); 45 | return false; 46 | } 47 | }) 48 | } catch (err) { 49 | $("#connfail").modal("show"); 50 | return false; 51 | } 52 | } else { 53 | $("#abstcred").modal("show"); 54 | return false; 55 | } 56 | } 57 | ); 58 | } 59 | 60 | async function populate_image_information (imejiden) { 61 | if (sessionStorage.getItem("vsoniden") !== null) { 62 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 63 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 64 | await $.getJSON(drivloca + "dishimej", { 65 | "passcode": passcode, 66 | "opername": "IDEN", 67 | "imejiden": imejiden 68 | }, function (data) { 69 | if (data["retnmesg"] === "deny") { 70 | $("#connfail").modal("show"); 71 | } else { 72 | // Attributes 73 | if (data["id"] !== "") { 74 | document.getElementById("attriden").innerText = data["id"]; 75 | } 76 | if (data["name"] !== "") { 77 | document.getElementById("attrname").innerText = data["name"]; 78 | } 79 | if (data["attrs"]["Parent"] !== "") { 80 | document.getElementById("attrprnt").innerText = data["attrs"]["Parent"]; 81 | } 82 | if (data["attrs"]["Comment"] !== "") { 83 | document.getElementById("attrcomt").innerText = data["attrs"]["Comment"]; 84 | } 85 | if (data["attrs"]["Created"] !== "") { 86 | document.getElementById("attrcton").innerText = data["attrs"]["Created"]; 87 | } 88 | if (data["attrs"]["Container"] !== "") { 89 | document.getElementById("attrcntr").innerText = data["attrs"]["Container"]; 90 | } 91 | if (data["attrs"]["DockerVersion"] !== "") { 92 | document.getElementById("attrdcvr").innerText = data["attrs"]["DockerVersion"]; 93 | } 94 | if (data["attrs"]["Author"] !== "") { 95 | document.getElementById("attrauth").innerText = data["attrs"]["Author"]; 96 | } 97 | if (data["attrs"]["Architecture"] !== "") { 98 | document.getElementById("attrarch").innerText = data["attrs"]["Architecture"]; 99 | } 100 | if (data["attrs"]["Os"] !== "") { 101 | document.getElementById("attropsy").innerText = data["attrs"]["Os"]; 102 | } 103 | if (data["attrs"]["Size"] !== "") { 104 | document.getElementById("attrsize").innerText = data["attrs"]["Size"] + " bytes"; 105 | } 106 | if (data["attrs"]["VirtualSize"] !== "") { 107 | document.getElementById("attrvrsz").innerText = data["attrs"]["VirtualSize"] + " bytes"; 108 | } 109 | // Container configuration 110 | if (data["attrs"]["Config"]["Hostname"] !== "") { 111 | document.getElementById("cocohost").innerText = data["attrs"]["Config"]["Hostname"]; 112 | } 113 | if (data["attrs"]["Config"]["Domainname"] !== "") { 114 | document.getElementById("cocodonm").innerText = data["attrs"]["Config"]["Domainname"]; 115 | } 116 | if (data["attrs"]["Config"]["User"] !== "") { 117 | document.getElementById("cocouser").innerText = data["attrs"]["Config"]["User"]; 118 | } 119 | if (data["attrs"]["Config"]["AttachStdin"] === true) { 120 | document.getElementById("cocoatin").innerHTML = ""; 121 | } else if (data["attrs"]["Config"]["AttachStdin"] === false) { 122 | document.getElementById("cocoatin").innerHTML = ""; 123 | } 124 | if (data["attrs"]["Config"]["AttachStdout"] === true) { 125 | document.getElementById("cocoatot").innerHTML = ""; 126 | } else if (data["attrs"]["Config"]["AttachStdout"] === false) { 127 | document.getElementById("cocoatot").innerHTML = ""; 128 | } 129 | if (data["attrs"]["Config"]["AttachStderr"] === true) { 130 | document.getElementById("cocoater").innerHTML = ""; 131 | } else if (data["attrs"]["Config"]["AttachStderr"] === false) { 132 | document.getElementById("cocoater").innerHTML = ""; 133 | } 134 | if (data["attrs"]["Config"]["Tty"] === true) { 135 | document.getElementById("cocoatty").innerHTML = ""; 136 | } else if (data["attrs"]["Config"]["Tty"] === false) { 137 | document.getElementById("cocoatty").innerHTML = ""; 138 | } 139 | if (data["attrs"]["Config"]["OpenStdin"] === true) { 140 | document.getElementById("cocoopin").innerHTML = ""; 141 | } else if (data["attrs"]["Config"]["OpenStdin"] === false) { 142 | document.getElementById("cocoopin").innerHTML = ""; 143 | } 144 | if (data["attrs"]["Config"]["StdinOnce"] === true) { 145 | document.getElementById("cocostdo").innerHTML = ""; 146 | } else if (data["attrs"]["Config"]["StdinOnce"] === false) { 147 | document.getElementById("cocostdo").innerHTML = ""; 148 | } 149 | if (data["attrs"]["Config"]["Image"] !== "") { 150 | document.getElementById("cocoimej").innerText = data["attrs"]["Config"]["Image"]; 151 | } 152 | if (data["attrs"]["Config"]["WorkingDir"] !== "") { 153 | document.getElementById("cocowrdr").innerText = data["attrs"]["Config"]["WorkingDir"]; 154 | } 155 | // Graph driver 156 | document.getElementById("grafname").innerText = data["attrs"]["GraphDriver"]["Name"]; 157 | document.getElementById("grafdvid").innerText = data["attrs"]["GraphDriver"]["Data"]["DeviceId"]; 158 | document.getElementById("grafdvnm").innerText = data["attrs"]["GraphDriver"]["Data"]["DeviceName"]; 159 | document.getElementById("grafdvsz").innerText = data["attrs"]["GraphDriver"]["Data"]["DeviceSize"]; 160 | document.getElementById("contwrap").removeAttribute("hidden"); 161 | } 162 | }) 163 | } 164 | } 165 | 166 | async function populate_image_name (imejiden) { 167 | if (sessionStorage.getItem("vsoniden") !== null) { 168 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 169 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 170 | await $.getJSON(drivloca + "dishimej", { 171 | "passcode": passcode, 172 | "opername": "IDEN", 173 | "imejiden": imejiden 174 | }, function (data) { 175 | if (data["retnmesg"] === "deny") { 176 | $("#imejntfd").modal("show"); 177 | } else { 178 | document.getElementById("imejname").innerText = data["name"].substring(0, 25); 179 | } 180 | }); 181 | } 182 | } 183 | 184 | async function image_information_operations(imejiden) { 185 | await authenticate_endpoint_access(); 186 | await populate_image_name(imejiden); 187 | await populate_image_information(imejiden); 188 | } 189 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/imejlist.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | async function authenticate_endpoint_access () { 23 | await $.post( 24 | "/credpull/", 25 | {}, 26 | async function (data) { 27 | let retndict = JSON.parse(data) 28 | if (retndict["retnmesg"] === "allow") { 29 | let vsondict = { 30 | "drivloca": retndict["drivloca"], 31 | "sockloca": retndict["sockloca"], 32 | "passcode": retndict["passcode"] 33 | }; 34 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 35 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 36 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 37 | try { 38 | await $.getJSON(drivloca + "testconn", { 39 | "passcode": passcode 40 | }, function (data) { 41 | if (data["retnmesg"] === "allow") { 42 | return true; 43 | } else { 44 | $("#connfail").modal("show"); 45 | return false; 46 | } 47 | }) 48 | } catch (err) { 49 | $("#connfail").modal("show"); 50 | return false; 51 | } 52 | } else { 53 | $("#abstcred").modal("show"); 54 | return false; 55 | } 56 | } 57 | ); 58 | } 59 | 60 | async function populate_image_list () { 61 | if (sessionStorage.getItem("vsoniden") !== null) { 62 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 63 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 64 | await $.getJSON(drivloca + "dishimej", { 65 | "passcode": passcode, 66 | "opername": "LIST", 67 | }, function (data) { 68 | if (data["retnmesg"] === "deny") { 69 | $("#connfail").modal("show"); 70 | } else { 71 | let imejlent = 0; 72 | // Sorting JSON on the basis of key first before populating DOM elements 73 | data = Object.keys(data).sort().reduce( 74 | (obj, key) => { 75 | obj[key] = data[key]; 76 | return obj; 77 | }, {} 78 | ); 79 | for (indx in data) { 80 | $("#imejlist").append( 81 | ` 82 |
83 |
84 |
85 | 86 |
87 | ${data[indx]["id"].substring(7,17)} 88 | ${data[indx]["name"]} 89 |
90 |
91 | 101 |
102 |
103 | ` 104 | ) 105 | imejlent++; 106 | } 107 | document.getElementById("imejnumb").innerText = imejlent; 108 | } 109 | }) 110 | } 111 | } 112 | 113 | async function image_list_operations () { 114 | await authenticate_endpoint_access(); 115 | await populate_image_list(); 116 | document.getElementById("contwrap").removeAttribute("hidden"); 117 | } 118 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/imejrevs.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | async function authenticate_endpoint_access () { 23 | await $.post( 24 | "/credpull/", 25 | {}, 26 | async function (data) { 27 | let retndict = JSON.parse(data) 28 | if (retndict["retnmesg"] === "allow") { 29 | let vsondict = { 30 | "drivloca": retndict["drivloca"], 31 | "sockloca": retndict["sockloca"], 32 | "passcode": retndict["passcode"] 33 | }; 34 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 35 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 36 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 37 | try { 38 | await $.getJSON(drivloca + "testconn", { 39 | "passcode": passcode 40 | }, function (data) { 41 | if (data["retnmesg"] === "allow") { 42 | return true; 43 | } else { 44 | $("#connfail").modal("show"); 45 | return false; 46 | } 47 | }) 48 | } catch (err) { 49 | $("#connfail").modal("show"); 50 | return false; 51 | } 52 | } else { 53 | $("#abstcred").modal("show"); 54 | return false; 55 | } 56 | } 57 | ); 58 | } 59 | 60 | async function populate_image_revision_list (imejiden) { 61 | if (sessionStorage.getItem("vsoniden") !== null) { 62 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 63 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 64 | await $.getJSON(drivloca + "dishimej", { 65 | "passcode": passcode, 66 | "opername": "REVS", 67 | "imejiden": imejiden 68 | }, function (data) { 69 | if (data["retnmesg"] === "deny") { 70 | $("#imejntfd").modal("show"); 71 | } else { 72 | let revslent = 0; 73 | for (indx in data["history"]) { 74 | let comt = "UNAVAILABLE"; 75 | let cret = "UNAVAILABLE"; 76 | let crby = "UNAVAILABLE"; 77 | let iden = "UNAVAILABLE"; 78 | let imsz = "UNAVAILABLE"; 79 | if (data["history"][indx]["Comment"] !== "") { 80 | comt = data["history"][indx]["Comment"]; 81 | } 82 | if (data["history"][indx]["Created"] !== "") { 83 | cret = data["history"][indx]["Created"]; 84 | } 85 | if (data["history"][indx]["CreatedBy"] !== "") { 86 | crby = data["history"][indx]["CreatedBy"]; 87 | } 88 | if (data["history"][indx]["Id"] !== "" || data["history"][indx]["Id"] !== "") { 89 | iden = data["history"][indx]["Id"]; 90 | } 91 | if (data["history"][indx]["Size"] !== "") { 92 | imsz = data["history"][indx]["Size"]; 93 | } 94 | $("#revslist").append( 95 | ` 96 |
97 |
98 |
99 |

#${parseInt(indx)+1}

100 |
101 |
102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 |
AttributesData
Comment${comt}
Created on${cret}
Created by${crby}
Identity${iden}
Size${imsz} bytes
132 |
133 |
134 |
135 | ` 136 | ) 137 | revslent++; 138 | } 139 | document.getElementById("revsnumb").innerText = revslent; 140 | document.getElementById("contwrap").removeAttribute("hidden"); 141 | } 142 | }) 143 | } 144 | } 145 | 146 | async function populate_image_name (imejiden) { 147 | if (sessionStorage.getItem("vsoniden") !== null) { 148 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 149 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 150 | await $.getJSON(drivloca + "dishimej", { 151 | "passcode": passcode, 152 | "opername": "IDEN", 153 | "imejiden": imejiden 154 | }, function (data) { 155 | if (data["retnmesg"] === "deny") { 156 | $("#imejntfd").modal("show"); 157 | } else { 158 | document.getElementById("imejname").innerText = data["name"].substring(0, 25); 159 | } 160 | }); 161 | } 162 | } 163 | 164 | async function revision_list_operations (imejiden) { 165 | await authenticate_endpoint_access(); 166 | await populate_image_name(imejiden); 167 | await populate_image_revision_list(imejiden); 168 | } 169 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/logepage.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | function hidepass() { 23 | document.getElementById("passcode").type = "password" 24 | document.getElementById("eyeslash").style.display = "none" 25 | document.getElementById("eyeimage").style.display = "block" 26 | } 27 | 28 | function showpass() { 29 | document.getElementById("passcode").type = "text" 30 | document.getElementById("eyeslash").style.display = "block" 31 | document.getElementById("eyeimage").style.display = "none" 32 | } 33 | 34 | function fetchapi() { 35 | let drivloca = document.getElementById("drivloca").value; 36 | let sockloca = document.getElementById("sockloca").value; 37 | let passcode = document.getElementById("passcode").value; 38 | if (drivloca.trim() !== "" && 39 | sockloca.trim() !== "" && 40 | passcode.trim() !== "") { 41 | let credjson = { 42 | "drivloca": drivloca, 43 | "sockloca": sockloca, 44 | "passcode": passcode, 45 | } 46 | sessionStorage.setItem("vsoniden", JSON.stringify(credjson)); 47 | let colrjson = { 48 | "darkmode": 0, 49 | } 50 | sessionStorage.setItem("colriden", JSON.stringify(colrjson)); 51 | } 52 | testconn(); 53 | } 54 | 55 | async function testconn() { 56 | if (sessionStorage.getItem("vsoniden") !== null) { 57 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 58 | let sockloca = JSON.parse(sessionStorage.getItem("vsoniden"))["sockloca"]; 59 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 60 | try { 61 | await $.getJSON(drivloca + "testconn", { 62 | "passcode": passcode 63 | }, async function (data) { 64 | let sockobjc = await new WebSocket(sockloca + "websocket"); 65 | await new Promise(r => setTimeout(r, 1000)); 66 | if (sockobjc.readyState !== 3) { 67 | if (data["retnmesg"] === "allow") { 68 | document.getElementById("inptform").remove(); 69 | document.getElementById("textordr").innerText = "Endpoint authentication complete"; 70 | document.getElementById("versinfo").innerText = "Redirecting to dashboard"; 71 | await $.post( 72 | "/", 73 | { 74 | "drivloca": drivloca, 75 | "sockloca": sockloca, 76 | "passcode": passcode, 77 | "darkmode": 0 78 | }, 79 | function(data) { 80 | if (JSON.parse(data)["retnmesg"] === "allow") { 81 | document.location.href = "/dashbord/"; 82 | } 83 | } 84 | ); 85 | } else { 86 | $("#connfail").modal("show"); 87 | } 88 | } else { 89 | $("#connfail").modal("show"); 90 | } 91 | }); 92 | } catch (err) { 93 | $("#connfail").modal("show"); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/mtrclist.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | async function authenticate_endpoint_access () { 23 | await $.post( 24 | "/credpull/", 25 | {}, 26 | async function (data) { 27 | let retndict = JSON.parse(data) 28 | if (retndict["retnmesg"] === "allow") { 29 | let vsondict = { 30 | "drivloca": retndict["drivloca"], 31 | "sockloca": retndict["sockloca"], 32 | "passcode": retndict["passcode"] 33 | }; 34 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 35 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 36 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 37 | try { 38 | await $.getJSON(drivloca + "testconn", { 39 | "passcode": passcode 40 | }, function (data) { 41 | if (data["retnmesg"] === "allow") { 42 | return true; 43 | } else { 44 | $("#connfail").modal("show"); 45 | return false; 46 | } 47 | }) 48 | } catch (err) { 49 | $("#connfail").modal("show"); 50 | return false; 51 | } 52 | } else { 53 | $("#abstcred").modal("show"); 54 | return false; 55 | } 56 | } 57 | ); 58 | } 59 | 60 | async function initiate_metric_list_fetching (rfrstime) { 61 | if (sessionStorage.getItem("vsoniden") !== null) { 62 | await new Promise(r => setTimeout(r, rfrstime * 1000)); 63 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 64 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 65 | await $.getJSON(drivloca + "mtrcrecv", { 66 | "passcode": passcode, 67 | "opername": "LIST", 68 | }, function (data) { 69 | if (data["retnmesg"] === "deny") { 70 | $("#connfail").modal("show"); 71 | } else { 72 | let timecrnt = new Date(); 73 | document.getElementById("rfrsfreq").innerText = data["duration"] + " seconds"; 74 | document.getElementById("rtnsqant").innerText = data["mtrclist"].length + "/" + data["recsqant"] + " records"; 75 | document.getElementById("lastupdt").innerText = timecrnt.toString(); 76 | let mtrclist = data["mtrclist"].sort().reverse(); 77 | for (let indx = 0; indx < mtrclist.length; indx ++) { 78 | let mtrctime = new Date(mtrclist[indx] * 1000); 79 | $("#mtrclist").append( 80 | ` 81 | 82 | ${mtrclist[indx]} 83 | ${mtrctime.toString()} 84 | 85 | ` 86 | ); 87 | } 88 | document.getElementById("contwrap").removeAttribute("hidden"); 89 | } 90 | }); 91 | } 92 | } 93 | 94 | async function metric_listing_operations () { 95 | let rfrstime = 1; 96 | await authenticate_endpoint_access(); 97 | await initiate_metric_list_fetching(rfrstime); 98 | } 99 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/ntwkdata.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | 23 | async function authenticate_endpoint_access () { 24 | await $.post( 25 | "/credpull/", 26 | {}, 27 | async function (data) { 28 | let retndict = JSON.parse(data) 29 | if (retndict["retnmesg"] === "allow") { 30 | let vsondict = { 31 | "drivloca": retndict["drivloca"], 32 | "sockloca": retndict["sockloca"], 33 | "passcode": retndict["passcode"] 34 | }; 35 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 36 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 37 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 38 | try { 39 | await $.getJSON(drivloca + "testconn", { 40 | "passcode": passcode 41 | }, function (data) { 42 | if (data["retnmesg"] === "allow") { 43 | return true; 44 | } else { 45 | $("#connfail").modal("show"); 46 | return false; 47 | } 48 | }) 49 | } catch (err) { 50 | $("#connfail").modal("show"); 51 | return false; 52 | } 53 | } else { 54 | $("#abstcred").modal("show"); 55 | return false; 56 | } 57 | } 58 | ); 59 | } 60 | 61 | async function populate_network_information (ntwkiden) { 62 | if (sessionStorage.getItem("vsoniden") !== null) { 63 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 64 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 65 | await $.getJSON(drivloca + "dishntwk", { 66 | "passcode": passcode, 67 | "opername": "IDEN", 68 | "ntwkiden": ntwkiden 69 | }, function (data) { 70 | if (data["retnmesg"] === "deny") { 71 | $("#ntwkntfd").modal("show"); 72 | } else { 73 | // Attributes 74 | document.getElementById("ntwkname").innerText = data["name"].substring(0, 25); 75 | document.getElementById("attriden").innerText = data["name"]; 76 | document.getElementById("attrmkdt").innerText = data["attrs"]["Created"]; 77 | document.getElementById("attrscop").innerText = data["attrs"]["Scope"]; 78 | document.getElementById("attrdrvr").innerText = data["attrs"]["Driver"]; 79 | if (data["attrs"]["EnableIPv6"] === true) { 80 | document.getElementById("attripv6").innerHTML = ""; 81 | } else if (data["attrs"]["EnableIPv6"] === false) { 82 | document.getElementById("attripv6").innerHTML = ""; 83 | } 84 | if (data["attrs"]["Internal"] === true) { 85 | document.getElementById("attrintl").innerHTML = ""; 86 | } else if (data["attrs"]["Internal"] === false) { 87 | document.getElementById("attrintl").innerHTML = ""; 88 | } 89 | if (data["attrs"]["Attachable"] === true) { 90 | document.getElementById("attratbl").innerHTML = ""; 91 | } else if (data["attrs"]["Attachable"] === false) { 92 | document.getElementById("attratbl").innerHTML = ""; 93 | } 94 | if (data["attrs"]["Ingress"] === true) { 95 | document.getElementById("attrings").innerHTML = ""; 96 | } else if (data["attrs"]["Ingress"] === false) { 97 | document.getElementById("attrings").innerHTML = ""; 98 | } 99 | if (data["attrs"]["ConfigOnly"] === true) { 100 | document.getElementById("attrcfol").innerHTML = ""; 101 | } else if (data["attrs"]["ConfigOnly"] === false) { 102 | document.getElementById("attrcfol").innerHTML = ""; 103 | } 104 | // Containers 105 | for (indx in data["attrs"]["Containers"]) { 106 | $("#ntcnlist").append( 107 | ` 108 |
109 |
110 |

${data["attrs"]["Containers"][indx]["Name"]}

111 |
112 |
113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 |
AttributesData
Identity${indx}
Endpoint ID${data["attrs"]["Containers"][indx]["EndpointID"]}
MAC address${data["attrs"]["Containers"][indx]["MacAddress"]}
IPv4 address${data["attrs"]["Containers"][indx]["IPv4Address"]}
IPv6 address${data["attrs"]["Containers"][indx]["IPv6Address"]}
143 |
144 |
145 | ` 146 | ); 147 | } 148 | // Additional settings 149 | for (indx in data["attrs"]["Options"]) { 150 | $("#ntwkadcf").append( 151 | ` 152 | 153 | ${indx} 154 | ${data["attrs"]["Options"][indx]} 155 | 156 | ` 157 | ); 158 | } 159 | document.getElementById("contwrap").removeAttribute("hidden"); 160 | } 161 | }) 162 | } 163 | } 164 | 165 | async function network_information_operations (ntwkiden) { 166 | await authenticate_endpoint_access(); 167 | await populate_network_information(ntwkiden); 168 | } 169 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/ntwklist.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | async function authenticate_endpoint_access () { 23 | await $.post( 24 | "/credpull/", 25 | {}, 26 | async function (data) { 27 | let retndict = JSON.parse(data) 28 | if (retndict["retnmesg"] === "allow") { 29 | let vsondict = { 30 | "drivloca": retndict["drivloca"], 31 | "sockloca": retndict["sockloca"], 32 | "passcode": retndict["passcode"] 33 | }; 34 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 35 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 36 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 37 | try { 38 | await $.getJSON(drivloca + "testconn", { 39 | "passcode": passcode 40 | }, function (data) { 41 | if (data["retnmesg"] === "allow") { 42 | return true; 43 | } else { 44 | $("#connfail").modal("show"); 45 | return false; 46 | } 47 | }) 48 | } catch (err) { 49 | $("#connfail").modal("show"); 50 | return false; 51 | } 52 | } else { 53 | $("#abstcred").modal("show"); 54 | return false; 55 | } 56 | } 57 | ); 58 | } 59 | 60 | async function populate_network_list () { 61 | if (sessionStorage.getItem("vsoniden") !== null) { 62 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 63 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 64 | await $.getJSON(drivloca + "dishntwk", { 65 | "passcode": passcode, 66 | "opername": "LIST", 67 | }, function (data) { 68 | if (data["retnmesg"] === "deny") { 69 | $("#connfail").modal("show"); 70 | } else { 71 | let ntwklent = 0; 72 | // Sorting JSON on the basis of key first before populating DOM elements 73 | data = Object.keys(data).sort().reduce( 74 | (obj, key) => { 75 | obj[key] = data[key]; 76 | return obj; 77 | }, {} 78 | ); 79 | for (indx in data) { 80 | $("#ntwklist").append( 81 | ` 82 |
83 | 84 | 85 |
86 | ${data[indx]["id"].substring(0,10)} 87 | ${data[indx]["name"]} 88 |
89 |
90 |
91 | ` 92 | ) 93 | ntwklent++; 94 | } 95 | document.getElementById("ntwknumb").innerText = ntwklent; 96 | } 97 | }) 98 | } 99 | } 100 | 101 | async function network_list_operations () { 102 | await authenticate_endpoint_access(); 103 | await populate_network_list(); 104 | document.getElementById("contwrap").removeAttribute("hidden"); 105 | } 106 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/termpage.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | function make_terminal(element, size, ws_url, contiden) { 23 | var ws = new WebSocket(ws_url); 24 | var term = new Terminal({ 25 | cols: size.cols, 26 | rows: size.rows, 27 | screenKeys: true, 28 | useStyle: true 29 | }); 30 | ws.onopen = function(event) { 31 | ws.send(JSON.stringify(["set_size", size.rows, size.cols, window.innerHeight, window.innerWidth])); 32 | term.on('data', function (data) { 33 | ws.send(JSON.stringify(['stdin', data])); 34 | }); 35 | term.on('title', function (title) { 36 | document.title = title; 37 | }); 38 | term.open(element); 39 | term.write("\u001b[33m\u001b[1m" + "SuperVisor Web Console" + "\u001b[0m\u001b[0m" + 40 | "\r\n" + 41 | "\u001b[32m" + "Please press BACK button to return to SUPERVISOR" + "\u001b[0m" + 42 | "\r\n\r\n" 43 | ); 44 | if (contiden.length === 64) { 45 | if (contiden === "0000000000000000000000000000000000000000000000000000000000000000") { 46 | term.write( 47 | "\u001b[31m\u001b[1m" + 48 | "[SYSTEM CONSOLE]" + 49 | "\u001b[0m\u001b[0m" + 50 | "\r\n\r\n" 51 | ); 52 | } else { 53 | term.write( 54 | "\u001b[36m\u001b[1m" + 55 | "[CONTAINER CONSOLE]" + 56 | "\u001b[0m\u001b[0m" + 57 | "\r\n\r\n" 58 | ); 59 | } 60 | } 61 | ws.onmessage = function(event) { 62 | json_msg = JSON.parse(event.data); 63 | switch(json_msg[0]) { 64 | case "stdout": 65 | term.write(json_msg[1]); 66 | break; 67 | case "disconnect": 68 | term.write("\r\n" + 69 | "\u001b[33m\u001b[1m" + 70 | "CONSOLE EXITED" + 71 | "\u001b[0m\u001b[0m" + 72 | "\r\n" + 73 | "\u001b[32m" + 74 | "Please press BACK button to return to SUPERVISOR" + 75 | "\u001b[0m" + 76 | "\r\n" 77 | ); 78 | break; 79 | } 80 | }; 81 | }; 82 | return { 83 | socket: ws, 84 | term: term 85 | }; 86 | } 87 | 88 | async function generate_system_console (contiden) { 89 | var term_rows_high = 0.0 + 1.02 * document.getElementById("dummy-screen").offsetHeight / 40; 90 | var term_cols_wide = 0.0 + 1.02 * document.getElementById("dummy-screen-rows").offsetWidth / 89; 91 | document.getElementById("dummy-screen").setAttribute("style", "display: none"); 92 | var protocol = (window.location.protocol.indexOf("https") === 0) ? "wss" : "ws"; 93 | let wbscloca = "" 94 | if (contiden === "0000000000000000000000000000000000000000000000000000000000000000") { 95 | wbscloca = JSON.parse(sessionStorage.getItem("vsoniden"))["sockloca"] + "websocket"; 96 | } else { 97 | wbscloca = JSON.parse(sessionStorage.getItem("vsoniden"))["sockloca"] + contiden; 98 | } 99 | function calculate_size(element) { 100 | var rows = Math.max(2, Math.floor(element.innerHeight / term_rows_high) - 1); 101 | var cols = Math.max(3, Math.floor(element.innerWidth / term_cols_wide) - 1); 102 | console.log("resize:", term_rows_high, term_cols_wide, element.innerHeight, element.innerWidth, rows, cols); 103 | return { 104 | rows: rows, 105 | cols: cols 106 | }; 107 | } 108 | size = calculate_size(window); 109 | let testobjc = new WebSocket(wbscloca); 110 | await new Promise(r => setTimeout(r, 1000)); 111 | if (testobjc.readyState !== 3) { 112 | var terminal = make_terminal(document.body, size, wbscloca, contiden); 113 | window.onresize = function () { 114 | var geometry = calculate_size(window); 115 | terminal.term.resize(geometry.cols, geometry.rows); 116 | terminal.socket.send( 117 | JSON.stringify(["set_size", geometry.rows, geometry.cols, window.innerHeight, window.innerWidth]) 118 | ); 119 | }; 120 | } else { 121 | $("#edptntfd").modal("show"); 122 | } 123 | } 124 | 125 | async function authenticate_endpoint_access (contiden) { 126 | await $.post( 127 | "/credpull/", 128 | {}, 129 | async function (data) { 130 | let retndict = JSON.parse(data) 131 | if (retndict["retnmesg"] === "allow") { 132 | let vsondict = { 133 | "drivloca": retndict["drivloca"], 134 | "sockloca": retndict["sockloca"], 135 | "passcode": retndict["passcode"] 136 | }; 137 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 138 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 139 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 140 | try { 141 | await $.getJSON(drivloca + "testconn", { 142 | "passcode": passcode 143 | }, function (data) { 144 | if (data["retnmesg"] === "allow") { 145 | generate_system_console(contiden); 146 | return true; 147 | } else { 148 | $("#connfail").modal("show"); 149 | return false; 150 | } 151 | }) 152 | } catch (err) { 153 | $("#connfail").modal("show"); 154 | return false; 155 | } 156 | } else { 157 | $("#abstcred").modal("show"); 158 | return false; 159 | } 160 | } 161 | ); 162 | } 163 | 164 | async function system_console_operations (contiden) { 165 | if (contiden.length === 64) { 166 | await authenticate_endpoint_access(contiden); 167 | } else { 168 | document.location.href = "/e404/"; 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/volmdata.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | async function authenticate_endpoint_access () { 23 | await $.post( 24 | "/credpull/", 25 | {}, 26 | async function (data) { 27 | let retndict = JSON.parse(data) 28 | if (retndict["retnmesg"] === "allow") { 29 | let vsondict = { 30 | "drivloca": retndict["drivloca"], 31 | "sockloca": retndict["sockloca"], 32 | "passcode": retndict["passcode"] 33 | }; 34 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 35 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 36 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 37 | try { 38 | await $.getJSON(drivloca + "testconn", { 39 | "passcode": passcode 40 | }, function (data) { 41 | if (data["retnmesg"] === "allow") { 42 | return true; 43 | } else { 44 | $("#connfail").modal("show"); 45 | return false; 46 | } 47 | }) 48 | } catch (err) { 49 | $("#connfail").modal("show"); 50 | return false; 51 | } 52 | } else { 53 | $("#abstcred").modal("show"); 54 | return false; 55 | } 56 | } 57 | ); 58 | } 59 | 60 | async function populate_volume_information (volmiden) { 61 | if (sessionStorage.getItem("vsoniden") !== null) { 62 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 63 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 64 | await $.getJSON(drivloca + "dishvolm", { 65 | "passcode": passcode, 66 | "opername": "IDEN", 67 | "volmiden": volmiden 68 | }, function (data) { 69 | if (data["retnmesg"] === "deny") { 70 | $("#volmntfd").modal("show"); 71 | } else { 72 | document.getElementById("volmname").innerText = data["name"].substring(0, 25); 73 | document.getElementById("attriden").innerText = data["name"]; 74 | document.getElementById("attrmkdt").innerText = data["attrs"]["CreatedAt"]; 75 | document.getElementById("attrdrvr").innerText = data["attrs"]["Driver"]; 76 | document.getElementById("attrmtpt").innerText = data["attrs"]["Mountpoint"]; 77 | document.getElementById("attrscop").innerText = data["attrs"]["Scope"]; 78 | document.getElementById("contwrap").removeAttribute("hidden"); 79 | } 80 | }) 81 | } 82 | } 83 | 84 | async function volume_information_operations (volmiden) { 85 | await authenticate_endpoint_access(); 86 | await populate_volume_information(volmiden); 87 | } 88 | -------------------------------------------------------------------------------- /src/svfrontend/static/jscn/volmlist.js: -------------------------------------------------------------------------------- 1 | /* 2 | ########################################################################## 3 | * 4 | * Copyright © 2019-2021 Akashdeep Dhar 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | * 19 | ########################################################################## 20 | */ 21 | 22 | async function authenticate_endpoint_access () { 23 | await $.post( 24 | "/credpull/", 25 | {}, 26 | async function (data) { 27 | let retndict = JSON.parse(data) 28 | if (retndict["retnmesg"] === "allow") { 29 | let vsondict = { 30 | "drivloca": retndict["drivloca"], 31 | "sockloca": retndict["sockloca"], 32 | "passcode": retndict["passcode"] 33 | }; 34 | sessionStorage.setItem("vsoniden", JSON.stringify(vsondict)); 35 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 36 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 37 | try { 38 | await $.getJSON(drivloca + "testconn", { 39 | "passcode": passcode 40 | }, function (data) { 41 | if (data["retnmesg"] === "allow") { 42 | return true; 43 | } else { 44 | $("#connfail").modal("show"); 45 | return false; 46 | } 47 | }) 48 | } catch (err) { 49 | $("#connfail").modal("show"); 50 | return false; 51 | } 52 | } else { 53 | $("#abstcred").modal("show"); 54 | return false; 55 | } 56 | } 57 | ); 58 | } 59 | 60 | async function populate_volume_list () { 61 | if (sessionStorage.getItem("vsoniden") !== null) { 62 | let drivloca = JSON.parse(sessionStorage.getItem("vsoniden"))["drivloca"]; 63 | let passcode = JSON.parse(sessionStorage.getItem("vsoniden"))["passcode"]; 64 | await $.getJSON(drivloca + "dishvolm", { 65 | "passcode": passcode, 66 | "opername": "LIST", 67 | }, function (data) { 68 | if (data["retnmesg"] === "deny") { 69 | $("#connfail").modal("show"); 70 | } else { 71 | let volmlent = 0; 72 | // Sorting JSON on the basis of key first before populating DOM elements 73 | data = Object.keys(data).sort().reduce( 74 | (obj, key) => { 75 | obj[key] = data[key]; 76 | return obj; 77 | }, {} 78 | ); 79 | for (indx in data) { 80 | $("#volmlist").append( 81 | ` 82 |
83 | 84 | 85 |
86 | ${data[indx]["id"].substring(0,10)} 87 | ${data[indx]["name"]} 88 |
89 |
90 |
91 | ` 92 | ) 93 | volmlent++; 94 | } 95 | document.getElementById("volmnumb").innerText = volmlent; 96 | } 97 | }) 98 | } 99 | } 100 | 101 | async function volume_list_operations () { 102 | await authenticate_endpoint_access(); 103 | await populate_volume_list(); 104 | document.getElementById("contwrap").removeAttribute("hidden"); 105 | } 106 | -------------------------------------------------------------------------------- /src/svfrontend/templates/conthtop.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {% extends "frameset.html" %} 23 | {% block onldscpt %} 24 | container_process_list_operations('{{ contiden }}'); 25 | {% endblock %} 26 | {% block headelem %} 27 |

UNAVAILABLE

28 | UNAVAILABLE 29 | {% endblock %} 30 | {% block bdcumbls %} 31 | 32 | 33 | 34 | {% endblock %} 35 | {% block contwrap %} 36 |
37 |
38 |
39 |
40 |

Processes

41 |
42 |
43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 |
UIDPIDPPIDCSTIMETTYTIMECMD
59 |
60 |
61 |
62 |
63 | {% endblock %} 64 | {% block extramod %} 65 | 89 | {% endblock %} 90 | {% block pagejsas %} 91 | 92 | {% endblock %} 93 | -------------------------------------------------------------------------------- /src/svfrontend/templates/contlist.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {% extends "frameset.html" %} 23 | {% block onldscpt %} 24 | container_list_operations(); 25 | {% endblock %} 26 | {% block headelem %} 27 |

Containers

28 | {% endblock %} 29 | {% block bdcumbls %} 30 | 31 | {% endblock %} 32 | {% block contwrap %} 33 |
34 |

0 container(s) found.

35 | {% endblock %} 36 | {% block extramod %} 37 | 74 | {% endblock %} 75 | {% block pagejsas %} 76 | 77 | {% endblock %} 78 | -------------------------------------------------------------------------------- /src/svfrontend/templates/contlogs.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {% extends "frameset.html" %} 23 | {% block onldscpt %} 24 | container_logging_operations('{{ contiden }}'); 25 | {% endblock %} 26 | {% block headelem %} 27 |

UNAVAILABLE

28 | UNAVAILABLE 29 | {% endblock %} 30 | {% block bdcumbls %} 31 | 32 | 33 | 34 | {% endblock %} 35 | {% block contwrap %} 36 |
37 | 38 |
39 | Is the theming messed up here? 40 |
41 |

42 | The log output is supposed to have a white background even when dark theme is employed as the logs make use 43 | of ANSI-UP 44 | JavaScript library to render all ANSI sequences like they are shown in the terminal but we are yet to find 45 | how they can be overridden to accommodate custom CSS additions to them. Please feel free to contribute to the 46 | project in 47 | this issue 48 | if you seem to have an idea of how it can be implemented. 49 |

50 |
51 |
52 |
53 |
54 |
55 |

Logs

56 |
57 |
58 |

59 |                 
60 |
61 |
62 |
63 | {% endblock %} 64 | {% block extramod %} 65 | 84 | {% endblock %} 85 | {% block pagejsas %} 86 | 87 | 88 | {% endblock %} 89 | -------------------------------------------------------------------------------- /src/svfrontend/templates/dashbard.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {% extends "frameset.html" %} 23 | {% block onldscpt %} 24 | dashboard_operations(); 25 | {% endblock %} 26 | {% block headelem %} 27 |

Welcome to SuperVisor!

28 | {% endblock %} 29 | {% block bdcumbls %} 30 | 31 | {% endblock %} 32 | {% block contwrap %} 33 |
34 |
35 |
36 | 37 |
38 | Containers 39 | 0 40 |
41 |
42 |
43 | 47 |
48 |
49 |
50 |
51 | 52 |
53 | Images 54 | 0 55 |
56 |
57 |
58 | 62 |
63 |
64 |
65 |
66 | 67 |
68 | Volumes 69 | 0 70 |
71 |
72 |
73 | 77 |
78 |
79 |
80 |
81 | 82 |
83 | Networks 84 | 0 85 |
86 |
87 |
88 | 92 |
93 |
94 |
95 | {% endblock %} 96 | {% block pagejsas %} 97 | 98 | {% endblock %} 99 | -------------------------------------------------------------------------------- /src/svfrontend/templates/dockstat.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {% extends "frameset.html" %} 23 | {% block onldscpt %} 24 | docker_statistics_operations(); 25 | {% endblock %} 26 | {% block headelem %} 27 |

Docker station

28 | {% endblock %} 29 | {% block bdcumbls %} 30 | 31 | {% endblock %} 32 | {% block contwrap %} 33 |
34 | 35 |
36 | Server ID 37 | UNAVAILABLE 38 |
39 |
40 |
41 |
42 |
43 | 44 |
45 | Docker 46 | Information 47 |
48 |
49 |
50 |
51 |

Driver status

52 |
53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
AttributesData
64 |
65 |
66 |
67 |
68 |

Driver features

69 |
70 |
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 |
#Specifications
81 |
82 |
83 |
84 |
85 |

Driver specifications

86 |
87 |
88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 |
AttributesData
98 |
99 |
100 |
101 |
102 |

Warnings

103 |
104 |
105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 |
Notifications
114 |
115 |
116 |
117 |
118 |
119 | 120 |
121 | Docker 122 | Version 123 |
124 |
125 |
126 |
127 |

Driver revision

128 |
129 |
130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 |
AttributesData
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 | 153 |
154 |
155 |
156 |
157 | 161 |
162 |
163 |
164 | {% endblock %} 165 | {% block pagejsas %} 166 | 167 | {% endblock %} 168 | -------------------------------------------------------------------------------- /src/svfrontend/templates/e403page.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | SuperVisor {{ frntvers }} 28 | 29 | 30 | 31 | 32 | 33 | 51 | 52 |
53 |
54 |

55 |

403

56 |
57 |

Access denied

58 |

59 | The resource you are trying to access requires you to login using valid credentials. Please try again after entering correct credentials. 60 |

61 |
62 |
63 | 64 | 65 |
66 |

SuperVisor {{ frntvers }}

67 |
68 |
69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/svfrontend/templates/e404page.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | SuperVisor {{ frntvers }} 28 | 29 | 30 | 31 | 32 | 33 | 51 | 52 |
53 |
54 |

55 |

404

56 |
57 |

Resource not found

58 |

59 | We could not find the resource you were looking for. Meanwhile, you may either return to dashboard or go back to the page where you came from. 60 |

61 |
62 |
63 | 64 | 65 |
66 |

SuperVisor {{ frntvers }}

67 |
68 |
69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/svfrontend/templates/e500page.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | SuperVisor {{ frntvers }} 28 | 29 | 30 | 31 | 32 | 33 | 51 | 52 |
53 |
54 |

55 |

500

56 |
57 |

Internal server error

58 |

59 | An inexplicable error occured at the server end, which you would get to know more about if you check out the logs. 60 |

61 |
62 |
63 | 64 | 65 |
66 |

SuperVisor {{ frntvers }}

67 |
68 |
69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/svfrontend/templates/imejlist.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {% extends "frameset.html" %} 23 | {% block onldscpt %} 24 | image_list_operations(); 25 | {% endblock %} 26 | {% block headelem %} 27 |

Images

28 | {% endblock %} 29 | {% block bdcumbls %} 30 | 31 | {% endblock %} 32 | {% block contwrap %} 33 |
34 |

0 image(s) found.

35 | {% endblock %} 36 | {% block pagejsas %} 37 | 38 | {% endblock %} 39 | -------------------------------------------------------------------------------- /src/svfrontend/templates/imejrevs.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {% extends "frameset.html" %} 23 | {% block onldscpt %} 24 | revision_list_operations('{{ imejiden }}'); 25 | {% endblock %} 26 | {% block headelem %} 27 |

UNAVAILABLE

28 | {% endblock %} 29 | {% block bdcumbls %} 30 | 31 | 32 | 33 | {% endblock %} 34 | {% block contwrap %} 35 |
36 |
37 |

0 revision(s) found.

38 | {% endblock %} 39 | {% block extramod %} 40 | 59 | {% endblock %} 60 | {% block pagejsas %} 61 | 62 | {% endblock %} 63 | -------------------------------------------------------------------------------- /src/svfrontend/templates/logepage.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | SuperVisor {{ frntvers }} 28 | 29 | 30 | 31 | 32 | 33 | 44 | 45 | 87 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /src/svfrontend/templates/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "pagelist": { 3 | "logepage.html": "This is the login page where the users would get to choose their active sync endpoint and passcode for it.", 4 | "dashbord.html": "This is the page which shows the number and list of containers, images, networks and volumes.", 5 | "proclist.html": "This is the page especially for listing processes on the host device and handling them.", 6 | "systdata.html": "This is the page especially for monitoring devices on the host device and handling them", 7 | "dockstat.html": "This is the page which shows the info() and version() information of the Docker client.", 8 | "contlist.html": "This is the page which lists all the containers.", 9 | "continfo.html": "This is the page which shows static information about a given container.", 10 | "conthtop.html": "This is the page which shows top() information about a given container.", 11 | "contstat.html": "This is the page which shows stats() information about a given container.", 12 | "contlogs.html": "This is the page which shows logs() information about a given container.", 13 | "imejlist.html": "This is the page which lists all the images.", 14 | "imejinfo.html": "This is the page which shows static information about a given image.", 15 | "imejrevs.html": "This is the page which shows history() information about a given image.", 16 | "ntwklist.html": "This is the page which lists all the networks.", 17 | "ntwkinfo.html": "This is the page which shows static information about a given network.", 18 | "volmlist.html": "This is the page which lists all the volumes.", 19 | "volminfo.html": "This is the page which shows static information about a given volume." 20 | } 21 | } -------------------------------------------------------------------------------- /src/svfrontend/templates/mtrclist.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {% extends "frameset.html" %} 23 | {% block onldscpt %} 24 | metric_listing_operations(); 25 | {% endblock %} 26 | {% block headelem %} 27 |

Metrics

28 | {% endblock %} 29 | {% block bdcumbls %} 30 | 31 | {% endblock %} 32 | {% block contwrap %} 33 |
34 | 35 |
36 | How are metrics managed? 37 |
38 |

39 | Metrics provide a way for passive statistics monitoring of a container station to address the cases when 40 | information about the station is required in a situation or time when active monitoring cannot be possible. 41 | The performance readings are stored every after the frequency period until the record retention limit is 42 | reached and then once that happens, the older records are moved out in favour of the newer records. Please 43 | note that the records are retained from the event of booting of the container station and once rebooted, 44 | the records from the last uptime would be lost. The default parameters for metrics gathering allow for 45 | storing records every after 10 seconds for a retention limit of 2160 records - providing total coverage of 46 | 6 hours. These parameters can be easily changed when setting up the driver service. 47 |

48 |
49 |
50 | 51 |
52 | Last updated 53 | UNAVAILABLE 54 |
55 |
56 |
57 |
58 |
59 | 60 |
61 | Passive monitoring 62 | Metrics 63 |
64 |
65 |
66 | 67 |
68 | Frequency 69 | UNAVAILABLE 70 |
71 |
72 |
73 | 74 |
75 | Retention 76 | UNAVAILABLE 77 |
78 |
79 |
80 |
81 |
82 |
83 |

Record listing

84 |
85 |
86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 |
MIDData
96 |
97 |
98 |
99 |
100 | {% endblock %} 101 | {% block pagejsas %} 102 | 103 | {% endblock %} 104 | -------------------------------------------------------------------------------- /src/svfrontend/templates/ntwkinfo.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {% extends "frameset.html" %} 23 | {% block onldscpt %} 24 | network_information_operations('{{ ntwkiden }}'); 25 | {% endblock %} 26 | {% block headelem %} 27 |

UNAVAILABLE

28 | {% endblock %} 29 | {% block bdcumbls %} 30 | 31 | 32 | {% endblock %} 33 | {% block contwrap %} 34 |
35 |
36 |
37 | 38 |
39 | Information 40 | Preliminary 41 |
42 |
43 |
44 |
45 |
46 |
47 |

Network attributes

48 |
49 |
50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 |
AttributesData
IdentityUNAVAILABLE
Created atUNAVAILABLE
ScopeUNAVAILABLE
DriverUNAVAILABLE
Enable IPv6?UNAVAILABLE
Internal?UNAVAILABLE
Attachable?UNAVAILABLE
Ingress?UNAVAILABLE
Config only?UNAVAILABLE
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 | 104 |
105 | Additional 106 | Options 107 |
108 |
109 |
110 |
111 |
112 |
113 |

Configurations

114 |
115 |
116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 |
AttributesData
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 | 134 |
135 | Active 136 | Containers 137 |
138 |
139 |
140 |
141 |
142 |
143 | {% endblock %} 144 | {% block extramod %} 145 | 164 | {% endblock %} 165 | {% block pagejsas %} 166 | 167 | {% endblock %} 168 | -------------------------------------------------------------------------------- /src/svfrontend/templates/ntwklist.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {% extends "frameset.html" %} 23 | {% block onldscpt %} 24 | network_list_operations(); 25 | {% endblock %} 26 | {% block headelem %} 27 |

Networks

28 | {% endblock %} 29 | {% block bdcumbls %} 30 | 31 | {% endblock %} 32 | {% block contwrap %} 33 |
34 |

0 network(s) found.

35 | {% endblock %} 36 | {% block pagejsas %} 37 | 38 | {% endblock %} 39 | -------------------------------------------------------------------------------- /src/svfrontend/templates/termpage.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | SuperVisor {{ frntvers }} 37 | 38 | 39 | 40 | 41 | 42 | 53 | 54 | 83 | 84 | 85 | 86 | 87 | 88 | 107 | 126 | 145 | 146 | -------------------------------------------------------------------------------- /src/svfrontend/templates/volminfo.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {% extends "frameset.html" %} 23 | {% block onldscpt %} 24 | volume_information_operations('{{ volmiden }}'); 25 | {% endblock %} 26 | {% block headelem %} 27 |

UNAVAILABLE

28 | {% endblock %} 29 | {% block bdcumbls %} 30 | 31 | 32 | {% endblock %} 33 | {% block contwrap %} 34 |
35 |
36 |
37 |
38 |

Volume attributes

39 |
40 |
41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
AttributesData
IdentityUNAVAILABLE
Created atUNAVAILABLE
DriverUNAVAILABLE
Mount pointUNAVAILABLE
ScopeUNAVAILABLE
71 |
72 |
73 |
74 |
75 | {% endblock %} 76 | {% block extramod %} 77 | 96 | {% endblock %} 97 | {% block pagejsas %} 98 | 99 | {% endblock %} 100 | -------------------------------------------------------------------------------- /src/svfrontend/templates/volmlist.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | {% extends "frameset.html" %} 23 | {% block onldscpt %} 24 | volume_list_operations(); 25 | {% endblock %} 26 | {% block headelem %} 27 |

Volumes

28 | {% endblock %} 29 | {% block bdcumbls %} 30 | 31 | {% endblock %} 32 | {% block contwrap %} 33 |
34 |

0 volume(s) found.

35 | {% endblock %} 36 | {% block pagejsas %} 37 | 38 | {% endblock %} 39 | -------------------------------------------------------------------------------- /svfrontend.spec: -------------------------------------------------------------------------------- 1 | %global srcname supervisor-frontend-service 2 | 3 | Name: svfrontend 4 | Version: 1.2.0b 5 | Release: 1%{?dist} 6 | Summary: SuperVisor Frontend Service 7 | 8 | License: GPLv3+ 9 | URL: http://github.com/t0xic0der/%{srcname} 10 | Source0: https://github.com/t0xic0der/%{srcname}/releases/download/v1.2.0-beta/%{name}-%{version}.tar.gz 11 | 12 | BuildArch: noarch 13 | 14 | BuildRequires: python3-devel 15 | BuildRequires: python3-setuptools 16 | 17 | %description 18 | Reference frontend service for SuperVisor written in Flask 19 | 20 | %prep 21 | %autosetup 22 | 23 | %build 24 | %py3_build 25 | 26 | %install 27 | %py3_install 28 | 29 | %files 30 | %license LICENSE 31 | %doc README.md 32 | %{_bindir}/%{name} 33 | %{python3_sitelib}/%{name}-*.egg-info/ 34 | %{python3_sitelib}/%{name}/ 35 | 36 | %changelog 37 | * Sun Apr 11 2021 Akashdeep Dhar 38 | - v1.2.0b packaged release 39 | * Fri Dec 18 2020 Akashdeep Dhar 40 | - Initial packaged release 41 | --------------------------------------------------------------------------------