# HG changeset patch # User Aleksej Bobylev # Date 1440967597 -10800 # Node ID 082b622cb7819eb45981557f6d95cd480f2ef52d # Parent 34508d2309a6becf533b5c1eb0d63b70b1d8db37 Speed-up interface: cache xhtml header; need to use 'tazpanel cc' to clean cache when TazPanel menu changes (in post-install and post-remove functions for TazPanel modules) diff -r 34508d2309a6 -r 082b622cb781 Makefile --- a/Makefile Sun Aug 30 23:04:04 2015 +0300 +++ b/Makefile Sun Aug 30 23:46:37 2015 +0300 @@ -79,6 +79,10 @@ mkdir -p $(DESTDIR)/usr/share/fonts/TTF ln -fs $(PANEL)/styles/default/tazpanel.ttf $(DESTDIR)/usr/share/fonts/TTF/tazpanel.ttf + # TazPanel cache directory, rw access for all + install -m 0777 -d $(DESTDIR)/var/cache/tazpanel + + install_extra: mkdir -p \ $(DESTDIR)$(PANEL)/menu.d/boot \ diff -r 34508d2309a6 -r 082b622cb781 lib/libtazpanel --- a/lib/libtazpanel Sun Aug 30 23:04:04 2015 +0300 +++ b/lib/libtazpanel Sun Aug 30 23:46:37 2015 +0300 @@ -255,14 +255,23 @@ xhtml_header() { [ -n "$(GET noheader)" ] && return - SUBTITLE="$1" - . ${PANEL}$HEADER - cat < "$header" + cat >> "$header" < document.cookie = "guiuser=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; document.cookie = "guiuser=$GUI_USER"; EOT + fi + sed "s|@@SUBTITLE@@|$subtitle|" "$header" + + # Show debug output if [ "$DEBUG" -eq 1 ]; then local i j x args='' @@ -293,6 +302,7 @@ xhtml_footer() { [ -n "$(GET noheader)" ] && return + export TEXTDOMAIN='tazpkg' . ${PANEL}$FOOTER } diff -r 34508d2309a6 -r 082b622cb781 styles/default/header.html --- a/styles/default/header.html Sun Aug 30 23:04:04 2015 +0300 +++ b/styles/default/header.html Sun Aug 30 23:46:37 2015 +0300 @@ -1,6 +1,6 @@ # Header of TazPanel html page -rootclass='user'; [ $(id -u) == '0' ] && rootclass='root' +rootclass='user'; [ $(id -u) -eq 0 ] && rootclass='root' TEXTDOMAIN_original="${TEXTDOMAIN:-tazpanel}" export TEXTDOMAIN='tazpanel' diff -r 34508d2309a6 -r 082b622cb781 tazpanel --- a/tazpanel Sun Aug 30 23:04:04 2015 +0300 +++ b/tazpanel Sun Aug 30 23:46:37 2015 +0300 @@ -46,6 +46,7 @@ boot, hardware, help, index, installer, live, network, settings, pkgs If is empty, index page will open in the browser. You can also open sub-pages, so "pkgs#list" will open packages list. + cc Clean cache: remove interface's header from cache EOT ;; @@ -72,6 +73,8 @@ status ;; restart) tazpanel stop; sleep 1; tazpanel start;; + cc) + find /var/cache/tazpanel -name 'header.*' -delete;; *) . /etc/slitaz/applications.conf USER_CONFIG="$HOME/.config/slitaz/applications.conf"