Browse Source

Merge pull request #3 from daveplsno/devel

updates
master
daveplsno GitHub 2 months ago
parent
commit
482a2612f0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
55 changed files with 1068 additions and 1049 deletions
  1. +6
    -13
      .gitignore
  2. +19
    -0
      grafana/docker-compose.yml
  3. +0
    -0
      pinger_backend/.envexample
  4. +0
    -0
      pinger_backend/Dockerfile
  5. +0
    -0
      pinger_backend/data/api/__init__.py
  6. +0
    -0
      pinger_backend/data/api/admin.py
  7. +0
    -0
      pinger_backend/data/api/apps.py
  8. +0
    -0
      pinger_backend/data/api/models.py
  9. +0
    -0
      pinger_backend/data/api/serializers.py
  10. +0
    -0
      pinger_backend/data/api/tests.py
  11. +0
    -0
      pinger_backend/data/api/urls.py
  12. +0
    -0
      pinger_backend/data/api/views.py
  13. +0
    -0
      pinger_backend/data/collector/__init__.py
  14. +0
    -0
      pinger_backend/data/collector/admin.py
  15. +0
    -0
      pinger_backend/data/collector/apps.py
  16. +0
    -0
      pinger_backend/data/collector/models.py
  17. +0
    -0
      pinger_backend/data/collector/serializers.py
  18. +0
    -0
      pinger_backend/data/collector/tests.py
  19. +0
    -0
      pinger_backend/data/collector/views.py
  20. +0
    -0
      pinger_backend/data/manage.py
  21. +0
    -0
      pinger_backend/data/pinger_server/.envexample
  22. +0
    -0
      pinger_backend/data/pinger_server/__init__.py
  23. +0
    -0
      pinger_backend/data/pinger_server/asgi.py
  24. +0
    -0
      pinger_backend/data/pinger_server/settings.py
  25. +0
    -0
      pinger_backend/data/pinger_server/urls.py
  26. +0
    -0
      pinger_backend/data/pinger_server/wsgi.py
  27. +14
    -11
      pinger_backend/docker-compose.yml
  28. +2
    -1
      pinger_backend/requirements.txt
  29. +0
    -0
      pinger_frontend/.dockerignore
  30. +0
    -0
      pinger_frontend/Dockerfile
  31. +0
    -0
      pinger_frontend/data/pong/.gitignore
  32. +0
    -0
      pinger_frontend/data/pong/README.md
  33. +85
    -0
      pinger_frontend/data/pong/package-lock.json
  34. +3
    -0
      pinger_frontend/data/pong/package.json
  35. +0
    -0
      pinger_frontend/data/pong/public/favicon.ico
  36. +0
    -0
      pinger_frontend/data/pong/public/index.html
  37. +0
    -0
      pinger_frontend/data/pong/public/logo192.png
  38. +0
    -0
      pinger_frontend/data/pong/public/logo512.png
  39. +0
    -0
      pinger_frontend/data/pong/public/manifest.json
  40. +0
    -0
      pinger_frontend/data/pong/public/robots.txt
  41. +0
    -0
      pinger_frontend/data/pong/src/App.css
  42. +1
    -1
      pinger_frontend/data/pong/src/App.js
  43. +0
    -0
      pinger_frontend/data/pong/src/App.test.js
  44. +0
    -0
      pinger_frontend/data/pong/src/index.css
  45. +0
    -0
      pinger_frontend/data/pong/src/index.js
  46. +0
    -0
      pinger_frontend/data/pong/src/logo.svg
  47. +0
    -0
      pinger_frontend/data/pong/src/serviceWorker.js
  48. +0
    -0
      pinger_frontend/data/pong/src/setupTests.js
  49. +44
    -0
      pinger_frontend/data/pong/src/test.js
  50. +890
    -929
      pinger_frontend/data/pong/yarn.lock
  51. +4
    -4
      pinger_frontend/docker-compose.yml
  52. +0
    -73
      pinger_server/data/collector/migrations/0001_initial.py
  53. +0
    -17
      pinger_server/data/collector/migrations/0002_auto_20200418_2231.py
  54. +0
    -0
      pinger_server/data/collector/migrations/__init__.py
  55. +0
    -0
      pinger_server/data/pinger_server/__init__.py

