|
@@ -73,6 +73,7 @@ class type_path(Load):
|
|
self.common(
|
|
self.common(
|
|
name = u'硬件类型'
|
|
name = u'硬件类型'
|
|
,path = '/hardware/type'
|
|
,path = '/hardware/type'
|
|
|
|
+ ,button = ({'name':'重启守护进程','link':'/hardware/restart_cron','ajax':True,'icon':''},{'name':'重启mqtt订阅服务','link':'/hardware/restart_sub','ajax':True,'icon':''},{'name':'重启园区服务','link':'/hardware/restart_front','ajax':True,'icon':''},{'name':'重启后台服务','link':'/hardware/restart_admin','ajax':True,'icon':''},{'name':'重启网站服务','link':'/hardware/restart_web','ajax':True,'icon':''})
|
|
,width = '600'
|
|
,width = '600'
|
|
,height = '300'
|
|
,height = '300'
|
|
,search = (('name-input-mlike',), (u'类型名称',))
|
|
,search = (('name-input-mlike',), (u'类型名称',))
|
|
@@ -102,3 +103,34 @@ class type_update_path(Load):
|
|
@Web.setting
|
|
@Web.setting
|
|
def delete(self):
|
|
def delete(self):
|
|
self.commonDelete('hardware_type')
|
|
self.commonDelete('hardware_type')
|
|
|
|
+
|
|
|
|
+class restart_cron_path(Load):
|
|
|
|
+ @Web.auth
|
|
|
|
+ @Web.setting
|
|
|
|
+ def post(self):
|
|
|
|
+ Shell.popen('ps -ef | grep cron.py | grep -v grep |awk '{print $1}'|xargs kill -9')
|
|
|
|
+ Shell.popen('./cron.py >/dev/null &')
|
|
|
|
+
|
|
|
|
+class restart_sub_path(Load):
|
|
|
|
+ @Web.auth
|
|
|
|
+ @Web.setting
|
|
|
|
+ def post(self):
|
|
|
|
+ Shell.popen('ps -ef | grep sub.py | grep -v grep |awk '{print $1}'|xargs kill -9')
|
|
|
|
+
|
|
|
|
+class restart_admin_path(Load):
|
|
|
|
+ @Web.auth
|
|
|
|
+ @Web.setting
|
|
|
|
+ def post(self):
|
|
|
|
+ Shell.popen('ps -ef | grep admin.py | grep -v grep |awk '{print $1}'|xargs kill -9')
|
|
|
|
+
|
|
|
|
+class restart_front_path(Load):
|
|
|
|
+ @Web.auth
|
|
|
|
+ @Web.setting
|
|
|
|
+ def post(self):
|
|
|
|
+ Shell.popen('ps -ef | grep front.py | grep -v grep |awk '{print $1}'|xargs kill -9')
|
|
|
|
+
|
|
|
|
+class restart_web_path(Load):
|
|
|
|
+ @Web.auth
|
|
|
|
+ @Web.setting
|
|
|
|
+ def post(self):
|
|
|
|
+ Shell.popen('ps -ef | grep web.py | grep -v grep |awk '{print $1}'|xargs kill -9')
|