Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
message improve
Browse files Browse the repository at this point in the history
  • Loading branch information
cecep31 committed Mar 22, 2021
1 parent 2480109 commit c240e3d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Binary file modified routerapp/__pycache__/sendcom.cpython-38.pyc
Binary file not shown.
10 changes: 5 additions & 5 deletions routerapp/sendcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ def pcq(self):
"queue simple add target=ether2 name=pcq1 queue=pcq-upload-default/pcq-download-default")
time.sleep(1)
except paramiko.AuthenticationException:
return "gagal untuk login pastikan username dan password benar"
return "Gagal untuk login pastikan username dan password benar"
except paramiko.BadHostKeyException:
return "proses gagal roueter tidak terhubung"
return "Proses gagal roueter tidak terhubung"
except NoValidConnectionsError:
return "proses gagal roueter tidak terhubung"
return "Proses gagal roueter tidak terhubung"
except TimeoutError:
return "proses gagal karena router tidak menangapi"
return "Proses gagal karena router tidak menangapi"

if "already" in stdout.read().decode("ascii"):
return "Sudah Di Set sebelumnya"
else:
return "berhasil di aktifkan"
return "Berhasil di aktifkan"


def show_ip(ip_add, username, password):
Expand Down
6 changes: 4 additions & 2 deletions routerapp/templates/addrouter.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
{% block content %}

{% if messages %}

{% for message in messages %}
<div class="alert alert-dark" role="alert">
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<strong> {{ message }}</strong>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endif %}

<form action="{% url 'addrouter' %}" method="post">
{% csrf_token %}
{{formk.as_p}}
Expand Down
3 changes: 2 additions & 1 deletion routerapp/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
{% if messages %}

{% for message in messages %}
<div class="alert alert-dark" role="alert">
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<strong> {{ message }}</strong>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endif %}
Expand Down

0 comments on commit c240e3d

Please sign in to comment.