Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Feb 14, 2015
1 parent da4db79 commit 9ef20d5
Show file tree
Hide file tree
Showing 31 changed files with 261 additions and 191 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -18,11 +18,11 @@ clean:
check:
cd plugins && ajenti-dev-multitool --find-outdated

upload:
upload: build
cd ajenti-core && ./setup.py sdist upload
cd ajenti-panel && ./setup.py sdist upload

upload-plugins:
upload-plugins: build
cd plugins && ajenti-dev-multitool --setuppy 'sdist upload'

test:
Expand Down
2 changes: 1 addition & 1 deletion ajenti-core/aj/__init__.py
Expand Up @@ -7,7 +7,7 @@

# imported by installer, no 3rd party imports here!

__version__ = '0.15'
__version__ = '0.21'

# Global state

Expand Down
4 changes: 3 additions & 1 deletion ajenti-core/aj/gate/session.py
@@ -1,4 +1,6 @@
import uuid
from aj.util import LazyModule

uuid = LazyModule('uuid') # uses ctypes, forks, screws up Upstart
import time
import logging
from cookies import Cookie, Cookies
Expand Down
4 changes: 3 additions & 1 deletion ajenti-core/aj/gate/stream.py
@@ -1,10 +1,12 @@
from aj.util import LazyModule

uuid = LazyModule('uuid') # uses ctypes, forks, screws up Upstart
from gevent.lock import RLock
import gevent.socket
from gevent.socket import wait_read, wait_write
import gipc
import logging
import time
import uuid


class GateStreamRequest (object):
Expand Down
2 changes: 1 addition & 1 deletion ajenti-core/aj/util/misc.py
@@ -1,4 +1,3 @@
import catcher
import logging
import subprocess
import traceback
Expand Down Expand Up @@ -31,6 +30,7 @@ def make_report(e):
"""
Formats a bug report.
"""
import catcher
import platform as _platform
from aj import platform, platform_unmapped, platform_string, installation_uid, version, debug

Expand Down
2 changes: 1 addition & 1 deletion plugins/ace/.last-upload
@@ -1 +1 @@
1423822354.3
1423927691.46
2 changes: 1 addition & 1 deletion plugins/core/.last-upload
@@ -1 +1 @@
1423822358.79
1423927701.24
4 changes: 3 additions & 1 deletion plugins/core/api/tasks.py
@@ -1,3 +1,5 @@
from aj.util import LazyModule

import gipc
import logging
import sys
Expand All @@ -7,7 +9,7 @@
import os
import setproctitle
import signal
import uuid
uuid = LazyModule('uuid') # uses ctypes, forks, screws up Upstart

from aj.api import *
from aj.log import set_log_params
Expand Down
2 changes: 1 addition & 1 deletion plugins/core/plugin.yml
Expand Up @@ -2,7 +2,7 @@ name: core
author: Ajenti project
email: e@ajenti.org
url: http://ajenti.org
version: '0.9'
version: '0.12'
title: Core
icon: link
dependencies: []
Expand Down
33 changes: 18 additions & 15 deletions plugins/core/resources/js/core/services/core.service.coffee
@@ -1,20 +1,23 @@
angular.module('core').service 'core', ($timeout, $q, $http, identity, messagebox) ->
@restart = () ->
messagebox.show(title: 'Restart', text: 'Restart the panel?', positive: 'Yes', negative: 'No').then () ->
q = $q.defer()
msg = messagebox.show progress: true, title: 'Restarting'
$http.get('/api/core/restart-master').success () ->
$timeout () ->
msg.close()
q.resolve()
messagebox.show title: 'Restarted', text: 'Please wait'
$timeout () ->
location.reload()
, 5000
.error (err) ->
messagebox.show(title: 'Restart', text: 'Restart the panel?', positive: 'Yes', negative: 'No').then () =>
@forceRestart()

@forceRestart = () ->
q = $q.defer()
msg = messagebox.show progress: true, title: 'Restarting'
$http.get('/api/core/restart-master').success () ->
$timeout () ->
msg.close()
notify.error 'Could not restart', err.message
q.reject(err)
return q.promise
q.resolve()
messagebox.show title: 'Restarted', text: 'Please wait'
$timeout () ->
location.reload()
, 5000
.error (err) ->
msg.close()
notify.error 'Could not restart', err.message
q.reject(err)
return q.promise

