From 0cf76ccb4736473a958d9fd36ed914e2d25d594a Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Wed, 21 Oct 2020 13:12:15 +0200 Subject: Feature: add a Server administration page It contains mostly read only information about the current Shaarli instance, PHP version, extensions, file and folder permissions, etc. Also action buttons to clear the cache or sync thumbnails. Part of the content of this page is also displayed on the install page, to check server requirement before installing Shaarli config file. Fixes #40 Fixes #185 --- tpl/default/install.html | 10 +++ tpl/default/server.html | 129 +++++++++++++++++++++++++++++++++++ tpl/default/server.requirements.html | 68 ++++++++++++++++++ tpl/default/tools.html | 14 ++-- 4 files changed, 213 insertions(+), 8 deletions(-) create mode 100644 tpl/default/server.html create mode 100644 tpl/default/server.requirements.html (limited to 'tpl') diff --git a/tpl/default/install.html b/tpl/default/install.html index a506a2eb..4f98d49d 100644 --- a/tpl/default/install.html +++ b/tpl/default/install.html @@ -163,6 +163,16 @@ + +
+
+
+

{'Server requirements'|t}

+ + {include="server.requirements"} +
+
+ {include="page.footer"} diff --git a/tpl/default/server.html b/tpl/default/server.html new file mode 100644 index 00000000..de1c8b53 --- /dev/null +++ b/tpl/default/server.html @@ -0,0 +1,129 @@ + + + + {include="includes"} + + +{include="page.header"} + +
+
+
+

{'Server administration'|t}

+ +

{'General'|t}

+ +
+
+

{'Index URL'|t}

+
+ +
+
+
+

{'Base path'|t}

+
+
+

{$base_path}

+
+
+
+
+

{'Client IP'|t}

+
+
+

{$client_ip}

+
+
+
+
+

{'Trusted reverse proxies'|t}

+
+
+ {if="count($trusted_proxies) > 0"} +

+ {loop="$trusted_proxies"} + {$value}
+ {/loop} +

+ {else} +

{'N/A'|t}

+ {/if} +
+
+ + {include="server.requirements"} + +

Version

+ +
+
+

Current version

+
+
+

{$current_version}

+
+
+ +
+
+

Latest release

+
+ +
+ +

Thumbnails

+ +
+
+

Thumbnails status

+
+
+

+ {if="$thumbnails_mode==='all'"} + {'All'|t} + {elseif="$thumbnails_mode==='common'"} + {'Only common media hosts'|t} + {else} + {'None'|t} + {/if} +

+
+
+ + {if="$thumbnails_mode!=='none'"} + + {/if} + +

Cache

+ + + + +
+
+ +{include="page.footer"} + + + diff --git a/tpl/default/server.requirements.html b/tpl/default/server.requirements.html new file mode 100644 index 00000000..85def9b7 --- /dev/null +++ b/tpl/default/server.requirements.html @@ -0,0 +1,68 @@ +
+

{'Permissions'|t}

+ + {if="count($permissions) > 0"} +

+ + {'There are permissions that need to be fixed.'|t} +

+ +

+ {loop="$permissions"} +

{$value}
+ {/loop} +

+ {else} +

+ + {'All read/write permissions are properly set.'|t} +

+ {/if} + +

PHP

+ +

+ {'Running PHP'|t} {$php_version} + {if="$php_has_reached_eol"} +
+ {'End of life: '|t} {$php_eol} + {else} +
+ {/if} +

+ + + + + + + + + + + + {loop="$php_extensions"} + + + + + + + {/loop} + +
{'Extension'|t}{'Usage'|t}{'Status'|t}{'Loaded'|t}
{$value.name}{$value.desc}{$value.required ? t('Required') : t('Optional')} + {if="$value.loaded"} + {$classLoaded="fa-color-green"} + {$strLoaded=t('Loaded')} + {else} + {$strLoaded=t('Not loaded')} + {if="$value.required"} + {$classLoaded="fa-color-red"} + {else} + {$classLoaded="fa-color-orange"} + {/if} + {/if} + + +
+
diff --git a/tpl/default/tools.html b/tpl/default/tools.html index 2cb08e38..2df73598 100644 --- a/tpl/default/tools.html +++ b/tpl/default/tools.html @@ -20,6 +20,12 @@ {'Plugin administration'|t} + {if="!$openshaarli"} - {if="$thumbnails_enabled"} - - {/if} - {loop="$tools_plugin"}
{$value} -- cgit v1.2.3