mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
varnish up
This commit is contained in:
@@ -13,5 +13,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
pluginService('varnish');
|
||||
$.getScript( "/plugins/file?name=sys-opt&f=js/varnish.js",
|
||||
function() {
|
||||
pluginService('varnish');
|
||||
});
|
||||
</script>
|
||||
@@ -133,6 +133,27 @@ def runInfo():
|
||||
return mw.getJson(result)
|
||||
|
||||
|
||||
def configTpl():
|
||||
path = getPluginDir() + '/tpl'
|
||||
pathFile = os.listdir(path)
|
||||
tmp = []
|
||||
for one in pathFile:
|
||||
file = path + '/' + one
|
||||
tmp.append(file)
|
||||
return mw.getJson(tmp)
|
||||
|
||||
|
||||
def readConfigTpl():
|
||||
args = getArgs()
|
||||
data = checkArgs(args, ['file'])
|
||||
if not data[0]:
|
||||
return data[1]
|
||||
|
||||
content = mw.readFile(args['file'])
|
||||
content = contentReplace(content)
|
||||
return mw.returnJson(True, 'ok', content)
|
||||
|
||||
|
||||
def initdStatus():
|
||||
if not app_debug:
|
||||
if mw.isAppleSystem():
|
||||
@@ -192,5 +213,9 @@ if __name__ == "__main__":
|
||||
print(getConf())
|
||||
elif func == 'run_log':
|
||||
print(runLog())
|
||||
elif func == 'config_tpl':
|
||||
print(configTpl())
|
||||
elif func == 'read_config_tpl':
|
||||
print(readConfigTpl())
|
||||
else:
|
||||
print('error')
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
|
||||
function pRead(){
|
||||
var readme = '<ul class="help-info-text c7">';
|
||||
readme += '<li>修改后,点击重启按钮</li>';
|
||||
readme += '</ul>';
|
||||
|
||||
$('.soft-man-con').html(readme);
|
||||
}
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# This is an example VCL file for Varnish.
|
||||
#
|
||||
# It does not do anything by default, delegating control to the
|
||||
# builtin VCL. The builtin VCL is called when there is no explicit
|
||||
# return statement.
|
||||
#
|
||||
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
|
||||
# and https://www.varnish-cache.org/trac/wiki/VCLExamples for more examples.
|
||||
|
||||
# Marker to tell the VCL compiler that this VCL has been adapted to the
|
||||
# new 4.0 format.
|
||||
vcl 4.0;
|
||||
|
||||
# Default backend definition. Set this to point to your content server.
|
||||
backend default {
|
||||
.host = "127.0.0.1";
|
||||
.port = "8080";
|
||||
}
|
||||
|
||||
sub vcl_recv {
|
||||
# Happens before we check if we have this in cache already.
|
||||
#
|
||||
# Typically you clean up the request here, removing cookies you don't need,
|
||||
# rewriting the request, etc.
|
||||
}
|
||||
|
||||
sub vcl_backend_response {
|
||||
# Happens after we have read the response headers from the backend.
|
||||
#
|
||||
# Here you clean the response headers, removing silly Set-Cookie headers
|
||||
# and other mistakes your backend does.
|
||||
}
|
||||
|
||||
sub vcl_deliver {
|
||||
# Happens when we have all the pieces we need, and are about to send the
|
||||
# response to the client.
|
||||
#
|
||||
# You can do accounting or modifying the final object here.
|
||||
}
|
||||
Reference in New Issue
Block a user