alterator-logs-0.4/000075500000000000000000000000001111621627000143075ustar00rootroot00000000000000alterator-logs-0.4/Makefile000064400000000000000000000003701111621627000157470ustar00rootroot00000000000000NAME=logs DESCRIPTION="System logs" INSTALL=/usr/bin/install all: clean: install: install-module install-data include /usr/share/alterator/build/module.mak install-data: install -d $(sysconfdir)/alterator cp -a logs $(sysconfdir)/alterator alterator-logs-0.4/applications/000075500000000000000000000000001111621627000167755ustar00rootroot00000000000000alterator-logs-0.4/applications/logs.desktop000064400000000000000000000002251111621627000213330ustar00rootroot00000000000000[Desktop Entry] Type=Application Categories=X-Alterator-System Icon=logs Terminal=false Name=System logs X-Alterator-URI=/logs X-Alterator-Help=logs alterator-logs-0.4/backend3/000075500000000000000000000000001111621627000157615ustar00rootroot00000000000000alterator-logs-0.4/backend3/logs000075500000000000000000000061361111621627000166610ustar00rootroot00000000000000#!/bin/sh datadir=/etc/alterator/logs cachefile=/var/cache/alterator/alterator-logs.txt po_domain="alterator-logs" . alterator-sh-functions log_basename() { local n=${1##*/} echo "${n%%.desktop}" } desktop_awk() { [ ! -f "$1" ] || alterator-dump-desktop \ -v lang="$in_language" \ -v out="X-Alterator-URI;Name" \ -v def="/notfound;" \ $1 } cat_log() { find "$(dirname $1)" -type f -name "$(basename $1)*"| while read f; do t="$(file -b "$f")" if [ -z "${t##bzip2 compressed data*}" ]; then bzcat "$f" elif [ -z "${t##gzip compressed data*}" ]; then zcat "$f" else cat "$f" fi done } on_message() { case "$in_action" in write) write_nop ;; read) echo '(' local name="$in_name" local desktopfile="$datadir/$name.desktop" if [ ! -n "$name" ] ;then desktopfile="$(find "$datadir" -name '*.desktop'|head -n1)" name="$(log_basename "$desktopfile")" fi #dump + total size local path="$(desktop_awk "$desktopfile"|cut -f1)" local total="$(cat_log "$path"|tee "$cachefile"|wc -l)" #main data: page size and start shift local start="$in_start" local size="$in_size" local stop= [ -n "$size" ] || size=20 [ -n "$start" ] || start=1 #change size: back to first page if [ -n "$in_new_size" -a "$in_new_size" != "$in_size" ];then size="$in_new_size" start=1 fi #next/back/first/last if [ -n "$in_next" ]; then start="$(($start + $size))" fi if [ -n "$in_back" ]; then start="$(($start - $size))" [ "$start" -gt 0 ] || start=1 fi if [ -n "$in_first" ]; then start=1 fi if [ -n "$in_last" ]; then start="$(( ( $total / $size ) * $size ))" [ "$start" -gt 0 ] || start=1 stop="$total" else stop="$(($start + $size))" fi printf 'text "%s"' "$(sed -n -e "$start,$stop p" -e "$stop q" "$cachefile"|string_quote)" [ "$stop" -lt "$total" ] || stop="$total" local format="`_ "Lines %s-%s of %s"`" printf "range \"$format\"\n" "$start" "$stop" "$total" #save information for next page switch if [ "$stop" -eq "$total" ] ;then start="$(($start - $size))" [ "$start" -gt 0 ] || start=1 fi printf 'name "%s"\n' "$name" printf 'start "%s"\n' "$start" printf 'size "%s"\n' "$size" printf 'new_size "%s"\n' "$size" echo ')' ;; list) echo '(' case "$in__objects" in avail_size) write_enum_item "10" "`_ "10 lines"`" write_enum_item "20" "`_ "20 lines"`" write_enum_item "50" "`_ "50 lines"`" write_enum_item "100" "`_ "100 lines"`" ;; avail_log) find "$datadir" -name '*.desktop'| while read n;do printf '%s\t' "$(log_basename "$n")" desktop_awk "$n" done| while read desktopfile path description;do [ -f "$path" ] || continue write_enum_item "$desktopfile" "$description" done ;; esac echo ')' ;; *) echo '#f' ;; esac } message_loop alterator-logs-0.4/design/000075500000000000000000000000001111621627000155605ustar00rootroot00000000000000alterator-logs-0.4/design/scripts/000075500000000000000000000000001111621627000172475ustar00rootroot00000000000000alterator-logs-0.4/design/scripts/logs/000075500000000000000000000000001111621627000202135ustar00rootroot00000000000000alterator-logs-0.4/design/scripts/logs/select.js000064400000000000000000000006071111621627000220330ustar00rootroot00000000000000function LogsAutoSubmit(name) { var view = document.getElementById(name); var select = document.getElementById("select-"+name); if (!view || !select) return; view.style.display="none"; addEvent(select,'change',function() { select.form.submit(); }); } function initLogs() { LogsAutoSubmit("view"); LogsAutoSubmit("change"); } addEvent(window,'load',initLogs); alterator-logs-0.4/logs/000075500000000000000000000000001111621627000152535ustar00rootroot00000000000000alterator-logs-0.4/logs/ahttpd.desktop000064400000000000000000000003271111621627000201340ustar00rootroot00000000000000[Desktop Entry] Type=Application Categories=X-Alterator-Xorg Icon=configd Terminal=false Name=Web interface HTTP server Name[ru]=HTTP-сервер web-интерфейса X-Alterator-URI=/var/log/ahttpd/access.log alterator-logs-0.4/logs/configd.desktop000064400000000000000000000003141111621627000202550ustar00rootroot00000000000000[Desktop Entry] Type=Application Categories=X-Alterator-Xorg Icon=configd Terminal=false Name=System configurator Name[ru]=Системный конфигуратор X-Alterator-URI=/var/log/configd.log alterator-logs-0.4/logs/kernel.desktop000064400000000000000000000002331111621627000201240ustar00rootroot00000000000000[Desktop Entry] Type=Application Categories=X-Alterator-Xorg Icon=secure Terminal=false Name=Kernel Name[ru]=Ядро X-Alterator-URI=/var/log/kernel/info alterator-logs-0.4/logs/messages.desktop000064400000000000000000000003061111621627000204540ustar00rootroot00000000000000[Desktop Entry] Type=Application Categories=X-Alterator-Xorg Icon=configd Terminal=false Name=System messages Name[ru]=Системные сообщения X-Alterator-URI=/var/log/syslog/messages alterator-logs-0.4/logs/secure.desktop000064400000000000000000000002551111621627000201360ustar00rootroot00000000000000[Desktop Entry] Type=Application Categories=X-Alterator-Xorg Icon=secure Terminal=false Name=Security Name[ru]=Безопасность X-Alterator-URI=/var/log/auth/secure alterator-logs-0.4/templates/000075500000000000000000000000001111621627000163055ustar00rootroot00000000000000alterator-logs-0.4/templates/logs/000075500000000000000000000000001111621627000172515ustar00rootroot00000000000000alterator-logs-0.4/templates/logs/index.html000064400000000000000000000024301111621627000212450ustar00rootroot00000000000000