diff --git a/netauto/__init__.py b/netauto/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/netauto/__pycache__/__init__.cpython-38.pyc b/netauto/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index 9f7584c..0000000 Binary files a/netauto/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/netauto/__pycache__/admin.cpython-38.pyc b/netauto/__pycache__/admin.cpython-38.pyc deleted file mode 100644 index 75430fc..0000000 Binary files a/netauto/__pycache__/admin.cpython-38.pyc and /dev/null differ diff --git a/netauto/__pycache__/apps.cpython-38.pyc b/netauto/__pycache__/apps.cpython-38.pyc deleted file mode 100644 index 6ac95cc..0000000 Binary files a/netauto/__pycache__/apps.cpython-38.pyc and /dev/null differ diff --git a/netauto/__pycache__/forms.cpython-38.pyc b/netauto/__pycache__/forms.cpython-38.pyc deleted file mode 100644 index 4fb99ea..0000000 Binary files a/netauto/__pycache__/forms.cpython-38.pyc and /dev/null differ diff --git a/netauto/__pycache__/models.cpython-38.pyc b/netauto/__pycache__/models.cpython-38.pyc deleted file mode 100644 index dbd292a..0000000 Binary files a/netauto/__pycache__/models.cpython-38.pyc and /dev/null differ diff --git a/netauto/__pycache__/sendcom.cpython-38.pyc b/netauto/__pycache__/sendcom.cpython-38.pyc deleted file mode 100644 index 79fdc3b..0000000 Binary files a/netauto/__pycache__/sendcom.cpython-38.pyc and /dev/null differ diff --git a/netauto/__pycache__/urls.cpython-38.pyc b/netauto/__pycache__/urls.cpython-38.pyc deleted file mode 100644 index 6fb79fc..0000000 Binary files a/netauto/__pycache__/urls.cpython-38.pyc and /dev/null differ diff --git a/netauto/__pycache__/views.cpython-38.pyc b/netauto/__pycache__/views.cpython-38.pyc deleted file mode 100644 index 16f841e..0000000 Binary files a/netauto/__pycache__/views.cpython-38.pyc and /dev/null differ diff --git a/netauto/admin.py b/netauto/admin.py deleted file mode 100644 index 367ecfb..0000000 --- a/netauto/admin.py +++ /dev/null @@ -1,14 +0,0 @@ -from django.contrib import admin -from .models import Contohmodel, Routerm, Automation - -# Register your models here. -class Contohadmin(admin.ModelAdmin): - list_display = ['nama','pub_date'] - search_fields = ['nama'] - list_per_page = 4 - -admin.site.register(Contohmodel, Contohadmin ) - -admin.site.register(Routerm) - -admin.site.register(Automation) \ No newline at end of file diff --git a/netauto/apps.py b/netauto/apps.py deleted file mode 100644 index 518b016..0000000 --- a/netauto/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class NetautoConfig(AppConfig): - name = 'netauto' diff --git a/netauto/forms.py b/netauto/forms.py deleted file mode 100644 index fb0f979..0000000 --- a/netauto/forms.py +++ /dev/null @@ -1,31 +0,0 @@ -from django.forms import ModelForm -from .models import Contohmodel, Routerm,Manualcommand -from django import forms - -class Formcontoh(ModelForm): - - class Meta: - model = Contohmodel - fields = '__all__' - -class RoutermForm(ModelForm): - - class Meta: - model = Routerm - fields = '__all__' - widgets = { - 'nama' : forms.TextInput({'class':'form-control','placeholder':'masukan nama untuk router'}), - 'host' : forms.TextInput({'class':'form-control','placeholder':'alamat host router | contoh: 192.168.1.1'}), - 'user' : forms.TextInput({'class':'form-control','placeholder':'masukan username router'}), - 'password' : forms.TextInput({'class':'form-control','placeholder':'masukan pasword router'}), - 'kecepatan_internet' : forms.TextInput({'class':'form-control','placeholder':'dalam kilobyte'}), - } - -class Manualform(ModelForm): - - class Meta: - model = Manualcommand - fields = ['host', 'command'] - widgets = { - 'host' : forms.Select({'class':'form-control'}) - } diff --git a/netauto/migrations/0001_initial.py b/netauto/migrations/0001_initial.py deleted file mode 100644 index c7698f1..0000000 --- a/netauto/migrations/0001_initial.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 2.2.17 on 2020-11-22 15:16 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='Contohmodel', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('nama', models.CharField(max_length=50)), - ('desk', models.TextField()), - ('value', models.IntegerField()), - ], - ), - ] diff --git a/netauto/migrations/0002_contohmodel_pub_date.py b/netauto/migrations/0002_contohmodel_pub_date.py deleted file mode 100644 index cb0828a..0000000 --- a/netauto/migrations/0002_contohmodel_pub_date.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.17 on 2020-11-22 15:26 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('netauto', '0001_initial'), - ] - - operations = [ - migrations.AddField( - model_name='contohmodel', - name='pub_date', - field=models.DateField(auto_now=True, null=True), - ), - ] diff --git a/netauto/migrations/0003_routerm.py b/netauto/migrations/0003_routerm.py deleted file mode 100644 index 91a34c8..0000000 --- a/netauto/migrations/0003_routerm.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.2.17 on 2021-01-07 07:09 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('netauto', '0002_contohmodel_pub_date'), - ] - - operations = [ - migrations.CreateModel( - name='Routerm', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('nama', models.CharField(max_length=50)), - ('host', models.CharField(max_length=50)), - ('user', models.CharField(max_length=30)), - ('password', models.CharField(max_length=50)), - ('pub_date', models.DateField(auto_now=True)), - ], - ), - ] diff --git a/netauto/migrations/0004_auto_20210109_1542.py b/netauto/migrations/0004_auto_20210109_1542.py deleted file mode 100644 index a2255f8..0000000 --- a/netauto/migrations/0004_auto_20210109_1542.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.17 on 2021-01-09 08:42 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('netauto', '0003_routerm'), - ] - - operations = [ - migrations.AlterField( - model_name='routerm', - name='password', - field=models.CharField(max_length=50, null=True), - ), - ] diff --git a/netauto/migrations/0005_auto_20210109_1548.py b/netauto/migrations/0005_auto_20210109_1548.py deleted file mode 100644 index e1c57d2..0000000 --- a/netauto/migrations/0005_auto_20210109_1548.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.17 on 2021-01-09 08:48 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('netauto', '0004_auto_20210109_1542'), - ] - - operations = [ - migrations.AlterField( - model_name='routerm', - name='password', - field=models.CharField(blank=True, max_length=50), - ), - ] diff --git a/netauto/migrations/0006_automation_confrouter.py b/netauto/migrations/0006_automation_confrouter.py deleted file mode 100644 index 1a17662..0000000 --- a/netauto/migrations/0006_automation_confrouter.py +++ /dev/null @@ -1,29 +0,0 @@ -# Generated by Django 2.2.17 on 2021-01-17 14:26 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('netauto', '0005_auto_20210109_1548'), - ] - - operations = [ - migrations.CreateModel( - name='Automation', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('nama', models.CharField(max_length=50)), - ('deskripsi', models.TextField()), - ], - ), - migrations.CreateModel( - name='Confrouter', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('nama', models.CharField(max_length=50)), - ('deskripsi', models.CharField(max_length=50)), - ], - ), - ] diff --git a/netauto/migrations/0007_automation_status.py b/netauto/migrations/0007_automation_status.py deleted file mode 100644 index c57b4a2..0000000 --- a/netauto/migrations/0007_automation_status.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.17 on 2021-01-22 07:32 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('netauto', '0006_automation_confrouter'), - ] - - operations = [ - migrations.AddField( - model_name='automation', - name='status', - field=models.CharField(max_length=15, null=True), - ), - ] diff --git a/netauto/migrations/0008_auto_20210122_0734.py b/netauto/migrations/0008_auto_20210122_0734.py deleted file mode 100644 index 835b263..0000000 --- a/netauto/migrations/0008_auto_20210122_0734.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.2.17 on 2021-01-22 07:34 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('netauto', '0007_automation_status'), - ] - - operations = [ - migrations.AlterField( - model_name='automation', - name='status', - field=models.CharField(blank=True, max_length=15), - ), - ] diff --git a/netauto/migrations/0009_routerm_kecepatan_internet.py b/netauto/migrations/0009_routerm_kecepatan_internet.py deleted file mode 100644 index eb3c6eb..0000000 --- a/netauto/migrations/0009_routerm_kecepatan_internet.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2.17 on 2021-01-25 02:28 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('netauto', '0008_auto_20210122_0734'), - ] - - operations = [ - migrations.AddField( - model_name='routerm', - name='kecepatan_internet', - field=models.IntegerField(blank=True, default=10), - preserve_default=False, - ), - ] diff --git a/netauto/migrations/0010_manualcommand.py b/netauto/migrations/0010_manualcommand.py deleted file mode 100644 index 5bcf6e8..0000000 --- a/netauto/migrations/0010_manualcommand.py +++ /dev/null @@ -1,24 +0,0 @@ -# Generated by Django 2.2.17 on 2021-01-30 04:22 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('netauto', '0009_routerm_kecepatan_internet'), - ] - - operations = [ - migrations.CreateModel( - name='Manualcommand', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('command', models.CharField(max_length=50)), - ('output', models.TextField(blank=True)), - ('time', models.DateTimeField(auto_now=True)), - ('host', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='netauto.Automation')), - ], - ), - ] diff --git a/netauto/migrations/0011_auto_20210130_1123.py b/netauto/migrations/0011_auto_20210130_1123.py deleted file mode 100644 index 0f02097..0000000 --- a/netauto/migrations/0011_auto_20210130_1123.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.2.17 on 2021-01-30 04:23 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('netauto', '0010_manualcommand'), - ] - - operations = [ - migrations.AlterField( - model_name='manualcommand', - name='host', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='netauto.Routerm'), - ), - ] diff --git a/netauto/migrations/__init__.py b/netauto/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/netauto/migrations/__pycache__/0001_initial.cpython-38.pyc b/netauto/migrations/__pycache__/0001_initial.cpython-38.pyc deleted file mode 100644 index 7d3dfbc..0000000 Binary files a/netauto/migrations/__pycache__/0001_initial.cpython-38.pyc and /dev/null differ diff --git a/netauto/migrations/__pycache__/0002_contohmodel_pub_date.cpython-38.pyc b/netauto/migrations/__pycache__/0002_contohmodel_pub_date.cpython-38.pyc deleted file mode 100644 index eefc868..0000000 Binary files a/netauto/migrations/__pycache__/0002_contohmodel_pub_date.cpython-38.pyc and /dev/null differ diff --git a/netauto/migrations/__pycache__/0003_routerm.cpython-38.pyc b/netauto/migrations/__pycache__/0003_routerm.cpython-38.pyc deleted file mode 100644 index 78e0353..0000000 Binary files a/netauto/migrations/__pycache__/0003_routerm.cpython-38.pyc and /dev/null differ diff --git a/netauto/migrations/__pycache__/0004_auto_20210109_1542.cpython-38.pyc b/netauto/migrations/__pycache__/0004_auto_20210109_1542.cpython-38.pyc deleted file mode 100644 index 7cfc281..0000000 Binary files a/netauto/migrations/__pycache__/0004_auto_20210109_1542.cpython-38.pyc and /dev/null differ diff --git a/netauto/migrations/__pycache__/0005_auto_20210109_1548.cpython-38.pyc b/netauto/migrations/__pycache__/0005_auto_20210109_1548.cpython-38.pyc deleted file mode 100644 index 074767c..0000000 Binary files a/netauto/migrations/__pycache__/0005_auto_20210109_1548.cpython-38.pyc and /dev/null differ diff --git a/netauto/migrations/__pycache__/0006_automation_confrouter.cpython-38.pyc b/netauto/migrations/__pycache__/0006_automation_confrouter.cpython-38.pyc deleted file mode 100644 index 081f32e..0000000 Binary files a/netauto/migrations/__pycache__/0006_automation_confrouter.cpython-38.pyc and /dev/null differ diff --git a/netauto/migrations/__pycache__/0007_automation_status.cpython-38.pyc b/netauto/migrations/__pycache__/0007_automation_status.cpython-38.pyc deleted file mode 100644 index 986e46e..0000000 Binary files a/netauto/migrations/__pycache__/0007_automation_status.cpython-38.pyc and /dev/null differ diff --git a/netauto/migrations/__pycache__/0008_auto_20210122_0734.cpython-38.pyc b/netauto/migrations/__pycache__/0008_auto_20210122_0734.cpython-38.pyc deleted file mode 100644 index 6632fba..0000000 Binary files a/netauto/migrations/__pycache__/0008_auto_20210122_0734.cpython-38.pyc and /dev/null differ diff --git a/netauto/migrations/__pycache__/0009_routerm_kecepatan_internet.cpython-38.pyc b/netauto/migrations/__pycache__/0009_routerm_kecepatan_internet.cpython-38.pyc deleted file mode 100644 index aa93d52..0000000 Binary files a/netauto/migrations/__pycache__/0009_routerm_kecepatan_internet.cpython-38.pyc and /dev/null differ diff --git a/netauto/migrations/__pycache__/0010_manualcommand.cpython-38.pyc b/netauto/migrations/__pycache__/0010_manualcommand.cpython-38.pyc deleted file mode 100644 index a562ae5..0000000 Binary files a/netauto/migrations/__pycache__/0010_manualcommand.cpython-38.pyc and /dev/null differ diff --git a/netauto/migrations/__pycache__/0011_auto_20210130_1123.cpython-38.pyc b/netauto/migrations/__pycache__/0011_auto_20210130_1123.cpython-38.pyc deleted file mode 100644 index 3e100f9..0000000 Binary files a/netauto/migrations/__pycache__/0011_auto_20210130_1123.cpython-38.pyc and /dev/null differ diff --git a/netauto/migrations/__pycache__/__init__.cpython-38.pyc b/netauto/migrations/__pycache__/__init__.cpython-38.pyc deleted file mode 100644 index d101cda..0000000 Binary files a/netauto/migrations/__pycache__/__init__.cpython-38.pyc and /dev/null differ diff --git a/netauto/models.py b/netauto/models.py deleted file mode 100644 index fde504b..0000000 --- a/netauto/models.py +++ /dev/null @@ -1,53 +0,0 @@ -from django.db import models -from django.forms import ModelForm - -# Create your models here. -class Contohmodel(models.Model): - nama = models.CharField(max_length=50) - desk = models.TextField() - value = models.IntegerField() - pub_date = models.DateField(auto_now=True, null=True) - - def __str__(self): - return self.nama - pass - -class Routerm(models.Model): - nama = models.CharField(max_length=50) - host = models.CharField(max_length=50) - user = models.CharField(max_length=30) - password = models.CharField(max_length=50, blank=True) - kecepatan_internet = models.IntegerField(blank=True) - pub_date = models.DateField(auto_now=True) - - def __str__(self): - return self.nama - pass - -class Automation(models.Model): - nama = models.CharField(max_length=50) - deskripsi = models.TextField() - status = models.CharField(max_length=15, blank=True) - - def __str__(self): - return self.nama - pass - -class Confrouter(models.Model): - nama = models.CharField(max_length=50) - deskripsi = models.CharField(max_length=50) - - - def __str__(self): - return self.nama - pass - -class Manualcommand(models.Model): - host = models.ForeignKey(Routerm, on_delete=models.CASCADE) - command = models.CharField(max_length=255) - output = models.TextField(blank=True) - time = models.DateTimeField(auto_now=True) - - def __str__(self): - return self.time - pass diff --git a/netauto/sendcom.py b/netauto/sendcom.py deleted file mode 100644 index 0b956de..0000000 --- a/netauto/sendcom.py +++ /dev/null @@ -1,52 +0,0 @@ -import paramiko -import time -import routeros_api -import json -from .models import Routerm - -def show_ip(ip_add,username,password): - - ssh = paramiko.SSHClient() - ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy) - ssh.connect(hostname=ip_add,username=username,password=password) - - stdin, stdout, stderr = ssh.exec_command("ip address print") - - time.sleep(1) - - output=stdout.read().decode("ascii").strip("\n") - return output - pass - -def show_ipactive(parameter_list): - host = "192.168.31.1" - - conn = routeros_api.RouterOsApiPool(host, username="admin", password="", plaintext_login=True) - api= conn.get_api() - - list_ip = api.get_resource('ip/address') - show_ip = list_ip.get() - - data = json.dumps(show_ip, indent=3) - conn.disconnect() - return show_ip - pass - -def sendpcq1(id): - r=Routerm.objects.get(id=id) - host = r.host - username= r.user - password= r.password - - ssh = paramiko.SSHClient() - ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy) - ssh.connect(hostname=host,username=username,password=password) - - stdin, stdout, stderr = ssh.exec_command("ls \n ip address print") - - time.sleep(1) - - output= stdout.read().decode("ascii").strip("\n") - - return output - pass \ No newline at end of file diff --git a/netauto/templates/addcontoh.html b/netauto/templates/addcontoh.html deleted file mode 100644 index 847d03a..0000000 --- a/netauto/templates/addcontoh.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends 'base.html' %} -{% block title %} -tmabah kan -{% endblock title %} - -{% block content %} -
selahkan pilih pilihan outasi yang akan di gunakan:
-username atau password yang di masukan salah
-Your account doesn't have access to this page. To proceed, - please login with an account that has access.
- {% else %} - - {% endif %} - {% endif %} -