diff --git a/rootfs/standard/usr/share/mynode_apps/lndg/www/templates/lndg.html b/rootfs/standard/usr/share/mynode_apps/lndg/www/templates/lndg.html new file mode 100644 index 00000000..e65c0515 --- /dev/null +++ b/rootfs/standard/usr/share/mynode_apps/lndg/www/templates/lndg.html @@ -0,0 +1,46 @@ + + + {{ title }} + {% include 'includes/head.html' %} + + + {% include 'includes/logo_header.html' %} +
+ home  +
+ +
{{app.name}} (custom page - remove)
+
+ +
+
+
Status
+
+ + + + + + + + + +
Status{{app_status}}
Actions + Open + Button A + Button B +
+
+
+
+ + +
+
Instructions
+
    +
  1. Custom instructions?
  2. +
+ +
+ + diff --git a/rootfs/standard/var/www/mynode/app/README b/rootfs/standard/var/www/mynode/app/README new file mode 100644 index 00000000..b9326824 --- /dev/null +++ b/rootfs/standard/var/www/mynode/app/README @@ -0,0 +1,3 @@ +FOLDERS AND FILES IN THIS FOLDER ARE DYNAMICALLY ADDED + +Do not edit files within this folder. They will be overwritten during app install process. \ No newline at end of file diff --git a/rootfs/standard/var/www/mynode/generic_app.py b/rootfs/standard/var/www/mynode/generic_app.py new file mode 100644 index 00000000..3bec0b05 --- /dev/null +++ b/rootfs/standard/var/www/mynode/generic_app.py @@ -0,0 +1,32 @@ + +from flask import Blueprint, render_template, redirect, request, url_for +from flask import current_app +from user_management import check_logged_in +from device_info import * +from application_info import * +import subprocess +import re +import os + +mynode_generic_app = Blueprint('mynode_generic_app',__name__) + +# This is the generic app page handler. Specific ones can override this. +@mynode_generic_app.route('/app//info') +def app_generic_info_page(name): + check_logged_in() + + app = get_application(name) + if not is_application_valid(name) or app == None: + flash("Application is invalid", category="error") + return redirect("/apps") + + app_status = get_application_status(name) + + # Load page + templateData = { + "title": "myNode - " + app["name"], + "ui_settings": read_ui_settings(), + "app_status": app_status, + "app": app + } + return render_template('/app/generic_app.html', **templateData) diff --git a/rootfs/standard/var/www/mynode/marketplace.py b/rootfs/standard/var/www/mynode/marketplace.py new file mode 100644 index 00000000..d9d9937e --- /dev/null +++ b/rootfs/standard/var/www/mynode/marketplace.py @@ -0,0 +1,58 @@ + +from flask import Blueprint, render_template, redirect, request +from user_management import check_logged_in +from device_info import * +from application_info import * +import subprocess +import re +import os + +mynode_marketplace = Blueprint('mynode_marketplace',__name__) + + +### Page functions +@mynode_marketplace.route("/marketplace") +def marketplace_page(): + check_logged_in() + + t1 = get_system_time_in_ms() + apps = get_all_applications(order_by="alphabetic") + t2 = get_system_time_in_ms() + + categories = [{"name": "bitcoin_app", "title": "Bitcoin Apps"}, + {"name": "lightning_app", "title": "Lightning Apps"}, + {"name": "uncategorized", "title": "Uncategorized"} + ] + + # Load page + templateData = { + "title": "myNode Marketplace", + "ui_settings": read_ui_settings(), + "load_time": t2-t1, + "product_key_skipped": skipped_product_key(), + "categories": categories, + "apps": apps, + "has_customized_app_versions": has_customized_app_versions(), + } + return render_template('marketplace.html', **templateData) + +@mynode_marketplace.route("/marketplace/") +def marketplace_app_page(app_name): + check_logged_in() + + app = get_application(app_name) + if not is_application_valid(app_name) or app == None: + flash("Application is invalid", category="error") + return redirect("/marketplace") + + app_status = get_application_status(app_name) + + # Load page + templateData = { + "title": "myNode - " + app["name"], + "ui_settings": read_ui_settings(), + "product_key_skipped": skipped_product_key(), + "app_status": app_status, + "app": app + } + return render_template('/marketplace_app.html', **templateData) diff --git a/rootfs/standard/var/www/mynode/static/css/hes-gallery.min.css b/rootfs/standard/var/www/mynode/static/css/hes-gallery.min.css new file mode 100644 index 00000000..55042f40 --- /dev/null +++ b/rootfs/standard/var/www/mynode/static/css/hes-gallery.min.css @@ -0,0 +1,9 @@ +/*! + + HesGallery v1.5.1 + + Copyright (c) 2018-2019 Artur Medrygal + + Product under MIT licence + +*/#hgallery{display:block;content:'';position:fixed;top:0;left:0;width:100%;height:100vh;background-color:rgba(0,0,0,.9);visibility:hidden;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;opacity:0;-webkit-transition:.3s;transition:.3s;z-index:99999}.hg-disable-scrolling{overflow:hidden!important}#hg-bg{position:absolute;top:0;left:0;width:100%;height:100vh;z-index:1}#hg-bg::after{content:'';position:absolute;display:block;top:20px;right:20px;width:30px;height:30px;background-image:url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0xOSA2LjQxTDE3LjU5IDUgMTIgMTAuNTkgNi40MSA1IDUgNi40MSAxMC41OSAxMiA1IDE3LjU5IDYuNDEgMTkgMTIgMTMuNDEgMTcuNTkgMTkgMTkgMTcuNTkgMTMuNDEgMTJ6Ii8+CiAgICA8cGF0aCBkPSJNMCAwaDI0djI0SDB6IiBmaWxsPSJub25lIi8+Cjwvc3ZnPg==);background-position:center;background-size:contain;cursor:pointer;opacity:.8}#hg-bg::after:hover{background-color:#fff}#hgallery.open{visibility:visible!important;opacity:1}#hg-pic-cont{max-width:calc(70% - 40px);max-height:90vh;cursor:default;z-index:12;position:relative;background-color:#fff;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-transform:scale(1);transform:scale(1)}#hg-pic-cont.hg-transition{-webkit-transform:scale(.1);transform:scale(.1)}#hg-subtext{color:#ddd;font-size:14px;position:absolute;display:block;left:5px;top:calc(100% + 6px)}#hg-howmany{color:#aaa;font-size:14px;position:absolute;display:block;right:5px;bottom:-20px}#hg-pic{width:auto;height:auto;min-height:100px;min-width:100px;max-width:100%;max-height:90vh;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;cursor:default;-o-object-fit:contain;object-fit:contain;margin:0}#hg-pic:hover{-webkit-transform:none;transform:none;-webkit-box-shadow:none;box-shadow:none}#hgallery button{position:absolute;display:block;margin:auto 0;width:60px;height:60px;z-index:11;cursor:pointer;background-color:transparent;border:0;outline:0;opacity:0;-webkit-transition:opacity .3s,visibility .3s;transition:opacity .3s,visibility .3s;visibility:hidden}#hgallery button img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}#hgallery.open button{visibility:visible;opacity:.7}#hgallery button:hover{opacity:1}#hgallery button#hg-prev{left:10px;-webkit-transform:rotate(180deg);transform:rotate(180deg)}#hgallery button#hg-prev:active{left:7px}#hgallery button#hg-next{right:10px}#hgallery button#hg-next:active{right:7px}#hgallery #hg-next-onpic,#hgallery #hg-prev-onpic{position:absolute;top:0;left:0;width:34%;height:100%;cursor:pointer}#hgallery #hg-next-onpic{right:0;left:auto;width:66%}.hg-unvisible{opacity:0!important;visibility:hidden}@media (max-width:1100px){#hg-pic-cont{max-width:calc(100% - 40px)}} \ No newline at end of file diff --git a/rootfs/standard/var/www/mynode/static/js/hes-gallery.min.js b/rootfs/standard/var/www/mynode/static/js/hes-gallery.min.js new file mode 100644 index 00000000..24e44e80 --- /dev/null +++ b/rootfs/standard/var/www/mynode/static/js/hes-gallery.min.js @@ -0,0 +1,10 @@ +var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")} +/*! + + HesGallery v1.5.1 + + Copyright (c) 2018-2019 Artur Medrygal + + Product under MIT licence + +*/var HesGallery={version:"1.5.1",options:{disableScrolling:!1,hostedStyles:!0,animations:!0,keyboardControl:!0,minResolution:0,autoInit:!0,wrapAround:!1,showImageCount:!0,linkNested:!1},setOptions:function(){var t,e=0");var e=document.createElement("div");e.id="hgallery",e.setAttribute("style","visibility:hidden;"),this.elements.gallery=e,this.elements.gallery.innerHTML+="\n
\n
\n \n
\n
\n
\n
\n
\n \n \n ",document.body.appendChild(e),this.elements.b_prev=document.getElementById("hg-prev"),this.elements.b_next=document.getElementById("hg-next"),this.elements.pic_cont=document.getElementById("hg-pic-cont"),this.elements.b_next_onpic=document.getElementById("hg-next-onpic"),this.elements.b_prev_onpic=document.getElementById("hg-prev-onpic"),this.elements.b_prev.onclick=this.elements.b_prev_onpic.onclick=function(){t.prev()},this.elements.b_next.onclick=this.elements.b_next_onpic.onclick=function(){t.next()},document.getElementById("hg-bg").onclick=function(){t.hide()},this.executed=!0},show:function(t,e){if(innerWidth + + myNode - {{app.name}} + {% include 'includes/head.html' %} + + + + + + + + + + + + + {% include 'includes/logo_header.html' %} +
+ home  +
+ +
{{app.name}}
+
+ +
+
 
