diff --git a/admin/posts/newPost.html b/admin/posts/newPost.html index c11065a..35f1333 100644 --- a/admin/posts/newPost.html +++ b/admin/posts/newPost.html @@ -1,31 +1,54 @@ -
-

New Post

- -
- -
- - -
- -
- - -
- -
- - -
+
+
+

Server Controls

- -
- - -
- + + + + + + +
+ +
+ + +
+
- + +
+
+
+

New Post

+ +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + +
+
+ +
+
+
\ No newline at end of file diff --git a/admin/posts/newPost.js b/admin/posts/newPost.js index f0d2cc5..f7e3ac8 100644 --- a/admin/posts/newPost.js +++ b/admin/posts/newPost.js @@ -36,6 +36,16 @@ const processPost = function(postData) reject(error); }) } + else if(post.clear_cache) + { + require("../../sites/blog.js").clearCache(); + require("../../includes/includes.js").clearCache(); + } + else if(post.git_pull) + { + const execSync = require('child_process').execSync; + code = execSync('git pull') + } else { resolve(""); diff --git a/includes/includes.js b/includes/includes.js index cb816d7..33cb075 100644 --- a/includes/includes.js +++ b/includes/includes.js @@ -166,5 +166,14 @@ module.exports = sendSVG: function(result, fileName) { sendCachedContent(fileName, 'image/svg+xml', result); + }, + + /** + * Clears the cache + */ + clearCache: function() + { + console.log("Includes cache cleared"); + cache.clear(); } }; \ No newline at end of file diff --git a/sites/blog.js b/sites/blog.js index b0b20c3..38ca2c0 100644 --- a/sites/blog.js +++ b/sites/blog.js @@ -79,5 +79,14 @@ module.exports= result.end(); } } + }, + + /** + * Clears the memory cache. + */ + clearCache: function() + { + console.log("Blog cache cleared"); + cache.clear(); } }; \ No newline at end of file