# HG changeset patch # User Christophe Lincoln # Date 1307734807 -7200 # Node ID d65aa88d638f5903dfb10dc2cddf705eead58beb # Parent dbb91ac456b7fc2bc8e03b5156b82a329a5dfaff Add a small terminal emulator (wih wget support to upload file on remote machine) diff -r dbb91ac456b7 -r d65aa88d638f index.cgi --- a/index.cgi Fri Jun 10 20:58:58 2011 +0200 +++ b/index.cgi Fri Jun 10 21:40:07 2011 +0200 @@ -102,6 +102,38 @@ esac < $file echo '' fi ;; + *\ terminal\ *|*\ cmd\ *) + # Cmdline terminal. + commands='du help ls ping pwd who wget' + cmd=$(GET cmd) + TITLE="- $(gettext "Terminal")" + xhtml_header + cat << EOT +
+
+ root@$(hostname):~# +
+
+EOT + echo '
'
+	# Allow only a few commands for the moment.
+	case "$cmd" in
+		usage|help)
+			gettext -e "Small terminal emulator, commands options are supported.\n"
+			gettext "Commands:"; echo " $commands" ;;
+		wget*)
+			dl=/var/cache/downloads
+			[ ! -d "$dl" ] && mkdir -p $dl
+			gettext "Downloading to:"; echo " $dl"
+			cd $dl && $cmd ;;
+		du*|ls*|ping*|pwd|who)
+			$cmd ;;
+		*)
+			[ "$cmd" == "" ] || \
+				gettext "Unknow command: $cmd"
+			gettext "Commands:"; echo " $commands" ;;
+	esac
+	echo '
' ;; *\ top\ *) TITLE="- $(gettext "Process activity")" xhtml_header @@ -254,6 +286,8 @@

$(gettext "SliTaz administration and configuration Panel")

+ + $(gettext "Terminal") $(gettext "Process activity") diff -r dbb91ac456b7 -r d65aa88d638f styles/default/images/terminal.png Binary file styles/default/images/terminal.png has changed diff -r dbb91ac456b7 -r d65aa88d638f styles/default/style.css --- a/styles/default/style.css Fri Jun 10 20:58:58 2011 +0200 +++ b/styles/default/style.css Fri Jun 10 21:40:07 2011 +0200 @@ -56,16 +56,16 @@ #icons img { padding: 0; } #loading { - /* font-weight: bold; */ - background-color: #f8f8f8; - border: 1px solid #ddd; - color: #666; - cursor: progress; - position: fixed; - top: 92px; - right: 120px; - width: 248px; - padding: 4px 4px 2px; + /* font-weight: bold; */ + background-color: #f8f8f8; + border: 1px solid #ddd; + color: #666; + cursor: progress; + position: fixed; + top: 92px; + right: 120px; + width: 248px; + padding: 4px 4px 2px; } /* Blocks */ @@ -236,6 +236,14 @@ border: 1px solid #ddd; } div.scroll table { border: 0px solid #fff; } +#terminal { + background: #000; + color: #fff; + border: 1px solid #444; + min-height: 180px; + opacity: 0.8; +} + /* Round corner */ #loading, table, pre, input[type=submit], .debug, .box,