pull/109/head
midoks 3 years ago
parent 29afd96c72
commit 1d29ccbf80
  1. 12
      plugins/varnish/index.py
  2. 1
      plugins/varnish/js/varnish.js

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

@ -20,6 +20,7 @@ function varnishStatus() {
}
var rdata = $.parseJSON(data.data);
console.log(rdata);
hit = (parseInt(rdata.keyspace_hits) / (parseInt(rdata.keyspace_hits) + parseInt(rdata.keyspace_misses)) * 100).toFixed(2);
var Con = '<div class="divtable">\
<table class="table table-hover table-bordered" style="width: 490px;">\

Loading…
Cancel
Save