diff --git a/Dockerfile b/Dockerfile index 8dae610fba73c11f5c37158b0f0fac4d6c6170dc..154b6e9022a3089f10ef63852baa9021bf515b71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,6 @@ COPY ./requirements.txt /app/requirements.txt # switch working directory WORKDIR /app -# RUN apk update && apk add git - # install the dependencies and packages in the requirements file RUN pip install -r requirements.txt @@ -18,10 +16,10 @@ RUN apt-get install -y graphviz # copy every content from the local file to the image COPY . . +# switch working directory WORKDIR /app/Frontend # configure the container to run in an executed manner ENTRYPOINT [ "python" ] -# RUN chmod 644 Frontend/main.py CMD ["main.py" ] diff --git a/Frontend/main.py b/Frontend/main.py index 1273033cc0ea06a382e8f40f177b04b7310a6f94..9ce0e2cbcfc71b86d9f23aa7abf75a346187f79b 100644 --- a/Frontend/main.py +++ b/Frontend/main.py @@ -35,15 +35,15 @@ app.config['STATIC_FOLDER'] = STATIC_FOLDER DOWNLOAD_FOLDER = r'export' app.config['DOWNLOAD_FOLDER'] = DOWNLOAD_FOLDER -IMAGES_FOLDER = r'images' -app.config['IMAGES_FOLDER'] = IMAGES_FOLDER - +#global variable in which the allowed file types are saved FILE_TYPES = ['csv','xes'] +#route to the index page @app.route('/') def index(): return render_template('index.html') +#redirect to the next page when the button on the index page is pressed @app.route('/', methods=['POST']) def go_to_start(): return redirect(url_for('start')) @@ -66,6 +66,7 @@ def upload_file(): #file is saved in the 'upload' directory. uploaded_file.save(os.path.join(app.config['UPLOAD_FOLDER'],uploaded_file.filename)) if not elog.format_check(uploaded_file.filename): + #if the event log is not of the right format flashes a warning flash('Event log does not match the expected business process!') return redirect(url_for('start')) elif uploaded_file.filename == '': @@ -76,9 +77,8 @@ def upload_file(): return redirect(url_for('preview', filename = uploaded_file.filename)) """ -The download usage. Currently just downloads fish.jpg. -os.path.join here is setup to point towards static folder and also point at fish.jpg. -Currently it just sends a preexisting file. Meaning the generated file will have to be saved somewhere to import. +The download function. Generates an event log based on the user specification - +Start and End Date and Time, as well as format (csv or xes), and downloads it. """ @app.route('/download/<current_time>', methods=['GET']) def download(current_time): @@ -91,6 +91,7 @@ def download(current_time): start_date_time = request.args.get("startTime") end_date_time = request.args.get("endTime") + #warnings if empty if not start_date_time: flash('Invalid simulation period! Start Date and Time cannot be empty!') elif not end_date_time: @@ -131,7 +132,9 @@ def download(current_time): return render_template('start.html', file_types = file_types, current_time = current_time) - +""" +The preview page. Gets the first 15 rows of the uploaded file and passes them to the template in html format. +""" @app.route('/preview.html/<filename>', methods=['GET']) def preview(filename): df = elog.convert_to_dataframe(filename) @@ -140,6 +143,9 @@ def preview(filename): preview_data=preview_df.to_html() return render_template('preview.html', preview_data=preview_data, filename=filename, row_count=row_count) +""" +Redirects from the preview page to the case selection page. +""" @app.route('/preview.html/<filename>', methods=['POST']) def go_to_selection(filename): return redirect(url_for('case_id', filename=filename)) @@ -147,19 +153,13 @@ def go_to_selection(filename): """ Route for displaying possible case IDs. It is a dropdown menu that displays the list from the python script in the dropdown menu. There is a preview functionality, when clicked will show a preview of a generated image. It is linked to the 'preview' button in the case id page. -The generated image currently displays static images and not instantly generated ones from the backend. -Currently it displays moyai.jpg by default and fish.jpg on case 1 and 2. Will change this later. """ @app.route('/case.html/<filename>', methods=['GET']) def case_id(filename): - #temporary choice of cases until I figure out where the actual function from backend is. - #give the list here in selection using functions from selection = elog.get_active_cases(filename) previewid = request.args.get("selectpreview") state = None - # preview = "../static/fish.jpg" - if previewid != None: for file in os.listdir('static/'): if file.startswith('preview_net'): # not to remove other images @@ -184,8 +184,6 @@ def send_caseid(filename): """ The result page. -It processes "id" (for now it uses the "foo" function from input.py) using backend functions -and prints out the result immediately in the page. """ @app.route('/result.html/<filename>/<result>', methods=['GET']) def recommendation(result, filename): diff --git a/Frontend/static/OPTIS_team.jpg b/Frontend/static/OPTIS_team.jpg new file mode 100644 index 0000000000000000000000000000000000000000..32306ed1a3abc68201d60ec8070ea00075703608 Binary files /dev/null and b/Frontend/static/OPTIS_team.jpg differ diff --git a/Frontend/static/process_net.png b/Frontend/static/process_net.png index 6de7d287a93524646ab6b2610ee1eb4233dc12a2..5ecb80596bebb6ce8133b6a6541b78a9121e6df9 100644 Binary files a/Frontend/static/process_net.png and b/Frontend/static/process_net.png differ diff --git a/Frontend/static/user_manual.pdf b/Frontend/static/user_manual.pdf index ae3b2fbac4eb6f759329487057ddb53763b1c77f..0b3f2208d61f61adc17d3f55040e19bd3440a55b 100644 Binary files a/Frontend/static/user_manual.pdf and b/Frontend/static/user_manual.pdf differ diff --git a/Frontend/templates/aboutus.html b/Frontend/templates/aboutus.html index 30628e3ccf46f91aa984479aed0c86af02e460bc..2b0819aec5429f7d05b3062fb9bbb50579cbe7d5 100644 --- a/Frontend/templates/aboutus.html +++ b/Frontend/templates/aboutus.html @@ -1,3 +1,4 @@ +<!--Here is the About Us page. It contains information about the project's creators.--> {% extends 'base.html' %} {% block head %} @@ -7,7 +8,7 @@ {% block body %} <div class="contents" style='text-align:center'> <h1>This is a project from the Chair of Process and Data Science from RWTH Aachen University</h1> - <img src="{{url_for('static',filename='moyai.jpg')}}" alt="Placeholder"> <br> - <h2>by: Ahmad Mannoun, Aleksandra Dimitrova, Geno Jayadi, Paula Hermenau </h2> + <img src="{{url_for('static',filename='OPTIS_team.jpg')}}" alt="The team" style="max-width: 50%; border: solid 20px rgb(230,241,250);"> <br> + <h2>by: Aleksandra Dimitrova, Paula Hermenau, Geno Jayadi, Ahmad Mannoun </h2> </div> {% endblock %} \ No newline at end of file diff --git a/Frontend/templates/case.html b/Frontend/templates/case.html index 430e221722eee14244730297c3ba31b393471e07..1f878b0b8186f9f54508cdec7157b9840451ebb2 100644 --- a/Frontend/templates/case.html +++ b/Frontend/templates/case.html @@ -1,5 +1,6 @@ <!-- - Here is the case ID input page. Really straightforward as it is just one form and one input. + Here is the case ID input page. Contains the case-selection form and the case-preview form. + If a case is chosen to be previewed, shows a table and a petr-net. --> {% extends 'base.html' %} @@ -44,12 +45,13 @@ <div style="text-align: center;"> <!-- The preview image --> {% if previewid or previewid == 0 %} - <p>Previewing case ID: {{ previewid }}</p> + <p>Previewing Case-ID: {{ previewid }}</p> + <!-- The preview table when a case is selected --> <table> {{ state | safe }} </table> <!-- The preview image when a case is selected --> - <img src="../static/preview_net.png" alt="Placeholder" style="max-width: 80%; border: solid 20px rgb(230,241,250)"> + <img src="../static/preview_net.png" alt="Preview Petri-Net" style="max-width: 80%; border: solid 20px rgb(230,241,250)"> {% else %} <!-- no image --> {% endif %} diff --git a/Frontend/templates/index.html b/Frontend/templates/index.html index 52c5e3b60fee722a506c6dc1f6f5f97bf78db35b..117aebb14dc6c44b937621c1774bd732bee9d79b 100644 --- a/Frontend/templates/index.html +++ b/Frontend/templates/index.html @@ -8,7 +8,7 @@ {% block body %} <div class="contents"> <header style="text-align: center;"> - <img src="/static/OPTIS_logo3.png" alt="Placeholder" style="max-width: 50%; padding: 40px;"> + <img src="/static/OPTIS_logo3.png" alt="Logo" style="max-width: 50%; padding: 40px;"> </header> <div style="text-align: center; padding-top: 40 px;"> diff --git a/Frontend/templates/info.html b/Frontend/templates/info.html index 47fa9dec67d5587b8a9d8424220eb1a9f1f7baf9..e98f39859f828c41b2d130ffa5698af3a71f2877 100644 --- a/Frontend/templates/info.html +++ b/Frontend/templates/info.html @@ -1,3 +1,4 @@ +<!--Here is the info page. It contains information about the app.--> {% extends 'base.html' %} {% block head %} diff --git a/Frontend/templates/preview.html b/Frontend/templates/preview.html index c4b1993f0bb0ed0a3a863ef80358170a681cde28..db4e482303f0130d1f6ace8faf9da8a7e432b830 100644 --- a/Frontend/templates/preview.html +++ b/Frontend/templates/preview.html @@ -1,3 +1,4 @@ +<!--Here is the Preview page. It shows a table containing the first 15 rows of the uploaded event log.--> {% extends 'base.html' %} {%block head%} diff --git a/Frontend/templates/result.html b/Frontend/templates/result.html index 7c19f75022ccf79829b7e328a8a570954dfd1a66..29446033ed947368a416834f63340d5937fc54a1 100644 --- a/Frontend/templates/result.html +++ b/Frontend/templates/result.html @@ -1,7 +1,4 @@ -<!-- - The result. For now it outputs a placeholder image moyai.jpg. - "res" is the result specified by the Flask app. Use that to print out the result in the bracket. ---> +<!--The result page. It shows a petri-net colored with the recommendation.--> {% extends 'base.html' %} {%block head%} diff --git a/Frontend/templates/start.html b/Frontend/templates/start.html index a768327a57838bd093694d2172c494d818d9f9da..a3add076b2d40bba687eeb2bbf5eddbd2df3b9e3 100644 --- a/Frontend/templates/start.html +++ b/Frontend/templates/start.html @@ -27,13 +27,6 @@ {% endfor %} </select> - <!-- - <div> - <h2>Please input the desired simulation length:</h2> - <input type="number" name="elogTime" id="elogTime"></input> - </div> - --> - <div> <p>Please input the desired simulation period: </p> <label for="startTime">Start Date and Time:</label> diff --git a/backend/__pycache__/qagent.cpython-311.pyc b/backend/__pycache__/qagent.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..73bd74a23102574ab177dcf993745fb58230ac65 Binary files /dev/null and b/backend/__pycache__/qagent.cpython-311.pyc differ diff --git a/backend/docs/conf.py b/backend/docs/conf.py index 74671c645a4d862513024db8ca291e2606f1497f..51244784e822accfd79aea8985b09ef0f9196fd3 100644 --- a/backend/docs/conf.py +++ b/backend/docs/conf.py @@ -32,3 +32,5 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] html_theme = 'sphinx_rtd_theme' html_static_path = ['_static'] + +