-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
from collections import OrderedDict | ||
import logging | ||
from datetime import datetime | ||
|
||
from babel.numbers import format_currency | ||
from flask import Blueprint, render_template, url_for, redirect, flash, abort, request, current_app | ||
from flask_babel import format_date, gettext | ||
from flask_login import current_user, login_required | ||
from flask_wtf import FlaskForm | ||
from markupsafe import Markup | ||
|
||
bp_control = Blueprint('control', __name__, url_prefix='/control') | ||
@bp_control.route("/port", methods=['GET', 'POST']) | ||
def check_port(): | ||
""" | ||
returns json with all the port forwardings | ||
""" | ||
if not request.form.get("port"): | ||
return 'port nicht in Textfeld' | ||
if not request.form["port"].isnumeric(): | ||
return gettext('der Port muss eine Nummer sein') | ||
if int(request.form["port"]) < 1: | ||
return gettext('der Port muss größer als 0 sein') | ||
if int(request.form["port"]) > 65535: | ||
return gettext('der Port muss kleiner als 65536 sein') | ||
return "" | ||
|
||
@bp_control.route("/ip", methods=['GET', 'POST']) | ||
def checks_ip_address(): | ||
""" | ||
checks rather the given ip address is valid | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters