From 95b96692130e0a949375e133c1aa879efd0cfb2e Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 1 May 2016 21:20:49 -0400 Subject: Create form on admin/plugins page to add plugin git repo using PHPGit --- view/tpl/admin_plugins.tpl | 19 +++++++++++++++---- view/tpl/admin_plugins_addrepo.tpl | 8 ++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 view/tpl/admin_plugins_addrepo.tpl (limited to 'view') diff --git a/view/tpl/admin_plugins.tpl b/view/tpl/admin_plugins.tpl index 4b91f9e46..1493d13a4 100755 --- a/view/tpl/admin_plugins.tpl +++ b/view/tpl/admin_plugins.tpl @@ -1,6 +1,16 @@ -
-

{{$title}} - {{$page}}

- +
+
+
+ +
+

{{$title}} - {{$page}}

+
+
+ +
+
    {{foreach $plugins as $p}}
  • @@ -16,4 +26,5 @@
  • {{/foreach}}
-
+
+
\ No newline at end of file diff --git a/view/tpl/admin_plugins_addrepo.tpl b/view/tpl/admin_plugins_addrepo.tpl new file mode 100644 index 000000000..f6264f879 --- /dev/null +++ b/view/tpl/admin_plugins_addrepo.tpl @@ -0,0 +1,8 @@ +
+ +

{{$desc}}

+ {{include file="field_input.tpl" field=$repoURL}} +
+ +
+
-- cgit v1.2.3 From c2d15e6c3bd8a29bae89d184a999ddac15fcb807 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 1 May 2016 22:29:51 -0400 Subject: New plugin repo is cloned to /store/pluginrepos/REPONAME for analysis --- view/tpl/admin_plugins.tpl | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'view') diff --git a/view/tpl/admin_plugins.tpl b/view/tpl/admin_plugins.tpl index 1493d13a4..3747a59f9 100755 --- a/view/tpl/admin_plugins.tpl +++ b/view/tpl/admin_plugins.tpl @@ -11,20 +11,21 @@
-
    - {{foreach $plugins as $p}} -
  • - {{if ! $p.2.disabled}} - - {{else}} - - {{/if}} - {{$p.2.name}} - {{$p.2.version}}{{if $p.2.disabled}} {{$disabled}}{{/if}} - {{if $p.2.experimental}} {{$experimental}} {{/if}}{{if $p.2.unsupported}} {{$unsupported}} {{/if}} + {{foreach $plugins as $p}} +
    +
    + {{if ! $p.2.disabled}} + + {{else}} + + {{/if}} + {{$p.2.name}} - {{$p.2.version}}{{if $p.2.disabled}} {{$disabled}}{{/if}} + {{if $p.2.experimental}} {{$experimental}} {{/if}}{{if $p.2.unsupported}} {{$unsupported}} {{/if}} -
    {{$p.2.description}}
    -
  • - {{/foreach}} -
+
{{$p.2.description}}
+
+ + {{/foreach}} + \ No newline at end of file -- cgit v1.2.3 From 9619d02be988a5af7746fa5524b17e645f99d40d Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Tue, 3 May 2016 06:30:46 -0400 Subject: AJAX and spinner for add repo form submission. Repo info will be displayed below the form. --- view/tpl/admin_plugins.tpl | 26 +++++++++++++++++++++++++- view/tpl/admin_plugins_addrepo.tpl | 2 +- 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'view') diff --git a/view/tpl/admin_plugins.tpl b/view/tpl/admin_plugins.tpl index 3747a59f9..e10cde81d 100755 --- a/view/tpl/admin_plugins.tpl +++ b/view/tpl/admin_plugins.tpl @@ -10,6 +10,11 @@ {{$form}}
+
+
+
+
+
{{foreach $plugins as $p}}
@@ -28,4 +33,23 @@ {{/foreach}}
-
\ No newline at end of file + + + \ No newline at end of file diff --git a/view/tpl/admin_plugins_addrepo.tpl b/view/tpl/admin_plugins_addrepo.tpl index f6264f879..fe5fecc25 100644 --- a/view/tpl/admin_plugins_addrepo.tpl +++ b/view/tpl/admin_plugins_addrepo.tpl @@ -3,6 +3,6 @@

{{$desc}}