+ 6
- 13
.gitignore View File

@@ -1,22 +1,15 @@
.env/
.vscode/
pinger_client/.env
pinger_server/.env
pinger_server/data/pinger_server/.env
pinger_server/db/*
pinger_backend/.env
pinger_backend/data/pinger_server/.env
pinger_backend/db/*
tests and or rubbish bin/*

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
pinger_server/data/api/migrations/0001_initial.py
pinger_server/data/api/migrations/0002_auto_20200425_1256.py
pinger_server/data/api/migrations/0003_auto_20200425_1302.py
pinger_server/data/api/migrations/0004_auto_20200425_1305.py
pinger_server/data/api/migrations/0005_auto_20200425_1328.py
pinger_server/data/api/migrations/0006_auto_20200425_1400.py
pinger_server/data/api/migrations/0007_auto_20200425_1415.py
pinger_server/data/api/migrations/0008_auto_20200425_1417.py
pinger_server/data/collector/migrations/0003_auto_20200509_1155.py
pinger_server/data/collector/migrations/0004_auto_20200509_1204.py
pinger_backend/data/api/migrations/*
pinger_backend/data/collector/migrations/*
grafana/data/grafana.db

+ 19
- 0
grafana/docker-compose.yml View File

@@ -0,0 +1,19 @@
version: "3.8"

services:

grafana:
restart: always
container_name: grafana
image: grafana/grafana:latest
volumes:
- ./data:/var/lib/grafana
ports:
- "3001:3000"
user: "1000"
networks:
- pinger_backend

networks:
pinger_backend:
name: pinger_backend

pinger_server/.envexample → pinger_backend/.envexample View File


pinger_server/Dockerfile → pinger_backend/Dockerfile View File


pinger_server/data/api/__init__.py → pinger_backend/data/api/__init__.py View File


pinger_server/data/api/admin.py → pinger_backend/data/api/admin.py View File


pinger_server/data/api/apps.py → pinger_backend/data/api/apps.py View File


pinger_server/data/api/models.py → pinger_backend/data/api/models.py View File


pinger_server/data/api/serializers.py → pinger_backend/data/api/serializers.py View File


pinger_server/data/api/tests.py → pinger_backend/data/api/tests.py View File


pinger_server/data/api/urls.py → pinger_backend/data/api/urls.py View File


pinger_server/data/api/views.py → pinger_backend/data/api/views.py View File


pinger_server/data/api/migrations/__init__.py → pinger_backend/data/collector/__init__.py View File


pinger_server/data/collector/admin.py → pinger_backend/data/collector/admin.py View File


pinger_server/data/collector/apps.py → pinger_backend/data/collector/apps.py View File


pinger_server/data/collector/models.py → pinger_backend/data/collector/models.py View File


pinger_server/data/collector/serializers.py → pinger_backend/data/collector/serializers.py View File


pinger_server/data/collector/tests.py → pinger_backend/data/collector/tests.py View File


pinger_server/data/collector/views.py → pinger_backend/data/collector/views.py View File


pinger_server/data/manage.py → pinger_backend/data/manage.py View File


pinger_server/data/pinger_server/.envexample → pinger_backend/data/pinger_server/.envexample View File


pinger_server/data/collector/__init__.py → pinger_backend/data/pinger_server/__init__.py View File


pinger_server/data/pinger_server/asgi.py → pinger_backend/data/pinger_server/asgi.py View File


pinger_server/data/pinger_server/settings.py → pinger_backend/data/pinger_server/settings.py View File


pinger_server/data/pinger_server/urls.py → pinger_backend/data/pinger_server/urls.py View File


pinger_server/data/pinger_server/wsgi.py → pinger_backend/data/pinger_server/wsgi.py View File


pinger_server/docker-compose.yml → pinger_backend/docker-compose.yml View File

@@ -1,4 +1,4 @@
version: "3"
version: "3.8"

services:
db:
@@ -12,12 +12,16 @@ services:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes:
- ./db:/var/lib/mysql
networks:
- pinger_backend
adminer:
image: adminer
restart: always
container_name: adminer
ports:
- 8085:8080
networks:
- pinger_backend
pinger_server:
restart: always
container_name: pinger_server
@@ -30,13 +34,12 @@ services:
- "10000:10000"
depends_on:
- db
grafana:
restart: always
container_name: grafana
image: grafana/grafana:latest
volumes:
- ../grafana/data:/data
ports:
- "3001:3000"
depends_on:
- db
networks:
- pinger_frontend
- pinger_backend

networks:
pinger_frontend:
name: pinger_frontend
pinger_backend:
name: pinger_backend

pinger_server/requirements.txt → pinger_backend/requirements.txt View File

@@ -2,4 +2,5 @@ Django==3.0.5
djangorestframework==3.11.0
mysqlclient==1.4.6
python-dotenv==0.13.0
djoser==2.0.3
djoser==2.0.3
django-cors-headers==3.2.1

ponger/.dockerignore → pinger_frontend/.dockerignore View File


ponger/Dockerfile → pinger_frontend/Dockerfile View File


ponger/data/pong/.gitignore → pinger_frontend/data/pong/.gitignore View File


ponger/data/pong/README.md → pinger_frontend/data/pong/README.md View File


ponger/data/pong/package-lock.json → pinger_frontend/data/pong/package-lock.json View File

@@ -2151,6 +2151,19 @@
"normalize-path": "^2.1.1"
}
},
"apexcharts": {
"version": "3.19.0",
"resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.19.0.tgz",
"integrity": "sha512-fzupCGVDvOoU6kEzguLAfgRgrlHynHM5fnkkyCL85tYf9U8bw1hCijs4A+kWXurC/SNytJrArBc21kA/2wuHYg==",
"requires": {
"svg.draggable.js": "^2.2.2",
"svg.easing.js": "^2.0.0",
"svg.filter.js": "^2.0.2",
"svg.pathmorphing.js": "^0.1.3",
"svg.resize.js": "^1.4.3",
"svg.select.js": "^3.0.1"
}
},
"aproba": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
@@ -10821,6 +10834,14 @@
"prop-types": "^15.6.2"
}
},
"react-apexcharts": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/react-apexcharts/-/react-apexcharts-1.3.7.tgz",
"integrity": "sha512-2OFhEHd70/WHN0kmrJtVx37UfaL71ZogVkwezmDqwQWgwhK6upuhlnEEX7tEq4xvjA+RFDn6hiUTNIuC/Q7Zqw==",
"requires": {
"prop-types": "^15.5.7"
}
},
"react-app-polyfill": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/react-app-polyfill/-/react-app-polyfill-1.0.6.tgz",
@@ -12676,6 +12697,70 @@
"resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz",
"integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ=="
},
"svg.draggable.js": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/svg.draggable.js/-/svg.draggable.js-2.2.2.tgz",
"integrity": "sha512-JzNHBc2fLQMzYCZ90KZHN2ohXL0BQJGQimK1kGk6AvSeibuKcIdDX9Kr0dT9+UJ5O8nYA0RB839Lhvk4CY4MZw==",
"requires": {
"svg.js": "^2.0.1"
}
},
"svg.easing.js": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/svg.easing.js/-/svg.easing.js-2.0.0.tgz",
"integrity": "sha1-iqmUawqOJ4V6XEChDrpAkeVpHxI=",
"requires": {
"svg.js": ">=2.3.x"
}
},
"svg.filter.js": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/svg.filter.js/-/svg.filter.js-2.0.2.tgz",
"integrity": "sha1-kQCOFROJ3ZIwd5/L5uLJo2LRwgM=",
"requires": {
"svg.js": "^2.2.5"
}
},
"svg.js": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/svg.js/-/svg.js-2.7.1.tgz",
"integrity": "sha512-ycbxpizEQktk3FYvn/8BH+6/EuWXg7ZpQREJvgacqn46gIddG24tNNe4Son6omdXCnSOaApnpZw6MPCBA1dODA=="
},
"svg.pathmorphing.js": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/svg.pathmorphing.js/-/svg.pathmorphing.js-0.1.3.tgz",
"integrity": "sha512-49HWI9X4XQR/JG1qXkSDV8xViuTLIWm/B/7YuQELV5KMOPtXjiwH4XPJvr/ghEDibmLQ9Oc22dpWpG0vUDDNww==",
"requires": {
"svg.js": "^2.4.0"
}
},
"svg.resize.js": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/svg.resize.js/-/svg.resize.js-1.4.3.tgz",
"integrity": "sha512-9k5sXJuPKp+mVzXNvxz7U0uC9oVMQrrf7cFsETznzUDDm0x8+77dtZkWdMfRlmbkEEYvUn9btKuZ3n41oNA+uw==",
"requires": {
"svg.js": "^2.6.5",
"svg.select.js": "^2.1.2"
},
"dependencies": {
"svg.select.js": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/svg.select.js/-/svg.select.js-2.1.2.tgz",
"integrity": "sha512-tH6ABEyJsAOVAhwcCjF8mw4crjXSI1aa7j2VQR8ZuJ37H2MBUbyeqYr5nEO7sSN3cy9AR9DUwNg0t/962HlDbQ==",
"requires": {
"svg.js": "^2.2.5"
}
}
}
},
"svg.select.js": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/svg.select.js/-/svg.select.js-3.0.1.tgz",
"integrity": "sha512-h5IS/hKkuVCbKSieR9uQCj9w+zLHoPh+ce19bBYyqF53g6mnPB8sAtIbe1s9dh2S2fCmYX2xel1Ln3PJBbK4kw==",
"requires": {
"svg.js": "^2.6.5"
}
},
"svgo": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/svgo/-/svgo-1.3.2.tgz",

ponger/data/pong/package.json → pinger_frontend/data/pong/package.json View File

@@ -6,7 +6,10 @@
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"apexcharts": "^3.19.0",
"axios": "^0.19.2",
"react": "^16.13.1",
"react-apexcharts": "^1.3.7",
"react-dom": "^16.13.1",
"react-scripts": "3.2.0"
},

ponger/data/pong/public/favicon.ico → pinger_frontend/data/pong/public/favicon.ico View File


ponger/data/pong/public/index.html → pinger_frontend/data/pong/public/index.html View File


ponger/data/pong/public/logo192.png → pinger_frontend/data/pong/public/logo192.png View File


ponger/data/pong/public/logo512.png → pinger_frontend/data/pong/public/logo512.png View File


ponger/data/pong/public/manifest.json → pinger_frontend/data/pong/public/manifest.json View File


ponger/data/pong/public/robots.txt → pinger_frontend/data/pong/public/robots.txt View File


ponger/data/pong/src/App.css → pinger_frontend/data/pong/src/App.css View File


ponger/data/pong/src/App.js → pinger_frontend/data/pong/src/App.js View File

@@ -6,7 +6,7 @@ function App() {
<div className="App">
<header className="App-header">
<p>
Hello.
Hello, W.
</p>
</header>
</div>

ponger/data/pong/src/App.test.js → pinger_frontend/data/pong/src/App.test.js View File


ponger/data/pong/src/index.css → pinger_frontend/data/pong/src/index.css View File


ponger/data/pong/src/index.js → pinger_frontend/data/pong/src/index.js View File


ponger/data/pong/src/logo.svg → pinger_frontend/data/pong/src/logo.svg View File


ponger/data/pong/src/serviceWorker.js → pinger_frontend/data/pong/src/serviceWorker.js View File


ponger/data/pong/src/setupTests.js → pinger_frontend/data/pong/src/setupTests.js View File


+ 44
- 0
pinger_frontend/data/pong/src/test.js View File

@@ -0,0 +1,44 @@
import React, { Component } from "react";
import Chart from "react-apexcharts";

class App extends Component {
constructor(props) {
super(props);

this.state = {
options: {
chart: {
id: "basic-bar"
},
xaxis: {
categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999]
}
},
series: [
{
name: "series-1",
data: [30, 40, 45, 50, 49, 60, 70, 91]
}
]
};
}

render() {
return (
<div className="app">
<div className="row">
<div className="mixed-chart">
<Chart
options={this.state.options}
series={this.state.series}
type="bar"
width="500"
/>
</div>
</div>
</div>
);
}
}

export default App;

pinger_frontend/data/pong/yarn.lock
File diff suppressed because it is too large
View File


ponger/docker-compose.yml → pinger_frontend/docker-compose.yml View File

@@ -1,9 +1,9 @@
version: "3.5"
version: "3.8"

services:
pong:
pinger_frontend:
restart: always
container_name: pong
container_name: pinger_frontend
image: node:lts-slim
#build: .
working_dir: /app/pong
@@ -12,5 +12,5 @@ services:
- ./data:/app
ports:
- "3000:3000"
- "5000:5000"
#- "5000:5000"
stdin_open: true

+ 0
- 73
pinger_server/data/collector/migrations/0001_initial.py View File

@@ -1,73 +0,0 @@
# Generated by Django 3.0.5 on 2020-04-18 12:29

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='dns_results',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('target', models.CharField(blank=True, max_length=255)),
('ttl_time', models.CharField(blank=True, max_length=255)),
('protocol', models.CharField(blank=True, max_length=255)),
('state', models.CharField(blank=True, max_length=255)),
('last_state', models.CharField(blank=True, max_length=255)),
('created_date', models.DateTimeField(auto_now_add=True)),
('modified_date', models.DateTimeField(auto_now=True)),
],
options={
'verbose_name_plural': 'dns_results',
},
),
migrations.CreateModel(
name='icmp_results',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255)),
('address', models.CharField(blank=True, max_length=255)),
('icmp_size', models.IntegerField(default=0, null=True)),
('icmp_interval', models.IntegerField(default=0, null=True)),
('icmp_count', models.IntegerField(default=0, null=True)),
('created', models.DateTimeField(default=django.utils.timezone.now)),
('rtt_avg', models.CharField(max_length=255, null=True)),
('rtt_max', models.CharField(max_length=255, null=True)),
('rtt_min', models.CharField(max_length=255, null=True)),
('packetloss', models.IntegerField(default=0)),
('received', models.IntegerField(default=0)),
('transmitted', models.IntegerField(default=0)),
('success', models.BooleanField(default=False)),
('results', models.CharField(max_length=1000, null=True)),
('username', models.CharField(max_length=255, null=True)),
],
options={
'verbose_name_plural': 'icmp_results',
},
),
migrations.CreateModel(
name='targets',
fields=[
('name', models.CharField(max_length=255, primary_key=True, serialize=False)),
('icmp', models.BooleanField(default=False)),
('dns', models.BooleanField(default=False)),
('created', models.DateTimeField(default=django.utils.timezone.now)),
('modified', models.DateTimeField(default=django.utils.timezone.now)),
('address', models.CharField(max_length=255, null=True)),
('icmp_size', models.IntegerField(default=500, null=True)),
('icmp_interval', models.IntegerField(default=1, null=True)),
('icmp_count', models.IntegerField(default=5, null=True)),
],
options={
'verbose_name_plural': ('targets',),
},
),
]

+ 0
- 17
pinger_server/data/collector/migrations/0002_auto_20200418_2231.py View File

@@ -1,17 +0,0 @@
# Generated by Django 3.0.5 on 2020-04-18 12:31

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('collector', '0001_initial'),
]

operations = [
migrations.AlterModelOptions(
name='targets',
options={'verbose_name_plural': 'targets'},
),
]

+ 0
- 0
pinger_server/data/collector/migrations/__init__.py View File


+ 0
- 0
pinger_server/data/pinger_server/__init__.py View File


Loading…
Cancel
Save