+
+ +
+ +

{{app_status}}

+ +
+ + {% if not app.is_installed %} + + + {% else %} + + + + {% if app.is_enabled %} + {% if app.http_port != "" or app.https_port != "" %} + + {% endif %} + {% endif %} + +
+ + + {% if app.is_enabled %} + + + {% for btn in app.app_page_additional_buttons %} + + {% endfor %} + +
+ {% endif %} + + + + + {% if app.current_version != app.latest_version %} + + {% endif %} + {% if app.can_reinstall %} + + {% endif %} + {% if app.can_uninstall %} + + {% endif %} + {% endif %} + +
+ +
+
+
Info
+
+
+ + + + + + + + + + {% if app.author.name is defined %} + + + + + {% endif %} + {% if app.website.name is defined and app.website.link is defined %} + + + + + {% endif %} +
Installed Version + {% if app.is_installed %} + {{app.current_version}} + {% else %} + Not Installed + {% endif %} +
Latest Version{{app.latest_version}}
Author + {% if app.author.link is defined and app.author.link != "" %} + {{app.author.name}} + {% else %} + {{app.author.name}} + {% endif %} +
Website + {{app.website.name}} +
+
+ +
+
Description
+
+
+ {% if app.description is defined and app.description|length > 0 %} + {% for parapraph in app.description %} +

