This commit is contained in:
parent
e3dd6f2a68
commit
b4764d1046
@ -4,7 +4,7 @@ from secrets import token_hex
|
||||
from htmlmin.main import minify
|
||||
from flask import render_template, url_for, redirect, request, Blueprint, jsonify
|
||||
from flask_login import current_user
|
||||
from dashmachine.main.models import Files
|
||||
from dashmachine.main.models import Files, Apps
|
||||
from dashmachine.main.utils import get_rest_data, public_route, check_groups
|
||||
from dashmachine.settings_system.models import Settings
|
||||
from dashmachine.paths import cache_folder
|
||||
@ -60,9 +60,10 @@ def home():
|
||||
return render_template("main/home.html")
|
||||
|
||||
|
||||
@main.route("/app_view?<url>", methods=["GET"])
|
||||
def app_view(url):
|
||||
return render_template("main/app-view.html", url=f"https://{url}")
|
||||
@main.route("/app_view?<app_id>", methods=["GET"])
|
||||
def app_view(app_id):
|
||||
app_db = Apps.query.filter_by(id=app_id).first()
|
||||
return render_template("main/app-view.html", url=f"{app_db.prefix}{app_db.url}")
|
||||
|
||||
|
||||
@main.route("/load_rest_data", methods=["GET"])
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
{% for app in apps %}
|
||||
{% if app.open_in == 'iframe' %}
|
||||
<a href="{{ url_for('main.app_view', url=app.url) }}" class="app-a" data-name="{{ app.name }}" data-description="{{ app.description }}">
|
||||
<a href="{{ url_for('main.app_view', app_id=app.id) }}" class="app-a" data-name="{{ app.name }}" data-description="{{ app.description }}">
|
||||
{% elif app.open_in == 'this_tab' %}
|
||||
<a href="{{ app.prefix }}{{ app.url }}" class="app-a" data-name="{{ app.name }}" data-description="{{ app.description }}">
|
||||
{% elif app.open_in == "new_tab" %}
|
||||
|
@ -37,7 +37,7 @@
|
||||
{% for app in apps %}
|
||||
<li class="bold">
|
||||
{% if app.open_in == 'iframe' %}
|
||||
<a id="dashboard-sidenav" class="waves-effect waves-cyan" href="{{ url_for('main.app_view', url=app.url) }}">
|
||||
<a id="dashboard-sidenav" class="waves-effect waves-cyan" href="{{ url_for('main.app_view', app_id=app.id) }}">
|
||||
{% elif app.open_in == "this_tab" %}
|
||||
<a id="dashboard-sidenav" class="waves-effect waves-cyan" href="{{ app.prefix }}{{ app.url }}">
|
||||
{% elif app.open_in == "new_tab" %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user