return this
2 changes: 1 addition & 1 deletion plugins/dashboard/.last-upload
@@ -1 +1 @@
1423822327.86
1423927663.15
2 changes: 1 addition & 1 deletion plugins/dashboard/plugin.yml
Expand Up @@ -2,7 +2,7 @@ name: dashboard
author: Ajenti project
email: e@ajenti.org
url: http://ajenti.org
version: '0.8'
version: '0.9'
title: 'Dashboard'
icon: bar-chart
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion plugins/filemanager/.last-upload
@@ -1 +1 @@
1423822342.5
1423927679.52
2 changes: 1 addition & 1 deletion plugins/filesystem/.last-upload
@@ -1 +1 @@
1423822360.79
1423927703.71
2 changes: 1 addition & 1 deletion plugins/filesystem/plugin.yml
Expand Up @@ -2,7 +2,7 @@ name: filesystem
author: Ajenti project
email: e@ajenti.org
url: http://ajenti.org
version: '0.8'
version: '0.9'
title: 'Filesystem API'
icon: cog
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion plugins/notepad/.last-upload
@@ -1 +1 @@
1423822329.72
1423927665.1
2 changes: 1 addition & 1 deletion plugins/packages/.last-upload
@@ -1 +1 @@
1423822337.04
1423927672.59
2 changes: 1 addition & 1 deletion plugins/packages/plugin.yml
Expand Up @@ -2,7 +2,7 @@ name: packages
author: Ajenti project
email: e@ajenti.org
url: http://ajenti.org
version: '0.8'
version: '0.9'
title: 'Packages'
icon: gift
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion plugins/passwd/.last-upload
@@ -1 +1 @@
1423822330.93
1423927666.42
2 changes: 1 addition & 1 deletion plugins/plugins/.last-upload
@@ -1 +1 @@
1423822341.39
1423927678.41
2 changes: 1 addition & 1 deletion plugins/plugins/plugin.yml
Expand Up @@ -2,7 +2,7 @@ name: plugins
author: Ajenti project
email: e@ajenti.org
url: http://ajenti.org
version: '0.9'
version: '0.15'
title: 'Plugins'
icon: th-large
dependencies:
Expand Down
1 change: 0 additions & 1 deletion plugins/plugins/requirements.txt
@@ -1,3 +1,2 @@
aj
ajenti.plugin.core
urllib3
34 changes: 27 additions & 7 deletions plugins/plugins/resources/js/controllers/index.controller.coffee
Expand Up @@ -3,6 +3,7 @@ angular.module('ajenti.plugins').controller 'PluginsIndexController', ($scope, $

$scope.selectedInstalledPlugin = null
$scope.selectedRepoPlugin = null
$scope.coreUpgradeAvailable = null

$scope.refresh = () ->
$http.get('/api/plugins/list/installed').success (data) ->
Expand All @@ -16,9 +17,21 @@ angular.module('ajenti.plugins').controller 'PluginsIndexController', ($scope, $
notify.error 'Could not installed plugin list', err.message
$http.get('/api/plugins/pypi/list').success (data) ->
$scope.pypiList = data
$http.get('/api/plugins/core/check-upgrade').success (data) ->
$scope.coreUpgradeAvailable = data

$scope.refresh()

$scope.upgradeCore = () ->
msg = messagebox.show progress: true, title: 'Upgrading'
$http.get("/api/plugins/core/upgrade/#{$scope.coreUpgradeAvailable}").success () ->
messagebox.show(title: 'Done', text: 'Upgrade complete. A panel restart is absolutely required.', positive: 'Restart now').then () ->
core.forceRestart()
.error (err) ->
notify.error 'Upgrade failed', err.message
.finally () ->
msg.close()

$scope.isInstalled = (plugin) ->
if not $scope.isInstalled
return false
Expand All @@ -27,36 +40,43 @@ angular.module('ajenti.plugins').controller 'PluginsIndexController', ($scope, $
return true
return false

$scope.isUpgradeable = (plugin) ->
$scope.getUpgrade = (plugin) ->
if not $scope.repoList or not plugin
return false
return null
for p in $scope.repoList
if p.name == plugin.name and p.version != plugin.version
return true
return false
return p
return null

$scope.installPlugin = (plugin) ->
$scope.selectedRepoPlugin = null
$scope.selectedInstalledPlugin = null
msg = messagebox.show progress: true, title: 'Installing'
$http.get("/api/plugins/pypi/install/#{plugin.name}").success () ->
$http.get("/api/plugins/pypi/install/#{plugin.name}/#{plugin.version}").success () ->
$scope.refresh()
messagebox.show(title: 'Done', text: 'Installed. A panel restart is required.', positive: 'Restart now', negative: 'Later').then () ->
$scope.restart()
core.forceRestart()
.error (err) ->
notify.error 'Install failed', err.message
.finally () ->
msg.close()

$scope.uninstallPlugin = (plugin) ->
if plugin.name in ['plugins', 'settings']
messagebox.show(title: 'Warning', text: 'This will remove the Plugins plugin. You can reinstall it later using PIP.', positive: 'Continue', negative: 'Cancel').then () ->
doUninstallPlugin(plugin)
else
doUninstallPlugin(plugin)

$scope.doUninstallPlugin = (plugin) ->
$scope.selectedRepoPlugin = null
$scope.selectedInstalledPlugin = null
messagebox.show(title: 'Uninstall', text: "Uninstall #{plugin.name}?", positive: 'Uninstall', negative: 'Cancel').then () ->
msg = messagebox.show progress: true, title: 'Uninstalling'
$http.get("/api/plugins/pypi/uninstall/#{plugin.name}").success () ->
$scope.refresh()
messagebox.show(title: 'Done', text: 'Uninstalled. A panel restart is required.', positive: 'Restart now', negative: 'Later').then () ->
$scope.restart()
core.forceRestart()
.error (err) ->
notify.error 'Uninstall failed', err.message
.finally () ->
Expand Down

0 comments on commit 9ef20d5

Please sign in to comment.