From e16f32c1741c25808577c821795eef50bc48a9ca Mon Sep 17 00:00:00 2001 From: Squandor Date: Wed, 4 Jan 2017 08:53:32 +0100 Subject: [PATCH 01/11] added automatic update for the plugins-manager --- templates/settings.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/templates/settings.html b/templates/settings.html index c6ca97e..a62ba55 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -130,7 +130,12 @@ } - + function automaticIndex() { + var url = "/api?custom=indexPlugins"; + requestAPI(url, function(d){ + getIndexedPlugins(); + }); + } $('#indexPluginsBtn').on('click', function(event) { var url = "/api?custom=indexPlugins"; requestAPI(url, function(d){ @@ -150,11 +155,11 @@ $(document).ready(function () { // Get the element with id="defaultOpen" and click on it document.getElementById("defaultOpen").click(); - getIndexedPlugins(); + automaticIndex(); $('.fullSummary').hide(); }); - setInterval(getIndexedPlugins(), 9000); + setInterval(automaticIndex(), 9000); retrieveAvailableDevices(); selected_page_settings(); selected_component_settings(); From ea777b47190b628521787b1ac391aeda8becbbbc Mon Sep 17 00:00:00 2001 From: Squandor Date: Wed, 4 Jan 2017 11:47:10 +0100 Subject: [PATCH 02/11] changed some code tweaks and plugin updates --- modules/api.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/api.py b/modules/api.py index e16ef7d..caf9f90 100644 --- a/modules/api.py +++ b/modules/api.py @@ -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 @@ -260,10 +260,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'}) From 2f8bb2cb6bdb08bdfd5b59cd9dc28aa820d55606 Mon Sep 17 00:00:00 2001 From: Squandor Date: Wed, 4 Jan 2017 12:01:42 +0100 Subject: [PATCH 03/11] changed some code tweaks and plugin updates --- templates/settings.html | 42 +++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/templates/settings.html b/templates/settings.html index a62ba55..aacebbf 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -1,18 +1,17 @@
  • Settings + onclick="openCat(event, 'plugins')">Plugins
  • Plugins
  • + onclick="openCat(event, 'settings')">Settings +
-
-
-
+