{{include file="field_input.tpl" field=$repoURL}}
- +
-- cgit v1.2.3 From 5686ee13b4540bfc0ce6c40f07b6e43c3c55e9a8 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Tue, 3 May 2016 21:49:52 -0400 Subject: Increased PHPGit timeout to 120 seconds for large repos. Retrieve Readme.md and render on plugins page. --- view/tpl/admin_plugins.tpl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'view') diff --git a/view/tpl/admin_plugins.tpl b/view/tpl/admin_plugins.tpl index e10cde81d..97759f817 100755 --- a/view/tpl/admin_plugins.tpl +++ b/view/tpl/admin_plugins.tpl @@ -44,7 +44,16 @@ function(response) { $('#chat-rotator').spin(false); if (response.success) { - $('#new-repo-info').html('

Repo Info

The repo was cloned to
' + response.message + '

'); + $('#new-repo-info').html('

Repo Info

' + response.message + '

'); + + $('#new-repo-info').append('

Branches

'+JSON.stringify(response.repo.branches)+'

'); + $('#new-repo-info').append('

URL

'+response.repo.url+'

'); + $('#new-repo-info').append('

Objects

    '); + for(var i = 0; i'+response.repo.objects[i]+''); + } + $('#new-repo-info').append('
'); + $('#new-repo-info').append('

Readme

'+response.repo.readme+'

'); } else { window.console.log('Error adding repo :' + response['message']); } -- cgit v1.2.3 From 0746794e8145eac0608eef26b9c6d3d0ae5319cc Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sat, 7 May 2016 18:39:19 -0400 Subject: New plugin repo cloned using new GitRepo class. Readme and info displayed in wide modal dialog. --- view/tpl/admin_plugins.tpl | 19 ++++++++----------- view/tpl/generic_modal.tpl | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 view/tpl/generic_modal.tpl (limited to 'view') diff --git a/view/tpl/admin_plugins.tpl b/view/tpl/admin_plugins.tpl index 97759f817..3ba83986f 100755 --- a/view/tpl/admin_plugins.tpl +++ b/view/tpl/admin_plugins.tpl @@ -34,7 +34,7 @@ - +{{$newRepoModal}} \ No newline at end of file -- cgit v1.2.3 From 174484a51cfc99e2194480a7e7513694028eecb3 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 8 May 2016 09:26:06 -0400 Subject: Custom addon repo name option added. --- view/tpl/admin_plugins.tpl | 3 ++- view/tpl/admin_plugins_addrepo.tpl | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'view') diff --git a/view/tpl/admin_plugins.tpl b/view/tpl/admin_plugins.tpl index 9e1d05a44..87d380a01 100755 --- a/view/tpl/admin_plugins.tpl +++ b/view/tpl/admin_plugins.tpl @@ -54,9 +54,10 @@ function adminPluginsAddRepo() { var repoURL = $('#id_repoURL').val(); + var repoName = $('#id_repoName').val(); $('#chat-rotator').spin('tiny'); $.post( - "/admin/plugins/addrepo", {repoURL: repoURL}, + "/admin/plugins/addrepo", {repoURL: repoURL, repoName: repoName}, function(response) { $('#chat-rotator').spin(false); if (response.success) { diff --git a/view/tpl/admin_plugins_addrepo.tpl b/view/tpl/admin_plugins_addrepo.tpl index fe5fecc25..de7b465bb 100644 --- a/view/tpl/admin_plugins_addrepo.tpl +++ b/view/tpl/admin_plugins_addrepo.tpl @@ -2,6 +2,7 @@

{{$desc}}

{{include file="field_input.tpl" field=$repoURL}} + {{include file="field_input.tpl" field=$repoName}}
-- cgit v1.2.3 From d714cd76dd4f38f7a04c7f9fbded427d7b06d3a8 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Sun, 8 May 2016 20:30:00 -0400 Subject: Addon repo is copied to /extend/addon/ when admin presses install. Addon repos can be removed via GUI. --- view/tpl/admin_plugins.tpl | 55 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 6 deletions(-) (limited to 'view') diff --git a/view/tpl/admin_plugins.tpl b/view/tpl/admin_plugins.tpl index 87d380a01..8ed5fd556 100755 --- a/view/tpl/admin_plugins.tpl +++ b/view/tpl/admin_plugins.tpl @@ -50,8 +50,6 @@ {{$newRepoModal}} \ No newline at end of file -- cgit v1.2.3 From 180731c162b12f62a0065bc9ce8d537a95c98ed6 Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Mon, 9 May 2016 21:17:47 -0400 Subject: copy-paste error --- view/tpl/admin_plugins.tpl | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'view') diff --git a/view/tpl/admin_plugins.tpl b/view/tpl/admin_plugins.tpl index 8ed5fd556..876681f9f 100755 --- a/view/tpl/admin_plugins.tpl +++ b/view/tpl/admin_plugins.tpl @@ -14,18 +14,19 @@
-
-

Installed Addon Repositories

+
@@ -110,6 +111,20 @@ function updateAddonRepo(repoName) { window.console.log('updateAddonRep:; ' + repoName); // TODO: Update an existing repo + if(confirm('Are you sure you want to update the addon repo ' + repoName + '?')) { + $.post( + "/admin/plugins/updaterepo", {repoName: repoName}, + function(response) { + if (response.success) { + window.console.log('Addon repo'+repoName+'successfully updated :' + response['message']); + alert('Repo updated'); + } else { + window.console.log('Error installing repo :' + response['message']); + } + return false; + }, + 'json'); + } } function switchAddonRepoBranch(repoName) { window.console.log('switchAddonRepoBranch: ' + repoName); @@ -117,20 +132,20 @@ } function removeAddonRepo(repoName) { window.console.log('removeAddonRepo: ' + repoName); - // TODO: Unlink the addons and delete the addon repo + // TODO: Unlink the addons if(confirm('Are you sure you want to remove the addon repo ' + repoName + '?')) { $.post( "/admin/plugins/removerepo", {repoName: repoName}, function(response) { if (response.success) { window.console.log('Addon repo'+repoName+'successfully removed :' + response['message']); + alert('Repo deleted'); } else { window.console.log('Error installing repo :' + response['message']); } return false; }, 'json'); - //alert('Deleted'); } } -- cgit v1.2.3 From 9c8cf7d43372aeea4d8a450e7cb17d7a24b64d5f Mon Sep 17 00:00:00 2001 From: Andrew Manning Date: Mon, 9 May 2016 21:59:27 -0400 Subject: Fixed some bugs with empty repo name and improved the interface a bit. --- view/tpl/admin_plugins.tpl | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'view') diff --git a/view/tpl/admin_plugins.tpl b/view/tpl/admin_plugins.tpl index 876681f9f..3265a534c 100755 --- a/view/tpl/admin_plugins.tpl +++ b/view/tpl/admin_plugins.tpl @@ -17,15 +17,14 @@