Update index.py

pull/109/head
midoks 3 years ago
parent 82f012b912
commit 9f21ee6937
  1. 21
      plugins/varnish/index.py

@ -106,16 +106,17 @@ def reload():
def runInfo(): def runInfo():
cmd = getServerDir() + "/usr/bin/varnishstat -j" cmd = getServerDir() + "/usr/bin/varnishstat -j"
data = mw.execShell(cmd)[0].strip() data = mw.execShell(cmd)[0].strip()
print(data) return data
result = {} # print(data)
for d in data: # result = {}
if len(d) < 3: # for d in data:
continue # if len(d) < 3:
t = d.strip().split(':') # continue
if not t[0] in res: # t = d.strip().split(':')
continue # if not t[0] in res:
result[t[0]] = t[1] # continue
return mw.getJson(result) # result[t[0]] = t[1]
# return mw.getJson(result)
def configTpl(): def configTpl():

Loading…
Cancel
Save