{{parapraph}}

+ {% endfor %} + {% else %} + No description available. + {% endif %} +
+ + {% if app.screenshots is defined and app.screenshots|length > 0 %} +
+
Screenshots
+
+
+ +
+ {% endif %} +
+ +
+
+ + + + + diff --git a/rootfs/standard/var/www/mynode/templates/marketplace.html b/rootfs/standard/var/www/mynode/templates/marketplace.html new file mode 100644 index 00000000..470a40a4 --- /dev/null +++ b/rootfs/standard/var/www/mynode/templates/marketplace.html @@ -0,0 +1,148 @@ + + + {{ title }} + {% include 'includes/head.html' %} + + + + + + + + + {% include 'includes/logo_header.html' %} +
+ home  +
+ +
Marketplace
+ + {% include 'includes/message_display.html' %} + +
+ + + +

+ {% for category in categories %} +
{{category.title}}
+ +
+ {% for app in apps %} + {% if app.show_on_application_page and app.category == category.name %} +
+
+ +
+
+
{{app.name}}
+
{{app.short_description}}
+ + {% if not product_key_skipped or product_key_skipped and not app.is_premium %} +
Version {{app.latest_version}}
+ {% else %} +
Premium Feature
+ {% endif %} + + {% if app.is_installed %} + + {% endif %} +
+ +
+ {% endif %} + {% endfor %} +
+ {% endfor %} + + + + + +

+ + {% include 'includes/footer.html' %} + + diff --git a/rootfs/standard/var/www/mynode/templates/marketplace_app.html b/rootfs/standard/var/www/mynode/templates/marketplace_app.html new file mode 100644 index 00000000..ca9c615a --- /dev/null +++ b/rootfs/standard/var/www/mynode/templates/marketplace_app.html @@ -0,0 +1,220 @@ + + + myNode - {{app.name}} + {% include 'includes/head.html' %} + + + + + + + + + + + + + {% include 'includes/logo_header.html' %} +
+ back  +
+ +
{{app.name}}
+
+ +
+
 
+
+ +
+ +

{{app.short_description}}

+
+ + {% if not product_key_skipped or product_key_skipped and not app.is_premium %} + + {% if not app.is_installed %} + + + {% else %} + + {% if app.current_version != app.latest_version %} + + {% endif %} + {% if app.can_reinstall %} + + {% endif %} + {% if app.can_uninstall %} + + {% endif %} + {% endif %} + {% else %} +

Premium Feature

+ {% endif %} + +
+ +
+
+
Info
+
+
+ + + + + + + + + + {% if app.author.name is defined %} + + + + + {% endif %} + {% if app.website.name is defined and app.website.link is defined %} + + + + + {% endif %} +
Installed Version + {% if app.is_installed %} + {{app.current_version}} + {% else %} + Not Installed + {% endif %} +
Latest Version{{app.latest_version}}
Author + {% if app.author.link is defined and app.author.link != "" %} + {{app.author.name}} + {% else %} + {{app.author.name}} + {% endif %} +
Website + {{app.website.name}} +
+
+ +
+
Description
+
+
+ {% if app.description is defined and app.description|length > 0 %} + {% for parapraph in app.description %} +

{{parapraph}}

+ {% endfor %} + {% else %} + No description available. + {% endif %} +
+ + {% if app.screenshots is defined and app.screenshots|length > 0 %} +
+
Screenshots
+
+
+ +
+ {% endif %} +
+ +
+
+ + + + +