-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web-interface added by flask #19
base: main
Are you sure you want to change the base?
web-interface added by flask #19
Conversation
Thanks for your work @ramtinsafadoust, but it seems to need a lot of improvements and changes to reach the stage of merge to main. |
that was for change HTMLs output directory |
|
||
TIMEOUT = 1 | ||
MAX_TTL = 50 | ||
DEFAULT_OUTPUT_DIR = "./templates/tracevis_data/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why output data is in the templates directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its default folder for flask templates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should the output of the core app be changed to a new address?
(The core app must be able to work in the same way and independently of WI.)
app.py
Outdated
app.secret_key = 'the random string' | ||
@app.route('/',methods = ['GET', 'POST']) | ||
def index(): | ||
|
||
if request.method == 'GET': | ||
name = 'Rosalia' | ||
return render_template('index.html', title='Welcome', username=name) | ||
if request.method == 'POST': | ||
|
||
url= request.form.get('url') | ||
|
||
|
||
return redirect(url_for('process')) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to change this part. Both naming and UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @ramtinsafadoust ! ❤️ 🌺
@moh53n, let me know if you would like to work on this and/or continue in a new branch.
i try to fix your correct suggests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
app.py
Outdated
def process(): | ||
if request.method=="POST": | ||
url= request.form.get('url') | ||
temp_return= run_command('sudo python3 ./tracevis.py --dns --domain1 %s --domain2 %s'% (url, url)) | ||
x=str(temp_return).rsplit('/', 1)[-1] | ||
size=len(x) | ||
z=x[:size - 3] | ||
y= 'tracevis_data/'+z | ||
return render_template(y) | ||
#return render_template('proccess.html') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to change this part too.
- naming
- UI
- command. 1) The app should be able to run on Windows too. Therefore we should check for OS name first. 2) The way of using the tracevis command is almost incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i want to make docker file from web interface after fix changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
templates/index.html
Outdated
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | ||
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to be able to run the app when we do not have internet access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove bootstrap library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it is still not possible to work offline.
I will add a patch to this at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resoved
templates/index.html
Outdated
document.getElementById('button').onclick = function() { | ||
alert("button was clicked"); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the button should be disabled until the end of the operation or always.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
templates/index.html
Outdated
<div class="input-group-prepend"> | ||
<span class="input-group-text" id="basic-addon1">URL</span> | ||
</div> | ||
<input type="text" class="form-control" placeholder="https://github.com" aria-label="Username" aria-describedby="basic-addon1" name="url"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to change this line. e.g. placeholder
, aria-label
, name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
TIMEOUT = 1 | ||
MAX_TTL = 50 | ||
DEFAULT_OUTPUT_DIR = "./tracevis_data/" | ||
DEFAULT_REQUEST_IPS = ["1.1.1.1", "8.8.8.8", "9.9.9.9"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the new changes we do not have this line! 🤷♂️
I think it's best to best thing to do is apply the changes without change in the encoding of the file. so we can track the changes correctly! (please)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! we have, in line 107. But I think it's better to have all default values in ~one place.
@@ -1,144 +1,134 @@ | |||
#!/usr/bin/env python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
278 changes: 134 additions & 144 deletions
Something is not right!
Thanks again @ramtinsafadoust ! ❤️ 🌺 @moh53n, let me know if you would like to work on this and/or continue in a new branch. |
we do not need internet yet. and some trash line deleted
it can be start of WI development