|
|
@ -3,7 +3,7 @@
|
|||
|
||||
from flask import request
|
||||
from flaskext.auth import login_required
|
||||
from git import Repo
|
||||
import git
|
||||
import security
|
||||
import requests, json, re
|
||||
import os, sys, imp, shutil
|
||||
|
|
@ -124,8 +124,9 @@ def checkDomoticzStatus(config):
|
|||
sys.exit("Domoticz is not reachable.")
|
||||
for device in result["result"]:
|
||||
domoticzDevices.append(device["idx"])
|
||||
for device in resultScene["result"]:
|
||||
domoticzScenes.append(device["idx"])
|
||||
if 'result' in resultScene:
|
||||
for device in resultScene["result"]:
|
||||
domoticzScenes.append(device["idx"])
|
||||
configuredDevicesInDomoticz(config, domoticzDevices, domoticzScenes)
|
||||
|
||||
def configuredDevicesInDomoticz(config, domoticzDevices, domoticzScenes):
|
||||
|
|
@ -260,10 +261,15 @@ def indexPlugins(params={}):
|
|||
os.makedirs(tmpFolder)
|
||||
if not os.path.exists(indexFolderPath):
|
||||
os.makedirs(indexFolderPath)
|
||||
|
||||
if not os.path.isfile(indexFolderPath + 'README.md'):
|
||||
shutil.rmtree(indexFolderPath)
|
||||
try:
|
||||
git.Repo.clone_from("https://github.com/wez3/domoboard-plugins.git", indexFolderPath)
|
||||
except:
|
||||
print 'indexed'
|
||||
else:
|
||||
shutil.rmtree(indexFolderPath)
|
||||
os.makedirs(indexFolderPath)
|
||||
Repo.clone_from("https://github.com/wez3/domoboard-plugins.git", indexFolderPath)
|
||||
git.cmd.Git(indexFolderPath).pull("https://github.com/wez3/domoboard-plugins.git")
|
||||
folders = filter(lambda x: os.path.isdir(os.path.join(indexFolderPath, x)),
|
||||
os.listdir(indexFolderPath))
|
||||
return indexPlugins({'action': 'getPlugins'})
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
/*!
|
||||
* Font Awesome 4.5.0 by @davegandy - http://fontawesome.io - @fontawesome
|
||||
* Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
|
||||
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
|
||||
*/
|
||||
/* FONT PATH
|
||||
* -------------------------- */
|
||||
@font-face {
|
||||
font-family: 'FontAwesome';
|
||||
src: url('../fonts/fontawesome-webfont.eot?v=4.5.0');
|
||||
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.5.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.5.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.5.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.5.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.5.0#fontawesomeregular') format('svg');
|
||||
src: url('../fonts/fontawesome-webfont.eot?v=4.7.0');
|
||||
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
|
@ -118,31 +118,31 @@
|
|||
}
|
||||
}
|
||||
.fa-rotate-90 {
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
|
||||
-webkit-transform: rotate(90deg);
|
||||
-ms-transform: rotate(90deg);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
.fa-rotate-180 {
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";
|
||||
-webkit-transform: rotate(180deg);
|
||||
-ms-transform: rotate(180deg);
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
.fa-rotate-270 {
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";
|
||||
-webkit-transform: rotate(270deg);
|
||||
-ms-transform: rotate(270deg);
|
||||
transform: rotate(270deg);
|
||||
}
|
||||
.fa-flip-horizontal {
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";
|
||||
-webkit-transform: scale(-1, 1);
|
||||
-ms-transform: scale(-1, 1);
|
||||
transform: scale(-1, 1);
|
||||
}
|
||||
.fa-flip-vertical {
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);
|
||||
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
|
||||
-webkit-transform: scale(1, -1);
|
||||
-ms-transform: scale(1, -1);
|
||||
transform: scale(1, -1);
|
||||
|
|
@ -1383,7 +1383,7 @@
|
|||
.fa-digg:before {
|
||||
content: "\f1a6";
|
||||
}
|
||||
.fa-pied-piper:before {
|
||||
.fa-pied-piper-pp:before {
|
||||
content: "\f1a7";
|
||||
}
|
||||
.fa-pied-piper-alt:before {
|
||||
|
|
@ -1509,6 +1509,7 @@
|
|||
content: "\f1ce";
|
||||
}
|
||||
.fa-ra:before,
|
||||
.fa-resistance:before,
|
||||
.fa-rebel:before {
|
||||
content: "\f1d0";
|
||||
}
|
||||
|
|
@ -1831,6 +1832,7 @@
|
|||
content: "\f23e";
|
||||
}
|
||||
.fa-battery-4:before,
|
||||
.fa-battery:before,
|
||||
.fa-battery-full:before {
|
||||
content: "\f240";
|
||||
}
|
||||
|
|
@ -2084,3 +2086,252 @@
|
|||
.fa-percent:before {
|
||||
content: "\f295";
|
||||
}
|
||||
.fa-gitlab:before {
|
||||
content: "\f296";
|
||||
}
|
||||
.fa-wpbeginner:before {
|
||||
content: "\f297";
|
||||
}
|
||||
.fa-wpforms:before {
|
||||
content: "\f298";
|
||||
}
|
||||
.fa-envira:before {
|
||||
content: "\f299";
|
||||
}
|
||||
.fa-universal-access:before {
|
||||
content: "\f29a";
|
||||
}
|
||||
.fa-wheelchair-alt:before {
|
||||
content: "\f29b";
|
||||
}
|
||||
.fa-question-circle-o:before {
|
||||
content: "\f29c";
|
||||
}
|
||||
.fa-blind:before {
|
||||
content: "\f29d";
|
||||
}
|
||||
.fa-audio-description:before {
|
||||
content: "\f29e";
|
||||
}
|
||||
.fa-volume-control-phone:before {
|
||||
content: "\f2a0";
|
||||
}
|
||||
.fa-braille:before {
|
||||
content: "\f2a1";
|
||||
}
|
||||
.fa-assistive-listening-systems:before {
|
||||
content: "\f2a2";
|
||||
}
|
||||
.fa-asl-interpreting:before,
|
||||
.fa-american-sign-language-interpreting:before {
|
||||
content: "\f2a3";
|
||||
}
|
||||
.fa-deafness:before,
|
||||
.fa-hard-of-hearing:before,
|
||||
.fa-deaf:before {
|
||||
content: "\f2a4";
|
||||
}
|
||||
.fa-glide:before {
|
||||
content: "\f2a5";
|
||||
}
|
||||
.fa-glide-g:before {
|
||||
content: "\f2a6";
|
||||
}
|
||||
.fa-signing:before,
|
||||
.fa-sign-language:before {
|
||||
content: "\f2a7";
|
||||
}
|
||||
.fa-low-vision:before {
|
||||
content: "\f2a8";
|
||||
}
|
||||
.fa-viadeo:before {
|
||||
content: "\f2a9";
|
||||
}
|
||||
.fa-viadeo-square:before {
|
||||
content: "\f2aa";
|
||||
}
|
||||
.fa-snapchat:before {
|
||||
content: "\f2ab";
|
||||
}
|
||||
.fa-snapchat-ghost:before {
|
||||
content: "\f2ac";
|
||||
}
|
||||
.fa-snapchat-square:before {
|
||||
content: "\f2ad";
|
||||
}
|
||||
.fa-pied-piper:before {
|
||||
content: "\f2ae";
|
||||
}
|
||||
.fa-first-order:before {
|
||||
content: "\f2b0";
|
||||
}
|
||||
.fa-yoast:before {
|
||||
content: "\f2b1";
|
||||
}
|
||||
.fa-themeisle:before {
|
||||
content: "\f2b2";
|
||||
}
|
||||
.fa-google-plus-circle:before,
|
||||
.fa-google-plus-official:before {
|
||||
content: "\f2b3";
|
||||
}
|
||||
.fa-fa:before,
|
||||
.fa-font-awesome:before {
|
||||
content: "\f2b4";
|
||||
}
|
||||
.fa-handshake-o:before {
|
||||
content: "\f2b5";
|
||||
}
|
||||
.fa-envelope-open:before {
|
||||
content: "\f2b6";
|
||||
}
|
||||
.fa-envelope-open-o:before {
|
||||
content: "\f2b7";
|
||||
}
|
||||
.fa-linode:before {
|
||||
content: "\f2b8";
|
||||
}
|
||||
.fa-address-book:before {
|
||||
content: "\f2b9";
|
||||
}
|
||||
.fa-address-book-o:before {
|
||||
content: "\f2ba";
|
||||
}
|
||||
.fa-vcard:before,
|
||||
.fa-address-card:before {
|
||||
content: "\f2bb";
|
||||
}
|
||||
.fa-vcard-o:before,
|
||||
.fa-address-card-o:before {
|
||||
content: "\f2bc";
|
||||
}
|
||||
.fa-user-circle:before {
|
||||
content: "\f2bd";
|
||||
}
|
||||
.fa-user-circle-o:before {
|
||||
content: "\f2be";
|
||||
}
|
||||
.fa-user-o:before {
|
||||
content: "\f2c0";
|
||||
}
|
||||
.fa-id-badge:before {
|
||||
content: "\f2c1";
|
||||
}
|
||||
.fa-drivers-license:before,
|
||||
.fa-id-card:before {
|
||||
content: "\f2c2";
|
||||
}
|
||||
.fa-drivers-license-o:before,
|
||||
.fa-id-card-o:before {
|
||||
content: "\f2c3";
|
||||
}
|
||||
.fa-quora:before {
|
||||
content: "\f2c4";
|
||||
}
|
||||
.fa-free-code-camp:before {
|
||||
content: "\f2c5";
|
||||
}
|
||||
.fa-telegram:before {
|
||||
content: "\f2c6";
|
||||
}
|
||||
.fa-thermometer-4:before,
|
||||
.fa-thermometer:before,
|
||||
.fa-thermometer-full:before {
|
||||
content: "\f2c7";
|
||||
}
|
||||
.fa-thermometer-3:before,
|
||||
.fa-thermometer-three-quarters:before {
|
||||
content: "\f2c8";
|
||||
}
|
||||
.fa-thermometer-2:before,
|
||||
.fa-thermometer-half:before {
|
||||
content: "\f2c9";
|
||||
}
|
||||
.fa-thermometer-1:before,
|
||||
.fa-thermometer-quarter:before {
|
||||
content: "\f2ca";
|
||||
}
|
||||
.fa-thermometer-0:before,
|
||||
.fa-thermometer-empty:before {
|
||||
content: "\f2cb";
|
||||
}
|
||||
.fa-shower:before {
|
||||
content: "\f2cc";
|
||||
}
|
||||
.fa-bathtub:before,
|
||||
.fa-s15:before,
|
||||
.fa-bath:before {
|
||||
content: "\f2cd";
|
||||
}
|
||||
.fa-podcast:before {
|
||||
content: "\f2ce";
|
||||
}
|
||||
.fa-window-maximize:before {
|
||||
content: "\f2d0";
|
||||
}
|
||||
.fa-window-minimize:before {
|
||||
content: "\f2d1";
|
||||
}
|
||||
.fa-window-restore:before {
|
||||
content: "\f2d2";
|
||||
}
|
||||
.fa-times-rectangle:before,
|
||||
.fa-window-close:before {
|
||||
content: "\f2d3";
|
||||
}
|
||||
.fa-times-rectangle-o:before,
|
||||
.fa-window-close-o:before {
|
||||
content: "\f2d4";
|
||||
}
|
||||
.fa-bandcamp:before {
|
||||
content: "\f2d5";
|
||||
}
|
||||
.fa-grav:before {
|
||||
content: "\f2d6";
|
||||
}
|
||||
.fa-etsy:before {
|
||||
content: "\f2d7";
|
||||
}
|
||||
.fa-imdb:before {
|
||||
content: "\f2d8";
|
||||
}
|
||||
.fa-ravelry:before {
|
||||
content: "\f2d9";
|
||||
}
|
||||
.fa-eercast:before {
|
||||
content: "\f2da";
|
||||
}
|
||||
.fa-microchip:before {
|
||||
content: "\f2db";
|
||||
}
|
||||
.fa-snowflake-o:before {
|
||||
content: "\f2dc";
|
||||
}
|
||||
.fa-superpowers:before {
|
||||
content: "\f2dd";
|
||||
}
|
||||
.fa-wpexplorer:before {
|
||||
content: "\f2de";
|
||||
}
|
||||
.fa-meetup:before {
|
||||
content: "\f2e0";
|
||||
}
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
border: 0;
|
||||
}
|
||||
.sr-only-focusable:active,
|
||||
.sr-only-focusable:focus {
|
||||
position: static;
|
||||
width: auto;
|
||||
height: auto;
|
||||
margin: 0;
|
||||
overflow: visible;
|
||||
clip: auto;
|
||||
}
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 357 KiB After Width: | Height: | Size: 434 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
|
@ -5,13 +5,39 @@
|
|||
<!-- Meta, title, CSS, favicons, etc. -->
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
|
||||
<link rel="shortcut icon" href="/static/images/favicon.ico" />
|
||||
<link rel="apple-touch-icon" href="/static/images/icons/logo-76x76.png"/>
|
||||
<link rel="icon" sizes="196x196" href="/static/images/icons/logo-169x169.png">
|
||||
<link rel="icon" sizes="192x192" href="/static/images/icons/logo-192x192.png">
|
||||
|
||||
<!-- ICONS -->
|
||||
<!-- iPad retina icon -->
|
||||
<link href="/static/images/icons/logo-152x152.png" sizes="152x152" rel="apple-touch-icon-precomposed">
|
||||
<!-- iPad retina icon (iOS < 7) -->
|
||||
<link href="/static/images/icons/logo-144x144.png" sizes="144x144" rel="apple-touch-icon-precomposed">
|
||||
<!-- iPad non-retina icon -->
|
||||
<link href="/static/images/icons/logo-76x76.png" sizes="76x76" rel="apple-touch-icon-precomposed">
|
||||
<!-- iPad non-retina icon (iOS < 7) -->
|
||||
<link href="/static/images/icons/logo-72x72.png" sizes="72x72" rel="apple-touch-icon-precomposed">
|
||||
<!-- iPhone 6 Plus icon -->
|
||||
<link href="/static/images/icons/logo-180x180.png" sizes="120x120" rel="apple-touch-icon-precomposed">
|
||||
<!-- iPhone retina icon (iOS < 7) -->
|
||||
<link href="/static/images/icons/logo-114x114.png" sizes="114x114" rel="apple-touch-icon-precomposed">
|
||||
<!-- iPhone non-retina icon (iOS < 7) -->
|
||||
<link href="/static/images/icons/logo-57x57.png" sizes="57x57" rel="apple-touch-icon-precomposed">
|
||||
|
||||
<title>Domoboard</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<script src="/static/js/jquery-2.2.3.min.js"></script>
|
||||
<script src="/static/js/jquery-3.1.0.min.js"></script>
|
||||
<link rel="shortcut icon" href="/static/images/favicon.ico">
|
||||
<!--<link rel="shortcut icon" href="/static/images/favicon.ico">-->
|
||||
<link href="/static/fonts/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,38 @@
|
|||
<!-- Meta, title, CSS, favicons, etc. -->
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
|
||||
<link rel="shortcut icon" href="/static/images/favicon.ico" />
|
||||
<link rel="apple-touch-icon" href="/static/images/icons/logo-76x76.png"/>
|
||||
<link rel="icon" sizes="196x196" href="/static/images/icons/logo-169x169.png">
|
||||
<link rel="icon" sizes="192x192" href="/static/images/icons/logo-192x192.png">
|
||||
|
||||
<!-- ICONS -->
|
||||
<!-- iPad retina icon -->
|
||||
<link href="/static/images/icons/logo-152x152.png" sizes="152x152" rel="apple-touch-icon-precomposed">
|
||||
<!-- iPad retina icon (iOS < 7) -->
|
||||
<link href="/static/images/icons/logo-144x144.png" sizes="144x144" rel="apple-touch-icon-precomposed">
|
||||
<!-- iPad non-retina icon -->
|
||||
<link href="/static/images/icons/logo-76x76.png" sizes="76x76" rel="apple-touch-icon-precomposed">
|
||||
<!-- iPad non-retina icon (iOS < 7) -->
|
||||
<link href="/static/images/icons/logo-72x72.png" sizes="72x72" rel="apple-touch-icon-precomposed">
|
||||
<!-- iPhone 6 Plus icon -->
|
||||
<link href="/static/images/icons/logo-180x180.png" sizes="120x120" rel="apple-touch-icon-precomposed">
|
||||
<!-- iPhone retina icon (iOS < 7) -->
|
||||
<link href="/static/images/icons/logo-114x114.png" sizes="114x114" rel="apple-touch-icon-precomposed">
|
||||
<!-- iPhone non-retina icon (iOS < 7) -->
|
||||
<link href="/static/images/icons/logo-57x57.png" sizes="57x57" rel="apple-touch-icon-precomposed">
|
||||
|
||||
<title>Domoboard</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link rel="shortcut icon" href="/static/images/favicon.ico">
|
||||
<!--<link rel="shortcut icon" href="/static/images/favicon.ico">-->
|
||||
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="/static/fonts/css/font-awesome.min.css" rel="stylesheet">
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,17 @@
|
|||
<link href="static/css/settings.css" rel="stylesheet" type="text/css"/>
|
||||
<ul class="tab">
|
||||
<li><a href="javascript:void(0)" id="defaultOpen" class="tablinks"
|
||||
onclick="openCat(event, 'settings')">Settings</a>
|
||||
onclick="openCat(event, 'plugins')">Plugins</a>
|
||||
</li>
|
||||
<li><a href="javascript:void(0)" class="tablinks"
|
||||
onclick="openCat(event, 'plugins')">Plugins</a></li>
|
||||
onclick="openCat(event, 'settings')">Settings</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="plugins" class="tabcontent">
|
||||
<button type="button" id="indexPluginsBtn" class="btn btn-primary">Index Plugins</button>
|
||||
<div id="pluginView">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabcontent" id="settings">
|
||||
<div class="modal fade tabcontent" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
|
|
@ -77,66 +76,62 @@
|
|||
document.getElementById(catName).style.display = "block";
|
||||
evt.currentTarget.className += " active";
|
||||
}
|
||||
function getIndexedPlugins() {
|
||||
var url = '/api?custom=indexPlugins&action=getPlugins';
|
||||
requestAPI(url, function(d){
|
||||
var result = JSON.parse(d);
|
||||
$('#pluginView').empty();
|
||||
for (i in result) {
|
||||
var buttons = '';
|
||||
if (result[i].update == 'yes') {
|
||||
buttons = buttons + "<button onclick='updatePlugin("+ result[i].id + ")' type='button' class='btn updateBtn'>Update";
|
||||
}
|
||||
buttons = buttons + "<button onclick='" + result[i].status + "Plugin(" + result[i].id + ")' name='"+ result[i].title + "' fol='" + result[i].folder + "' type='button' class='btn " + result[i].status + "Btn'>" + result[i].status + "</button>";
|
||||
$('#pluginView').append("<div class='pluginItem'><span onclick=getSummary('" + result[i].title + "_summary')>" + result[i].title + " - Author: " + result[i].author + " - version: " + result[i].version + "</span>"+ buttons + "<div id='" + result[i].title + "_summary' class='fullSummary'><span>" + result[i].description + "</span></div></div>");
|
||||
if (("structure" in result[i]) == true) {
|
||||
$('#' + result[i].title + "_summary").append('<div>');
|
||||
$('#' + result[i].title + "_summary").append('<ul>');
|
||||
for (k in result[i].structure[result[i].folder]) {
|
||||
for (l in result[i].structure[result[i].folder][k]) {
|
||||
$('#' + result[i].title + "_summary").append('<li>' + k + '/' + l + '</li>');
|
||||
}
|
||||
}
|
||||
$('#' + result[i].title + "_summary").append('</ul>');
|
||||
$('#' + result[i].title + "_summary").append('</div>');
|
||||
}
|
||||
|
||||
function getIndexedPlugins(d) {
|
||||
var result = JSON.parse(d);
|
||||
$('#pluginView').empty();
|
||||
for (i in result) {
|
||||
var buttons = '';
|
||||
if (result[i].update == 'yes') {
|
||||
buttons = buttons + "<button onclick='updatePlugin("+ result[i].id + ")' type='button' class='btn updateBtn'>update";
|
||||
}
|
||||
$('.fullSummary').hide();
|
||||
});
|
||||
buttons = buttons + "<button onclick='" + result[i].status + "Plugin(" + result[i].id + ")' name='"+ result[i].title + "' fol='" + result[i].folder + "' type='button' class='btn " + result[i].status + "Btn'>" + result[i].status + "</button>";
|
||||
$('#pluginView').append("<div class='pluginItem'><span onclick=getSummary('" + result[i].title + "_summary')>" + result[i].title + " - Author: " + result[i].author + " - version: " + result[i].version + "</span>"+ buttons + "<div id='" + result[i].title + "_summary' class='fullSummary'><span>" + result[i].description + "</span></div></div>");
|
||||
if (("structure" in result[i]) == true) {
|
||||
$('#' + result[i].title + "_summary").append('<div>');
|
||||
$('#' + result[i].title + "_summary").append('<ul>');
|
||||
for (k in result[i].structure[result[i].folder]) {
|
||||
for (l in result[i].structure[result[i].folder][k]) {
|
||||
$('#' + result[i].title + "_summary").append('<li>' + k + '/' + l + '</li>');
|
||||
}
|
||||
}
|
||||
$('#' + result[i].title + "_summary").append('</ul>');
|
||||
$('#' + result[i].title + "_summary").append('</div>');
|
||||
}
|
||||
}
|
||||
$('.fullSummary').hide();
|
||||
}
|
||||
|
||||
function installPlugin(plugin_id) {
|
||||
var url = "/api?custom=indexPlugins&action=installPlugin&folid=" + plugin_id;
|
||||
requestAPI(url, function(d){
|
||||
getIndexedPlugins();
|
||||
automaticIndex();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
function removePlugin(plugin_id) {
|
||||
var url = "/api?custom=indexPlugins&action=removePlugin&folid=" + plugin_id;
|
||||
requestAPI(url, function(d){
|
||||
getIndexedPlugins();
|
||||
automaticIndex();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function updatePlugin(plugin_id) {
|
||||
var url = "/api?custom=indexPlugins&action=removePlugin&folid=" + plugin_id;
|
||||
requestAPI(url, function(d) {
|
||||
var url = "/api?custom=indexPlugins&action=installPlugin&folid=" + plugin_id;
|
||||
requestAPI(url, function(dd) {
|
||||
getIndexedPlugins();
|
||||
automaticIndex();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
$('#indexPluginsBtn').on('click', function(event) {
|
||||
var url = "/api?custom=indexPlugins";
|
||||
requestAPI(url, function(d){
|
||||
getIndexedPlugins();
|
||||
});
|
||||
});
|
||||
function automaticIndex() {
|
||||
var url = "/api?custom=indexPlugins";
|
||||
requestAPI(url, function(d){
|
||||
getIndexedPlugins(d);
|
||||
});
|
||||
}
|
||||
|
||||
function getSummary(div_id) {
|
||||
$('.fullSummary').hide();
|
||||
|
|
@ -150,11 +145,10 @@
|
|||
$(document).ready(function () {
|
||||
// Get the element with id="defaultOpen" and click on it
|
||||
document.getElementById("defaultOpen").click();
|
||||
getIndexedPlugins();
|
||||
setInterval(automaticIndex(), 9000);
|
||||
$('.fullSummary').hide();
|
||||
|
||||
});
|
||||
setInterval(getIndexedPlugins(), 9000);
|
||||
|
||||
retrieveAvailableDevices();
|
||||
selected_page_settings();
|
||||
selected_component_settings();
|
||||
|
|
|
|||