Compare commits

..

1 Commits

Author SHA1 Message Date
Safihre
9ca80e481c Handle Direct Unpack sets before proceeding to unpack the rest 2020-12-12 19:46:03 +01:00
329 changed files with 23152 additions and 20942 deletions

View File

View File

@@ -1,14 +0,0 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "pip"
directory: "/builder"
schedule:
interval: "weekly"
- package-ecosystem: "pip"
directory: "/builder/osx"
schedule:
interval: "weekly"

View File

@@ -14,9 +14,7 @@ jobs:
sabnzbd
scripts
tools
builder
tests
--line-length=120
--target-version=py37
--target-version=py36
--check
--diff

View File

@@ -1,152 +0,0 @@
name: Build binaries and source distribution
on: [push, pull_request]
env:
AUTOMATION_GITHUB_TOKEN: ${{ secrets.AUTOMATION_GITHUB_TOKEN }}
jobs:
build_windows:
name: Build Windows binary
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10 (64bit)
uses: actions/setup-python@v2
with:
python-version: "3.10"
architecture: "x64"
- name: Install Python dependencies (64bit)
run: |
python --version
pip install --upgrade pip wheel
pip install --upgrade -r requirements.txt
pip install --upgrade -r builder/requirements.txt
- name: Build source distribution
run: python builder/package.py source
- name: Upload source distribution
uses: actions/upload-artifact@v2
with:
path: "*-src.tar.gz"
name: Source distribution
- name: Build Windows standalone binary and installer (64bit)
run: python builder/package.py installer
- name: Upload Windows standalone binary (64bit)
uses: actions/upload-artifact@v2
with:
path: "*-win64-bin.zip"
name: Windows Windows standalone binary (64bit)
- name: Upload Windows installer (64bit)
uses: actions/upload-artifact@v2
with:
path: "*-win-setup.exe"
name: Windows installer
- name: Set up Python 3.8 (32bit and legacy)
uses: actions/setup-python@v2
with:
python-version: "3.8"
architecture: "x86"
- name: Install Python dependencies (32bit and legacy)
run: |
python --version
pip install --upgrade pip wheel
pip install --upgrade -r requirements.txt
pip install --upgrade -r builder/requirements.txt
- name: Build Windows standalone binary (32bit and legacy)
run: python builder/package.py binary
- name: Upload Windows standalone binary (32bit and legacy)
uses: actions/upload-artifact@v2
with:
path: "*-win32-bin.zip"
name: Windows Windows standalone binary (32bit and legacy)
- name: Prepare official release
if: env.AUTOMATION_GITHUB_TOKEN && startsWith(github.ref, 'refs/tags/')
run: python builder/package.py release
build_macos:
name: Build macOS binary
runs-on: macos-11
timeout-minutes: 15
env:
SIGNING_AUTH: ${{ secrets.SIGNING_AUTH }}
NOTARIZATION_USER: ${{ secrets.NOTARIZATION_USER }}
NOTARIZATION_PASS: ${{ secrets.NOTARIZATION_PASS }}
# We need the official Python, because the GA ones only support newer macOS versions
# The deployment target is picked up by the Python build tools automatically
# If updated, make sure to also set LSMinimumSystemVersion in SABnzbd.spec
PYTHON_VERSION: "3.10.2"
MACOSX_DEPLOYMENT_TARGET: "10.9"
# We need to force compile for universal2 support
CFLAGS: -arch arm64 -arch x86_64
steps:
- uses: actions/checkout@v2
- name: Cache Python download
id: cache-python-download
uses: actions/cache@v2
with:
path: ~/python.pkg
key: macOS-Python-${{ env.PYTHON_VERSION }}
- name: Get Python
if: steps.cache-python-download.outputs.cache-hit != 'true'
run: curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macos11.pkg -o ~/python.pkg
- name: Install Python
run: sudo installer -pkg ~/python.pkg -target /
- name: Install Python dependencies
# We have to manually install a few packages:
# 1. cffi will pick up the single-arch libffi from Homebrew, while Apple provides universal2-version
# of libffi with XCode. So we forcefully have to remove the Homebrew one.
# 2. Because building cryptography is hard, and we cannot force pip to fetch universal2 version we
# first install the x86 version (and it's dependencies) and then manually fetch the universal2 build
# https://github.com/pyca/cryptography/issues/5918
# 3. We need to build the PyInstaller bootloader from sources:
# https://github.com/pyinstaller/pyinstaller/issues/6235
run: |
python3 --version
pip3 install --upgrade pip wheel
brew uninstall libffi --ignore-dependencies
ARCHFLAGS="-arch x86_64 -arch arm64" pip3 install --upgrade cffi --no-binary cffi
pip3 install --upgrade -r requirements.txt --no-binary sabyenc3
pip3 uninstall cryptography -y
pip3 download -r builder/osx/requirements.txt --platform macosx_10_10_universal2 --only-binary :all: --no-deps --dest .
pip3 install -r builder/osx/requirements.txt --no-cache-dir --no-index --find-links .
PYINSTALLER_COMPILE_BOOTLOADER=1 pip3 install --upgrade -r builder/requirements.txt --no-binary pyinstaller
- name: Import macOS codesign certificates
uses: apple-actions/import-codesign-certs@v1
if: env.SIGNING_AUTH
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Build macOS binary
run: |
python3 builder/package.py app
python3 builder/make_dmg.py
- name: Upload macOS binary
uses: actions/upload-artifact@v2
with:
path: "*-osx.dmg"
name: macOS binary (not notarized)
- name: Prepare official release
if: env.AUTOMATION_GITHUB_TOKEN && startsWith(github.ref, 'refs/tags/')
run: python3 builder/package.py release
release_snap:
name: Release Snap
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
env:
SNAP_TOKEN: ${{ secrets.SNAP_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Release latest available Snap
run: |
sudo snap install snapcraft --classic
echo "${SNAP_TOKEN}" | snapcraft login --with -
python3 snap/local/release_snap.py

View File

@@ -4,22 +4,17 @@ on: [push, pull_request]
jobs:
test:
name: Test ${{ matrix.name }} - Python ${{ matrix.python-version }}
name: Test ${{ matrix.os }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: [3.6, 3.7, 3.8, 3.9]
os: [ubuntu-20.04]
include:
# TODO: Update to 3.10 when all packages are available, currently lxml is missing
- name: macOS
os: macos-latest
python-version: "3.10"
- name: Windows
os: windows-latest
python-version: "3.10"
- os: macos-latest
python-version: 3.9
- os: windows-latest
python-version: 3.9
steps:
- uses: actions/checkout@v2
@@ -29,11 +24,11 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
if: runner.os == 'Linux'
run: sudo apt-get install unrar p7zip-full par2
run: sudo apt-get install unrar p7zip-full par2 chromium-chromedriver
- name: Install Python dependencies
run: |
python --version
pip install --upgrade pip wheel
pip install --upgrade pip
pip install --upgrade -r requirements.txt
pip install --upgrade -r tests/requirements.txt
- name: Test SABnzbd

View File

@@ -8,30 +8,24 @@ on:
jobs:
translations:
runs-on: ubuntu-latest
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Generate translatable texts
run: |
python3 tools/extract_pot.py
- name: Install Transifex client
if: env.TX_TOKEN
# Sudo is needed to link the "tx"-command
run: |
sudo -H python3 -m pip install setuptools wheel
sudo -H python3 -m pip install transifex-client
- name: Push/pull Transifex translations
if: env.TX_TOKEN
run: |
tx push --source --parallel
tx pull --all --force --parallel
- name: Compile translations to validate them
run: |
python3 tools/make_mo.py
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Push translatable and translated texts back to repo
uses: stefanzweifel/git-auto-commit-action@v4.5.1
if: env.TX_TOKEN
with:
commit_message: Update translatable texts
commit_user_name: SABnzbd Automation

3
.gitignore vendored
View File

@@ -31,9 +31,6 @@ SABnzbd-*/
*.wp[ru]
.idea
# VScode
.vscode/
# Testing folders
.cache
.xprocess

View File

@@ -21,3 +21,4 @@ minimum_perc = 0
source_file = po/nsis/SABnsis.pot
source_lang = en
type = PO

View File

@@ -1,5 +1,5 @@
(c) Copyright 2007-2022 by "The SABnzbd-team" <team@sabnzbd.org>
(c) Copyright 2007-2020 by "The SABnzbd-team" <team@sabnzbd.org>
The SABnzbd-team is:

View File

@@ -1,10 +1,10 @@
SABnzbd
SABnzbd 3.2.0
-------------------------------------------------------------------------------
0) LICENSE
-------------------------------------------------------------------------------
(c) Copyright 2007-2022 by "The SABnzbd-team" <team@sabnzbd.org>
(c) Copyright 2007-2020 by "The SABnzbd-team" <team@sabnzbd.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -41,7 +41,7 @@ Use the "Help" button in the web-interface to be directed to the Help Wiki.
-------------------------------------------------------------------------------
3) INSTALL pre-built macOS binaries
-------------------------------------------------------------------------------
Download the DMG file, mount and drag the SABnzbd icon to Applications.
Download the DMG file, mount and drag the SABnzbd icon to Programs.
Just like you do with so many apps.
-------------------------------------------------------------------------------
@@ -52,7 +52,7 @@ Specific guides to install from source are available for Windows and macOS:
https://sabnzbd.org/wiki/installation/install-macos
https://sabnzbd.org/wiki/installation/install-from-source-windows
Only Python 3.7 and above is supported.
Only Python 3.6 and above is supported.
On Linux systems you need to install:
par2 unrar unzip python3-setuptools python3-pip

View File

@@ -14,13 +14,13 @@
For these the server blocking method is not very favourable.
There is an INI-only option that will limit blocks to 1 minute.
no_penalties = 1
See: https://sabnzbd.org/wiki/configuration/3.4/special
See: https://sabnzbd.org/wiki/configuration/3.1/special
- Some third-party utilties try to probe SABnzbd API in such a way that you will
often see warnings about unauthenticated access.
If you are sure these probes are harmless, you can suppress the warnings by
setting the option "api_warnings" to 0.
See: https://sabnzbd.org/wiki/configuration/3.4/special
See: https://sabnzbd.org/wiki/configuration/3.1/special
- On macOS you may encounter downloaded files with foreign characters.
The par2 repair may fail when the files were created on a Windows system.

View File

@@ -1,4 +1,4 @@
(c) Copyright 2007-2022 by "The SABnzbd-team" <team@sabnzbd.org>
(c) Copyright 2007-2020 by "The SABnzbd-team" <team@sabnzbd.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License

View File

@@ -1,7 +1,7 @@
Metadata-Version: 1.0
Name: SABnzbd
Version: 3.5.2
Summary: SABnzbd-3.5.2
Version: 3.2.0-develop
Summary: SABnzbd-3.2.0-develop
Home-page: https://sabnzbd.org
Author: The SABnzbd Team
Author-email: team@sabnzbd.org

View File

@@ -1,11 +1,11 @@
SABnzbd - The automated Usenet download tool
============================================
![CI tests](https://github.com/sabnzbd/sabnzbd/workflows/CI%20Tests/badge.svg)
![Build binaries](https://github.com/sabnzbd/sabnzbd/workflows/Build%20binaries%20and%20source%20distribution/badge.svg)
[![Travis CI](https://travis-ci.org/sabnzbd/sabnzbd.svg?branch=develop)](https://travis-ci.org/sabnzbd/sabnzbd)
[![AppVeryor](https://ci.appveyor.com/api/projects/status/github/sabnzbd/sabnzbd?svg=true&branch=develop)](https://ci.appveyor.com/project/Safihre/sabnzbd)
[![Snap Status](https://build.snapcraft.io/badge/sabnzbd/sabnzbd.svg)](https://snapcraft.io/sabnzbd)
[![License](https://img.shields.io/badge/license-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
SABnzbd is an Open Source Binary Newsreader written in Python.
It's totally free, easy to use, and works practically everywhere.
@@ -18,8 +18,8 @@ If you want to know more you can head over to our website: https://sabnzbd.org.
SABnzbd has a few dependencies you'll need before you can get running. If you've previously run SABnzbd from one of the various Linux packages, then you likely already have all the needed dependencies. If not, here's what you're looking for:
- `python` (Python 3.7 and above, often called `python3`)
- Python modules listed in `requirements.txt`. Install with `python3 -m pip install -r requirements.txt -U`
- `python` (Python 3.6 and higher, often called `python3`)
- Python modules listed in `requirements.txt`
- `par2` (Multi-threaded par2 installation guide can be found [here](https://sabnzbd.org/wiki/installation/multicore-par2))
- `unrar` (make sure you get the "official" non-free version of unrar)

View File

@@ -1,53 +1,38 @@
Release Notes - SABnzbd 3.5.2
Release Notes - SABnzbd 3.1.0 Release Candidate 1
=========================================================
## Bugfix since 3.5.1
- Reverted change to file assembly that resulted in disk errors.
## Changes and bugfixes since 3.1.0 Beta 2
- Deobfuscate final filenames can now be used when job folders are disabled.
- Deobfuscate final filenames will ignore blu-ray disc files.
- Clear error if Complete Folder is set as a subfolder of the Temporary Folder.
- Filtering of history by category would not filter jobs in post-processing.
## Changes and bugfixes since 3.5.0
- Prevent permissions errors on systems that do not support them.
- Small changes in file assembly and Direct Unpack processing.
- Changes to the transition from download to active post-processing.
- Malformed NZB files could result in a crash.
- Prevent crash in Direct Unpack for obfuscated posts.
- RSS feeds with HTML-characters in the name resulted in crashes.
- macOS: failed to start on older macOS versions.
## Changes since 3.0.2
- Added option to automatically deobfuscate final filenames: after unpacking,
detect and rename obfuscated or meaningless filenames to the job name,
similar to the Deobfuscate.py post-processing script.
- Switched to Transifex as our translations platform:
Help us translate SABnzbd in your language! Add untranslated texts or
improved existing translations here: https://sabnzbd.org/wiki/translate
- Redesigned job availability-check to be more efficient and reliable.
- Skip repair on Retry if all sets were previously successfully verified.
- Passwords included in the filename no longer have to be at the end.
- Restore limit on length of foldernames (`max_foldername_length`).
- Added password input box on the Add NZB screen.
- Show warning that Pyton 3.5 support will be dropped after 3.1.0.
- Windows/macOS: update UnRar to 5.91 and MultiPar to 1.3.1.0.
- Windows: retry `Access Denied` when renaming files on Windows.
## Changes since 3.4.2
- Removed Python 3.6 support.
- SOCKS5 proxy support for all outgoing connections.
- Restored support for UUencoded jobs.
- `Required` server option: in case of connection failures, the queue
will be paused for a few minutes instead of skipping the server.
- Added Special option to preserve paused state after a restart.
- Show an estimated time-left indicator for repair and unpacking.
- Require TLS version 1.2 or higher for SSL news server connections.
- Setting custom ciphers forces the maximum TLS version to 1.2.
- Reduced memory usage during and after parsing `.nzb` files.
- Handle multiple passwords stored in NZB-file.
- macOS/Linux: `Permissions` are only applied if any are set.
- macOS/Windows: updated to Python 3.10.2.
- macOS: run native on M1 systems. However, included tools
(`par2`, `unrar` and `7za`) still require Rosetta emulation.
- Snap: updated to `core20` base and restore 7zip support.
## Bugfixes since 3.4.2
- Global interface settings would not always be applied correctly.
- Email notification setting was not shown correctly.
- Improvements and fixes for `Defobfuscate final filenames`.
- `Post-Process Only Verified Jobs` would not always work as intended.
- Correctly detect too little disk space when unpacking 7zip's.
- Improvements to handling of repair by MultiPar and par2cmdline.
- HTML characters in configuration fields were shown incorrectly.
- On Retry the number of downloaded bytes could exceed the total bytes.
- `unrar` logging of Direct Unpack was not logged if it was aborted.
- Windows: `portable.cmd` was not included in the release.
- Windows: print low-level Windows error on `IOError`.
## Upgrade notices
- The download statistics file `totals10.sab` is updated in 3.2.x
version. If you downgrade to 3.1.x or lower, detailed download
statistics will be lost.
## Bugfixes since 3.0.2
- Assembler crashes could occur due to race condition in `ArticleCache`.
- On HTTP-redirects the scheme/hostname/port were ignored when behind a proxy.
- Strip slash of the end of `url_base` as it could break other code.
- Unpacking with a relative folder set for a category could fail.
- Paused priority of pre-queue script was ignored.
- Duplicate Detection did not check filenames in History.
- Downloaded bytes could show as exceeding the total bytes of a job.
- Windows: non-Latin languages were displayed incorrectly in the installer.
- Windows: could fail to create folders on some network shares.
## Known problems and solutions
- Read the file "ISSUES.txt"
@@ -59,4 +44,4 @@ Release Notes - SABnzbd 3.5.2
that automatically verify, repair, extract and clean up posts downloaded
from Usenet.
(c) Copyright 2007-2022 by "The SABnzbd-team" \<team@sabnzbd.org\>
(c) Copyright 2007-2020 by "The SABnzbd-team" \<team@sabnzbd.org\>

View File

@@ -1,5 +1,5 @@
#!/usr/bin/python3 -OO
# Copyright 2007-2022 The SABnzbd-Team <team@sabnzbd.org>
# Copyright 2007-2020 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -17,12 +17,11 @@
import sys
if sys.hexversion < 0x03070000:
print("Sorry, requires Python 3.7 or above")
print("You can read more at: https://sabnzbd.org/wiki/installation/install-off-modules")
if sys.hexversion < 0x03060000:
print("Sorry, requires Python 3.6 or above")
print("You can read more at: https://sabnzbd.org/python3")
sys.exit(1)
import os
import logging
import logging.handlers
import importlib.util
@@ -32,11 +31,9 @@ import signal
import socket
import platform
import subprocess
import multiprocessing
import ssl
import time
import re
import gc
from typing import List, Dict, Any
try:
@@ -47,61 +44,39 @@ try:
import portend
import cryptography
import chardet
import guessit
import puremagic
import socks
except ImportError as e:
print("Not all required Python modules are available, please check requirements.txt")
print("Missing module:", e.name)
print("You can read more at: https://sabnzbd.org/wiki/installation/install-off-modules")
print("You can read more at: https://sabnzbd.org/python3")
print("If you still experience problems, remove all .pyc files in this folder and subfolders")
sys.exit(1)
import sabnzbd
import sabnzbd.lang
import sabnzbd.interface
from sabnzbd.constants import (
DEF_TIMEOUT,
DEF_LOG_ERRFILE,
DEF_MAIN_TMPL,
DEF_STDINTF,
DEF_WORKDIR,
DEF_INTERFACES,
DEF_LANGUAGE,
VALID_NZB_FILES,
VALID_ARCHIVES,
DEF_INI_FILE,
MAX_WARNINGS,
RSS_FILE_NAME,
DEF_LOG_FILE,
DEF_STDCONFIG,
DEF_LOG_CHERRY,
)
from sabnzbd.constants import *
import sabnzbd.newsunpack
from sabnzbd.misc import (
check_latest_version,
exit_sab,
split_host,
create_https_certificates,
windows_variant,
ip_extract,
set_serv_parms,
get_serv_parms,
get_from_url,
upload_file_to_sabnzbd,
is_localhost,
is_lan_addr,
ip_in_subnet,
helpful_warning,
set_https_verification,
probablyipv4,
)
from sabnzbd.filesystem import get_ext, real_path, long_path, globber_full, remove_file
from sabnzbd.panic import panic_tmpl, panic_port, panic_host, panic, launch_a_browser
import sabnzbd.config as config
import sabnzbd.cfg
import sabnzbd.downloader
import sabnzbd.notifier as notifier
import sabnzbd.zconfig
from sabnzbd.getipaddress import localipv4, publicipv4, ipv6
from sabnzbd.utils.getperformance import getpystone, getcpu
import sabnzbd.utils.ssdp as ssdp
try:
@@ -111,13 +86,10 @@ try:
import win32event
import win32service
import win32ts
import servicemanager
from win32com.shell import shell, shellcon
from sabnzbd.utils.apireg import get_connection_info, set_connection_info
import sabnzbd.sabtray
import pywintypes
win32api.SetConsoleCtrlHandler(sabnzbd.sig_handler, True)
from sabnzbd.utils.apireg import get_connection_info, set_connection_info, del_connection_info
except ImportError:
if sabnzbd.WIN32:
print("Sorry, requires Python module PyWin32.")
@@ -128,53 +100,50 @@ LOG_FLAG = False
def guard_loglevel():
"""Callback function for guarding loglevel"""
""" Callback function for guarding loglevel """
global LOG_FLAG
LOG_FLAG = True
def warning_helpful(*args, **kwargs):
""" Wrapper to ignore helpfull warnings if desired """
if sabnzbd.cfg.helpfull_warnings():
return logging.warning(*args, **kwargs)
return logging.info(*args, **kwargs)
logging.warning_helpful = warning_helpful
class GUIHandler(logging.Handler):
"""Logging handler collects the last warnings/errors/exceptions
to be displayed in the web-gui
"""
def __init__(self, size):
"""Initializes the handler"""
""" Initializes the handler """
logging.Handler.__init__(self)
self._size: int = size
self.store: List[Dict[str, Any]] = []
def emit(self, record: logging.LogRecord):
"""Emit a record by adding it to our private queue"""
""" Emit a record by adding it to our private queue """
# If % is part of the msg, this could fail
try:
parsed_msg = record.msg % record.args
except TypeError:
parsed_msg = record.msg + str(record.args)
warning = {
"type": record.levelname,
"text": parsed_msg,
"time": int(time.time()),
"origin": "%s%d" % (record.filename, record.lineno),
}
if record.levelno == logging.WARNING:
sabnzbd.notifier.send_notification(T("Warning"), parsed_msg, "warning")
else:
sabnzbd.notifier.send_notification(T("Error"), parsed_msg, "error")
# Append traceback, if available
warning = {"type": record.levelname, "text": parsed_msg, "time": int(time.time())}
if record.exc_info:
warning["text"] = "%s\n%s" % (warning["text"], traceback.format_exc())
# Do not notify the same notification within 1 minute from the same source
# This prevents endless looping if the notification service itself throws an error/warning
# We don't check based on message content, because if it includes a timestamp it's not unique
if not any(
stored_warning["origin"] == warning["origin"] and stored_warning["time"] + DEF_TIMEOUT > time.time()
for stored_warning in self.store
):
if record.levelno == logging.WARNING:
sabnzbd.notifier.send_notification(T("Warning"), parsed_msg, "warning")
else:
sabnzbd.notifier.send_notification(T("Error"), parsed_msg, "error")
# Loose the oldest record
if len(self.store) >= self._size:
self.store.pop(0)
@@ -187,7 +156,7 @@ class GUIHandler(logging.Handler):
return len(self.store)
def content(self):
"""Return an array with last records"""
""" Return an array with last records """
return self.store
@@ -198,36 +167,34 @@ def print_help():
print("Options marked [*] are stored in the config file")
print()
print("Options:")
print(" -f --config-file <ini> Location of config file")
print(" -s --server <srv:port> Listen on server:port [*]")
print(" -t --templates <templ> Template directory [*]")
print(" -f --config-file <ini> Location of config file")
print(" -s --server <srv:port> Listen on server:port [*]")
print(" -t --templates <templ> Template directory [*]")
print()
print(" -l --logging <-1..2> Set logging level (-1=off, 0=least,2= most) [*]")
print(" -w --weblogging Enable cherrypy access logging")
print(" -l --logging <-1..2> Set logging level (-1=off, 0= least, 2= most) [*]")
print(" -w --weblogging Enable cherrypy access logging")
print()
print(" -b --browser <0..1> Auto browser launch (0= off, 1= on) [*]")
print(" -b --browser <0..1> Auto browser launch (0= off, 1= on) [*]")
if sabnzbd.WIN32:
print(" -d --daemon Use when run as a service")
print(" -d --daemon Use when run as a service")
else:
print(" -d --daemon Fork daemon process")
print(" --pid <path> Create a PID file in the given folder (full path)")
print(" --pidfile <path> Create a PID file with the given name (full path)")
print(" -d --daemon Fork daemon process")
print(" --pid <path> Create a PID file in the given folder (full path)")
print(" --pidfile <path> Create a PID file with the given name (full path)")
print()
print(" -h --help Print this message")
print(" -v --version Print version information")
print(" -c --clean Remove queue, cache and logs")
print(" -p --pause Start in paused mode")
print(" --repair Add orphaned jobs from the incomplete folder to the queue")
print(" --repair-all Try to reconstruct the queue from the incomplete folder")
print(" with full data reconstruction")
print(" --https <port> Port to use for HTTPS server")
print(" --ipv6_hosting <0|1> Listen on IPv6 address [::1] [*]")
print(" --inet_exposure <0..5> Set external internet access [*]")
print(" --no-login Start with username and password reset")
print(" --log-all Log all article handling (for developers)")
print(" --disable-file-log Logging is only written to console")
print(" --console Force logging to console")
print(" --new Run a new instance of SABnzbd")
print(" -h --help Print this message")
print(" -v --version Print version information")
print(" -c --clean Remove queue, cache and logs")
print(" -p --pause Start in paused mode")
print(" --repair Add orphaned jobs from the incomplete folder to the queue")
print(" --repair-all Try to reconstruct the queue from the incomplete folder")
print(" with full data reconstruction")
print(" --https <port> Port to use for HTTPS server")
print(" --ipv6_hosting <0|1> Listen on IPv6 address [::1] [*]")
print(" --no-login Start with username and password reset")
print(" --log-all Log all article handling (for developers)")
print(" --disable-file-log Logging is only written to console")
print(" --new Run a new instance of SABnzbd")
print()
print("NZB (or related) file:")
print(" NZB or compressed NZB file, with extension .nzb, .zip, .rar, .7z, .gz, or .bz2")
@@ -240,7 +207,7 @@ def print_version():
"""
%s-%s
Copyright (C) 2007-2022 The SABnzbd-Team <team@sabnzbd.org>
Copyright (C) 2007-2020 The SABnzbd-Team <team@sabnzbd.org>
SABnzbd comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. It is licensed under the
@@ -253,7 +220,7 @@ GNU GENERAL PUBLIC LICENSE Version 2 or (at your option) any later version.
def daemonize():
"""Daemonize the process, based on various StackOverflow answers"""
""" Daemonize the process, based on various StackOverflow answers """
try:
pid = os.fork()
if pid > 0:
@@ -295,7 +262,7 @@ def daemonize():
def abort_and_show_error(browserhost, cherryport, err=""):
"""Abort program because of CherryPy troubles"""
""" Abort program because of CherryPy troubles """
logging.error(T("Failed to start web-interface") + " : " + str(err))
if not sabnzbd.DAEMON:
if "49" in err:
@@ -307,7 +274,7 @@ def abort_and_show_error(browserhost, cherryport, err=""):
def identify_web_template(key, defweb, wdir):
"""Determine a correct web template set, return full template path"""
""" Determine a correct web template set, return full template path """
if wdir is None:
try:
wdir = fix_webname(key())
@@ -325,7 +292,7 @@ def identify_web_template(key, defweb, wdir):
full_main = real_path(full_dir, DEF_MAIN_TMPL)
if not os.path.exists(full_main):
helpful_warning(T("Cannot find web template: %s, trying standard template"), full_main)
logging.warning_helpful(T("Cannot find web template: %s, trying standard template"), full_main)
full_dir = real_path(sabnzbd.DIR_INTERFACES, DEF_STDINTF)
full_main = real_path(full_dir, DEF_MAIN_TMPL)
if not os.path.exists(full_main):
@@ -338,7 +305,7 @@ def identify_web_template(key, defweb, wdir):
def check_template_scheme(color, web_dir):
"""Check existence of color-scheme"""
""" Check existence of color-scheme """
if color and os.path.exists(os.path.join(web_dir, "static", "stylesheets", "colorschemes", color + ".css")):
return color
elif color and os.path.exists(os.path.join(web_dir, "static", "stylesheets", "colorschemes", color)):
@@ -354,7 +321,7 @@ def fix_webname(name):
xname = ""
if xname in ("Default",):
return "Glitter"
elif xname in ("Glitter",):
elif xname in ("Glitter", "Plush"):
return xname
elif xname in ("Wizard",):
return name.lower()
@@ -364,8 +331,8 @@ def fix_webname(name):
return name
def get_user_profile_paths():
"""Get the default data locations on Windows"""
def get_user_profile_paths(vista_plus):
""" Get the default data locations on Windows"""
if sabnzbd.DAEMON:
# In daemon mode, do not try to access the user profile
# just assume that everything defaults to the program dir
@@ -380,15 +347,22 @@ def get_user_profile_paths():
return
elif sabnzbd.WIN32:
try:
from win32com.shell import shell, shellcon
path = shell.SHGetFolderPath(0, shellcon.CSIDL_LOCAL_APPDATA, None, 0)
sabnzbd.DIR_LCLDATA = os.path.join(path, DEF_WORKDIR)
sabnzbd.DIR_HOME = os.environ["USERPROFILE"]
except:
try:
root = os.environ["AppData"]
user = os.environ["USERPROFILE"]
sabnzbd.DIR_LCLDATA = "%s\\%s" % (root.replace("\\Roaming", "\\Local"), DEF_WORKDIR)
sabnzbd.DIR_HOME = user
if vista_plus:
root = os.environ["AppData"]
user = os.environ["USERPROFILE"]
sabnzbd.DIR_LCLDATA = "%s\\%s" % (root.replace("\\Roaming", "\\Local"), DEF_WORKDIR)
sabnzbd.DIR_HOME = user
else:
root = os.environ["USERPROFILE"]
sabnzbd.DIR_LCLDATA = "%s\\%s" % (root, DEF_WORKDIR)
sabnzbd.DIR_HOME = root
except:
pass
@@ -417,7 +391,7 @@ def get_user_profile_paths():
def print_modules():
"""Log all detected optional or external modules"""
""" Log all detected optional or external modules """
if sabnzbd.decoder.SABYENC_ENABLED:
# Yes, we have SABYenc, and it's the correct version, so it's enabled
logging.info("SABYenc module (v%s)... found!", sabnzbd.decoder.SABYENC_VERSION)
@@ -457,7 +431,9 @@ def print_modules():
if sabnzbd.newsunpack.RAR_PROBLEM:
have_str = "%.2f" % (float(sabnzbd.newsunpack.RAR_VERSION) / 100)
want_str = "%.2f" % (float(sabnzbd.constants.REC_RAR_VERSION) / 100)
helpful_warning(T("Your UNRAR version is %s, we recommend version %s or higher.<br />"), have_str, want_str)
logging.warning_helpful(
T("Your UNRAR version is %s, we recommend version %s or higher.<br />"), have_str, want_str
)
elif not (sabnzbd.WIN32 or sabnzbd.DARWIN):
logging.info("UNRAR binary version %.2f", (float(sabnzbd.newsunpack.RAR_VERSION) / 100))
else:
@@ -466,10 +442,8 @@ def print_modules():
sabnzbd.NO_DOWNLOADING = True
# If available, we prefer 7zip over unzip
if sabnzbd.newsunpack.SEVENZIP_COMMAND:
logging.info("7za binary... found (%s)", sabnzbd.newsunpack.SEVENZIP_COMMAND)
if not (sabnzbd.WIN32 or sabnzbd.DARWIN):
logging.info("7za binary version %s", sabnzbd.newsunpack.SEVENZIP_VERSION)
if sabnzbd.newsunpack.SEVEN_COMMAND:
logging.info("7za binary... found (%s)", sabnzbd.newsunpack.SEVEN_COMMAND)
else:
logging.info(T("7za binary... NOT found!"))
@@ -494,7 +468,7 @@ def print_modules():
def all_localhosts():
"""Return all unique values of localhost in order of preference"""
""" Return all unique values of localhost in order of preference """
ips = ["127.0.0.1"]
try:
# Check whether IPv6 is available and enabled
@@ -522,7 +496,7 @@ def all_localhosts():
def check_resolve(host):
"""Return True if 'host' resolves"""
""" Return True if 'host' resolves """
try:
socket.getaddrinfo(host, None)
except socket.error:
@@ -557,7 +531,7 @@ def get_webhost(cherryhost, cherryport, https_port):
# Valid user defined name?
info = socket.getaddrinfo(cherryhost, None)
except socket.error:
if not is_localhost(cherryhost):
if cherryhost not in LOCALHOSTS:
cherryhost = "0.0.0.0"
try:
info = socket.getaddrinfo(localhost, None)
@@ -610,7 +584,7 @@ def get_webhost(cherryhost, cherryport, https_port):
browserhost = localhost
else:
# If on APIPA, use numerical IP, to help FireFoxers
# If on Vista and/or APIPA, use numerical IP, to help FireFoxers
if ipv6 and ipv4:
cherryhost = hostip
browserhost = cherryhost
@@ -624,12 +598,12 @@ def get_webhost(cherryhost, cherryport, https_port):
except socket.error:
cherryhost = cherryhost.strip("[]")
if ipv6 and ipv4 and not is_localhost(browserhost):
if ipv6 and ipv4 and browserhost not in LOCALHOSTS:
sabnzbd.AMBI_LOCALHOST = True
logging.info("IPV6 has priority on this system, potential Firefox issue")
if ipv6 and ipv4 and cherryhost == "" and sabnzbd.WIN32:
helpful_warning(T("Please be aware the 0.0.0.0 hostname will need an IPv6 address for external access"))
logging.warning_helpful(T("Please be aware the 0.0.0.0 hostname will need an IPv6 address for external access"))
if cherryhost == "localhost" and not sabnzbd.WIN32 and not sabnzbd.DARWIN:
# On the Ubuntu family, localhost leads to problems for CherryPy
@@ -665,7 +639,7 @@ def get_webhost(cherryhost, cherryport, https_port):
def attach_server(host, port, cert=None, key=None, chain=None):
"""Define and attach server, optionally HTTPS"""
""" Define and attach server, optionally HTTPS """
if sabnzbd.cfg.ipv6_hosting() or "::1" not in host:
http_server = cherrypy._cpserver.Server()
http_server.bind_addr = (host, port)
@@ -678,20 +652,20 @@ def attach_server(host, port, cert=None, key=None, chain=None):
def is_sabnzbd_running(url):
"""Return True when there's already a SABnzbd instance running."""
""" Return True when there's already a SABnzbd instance running. """
try:
url = "%s&mode=version" % url
# Do this without certificate verification, few installations will have that
prev = set_https_verification(False)
prev = sabnzbd.set_https_verification(False)
ver = get_from_url(url)
set_https_verification(prev)
sabnzbd.set_https_verification(prev)
return ver and (re.search(r"\d+\.\d+\.", ver) or ver.strip() == sabnzbd.__version__)
except:
return False
def find_free_port(host, currentport):
"""Return a free port, 0 when nothing is free"""
""" Return a free port, 0 when nothing is free """
n = 0
while n < 10 and currentport <= 49151:
try:
@@ -712,10 +686,10 @@ def check_for_sabnzbd(url, upload_nzbs, allow_browser=True):
if is_sabnzbd_running(url):
# Upload any specified nzb files to the running instance
if upload_nzbs:
prev = set_https_verification(False)
prev = sabnzbd.set_https_verification(False)
for f in upload_nzbs:
upload_file_to_sabnzbd(url, f)
set_https_verification(prev)
sabnzbd.set_https_verification(prev)
else:
# Launch the web browser and quit since sabnzbd is already running
# Trim away everything after the final slash in the URL
@@ -788,9 +762,10 @@ def commandline_handler():
"server=",
"templates",
"ipv6_hosting=",
"inet_exposure=",
"template2",
"browser=",
"config-file=",
"force",
"disable-file-log",
"version",
"https=",
@@ -844,7 +819,7 @@ def commandline_handler():
def get_f_option(opts):
"""Return value of the -f option"""
""" Return value of the -f option """
for opt, arg in opts:
if opt == "-f":
return arg
@@ -869,9 +844,10 @@ def main():
cherrypylogging = None
clean_up = False
logging_level = None
console_logging = False
no_file_log = False
web_dir = None
vista_plus = False
win64 = False
repair = 0
no_login = False
sabnzbd.RESTART_ARGS = [sys.argv[0]]
@@ -879,7 +855,6 @@ def main():
pid_file = None
new_instance = False
ipv6_hosting = None
inet_exposure = None
_service, sab_opts, _serv_opts, upload_nzbs = commandline_handler()
@@ -924,8 +899,6 @@ def main():
if logging_level < -1 or logging_level > 2:
print_help()
exit_sab(1)
elif opt == "--console":
console_logging = True
elif opt in ("-v", "--version"):
print_version()
exit_sab(0)
@@ -959,8 +932,6 @@ def main():
new_instance = True
elif opt == "--ipv6_hosting":
ipv6_hosting = arg
elif opt == "--inet_exposure":
inet_exposure = arg
sabnzbd.MY_FULLNAME = os.path.normpath(os.path.abspath(sabnzbd.MY_FULLNAME))
sabnzbd.MY_NAME = os.path.basename(sabnzbd.MY_FULLNAME)
@@ -969,8 +940,8 @@ def main():
sabnzbd.DIR_LANGUAGE = real_path(sabnzbd.DIR_PROG, DEF_LANGUAGE)
org_dir = os.getcwd()
# Need console logging if requested, for SABnzbd.py and SABnzbd-console.exe
console_logging = console_logging or sabnzbd.MY_NAME.lower().find("-console") > 0 or not hasattr(sys, "frozen")
# Need console logging for SABnzbd.py and SABnzbd-console.exe
console_logging = (not hasattr(sys, "frozen")) or (sabnzbd.MY_NAME.lower().find("-console") > 0)
console_logging = console_logging and not sabnzbd.DAEMON
LOGLEVELS = (logging.FATAL, logging.WARNING, logging.INFO, logging.DEBUG)
@@ -987,12 +958,17 @@ def main():
logger.setLevel(logging.WARNING)
logger.addHandler(gui_log)
# Detect Windows variant
if sabnzbd.WIN32:
vista_plus, win64 = windows_variant()
sabnzbd.WIN64 = win64
if inifile:
# INI file given, simplest case
inifile = evaluate_inipath(inifile)
else:
# No ini file given, need profile data
get_user_profile_paths()
get_user_profile_paths(vista_plus)
# Find out where INI file is
inifile = os.path.abspath(os.path.join(sabnzbd.DIR_LCLDATA, DEF_INI_FILE))
@@ -1174,39 +1150,37 @@ def main():
).strip()
except:
pass
logging.info("Commit = %s", sabnzbd.__baseline__)
logging.info("Commit: %s", sabnzbd.__baseline__)
logging.info("Full executable path = %s", sabnzbd.MY_FULLNAME)
logging.info("Arguments = %s", sabnzbd.CMDLINE)
if sabnzbd.WIN32:
suffix = ""
if win64:
suffix = "(win64)"
try:
logging.info("Platform = %s %s", platform.platform(), suffix)
except:
logging.info("Platform = %s <unknown>", suffix)
else:
logging.info("Platform = %s", os.name)
logging.info("Python-version = %s", sys.version)
logging.info("Dockerized = %s", sabnzbd.DOCKER)
logging.info("CPU architecture = %s", platform.uname().machine)
try:
logging.info("Platform = %s - %s", os.name, platform.platform())
except:
# Can fail on special platforms (like Snapcraft or embedded)
pass
logging.info("Arguments = %s", sabnzbd.CMDLINE)
if sabnzbd.DOCKER:
logging.info("Running inside a docker container")
else:
logging.info("Not inside a docker container")
# Find encoding; relevant for external processing activities
logging.info("Preferred encoding = %s", sabnzbd.encoding.CODEPAGE)
# On Linux/FreeBSD/Unix "UTF-8" is strongly, strongly adviced:
if not sabnzbd.WIN32 and not sabnzbd.DARWIN and not ("utf-8" in sabnzbd.encoding.CODEPAGE.lower()):
helpful_warning(
logging.warning_helpful(
T(
"SABnzbd was started with encoding %s, this should be UTF-8. Expect problems with Unicoded file and directory names in downloads."
),
sabnzbd.encoding.CODEPAGE,
)
# Verify umask, we need at least 700
if not sabnzbd.WIN32 and sabnzbd.ORG_UMASK > int("077", 8):
sabnzbd.misc.helpful_warning(
T("Current umask (%o) might deny SABnzbd access to the files and folders it creates."),
sabnzbd.ORG_UMASK,
)
# SSL Information
logging.info("SSL version = %s", ssl.OPENSSL_VERSION)
@@ -1217,8 +1191,8 @@ def main():
try:
os.environ["SSL_CERT_FILE"] = certifi.where()
logging.info("Certifi version = %s", certifi.__version__)
logging.info("Loaded additional certificates from %s", os.environ["SSL_CERT_FILE"])
logging.info("Certifi version: %s", certifi.__version__)
logging.info("Loaded additional certificates from: %s", os.environ["SSL_CERT_FILE"])
except:
# Sometimes the certificate file is blocked
logging.warning(T("Could not load additional certificates from certifi package"))
@@ -1227,16 +1201,38 @@ def main():
# Extra startup info
if sabnzbd.cfg.log_level() > 1:
# List the number of certificates available (can take up to 1.5 seconds)
logging.debug("Available certificates = %s", repr(ssl.create_default_context().cert_store_stats()))
ctx = ssl.create_default_context()
logging.debug("Available certificates: %s", repr(ctx.cert_store_stats()))
# List networking
logging.debug("Local IPv4 address = %s", localipv4())
logging.debug("Public IPv4 address = %s", publicipv4())
logging.debug("IPv6 address = %s", ipv6())
mylocalipv4 = localipv4()
if mylocalipv4:
logging.debug("My local IPv4 address = %s", mylocalipv4)
else:
logging.debug("Could not determine my local IPv4 address")
mypublicipv4 = publicipv4()
if mypublicipv4:
logging.debug("My public IPv4 address = %s", mypublicipv4)
else:
logging.debug("Could not determine my public IPv4 address")
myipv6 = ipv6()
if myipv6:
logging.debug("My IPv6 address = %s", myipv6)
else:
logging.debug("Could not determine my IPv6 address")
# Measure and log system performance measured by pystone and - if possible - CPU model
logging.debug("CPU Pystone available performance = %s", getpystone())
logging.debug("CPU model = %s", getcpu())
from sabnzbd.utils.getperformance import getpystone, getcpu
pystoneperf = getpystone()
if pystoneperf:
logging.debug("CPU Pystone available performance = %s", pystoneperf)
else:
logging.debug("CPU Pystone available performance could not be calculated")
cpumodel = getcpu() # Linux only
if cpumodel:
logging.debug("CPU model = %s", cpumodel)
logging.info("Using INI file %s", inifile)
@@ -1255,8 +1251,10 @@ def main():
sabnzbd.cfg.web_color.set(sabnzbd.WEB_COLOR)
# Handle the several tray icons
if sabnzbd.cfg.win_menu() and not sabnzbd.DAEMON and not sabnzbd.WIN_SERVICE:
if sabnzbd.cfg.win_menu() and not sabnzbd.DAEMON:
if sabnzbd.WIN32:
import sabnzbd.sabtray
sabnzbd.WINTRAY = sabnzbd.sabtray.SABTrayThread()
elif sabnzbd.LINUX_POWER and os.environ.get("DISPLAY"):
try:
@@ -1345,10 +1343,6 @@ def main():
sabnzbd.cfg.username.set("")
sabnzbd.cfg.password.set("")
# Overwrite inet_exposure from command-line for VPS-setups
if inet_exposure:
sabnzbd.cfg.inet_exposure.set(inet_exposure)
mime_gzip = (
"text/*",
"application/javascript",
@@ -1434,11 +1428,12 @@ def main():
try:
cherrypy.engine.start()
except:
# Since the webserver is started by cherrypy in a separate thread, we can't really catch any
# start-up errors. This try/except only catches very few errors, the rest is only shown in the console.
logging.error(T("Failed to start web-interface: "), exc_info=True)
abort_and_show_error(browserhost, cherryport)
# Wait for server to become ready
cherrypy.engine.wait(cherrypy.process.wspbus.states.STARTED)
if sabnzbd.WIN32:
if enable_https:
mode = "s"
@@ -1462,9 +1457,6 @@ def main():
if sabnzbd.NO_DOWNLOADING:
return
# Apply proxy, if configured, before main requests are made
sabnzbd.misc.set_socks5_proxy()
# Start all SABnzbd tasks
logging.info("Starting %s-%s", sabnzbd.MY_NAME, sabnzbd.__version__)
try:
@@ -1476,7 +1468,7 @@ def main():
# Upload any nzb/zip/rar/nzb.gz/nzb.bz2 files from file association
if upload_nzbs:
for upload_nzb in upload_nzbs:
sabnzbd.nzbparser.add_nzbfile(upload_nzb)
sabnzbd.add_nzbfile(upload_nzb)
# Set URL for browser
if enable_https:
@@ -1492,52 +1484,38 @@ def main():
check_latest_version()
autorestarted = False
# Start SSDP and Bonjour if SABnzbd isn't listening on localhost only
if sabnzbd.cfg.enable_broadcast() and not is_localhost(cherryhost):
# Try to find a LAN IP address for SSDP/Bonjour
if is_lan_addr(cherryhost):
# A specific listening address was configured, use that
external_host = cherryhost
# bonjour/zeroconf needs an ip. Lets try to find it.
external_host = localipv4() # IPv4 address of the LAN interface. This is the normal use case
if not external_host:
# None, so no network / default route, so let's set to ...
external_host = "127.0.0.1"
elif probablyipv4(cherryhost) and cherryhost not in LOCALHOSTS + ("0.0.0.0", "::"):
# a hard-configured cherryhost other than the usual, so let's take that (good or wrong)
external_host = cherryhost
logging.debug("bonjour/zeroconf/SSDP using host: %s", external_host)
sabnzbd.zconfig.set_bonjour(external_host, cherryport)
# Start SSDP if SABnzbd is running exposed
if cherryhost not in LOCALHOSTS:
# Set URL for browser for external hosts
if enable_https:
ssdp_url = "https://%s:%s%s" % (external_host, cherryport, sabnzbd.cfg.url_base())
else:
# Fall back to the IPv4 address of the LAN interface
external_host = localipv4()
logging.debug("Using %s as host address for Bonjour and SSDP", external_host)
# Only broadcast to local network addresses. If local ranges have been defined, further
# restrict broadcasts to those specific ranges in order to avoid broadcasting to the "wrong"
# private network when the system is connected to multiple such networks (e.g. a corporate
# VPN in addition to a standard household LAN).
if is_lan_addr(external_host) and (
(not sabnzbd.cfg.local_ranges()) or any(ip_in_subnet(external_host, r) for r in sabnzbd.cfg.local_ranges())
):
# Start Bonjour and SSDP
sabnzbd.zconfig.set_bonjour(external_host, cherryport)
# Set URL for browser for external hosts
ssdp_url = "%s://%s:%s%s" % (
("https" if enable_https else "http"),
external_host,
cherryport,
sabnzbd.cfg.url_base(),
)
ssdp.start_ssdp(
external_host,
"SABnzbd",
ssdp_url,
"SABnzbd %s" % sabnzbd.__version__,
"SABnzbd Team",
"https://sabnzbd.org/",
"SABnzbd %s" % sabnzbd.__version__,
ssdp_broadcast_interval=sabnzbd.cfg.ssdp_broadcast_interval(),
)
ssdp_url = "http://%s:%s%s" % (external_host, cherryport, sabnzbd.cfg.url_base())
ssdp.start_ssdp(
external_host,
"SABnzbd",
ssdp_url,
"SABnzbd %s" % sabnzbd.__version__,
"SABnzbd Team",
"https://sabnzbd.org/",
"SABnzbd %s" % sabnzbd.__version__,
)
# Have to keep this running, otherwise logging will terminate
timer = 0
while not sabnzbd.SABSTOP:
# Wait to be awoken or every 3 seconds
with sabnzbd.SABSTOP_CONDITION:
sabnzbd.SABSTOP_CONDITION.wait(3)
timer += 1
time.sleep(3)
# Check for loglevel changes
if LOG_FLAG:
@@ -1547,17 +1525,11 @@ def main():
if console_logging:
console.setLevel(level)
# 300 sec polling tasks
if not timer % 100:
if sabnzbd.LOG_ALL:
logging.debug("Triggering Python garbage collection")
gc.collect()
timer = 0
# 30 sec polling tasks
if not timer % 10:
if timer > 9:
timer = 0
# Keep OS awake (if needed)
sabnzbd.misc.keep_awake()
sabnzbd.keep_awake()
# Restart scheduler (if needed)
sabnzbd.Scheduler.restart(plan_restart=False)
# Save config (if needed)
@@ -1566,42 +1538,48 @@ def main():
if not sabnzbd.check_all_tasks():
autorestarted = True
sabnzbd.TRIGGER_RESTART = True
else:
timer += 1
# 3 sec polling tasks
# Check for auto-restart request
# Or special restart cases like Mac and WindowsService
if sabnzbd.TRIGGER_RESTART:
logging.info("Performing triggered restart")
# Shutdown
sabnzbd.shutdown_program()
# Add arguments and make sure we are in the right directory
if sabnzbd.Downloader.paused:
sabnzbd.RESTART_ARGS.append("-p")
if autorestarted:
sabnzbd.RESTART_ARGS.append("--autorestarted")
sys.argv = sabnzbd.RESTART_ARGS
os.chdir(org_dir)
# Binaries require special restart
if hasattr(sys, "frozen"):
if sabnzbd.DARWIN:
# On macOS restart of app instead of embedded python
my_name = sabnzbd.MY_FULLNAME.replace("/Contents/MacOS/SABnzbd", "")
my_args = " ".join(sys.argv[1:])
cmd = 'kill -9 %s && open "%s" --args %s' % (os.getpid(), my_name, my_args)
logging.info("Launching: %s", cmd)
os.system(cmd)
elif sabnzbd.WIN_SERVICE:
# Use external service handler to do the restart
# Wait 5 seconds to clean up
subprocess.Popen("timeout 5 & sc start SABnzbd", shell=True)
elif sabnzbd.WIN32:
# Just a simple restart of the exe
os.execv(sys.executable, ['"%s"' % arg for arg in sys.argv])
os.chdir(org_dir)
# If macOS frozen restart of app instead of embedded python
if hasattr(sys, "frozen") and sabnzbd.DARWIN:
# [[NSProcessInfo processInfo] processIdentifier]]
# logging.info("%s" % (NSProcessInfo.processInfo().processIdentifier()))
my_pid = os.getpid()
my_name = sabnzbd.MY_FULLNAME.replace("/Contents/MacOS/SABnzbd", "")
my_args = " ".join(sys.argv[1:])
cmd = 'kill -9 %s && open "%s" --args %s' % (my_pid, my_name, my_args)
logging.info("Launching: %s", cmd)
os.system(cmd)
elif sabnzbd.WIN_SERVICE:
# Use external service handler to do the restart
# Wait 5 seconds to clean up
subprocess.Popen("timeout 5 & sc start SABnzbd", shell=True)
else:
# CherryPy has special logic to include interpreter options such as "-OO"
cherrypy.engine._do_execv()
config.save_config()
if sabnzbd.WINTRAY:
sabnzbd.WINTRAY.terminate = True
if sabnzbd.WIN32:
del_connection_info()
# Send our final goodbyes!
notifier.send_notification("SABnzbd", T("SABnzbd shutdown finished"), "startup")
logging.info("Leaving SABnzbd")
@@ -1628,9 +1606,10 @@ def main():
if sabnzbd.WIN32:
import servicemanager
class SABnzbd(win32serviceutil.ServiceFramework):
"""Win32 Service Handler"""
""" Win32 Service Handler """
_svc_name_ = "SABnzbd"
_svc_display_name_ = "SABnzbd Binary Newsreader"
@@ -1694,7 +1673,7 @@ def handle_windows_service():
Returns True when any service commands were detected or
when we have started as a service.
"""
# Detect if running as Windows Service
# Detect if running as Windows Service (only Vista and above!)
# Adapted from https://stackoverflow.com/a/55248281/5235502
# Only works when run from the exe-files
if hasattr(sys, "frozen") and win32ts.ProcessIdToSessionId(win32api.GetCurrentProcessId()) == 0:
@@ -1736,9 +1715,6 @@ def handle_windows_service():
if __name__ == "__main__":
# Require for freezing
multiprocessing.freeze_support()
# We can only register these in the main thread
signal.signal(signal.SIGINT, sabnzbd.sig_handler)
signal.signal(signal.SIGTERM, sabnzbd.sig_handler)
@@ -1748,6 +1724,7 @@ if __name__ == "__main__":
main()
elif sabnzbd.DARWIN and sabnzbd.FOUNDATION:
# macOS binary runner
from threading import Thread
from PyObjCTools import AppHelper
@@ -1756,7 +1733,7 @@ if __name__ == "__main__":
# Need to run the main application in separate thread because the eventLoop
# has to be in the main thread. The eventLoop is required for the menu.
# This code is made with trial-and-error, please feel free to improve!
# This code is made with trial-and-error, please improve!
class startApp(Thread):
def run(self):
main()

View File

@@ -1,192 +0,0 @@
# -*- mode: python -*-
import re
import sys
import pkginfo
from PyInstaller.building.api import EXE, COLLECT, PYZ
from PyInstaller.building.build_main import Analysis
from PyInstaller.building.osx import BUNDLE
from PyInstaller.utils.hooks import collect_data_files, collect_submodules
# Add extra files in the PyInstaller-spec
extra_pyinstaller_files = []
# Also modify these in "package.py"!
extra_files = [
"README.txt",
"INSTALL.txt",
"LICENSE.txt",
"GPL2.txt",
"GPL3.txt",
"COPYRIGHT.txt",
"ISSUES.txt",
"PKG-INFO",
]
extra_folders = [
"scripts/",
"licenses/",
"locale/",
"email/",
"interfaces/Glitter/",
"interfaces/wizard/",
"interfaces/Config/",
"scripts/",
"icons/",
]
# Get the version
RELEASE_VERSION = pkginfo.Develop(".").version
# Add hidden imports
extra_hiddenimports = ["Cheetah.DummyTransaction", "cheroot.ssl.builtin", "certifi"]
extra_hiddenimports.extend(collect_submodules("babelfish.converters"))
extra_hiddenimports.extend(collect_submodules("guessit.data"))
# Add platform specific stuff
if sys.platform == "darwin":
extra_hiddenimports.extend(["pyobjc", "objc", "PyObjCTools"])
# macOS folders
extra_folders += ["osx/par2/", "osx/unrar/", "osx/7zip/"]
# Add NZB-icon file
extra_pyinstaller_files.append(("builder/osx/image/nzbfile.icns", "."))
# Version information is set differently on macOS
version_info = None
else:
# Build would fail on non-Windows
from PyInstaller.utils.win32.versioninfo import (
VSVersionInfo,
FixedFileInfo,
StringFileInfo,
StringTable,
StringStruct,
VarFileInfo,
VarStruct,
)
# Windows
extra_hiddenimports.append("win32timezone")
extra_folders += ["win/multipar/", "win/unrar/", "win/7zip/"]
extra_files += ["portable.cmd"]
# Parse the version info
version_regexed = re.search(r"(\d+)\.(\d+)\.(\d+)([a-zA-Z]*)(\d*)", RELEASE_VERSION)
version_tuple = (int(version_regexed.group(1)), int(version_regexed.group(2)), int(version_regexed.group(3)), 0)
# Detailed instructions are in the PyInstaller documentation
# We don't include the alpha/beta/rc in the counters
version_info = VSVersionInfo(
ffi=FixedFileInfo(
filevers=version_tuple,
prodvers=version_tuple,
mask=0x3F,
flags=0x0,
OS=0x40004,
fileType=0x1,
subtype=0x0,
date=(0, 0),
),
kids=[
StringFileInfo(
[
StringTable(
"040904B0",
[
StringStruct("Comments", f"SABnzbd {RELEASE_VERSION}"),
StringStruct("CompanyName", "The SABnzbd-Team"),
StringStruct("FileDescription", f"SABnzbd {RELEASE_VERSION}"),
StringStruct("FileVersion", RELEASE_VERSION),
StringStruct("LegalCopyright", "The SABnzbd-Team"),
StringStruct("ProductName", f"SABnzbd {RELEASE_VERSION}"),
StringStruct("ProductVersion", RELEASE_VERSION),
],
)
]
),
VarFileInfo([VarStruct("Translation", [1033, 1200])]),
],
)
# Process the extra-files and folders
for file_item in extra_files:
extra_pyinstaller_files.append((file_item, "."))
for folder_item in extra_folders:
extra_pyinstaller_files.append((folder_item, folder_item))
# Add babelfish data files
extra_pyinstaller_files.extend(collect_data_files("babelfish"))
extra_pyinstaller_files.extend(collect_data_files("guessit"))
pyi_analysis = Analysis(
["SABnzbd.py"],
datas=extra_pyinstaller_files,
hiddenimports=extra_hiddenimports,
excludes=["FixTk", "tcl", "tk", "_tkinter", "tkinter", "Tkinter"],
)
pyz = PYZ(pyi_analysis.pure, pyi_analysis.zipped_data)
exe = EXE(
pyz,
pyi_analysis.scripts,
[],
exclude_binaries=True,
name="SABnzbd",
upx=True,
console=False,
append_pkg=False,
icon="icons/sabnzbd.ico",
version=version_info,
target_arch="universal2",
)
coll = COLLECT(exe, pyi_analysis.binaries, pyi_analysis.zipfiles, pyi_analysis.datas, name="SABnzbd")
# We need to run again for the console-app
if sys.platform == "win32":
# Enable console=True for this one
console_exe = EXE(
pyz,
pyi_analysis.scripts,
[],
exclude_binaries=True,
name="SABnzbd-console",
upx=True,
append_pkg=False,
icon="icons/sabnzbd.ico",
version=version_info,
)
console_coll = COLLECT(
console_exe,
pyi_analysis.binaries,
pyi_analysis.zipfiles,
pyi_analysis.datas,
upx=True,
name="SABnzbd-console",
)
# Build the APP on macOS
if sys.platform == "darwin":
info_plist = {
"NSUIElement": 1,
"NSPrincipalClass": "NSApplication",
"CFBundleShortVersionString": RELEASE_VERSION,
"NSHumanReadableCopyright": "The SABnzbd-Team",
"CFBundleIdentifier": "org.sabnzbd.sabnzbd",
"CFBundleDocumentTypes": [
{
"CFBundleTypeExtensions": ["nzb"],
"CFBundleTypeIconFile": "nzbfile.icns",
"CFBundleTypeMIMETypes": ["text/nzb"],
"CFBundleTypeName": "NZB File",
"CFBundleTypeRole": "Viewer",
"LSTypeIsPackage": 0,
"NSPersistentStoreTypeKey": "Binary",
}
],
"LSMinimumSystemVersion": "10.9",
"LSEnvironment": {"LANG": "en_US.UTF-8", "LC_ALL": "en_US.UTF-8"},
}
app = BUNDLE(coll, name="SABnzbd.app", icon="builder/osx/image/sabnzbdplus.icns", info_plist=info_plist)

View File

@@ -1,206 +0,0 @@
#!/usr/bin/python3 -OO
# Copyright 2008-2017 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import os
import pkginfo
# We need to call dmgbuild from command-line, so here we can setup how
if __name__ == "__main__":
# Check for DMGBuild
try:
import dmgbuild
except:
print("Requires dmgbuild-module, use pip install dmgbuild")
exit()
# Make sure we are in the src folder
if not os.path.exists("builder"):
raise FileNotFoundError("Run from the main SABnzbd source folder: python builder/package.py")
# Check if signing is possible
authority = os.environ.get("SIGNING_AUTH")
# Extract version info and set DMG path
# Create sub-folder to upload later
release = pkginfo.Develop(".").version
prod = "SABnzbd-" + release
fileDmg = prod + "-osx.dmg"
# Path to app file
apppath = "dist/SABnzbd.app"
# Copy Readme
readmepath = os.path.join(apppath, "Contents/Resources/README.txt")
# Path to background and the icon
backgroundpath = "builder/osx/image/sabnzbd_new_bg.png"
iconpath = "builder/osx/image/sabnzbdplus.icns"
# Make DMG
print("Building DMG")
dmgbuild.build_dmg(
filename=fileDmg,
volume_name=prod,
settings_file="builder/make_dmg.py",
defines={"app": apppath, "readme": readmepath, "background": backgroundpath, "iconpath": iconpath},
)
# Resign APP
if authority:
print("Siging DMG")
os.system('codesign --deep -f -i "org.sabnzbd.SABnzbd" -s "%s" "%s"' % (authority, fileDmg))
print("Signed!")
else:
print("Signing skipped, missing SIGNING_AUTH.")
exit()
### START OF DMGBUILD SETTINGS
### COPIED AND MODIFIED FROM THE EXAMPLE ONLINE
application = defines.get("app", "AppName.app")
readme = defines.get("readme", "ReadMe.rtf")
appname = os.path.basename(application)
# .. Basics ....................................................................
# Volume format (see hdiutil create -help)
format = defines.get("format", "UDBZ")
# Volume size (must be large enough for your files)
size = defines.get("size", "100M")
# Files to include
files = [application, readme]
# Symlinks to create
symlinks = {"Applications": "/Applications"}
# Volume icon
#
# You can either define icon, in which case that icon file will be copied to the
# image, *or* you can define badge_icon, in which case the icon file you specify
# will be used to badge the system's Removable Disk icon
#
badge_icon = defines.get("iconpath", "")
# Where to put the icons
icon_locations = {readme: (70, 160), appname: (295, 220), "Applications": (510, 220)}
# .. Window configuration ......................................................
# Window position in ((x, y), (w, h)) format
window_rect = ((100, 100), (660, 360))
# Background
#
# This is a STRING containing any of the following:
#
# #3344ff - web-style RGB color
# #34f - web-style RGB color, short form (#34f == #3344ff)
# rgb(1,0,0) - RGB color, each value is between 0 and 1
# hsl(120,1,.5) - HSL (hue saturation lightness) color
# hwb(300,0,0) - HWB (hue whiteness blackness) color
# cmyk(0,1,0,0) - CMYK color
# goldenrod - X11/SVG named color
# builtin-arrow - A simple built-in background with a blue arrow
# /foo/bar/baz.png - The path to an image file
#
# Other color components may be expressed either in the range 0 to 1, or
# as percentages (e.g. 60% is equivalent to 0.6).
background = defines.get("background", "builtin-arrow")
show_status_bar = False
show_tab_view = False
show_toolbar = False
show_pathbar = False
show_sidebar = False
sidebar_width = 0
# Select the default view; must be one of
#
# 'icon-view'
# 'list-view'
# 'column-view'
# 'coverflow'
#
default_view = "icon-view"
# General view configuration
show_icon_preview = False
# Set these to True to force inclusion of icon/list view settings (otherwise
# we only include settings for the default view)
include_icon_view_settings = "auto"
include_list_view_settings = "auto"
# .. Icon view configuration ...................................................
arrange_by = None
grid_offset = (0, 0)
grid_spacing = 50
scroll_position = (0, 0)
label_pos = "bottom" # or 'right'
text_size = 16
icon_size = 64
# .. List view configuration ...................................................
# Column names are as follows:
#
# name
# date-modified
# date-created
# date-added
# date-last-opened
# size
# kind
# label
# version
# comments
#
list_icon_size = 16
list_text_size = 12
list_scroll_position = (0, 0)
list_sort_by = "name"
list_use_relative_dates = True
list_calculate_all_sizes = (False,)
list_columns = ("name", "date-modified", "size", "kind", "date-added")
list_column_widths = {
"name": 300,
"date-modified": 181,
"date-created": 181,
"date-added": 181,
"date-last-opened": 181,
"size": 97,
"kind": 115,
"label": 100,
"version": 75,
"comments": 300,
}
list_column_sort_directions = {
"name": "ascending",
"date-modified": "descending",
"date-created": "descending",
"date-added": "descending",
"date-last-opened": "descending",
"size": "descending",
"kind": "ascending",
"label": "ascending",
"version": "ascending",
"comments": "ascending",
}

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>

View File

Binary file not shown.

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

View File

Binary file not shown.

View File

Binary file not shown.

View File

@@ -1,3 +0,0 @@
# Special requirements for macOS universal2 binary release
# This way dependabot can auto-update them
cryptography==36.0.1

View File

@@ -1,614 +0,0 @@
#!/usr/bin/python3 -OO
# Copyright 2008-2017 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import glob
import platform
import re
import sys
import os
import tempfile
import time
import shutil
import subprocess
import tarfile
import urllib.request
import urllib.error
import configobj
import pkginfo
import github
VERSION_FILE = "sabnzbd/version.py"
SPEC_FILE = "SABnzbd.spec"
# Also modify these in "SABnzbd.spec"!
extra_files = [
"README.mkd",
"INSTALL.txt",
"LICENSE.txt",
"GPL2.txt",
"GPL3.txt",
"COPYRIGHT.txt",
"ISSUES.txt",
"PKG-INFO",
]
extra_folders = [
"scripts/",
"licenses/",
"locale/",
"email/",
"interfaces/Glitter/",
"interfaces/wizard/",
"interfaces/Config/",
"scripts/",
"icons/",
]
# Support functions
def safe_remove(path):
"""Remove file without erros if the file doesn't exist
Can also handle folders
"""
if os.path.exists(path):
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.remove(path)
def delete_files_glob(name):
"""Delete one file or set of files from wild-card spec"""
for f in glob.glob(name):
if os.path.exists(f):
os.remove(f)
def run_external_command(command):
"""Wrapper to ease the use of calling external programs"""
process = subprocess.Popen(command, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output, _ = process.communicate()
ret = process.wait()
if output:
print(output)
if ret != 0:
raise RuntimeError("Command returned non-zero exit code %s!" % ret)
return output
def run_git_command(parms):
"""Run git command, raise error if it failed"""
return run_external_command(["git"] + parms)
def patch_version_file(release_name):
"""Patch in the Git commit hash, but only when this is
an unmodified checkout
"""
git_output = run_git_command(["log", "-1"])
for line in git_output.split("\n"):
if "commit " in line:
commit = line.split(" ")[1].strip()
break
else:
raise TypeError("Commit hash not found")
with open(VERSION_FILE, "r") as ver:
version_file = ver.read()
version_file = re.sub(r'__baseline__\s*=\s*"[^"]*"', '__baseline__ = "%s"' % commit, version_file)
version_file = re.sub(r'__version__\s*=\s*"[^"]*"', '__version__ = "%s"' % release_name, version_file)
with open(VERSION_FILE, "w") as ver:
ver.write(version_file)
def test_sab_binary(binary_path: str):
"""Wrapper to have a simple start-up test for the binary"""
with tempfile.TemporaryDirectory() as config_dir:
sabnzbd_process = subprocess.Popen(
[binary_path, "--browser", "0", "--logging", "2", "--config", config_dir],
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
# Wait for SAB to respond
base_url = "http://127.0.0.1:8080/"
for _ in range(10):
try:
urllib.request.urlopen(base_url, timeout=1).read()
break
except urllib.error.URLError:
time.sleep(1)
else:
raise urllib.error.URLError("Could not connect to SABnzbd")
# Open a number of API calls and pages, to see if we are really up
pages_to_test = [
"",
"wizard",
"config",
"config/server",
"config/categories",
"config/scheduling",
"config/rss",
"config/general",
"config/folders",
"config/switches",
"config/sorting",
"config/notify",
"config/special",
"api?mode=version",
]
for url in pages_to_test:
print("Testing: %s%s" % (base_url, url))
if b"500 Internal Server Error" in urllib.request.urlopen(base_url + url, timeout=1).read():
raise RuntimeError("Crash in %s" % url)
# Parse API-key so we can do a graceful shutdown
sab_config = configobj.ConfigObj(os.path.join(config_dir, "sabnzbd.ini"))
urllib.request.urlopen(base_url + "shutdown/?apikey=" + sab_config["misc"]["api_key"], timeout=10)
sabnzbd_process.wait()
# Print logs for verification
with open(os.path.join(config_dir, "logs", "sabnzbd.log"), "r") as log_file:
print(log_file.read())
# So we have time to print the file before the directory is removed
time.sleep(1)
if __name__ == "__main__":
# Was any option supplied?
if len(sys.argv) < 2:
raise TypeError("Please specify what to do")
# Make sure we are in the src folder
if not os.path.exists("builder"):
raise FileNotFoundError("Run from the main SABnzbd source folder: python builder/package.py")
# Extract version info
RELEASE_VERSION = pkginfo.Develop(".").version
# Check if we have the needed certificates
try:
import certifi
except ImportError:
raise FileNotFoundError("Need certifi module")
# Define release name
RELEASE_NAME = "SABnzbd-%s" % RELEASE_VERSION
RELEASE_TITLE = "SABnzbd %s" % RELEASE_VERSION
RELEASE_SRC = RELEASE_NAME + "-src.tar.gz"
RELEASE_BINARY_32 = RELEASE_NAME + "-win32-bin.zip"
RELEASE_BINARY_64 = RELEASE_NAME + "-win64-bin.zip"
RELEASE_INSTALLER = RELEASE_NAME + "-win-setup.exe"
RELEASE_MACOS = RELEASE_NAME + "-osx.dmg"
RELEASE_README = "README.mkd"
# Patch release file
patch_version_file(RELEASE_VERSION)
# To draft a release or not to draft a release?
ON_GITHUB_ACTIONS = os.environ.get("CI", False)
RELEASE_THIS = "refs/tags/" in os.environ.get("GITHUB_REF", "")
# Rename release notes file
safe_remove("README.txt")
shutil.copyfile(RELEASE_README, "README.txt")
# Compile translations
if not os.path.exists("locale"):
run_external_command([sys.executable, "tools/make_mo.py"])
# Check again if translations exist, fail otherwise
if not os.path.exists("locale"):
raise FileNotFoundError("Failed to compile language files")
# Make sure we remove any existing build-folders
safe_remove("build")
safe_remove("dist")
safe_remove(RELEASE_NAME)
# Copy the specification
shutil.copyfile("builder/%s" % SPEC_FILE, SPEC_FILE)
if "binary" in sys.argv or "installer" in sys.argv:
# Must be run on Windows
if sys.platform != "win32":
raise RuntimeError("Binary should be created on Windows")
# Check what architecture we are on
RELEASE_BINARY = RELEASE_BINARY_32
if platform.architecture()[0] == "64bit":
RELEASE_BINARY = RELEASE_BINARY_64
# Remove any leftovers
safe_remove(RELEASE_BINARY)
# Run PyInstaller and check output
run_external_command([sys.executable, "-O", "-m", "PyInstaller", "SABnzbd.spec"])
shutil.copytree("dist/SABnzbd-console", "dist/SABnzbd", dirs_exist_ok=True)
safe_remove("dist/SABnzbd-console")
# Remove unwanted DLL's
delete_files_glob("dist/SABnzbd/api-ms-win*.dll")
delete_files_glob("dist/SABnzbd/mfc140u.dll")
delete_files_glob("dist/SABnzbd/ucrtbase.dll")
# Remove other files we don't need
delete_files_glob("dist/SABnzbd/PKG-INFO")
delete_files_glob("dist/SABnzbd/win32ui.pyd")
delete_files_glob("dist/SABnzbd/winxpgui.pyd")
if "installer" in sys.argv:
# Needs to be run on 64 bit
if RELEASE_BINARY != RELEASE_BINARY_64:
raise RuntimeError("Installer should be created on 64bit Python")
# Compile NSIS translations
safe_remove("NSIS_Installer.nsi")
safe_remove("NSIS_Installer.nsi.tmp")
shutil.copyfile("builder/win/NSIS_Installer.nsi", "NSIS_Installer.nsi")
run_external_command([sys.executable, "tools/make_mo.py", "nsis"])
# Remove 32bit external executables
delete_files_glob("dist/SABnzbd/win/par2/multipar/par2j.exe")
delete_files_glob("dist/SABnzbd/win/unrar/UnRAR.exe")
# Run NSIS to build installer
run_external_command(
[
"makensis.exe",
"/V3",
"/DSAB_PRODUCT=%s" % RELEASE_NAME,
"/DSAB_VERSION=%s" % RELEASE_VERSION,
"/DSAB_FILE=%s" % RELEASE_INSTALLER,
"NSIS_Installer.nsi.tmp",
]
)
# Rename the folder
shutil.copytree("dist/SABnzbd", RELEASE_NAME)
# Create the archive
run_external_command(["win/7zip/7za.exe", "a", RELEASE_BINARY, RELEASE_NAME])
# Test the release, as the very last step to not mess with any release code
test_sab_binary("dist/SABnzbd/SABnzbd.exe")
if "app" in sys.argv:
# Must be run on macOS
if sys.platform != "darwin":
raise RuntimeError("App should be created on macOS")
# Who will sign and notarize this?
authority = os.environ.get("SIGNING_AUTH")
notarization_user = os.environ.get("NOTARIZATION_USER")
notarization_pass = os.environ.get("NOTARIZATION_PASS")
# Run PyInstaller and check output
run_external_command([sys.executable, "-O", "-m", "PyInstaller", "SABnzbd.spec"])
# Make sure we created a fully universal2 release when releasing or during CI
if RELEASE_THIS or ON_GITHUB_ACTIONS:
for bin_to_check in glob.glob("dist/SABnzbd.app/Contents/MacOS/**/*.so", recursive=True):
print("Checking if binary is universal2: %s" % bin_to_check)
file_output = run_external_command(["file", bin_to_check])
# Make sure we have both arm64 and x86
if not ("x86_64" in file_output and "arm64" in file_output):
raise RuntimeError("Non-universal2 binary found!")
# Only continue if we can sign
if authority:
files_to_sign = [
"dist/SABnzbd.app/Contents/MacOS/osx/par2/par2-sl64",
"dist/SABnzbd.app/Contents/MacOS/osx/7zip/7za",
"dist/SABnzbd.app/Contents/MacOS/osx/unrar/unrar",
"dist/SABnzbd.app/Contents/MacOS/SABnzbd",
"dist/SABnzbd.app",
]
for file_to_sign in files_to_sign:
print("Signing %s with hardended runtime" % file_to_sign)
run_external_command(
[
"codesign",
"--deep",
"--force",
"--timestamp",
"--options",
"runtime",
"--entitlements",
"builder/osx/entitlements.plist",
"-i",
"org.sabnzbd.sabnzbd",
"-s",
authority,
file_to_sign,
],
)
print("Signed %s!" % file_to_sign)
# Only notarize for real builds that we want to deploy
if notarization_user and notarization_pass and RELEASE_THIS:
# Prepare zip to upload to notarization service
print("Creating zip to send to Apple notarization service")
# We need to use ditto, otherwise the signature gets lost!
notarization_zip = RELEASE_NAME + ".zip"
run_external_command(
["ditto", "-c", "-k", "--sequesterRsrc", "--keepParent", "dist/SABnzbd.app", notarization_zip]
)
# Upload to Apple
print("Sending zip to Apple notarization service")
upload_result = run_external_command(
[
"xcrun",
"notarytool",
"submit",
notarization_zip,
"--apple-id",
notarization_user,
"--team-id",
authority,
"--password",
notarization_pass,
"--wait",
],
)
# Check if success
if "status: accepted" not in upload_result.lower():
raise RuntimeError("Failed to notarize..")
# Staple the notarization!
print("Approved! Stapling the result to the app")
run_external_command(["xcrun", "stapler", "staple", "dist/SABnzbd.app"])
elif notarization_user and notarization_pass:
print("Notarization skipped, tag commit to trigger notarization!")
else:
print("Notarization skipped, NOTARIZATION_USER or NOTARIZATION_PASS missing.")
else:
print("Signing skipped, missing SIGNING_AUTH.")
# Test the release, as the very last step to not mess with any release code
test_sab_binary("dist/SABnzbd.app/Contents/MacOS/SABnzbd")
if "source" in sys.argv:
# Prepare Source distribution package.
# We assume the sources are freshly cloned from the repo
# Make sure all source files are Unix format
src_folder = "srcdist"
safe_remove(src_folder)
os.mkdir(src_folder)
# Remove any leftovers
safe_remove(RELEASE_SRC)
# Add extra files and folders need for source dist
extra_folders.extend(["sabnzbd/", "po/", "linux/", "tools/", "tests/"])
extra_files.extend(["SABnzbd.py", "requirements.txt"])
# Copy all folders and files to the new folder
for source_folder in extra_folders:
shutil.copytree(source_folder, os.path.join(src_folder, source_folder), dirs_exist_ok=True)
# Copy all files
for source_file in extra_files:
shutil.copyfile(source_file, os.path.join(src_folder, source_file))
# Make sure all line-endings are correct
for input_filename in glob.glob("%s/**/*.*" % src_folder, recursive=True):
base, ext = os.path.splitext(input_filename)
if ext.lower() not in (".py", ".txt", ".css", ".js", ".tmpl", ".sh", ".cmd"):
continue
print(input_filename)
with open(input_filename, "rb") as input_data:
data = input_data.read()
data = data.replace(b"\r", b"")
with open(input_filename, "wb") as output_data:
output_data.write(data)
# Create tar.gz file for source distro
with tarfile.open(RELEASE_SRC, "w:gz") as tar_output:
for root, dirs, files in os.walk(src_folder):
for _file in files:
input_path = os.path.join(root, _file)
if sys.platform == "win32":
tar_path = input_path.replace("srcdist\\", RELEASE_NAME + "/").replace("\\", "/")
else:
tar_path = input_path.replace("srcdist/", RELEASE_NAME + "/")
tarinfo = tar_output.gettarinfo(input_path, tar_path)
tarinfo.uid = 0
tarinfo.gid = 0
if _file in ("SABnzbd.py", "Sample-PostProc.sh", "make_mo.py", "msgfmt.py"):
# Force Linux/OSX scripts as executable
tarinfo.mode = 0o755
else:
tarinfo.mode = 0o644
with open(input_path, "rb") as f:
tar_output.addfile(tarinfo, f)
# Remove source folder
safe_remove(src_folder)
# Release to github
if "release" in sys.argv:
# Check if tagged as release and check for token
gh_token = os.environ.get("AUTOMATION_GITHUB_TOKEN", "")
if RELEASE_THIS and gh_token:
gh_obj = github.Github(gh_token)
gh_repo = gh_obj.get_repo("sabnzbd/sabnzbd")
# Read the release notes
with open(RELEASE_README, "r") as readme_file:
readme_data = readme_file.read()
# Pre-releases are longer than 6 characters (e.g. 3.1.0Beta1 vs 3.1.0, but also 3.0.11)
prerelease = len(RELEASE_VERSION) > 5
# We have to manually check if we already created this release
for release in gh_repo.get_releases():
if release.tag_name == RELEASE_VERSION:
gh_release = release
print("Found existing release %s" % gh_release.title)
break
else:
# Did not find it, so create the release, use the GitHub tag we got as input
print("Creating GitHub release SABnzbd %s" % RELEASE_VERSION)
gh_release = gh_repo.create_git_release(
tag=RELEASE_VERSION,
name=RELEASE_TITLE,
message=readme_data,
draft=True,
prerelease=prerelease,
)
# Fetch existing assets, as overwriting is not allowed by GitHub
gh_assets = gh_release.get_assets()
# Upload the assets
files_to_check = (
RELEASE_SRC,
RELEASE_BINARY_32,
RELEASE_BINARY_64,
RELEASE_INSTALLER,
RELEASE_MACOS,
RELEASE_README,
)
for file_to_check in files_to_check:
if os.path.exists(file_to_check):
# Check if this file was previously uploaded
if gh_assets.totalCount:
for gh_asset in gh_assets:
if gh_asset.name == file_to_check:
print("Removing existing asset %s " % gh_asset.name)
gh_asset.delete_asset()
# Upload the new one
print("Uploading %s to release %s" % (file_to_check, gh_release.title))
gh_release.upload_asset(file_to_check)
# Check if we now have all files
gh_new_assets = gh_release.get_assets()
if gh_new_assets.totalCount:
all_assets = [gh_asset.name for gh_asset in gh_new_assets]
# Check if we have all files, using set-comparison
if set(files_to_check) == set(all_assets):
print("All assets present, releasing %s" % RELEASE_VERSION)
# Publish release
gh_release.update_release(
tag_name=RELEASE_VERSION,
name=RELEASE_TITLE,
message=readme_data,
draft=False,
prerelease=prerelease,
)
# Update the website
gh_repo_web = gh_obj.get_repo("sabnzbd/sabnzbd.github.io")
# Check if the branch already exists, only create one if it doesn't
skip_website_update = False
try:
gh_repo_web.get_branch(RELEASE_VERSION)
print("Branch %s on sabnzbd/sabnzbd.github.io already exists, skipping update" % RELEASE_VERSION)
skip_website_update = True
except github.GithubException:
# Create a new branch to have the changes
sb = gh_repo_web.get_branch("master")
print("Creating branch %s on sabnzbd/sabnzbd.github.io" % RELEASE_VERSION)
new_branch = gh_repo_web.create_git_ref(ref="refs/heads/" + RELEASE_VERSION, sha=sb.commit.sha)
# Update the files
if not skip_website_update:
# We need bytes version to interact with GitHub
RELEASE_VERSION_BYTES = RELEASE_VERSION.encode()
# Get all the version files
latest_txt = gh_repo_web.get_contents("latest.txt")
latest_txt_items = latest_txt.decoded_content.split()
new_latest_txt_items = latest_txt_items[:2]
config_yml = gh_repo_web.get_contents("_config.yml")
if prerelease:
# If it's a pre-release, we append to current version in latest.txt
new_latest_txt_items.extend([RELEASE_VERSION_BYTES, latest_txt_items[1]])
# And replace in _config.yml
new_config_yml = re.sub(
b"latest_testing: '[^']*'",
b"latest_testing: '%s'" % RELEASE_VERSION_BYTES,
config_yml.decoded_content,
)
else:
# New stable release, replace the version
new_latest_txt_items[0] = RELEASE_VERSION_BYTES
# And replace in _config.yml
new_config_yml = re.sub(
b"latest_testing: '[^']*'",
b"latest_testing: ''",
config_yml.decoded_content,
)
new_config_yml = re.sub(
b"latest_stable: '[^']*'",
b"latest_stable: '%s'" % RELEASE_VERSION_BYTES,
new_config_yml,
)
# Also update the wiki-settings, these only use x.x notation
new_config_yml = re.sub(
b"wiki_version: '[^']*'",
b"wiki_version: '%s'" % RELEASE_VERSION_BYTES[:3],
new_config_yml,
)
# Update the files
print("Updating latest.txt")
gh_repo_web.update_file(
"latest.txt",
"Release %s: latest.txt" % RELEASE_VERSION,
b"\n".join(new_latest_txt_items),
latest_txt.sha,
RELEASE_VERSION,
)
print("Updating _config.yml")
gh_repo_web.update_file(
"_config.yml",
"Release %s: _config.yml" % RELEASE_VERSION,
new_config_yml,
config_yml.sha,
RELEASE_VERSION,
)
# Create pull-request
print("Creating pull request in sabnzbd/sabnzbd.github.io for the update")
gh_repo_web.create_pull(
title=RELEASE_VERSION,
base="master",
body="Automated update of release files",
head=RELEASE_VERSION,
)
else:
print("To push release to GitHub, first tag the commit.")
print("Or missing the AUTOMATION_GITHUB_TOKEN, cannot push to GitHub without it.")
# Reset!
run_git_command(["reset", "--hard"])
run_git_command(["clean", "-f"])

View File

@@ -1,18 +0,0 @@
# Basic build requirements
# Note that not all sub-dependencies are listed, but only ones we know could cause trouble
pyinstaller==4.8
pyinstaller-hooks-contrib==2022.0
altgraph==0.17.2
wrapt==1.13.3
setuptools==60.6.0
pkginfo==1.8.2
PyGithub==1.55
charset-normalizer==2.0.11
certifi
# For the macOS build
dmgbuild==1.5.2; sys_platform == 'darwin'
mac-alias==2.2.0; sys_platform == 'darwin'
macholib==1.15.2; sys_platform == 'darwin'
ds-store==1.3.0; sys_platform == 'darwin'
PyNaCl==1.5.0; sys_platform == 'darwin'

View File

@@ -1,405 +0,0 @@
; -*- coding: utf-8 -*-
;
; Copyright 2008-2015 The SABnzbd-Team <team@sabnzbd.org>
;
; This program is free software; you can redistribute it and/or
; modify it under the terms of the GNU General Public License
; as published by the Free Software Foundation; either version 2
; of the License, or (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Unicode true
!addplugindir builder\win\nsis\Plugins
!addincludedir builder\win\nsis\Include
!include "MUI2.nsh"
!include "registerExtension.nsh"
!include "FileFunc.nsh"
!include "LogicLib.nsh"
!include "WinVer.nsh"
!include "nsProcess.nsh"
!include "x64.nsh"
!include "servicelib.nsh"
;------------------------------------------------------------------
;
; Marco for removing existing and the current installation
; It shared by the installer and the uninstaller.
;
!define RemovePrev "!insertmacro RemovePrev"
!macro RemovePrev idir
; Remove the whole dir
; Users should not be putting stuff here!
RMDir /r "${idir}"
!macroend
;------------------------------------------------------------------
; Define names of the product
Name "${SAB_PRODUCT}"
OutFile "${SAB_FILE}"
InstallDir "$PROGRAMFILES\SABnzbd"
;------------------------------------------------------------------
; Some default compiler settings (uncomment and change at will):
SetCompress auto ; (can be off or force)
SetDatablockOptimize on ; (can be off)
CRCCheck on ; (can be off)
AutoCloseWindow false ; (can be true for the window go away automatically at end)
ShowInstDetails hide ; (can be show to have them shown, or nevershow to disable)
SetDateSave off ; (can be on to have files restored to their orginal date)
WindowIcon on
SpaceTexts none
;------------------------------------------------------------------
; Vista/Win7 redirects $SMPROGRAMS to all users without this
RequestExecutionLevel admin
FileErrorText "If you have no admin rights, try to install into a user directory."
;------------------------------------------------------------------
;Variables
Var MUI_TEMP
Var STARTMENU_FOLDER
Var PREV_INST_DIR
;------------------------------------------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;Show all languages, despite user's codepage
!define MUI_LANGDLL_ALLLANGUAGES
!define MUI_ICON "dist\SABnzbd\icons\sabnzbd.ico"
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE "dist\SABnzbd\LICENSE.txt"
!define MUI_COMPONENTSPAGE_NODESC
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\SABnzbd"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "SABnzbd"
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\SABnzbd"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
!insertmacro MUI_PAGE_INSTFILES
; !define MUI_FINISHPAGE_RUN
; !define MUI_FINISHPAGE_RUN_FUNCTION PageFinishRun
; !define MUI_FINISHPAGE_RUN_TEXT $(MsgRunSAB)
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\README.txt"
!define MUI_FINISHPAGE_SHOWREADME_TEXT $(MsgShowRelNote)
!define MUI_FINISHPAGE_LINK $(MsgSupportUs)
!define MUI_FINISHPAGE_LINK_LOCATION "https://sabnzbd.org/donate"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!define MUI_UNPAGE_COMPONENTSPAGE_NODESC
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_INSTFILES
;------------------------------------------------------------------
; Run as user-level at end of install
; DOES NOT WORK
; Function PageFinishRun
; !insertmacro UAC_AsUser_ExecShell "" "$INSTDIR\SABnzbd.exe" "" "" ""
; FunctionEnd
;------------------------------------------------------------------
; Set supported languages
;
; If you edit this list you also need to edit apireg.py in SABnzbd!
;
!insertmacro MUI_LANGUAGE "English" ;first language is the default language
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "Hebrew"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "SimpChinese"
;------------------------------------------------------------------
;Reserve Files
;If you are using solid compression, files that are required before
;the actual installation should be stored first in the data block,
;because this will make your installer start faster.
!insertmacro MUI_RESERVEFILE_LANGDLL
;------------------------------------------------------------------
; SECTION main program
;
Section "SABnzbd" SecDummy
SetOutPath "$INSTDIR"
;------------------------------------------------------------------
; Make sure old versions are gone (reg-key already read in onInt)
StrCmp $PREV_INST_DIR "" noPrevInstallRemove
${RemovePrev} "$PREV_INST_DIR"
noPrevInstallRemove:
; add files / whatever that need to be installed here.
File /r "dist\SABnzbd\*"
;------------------------------------------------------------------
; Add firewall rules
liteFirewallW::AddRule "$INSTDIR\SABnzbd.exe" "SABnzbd"
liteFirewallW::AddRule "$INSTDIR\SABnzbd-console.exe" "SABnzbd-console"
;------------------------------------------------------------------
; Add to registery
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\SABnzbd" "" "$INSTDIR"
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\SABnzbd" "Installer Language" "$(MsgLangCode)"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "DisplayName" "SABnzbd ${SAB_VERSION}"
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "DisplayVersion" '${SAB_VERSION}'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "Publisher" 'The SABnzbd Team'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "HelpLink" 'https://forums.sabnzbd.org/'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "URLInfoAbout" 'https://sabnzbd.org/wiki/'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "URLUpdateInfo" 'https://sabnzbd.org/'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "Comments" 'The automated Usenet download tool'
WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "DisplayIcon" '$INSTDIR\icons\sabnzbd.ico'
WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "EstimatedSize" 25674
WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "NoRepair" -1
WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd" "NoModify" -1
; write out uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
;Create shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\SABnzbd.lnk" "$INSTDIR\SABnzbd.exe"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\SABnzbd - SafeMode.lnk" "$INSTDIR\SABnzbd.exe" "--server 127.0.0.1:8080 -b1 --no-login"
WriteINIStr "$SMPROGRAMS\$STARTMENU_FOLDER\SABnzbd - Documentation.url" "InternetShortcut" "URL" "https://sabnzbd.org/wiki/"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd ; end of default section
Section $(MsgIcon) desktop
CreateShortCut "$DESKTOP\SABnzbd.lnk" "$INSTDIR\SABnzbd.exe"
SectionEnd ; end of desktop icon section
Section $(MsgAssoc) assoc
${registerExtension} "$INSTDIR\icons\nzb.ico" "$INSTDIR\SABnzbd.exe" ".nzb" "NZB File"
${RefreshShellIcons}
SectionEnd ; end of file association section
Section /o $(MsgRunAtStart) startup
CreateShortCut "$SMPROGRAMS\Startup\SABnzbd.lnk" "$INSTDIR\SABnzbd.exe" "-b0"
SectionEnd ;
;------------------------------------------------------------------
Function .onInit
; We need to modify the dir here for X64
${If} ${RunningX64}
StrCpy $INSTDIR "$PROGRAMFILES64\SABnzbd"
${Else}
MessageBox MB_OK $(MsgOnly64bit)
ExecShell "open" "https://sabnzbd.org/downloads"
Abort
${EndIf}
; Python 3.9 no longer supports Windows 7
${If} ${AtMostWin8}
MessageBox MB_OK $(MsgNoWin7)
ExecShell "open" "https://sabnzbd.org/downloads"
Abort
${EndIf}
;------------------------------------------------------------------
; Change settings based on if SAB was already installed
ReadRegStr $PREV_INST_DIR HKEY_LOCAL_MACHINE "SOFTWARE\SABnzbd" ""
StrCmp $PREV_INST_DIR "" noPrevInstall
; We want to use the user's costom dir if he used one
StrCmp $PREV_INST_DIR "$PROGRAMFILES\SABnzbd" noSpecialDir
StrCmp $PREV_INST_DIR "$PROGRAMFILES64\SABnzbd" noSpecialDir
; Set what the user had before
StrCpy $INSTDIR "$PREV_INST_DIR"
noSpecialDir:
;------------------------------------------------------------------
; Check what the user has currently set for install options
IfFileExists "$SMPROGRAMS\Startup\SABnzbd.lnk" 0 endCheckStartup
SectionSetFlags ${startup} 1
endCheckStartup:
IfFileExists "$DESKTOP\SABnzbd.lnk" endCheckDesktop 0
SectionSetFlags ${desktop} 0 ; SAB is installed but desktop-icon not, so uncheck it
endCheckDesktop:
Push $1
ReadRegStr $1 HKCR ".nzb" "" ; read current file association
StrCmp "$1" "NZB File" noPrevInstall 0
SectionSetFlags ${assoc} 0 ; Uncheck it when it wasn't checked before
noPrevInstall:
;--------------------------------
; Display language chooser
!insertmacro MUI_LANGDLL_DISPLAY
;------------------------------------------------------------------
; make sure user terminates sabnzbd.exe or else abort
;
loop:
${nsProcess::FindProcess} "SABnzbd.exe" $R0
StrCmp $R0 0 0 endcheck
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(MsgCloseSab) IDOK loop IDCANCEL exitinstall
exitinstall:
${nsProcess::Unload}
Abort
endcheck:
;------------------------------------------------------------------
; make sure both services aren't running
;
!insertmacro SERVICE "running" "SABnzbd" ""
Pop $0 ;response
!insertmacro SERVICE "running" "SABHelper" ""
Pop $1
${If} $0 == true
${OrIf} $1 == true
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(MsgCloseSab) IDOK loop IDCANCEL exitinstall
; exitinstall already defined above
${EndIf}
;------------------------------------------------------------------
; Tell users about the service change
;
!insertmacro SERVICE "installed" "SABHelper" ""
Pop $0 ;response
${If} $0 == true
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION $(MsgServChange) IDOK removeservices IDCANCEL exitinstall
; exitinstall already defined above
removeservices:
!insertmacro SERVICE "delete" "SABHelper" ""
!insertmacro SERVICE "delete" "SABnzbd" ""
${EndIf}
FunctionEnd
;------------------------------------------------------------------
; Show the shortcuts at end of install so user can start SABnzbd
; This is instead of us trying to run SAB from the installer
;
Function .onInstSuccess
ExecShell "open" "$SMPROGRAMS\$STARTMENU_FOLDER"
FunctionEnd
;--------------------------------
; begin uninstall settings/section
UninstallText $(MsgUninstall)
Section "un.$(MsgDelProgram)" Uninstall
;make sure sabnzbd.exe isnt running..if so shut it down
${nsProcess::KillProcess} "SABnzbd.exe" $R0
${nsProcess::Unload}
DetailPrint "Process Killed"
; add delete commands to delete whatever files/registry keys/etc you installed here.
Delete "$INSTDIR\uninstall.exe"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\SABnzbd"
DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SABnzbd"
${RemovePrev} "$INSTDIR"
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete "$SMPROGRAMS\$MUI_TEMP\SABnzbd.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\SABnzbd - SafeMode.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\SABnzbd - Documentation.url"
RMDir "$SMPROGRAMS\$MUI_TEMP"
Delete "$SMPROGRAMS\Startup\SABnzbd.lnk"
Delete "$DESKTOP\SABnzbd.lnk"
DeleteRegKey HKEY_CURRENT_USER "Software\SABnzbd"
${unregisterExtension} ".nzb" "NZB File"
${RefreshShellIcons}
SectionEnd ; end of uninstall section
Section /o "un.$(MsgDelSettings)" DelSettings
DetailPrint "Uninstall settings $LOCALAPPDATA"
Delete "$LOCALAPPDATA\sabnzbd\sabnzbd.ini"
RMDir /r "$LOCALAPPDATA\sabnzbd"
SectionEnd
; eof
;--------------------------------
;Language strings
LangString MsgShowRelNote ${LANG_ENGLISH} "Show Release Notes"
LangString MsgSupportUs ${LANG_ENGLISH} "Support the project, Donate!"
LangString MsgCloseSab ${LANG_ENGLISH} "Please close $\"SABnzbd.exe$\" first"
LangString MsgServChange ${LANG_ENGLISH} "The SABnzbd Windows Service changed in SABnzbd 3.0.0. $\nYou will need to reinstall the SABnzbd service. $\n$\nClick `OK` to remove the existing services or `Cancel` to cancel this upgrade."
LangString MsgOnly64bit ${LANG_ENGLISH} "The installer only supports 64-bit Windows, use the standalone version to run on 32-bit Windows."
LangString MsgNoWin7 ${LANG_ENGLISH} "The installer only supports Windows 8.1 and above, use the standalone legacy version to run on older Windows version."
LangString MsgUninstall ${LANG_ENGLISH} "This will uninstall SABnzbd from your system"
LangString MsgRunAtStart ${LANG_ENGLISH} "Run at startup"
LangString MsgIcon ${LANG_ENGLISH} "Desktop Icon"
LangString MsgAssoc ${LANG_ENGLISH} "NZB File association"
LangString MsgDelProgram ${LANG_ENGLISH} "Delete Program"
LangString MsgDelSettings ${LANG_ENGLISH} "Delete Settings"
LangString MsgRemoveOld ${LANG_ENGLISH} "You cannot overwrite an existing installation. $\n$\nClick `OK` to remove the previous version or `Cancel` to cancel this upgrade."
LangString MsgRemoveOld2 ${LANG_ENGLISH} "Your settings and data will be preserved."
LangString MsgLangCode ${LANG_ENGLISH} "en"
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd

View File

@@ -1,28 +0,0 @@
!define nsProcess::FindProcess `!insertmacro nsProcess::FindProcess`
!macro nsProcess::FindProcess _FILE _ERR
nsProcess::_FindProcess /NOUNLOAD `${_FILE}`
Pop ${_ERR}
!macroend
!define nsProcess::KillProcess `!insertmacro nsProcess::KillProcess`
!macro nsProcess::KillProcess _FILE _ERR
nsProcess::_KillProcess /NOUNLOAD `${_FILE}`
Pop ${_ERR}
!macroend
!define nsProcess::CloseProcess `!insertmacro nsProcess::CloseProcess`
!macro nsProcess::CloseProcess _FILE _ERR
nsProcess::_CloseProcess /NOUNLOAD `${_FILE}`
Pop ${_ERR}
!macroend
!define nsProcess::Unload `!insertmacro nsProcess::Unload`
!macro nsProcess::Unload
nsProcess::_Unload
!macroend

View File

@@ -1,53 +0,0 @@
!define registerExtension "!insertmacro registerExtension"
!define unregisterExtension "!insertmacro unregisterExtension"
!define SHCNE_ASSOCCHANGED 0x8000000
!define SHCNF_IDLIST 0
; Source = http://nsis.sourceforge.net/File_Association
; Patched for SABnzbd by swi-tch
!macro registerExtension icon executable extension description
Push "${icon}" ; "full path to icon.ico"
Push "${executable}" ; "full path to my.exe"
Push "${extension}" ; ".mkv"
Push "${description}" ; "MKV File"
Call registerExtension
!macroend
; back up old value of .opt
Function registerExtension
!define Index "Line${__LINE__}"
pop $R0 ; ext name
pop $R1
pop $R2
pop $R3
push $1
push $0
DeleteRegKey HKEY_CURRENT_USER "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$R1"
WriteRegStr HKCR $R1 "" $R0
WriteRegStr HKCR $R0 "" $R0
WriteRegStr HKCR "$R0\shell" "" "open"
WriteRegStr HKCR "$R0\DefaultIcon" "" "$R3,0"
WriteRegStr HKCR "$R0\shell\open\command" "" '"$R2" "%1"'
WriteRegStr HKCR "$R0\shell\edit" "" "Edit $R0"
WriteRegStr HKCR "$R0\shell\edit\command" "" '"$R2" "%1"'
pop $0
pop $1
!undef Index
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
FunctionEnd
!macro unregisterExtension extension description
Push "${extension}" ; ".mkv"
Push "${description}" ; "MKV File"
Call un.unregisterExtension
!macroend
Function un.unregisterExtension
pop $R1 ; description
pop $R0 ; extension
!define Index "Line${__LINE__}"
DeleteRegKey HKCR $R0
!undef Index
System::Call 'Shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_IDLIST}, i 0, i 0)'
FunctionEnd

View File

@@ -1,411 +0,0 @@
; NSIS SERVICE LIBRARY - servicelib.nsh
; Version 1.8.1 - Jun 21th, 2013
; Questions/Comments - dselkirk@hotmail.com
;
; Description:
; Provides an interface to window services
;
; Inputs:
; action - systemlib action ie. create, delete, start, stop, pause,
; continue, installed, running, status
; name - name of service to manipulate
; param - action parameters; usage: var1=value1;var2=value2;...etc.
; (don't forget to add a ';' after the last value!)
;
; Actions:
; create - creates a new windows service
; Parameters:
; path - path to service executable
; autostart - automatically start with system ie. 1|0
; interact - interact with the desktop ie. 1|0
; depend - service dependencies
; user - user that runs the service
; password - password of the above user
; display - display name in service's console
; description - Description of service
; starttype - start type (supersedes autostart)
; servicetype - service type (supersedes interact)
;
; delete - deletes a windows service
; start - start a stopped windows service
; stop - stops a running windows service
; pause - pauses a running windows service
; continue - continues a paused windows service
; installed - is the provided service installed
; Parameters:
; action - if true then invokes the specified action
; running - is the provided service running
; Parameters:
; action - if true then invokes the specified action
; status - check the status of the provided service
;
; Usage:
; Method 1:
; Push "action"
; Push "name"
; Push "param"
; Call Service
; Pop $0 ;response
;
; Method 2:
; !insertmacro SERVICE "action" "name" "param"
;
; History:
; 1.0 - 09/15/2003 - Initial release
; 1.1 - 09/16/2003 - Changed &l to i, thx brainsucker
; 1.2 - 02/29/2004 - Fixed documentation.
; 1.3 - 01/05/2006 - Fixed interactive flag and pop order (Kichik)
; 1.4 - 12/07/2006 - Added display and depend, fixed datatypes (Vitoco)
; 1.5 - 06/25/2008 - Added description of service.(DeSafe.com/liuqixing#gmail.com)
; 1.5.1 - 06/12/2009 - Added use of __UNINSTALL__
; 1.6 - 08/02/2010 - Fixed description implementation (Anders)
; 1.7 - 04/11/2010 - Added get running service process id (Nico)
; 1.8 - 24/03/2011 - Added starttype and servicetype (Sergius)
; 1.8.1 - 21/06/2013 - Added dynamic ASCII & Unicode support (Zinthose)
!ifndef SERVICELIB
!define SERVICELIB
!define SC_MANAGER_ALL_ACCESS 0x3F
!define SC_STATUS_PROCESS_INFO 0x0
!define SERVICE_ALL_ACCESS 0xF01FF
!define SERVICE_CONTROL_STOP 1
!define SERVICE_CONTROL_PAUSE 2
!define SERVICE_CONTROL_CONTINUE 3
!define SERVICE_STOPPED 0x1
!define SERVICE_START_PENDING 0x2
!define SERVICE_STOP_PENDING 0x3
!define SERVICE_RUNNING 0x4
!define SERVICE_CONTINUE_PENDING 0x5
!define SERVICE_PAUSE_PENDING 0x6
!define SERVICE_PAUSED 0x7
!define SERVICE_KERNEL_DRIVER 0x00000001
!define SERVICE_FILE_SYSTEM_DRIVER 0x00000002
!define SERVICE_WIN32_OWN_PROCESS 0x00000010
!define SERVICE_WIN32_SHARE_PROCESS 0x00000020
!define SERVICE_INTERACTIVE_PROCESS 0x00000100
!define SERVICE_BOOT_START 0x00000000
!define SERVICE_SYSTEM_START 0x00000001
!define SERVICE_AUTO_START 0x00000002
!define SERVICE_DEMAND_START 0x00000003
!define SERVICE_DISABLED 0x00000004
## Added by Zinthose for Native Unicode Support
!ifdef NSIS_UNICODE
!define APITAG "W"
!else
!define APITAG "A"
!endif
!macro SERVICE ACTION NAME PARAM
Push '${ACTION}'
Push '${NAME}'
Push '${PARAM}'
!ifdef __UNINSTALL__
Call un.Service
!else
Call Service
!endif
!macroend
!macro FUNC_GETPARAM
Push $0
Push $1
Push $2
Push $3
Push $4
Push $5
Push $6
Push $7
Exch 8
Pop $1 ;name
Exch 8
Pop $2 ;source
StrCpy $0 ""
StrLen $7 $2
StrCpy $3 0
lbl_loop:
IntCmp $3 $7 0 0 lbl_done
StrLen $4 "$1="
StrCpy $5 $2 $4 $3
StrCmp $5 "$1=" 0 lbl_next
IntOp $5 $3 + $4
StrCpy $3 $5
lbl_loop2:
IntCmp $3 $7 0 0 lbl_done
StrCpy $6 $2 1 $3
StrCmp $6 ";" 0 lbl_next2
IntOp $6 $3 - $5
StrCpy $0 $2 $6 $5
Goto lbl_done
lbl_next2:
IntOp $3 $3 + 1
Goto lbl_loop2
lbl_next:
IntOp $3 $3 + 1
Goto lbl_loop
lbl_done:
Pop $5
Pop $4
Pop $3
Pop $2
Pop $1
Exch 2
Pop $6
Pop $7
Exch $0
!macroend
!macro CALL_GETPARAM VAR NAME DEFAULT LABEL
Push $1
Push ${NAME}
Call ${UN}GETPARAM
Pop $6
StrCpy ${VAR} "${DEFAULT}"
StrCmp $6 "" "${LABEL}" 0
StrCpy ${VAR} $6
!macroend
!macro FUNC_SERVICE UN
Push $0
Push $1
Push $2
Push $3
Push $4
Push $5
Push $6
Push $7
Exch 8
Pop $1 ;param
Exch 8
Pop $2 ;name
Exch 8
Pop $3 ;action
;$0 return
;$4 OpenSCManager
;$5 OpenService
StrCpy $0 "false"
System::Call 'advapi32::OpenSCManager${APITAG}(n, n, i ${SC_MANAGER_ALL_ACCESS}) i.r4'
IntCmp $4 0 lbl_done
StrCmp $3 "create" lbl_create
System::Call 'advapi32::OpenService${APITAG}(i r4, t r2, i ${SERVICE_ALL_ACCESS}) i.r5'
IntCmp $5 0 lbl_done
lbl_select:
StrCmp $3 "delete" lbl_delete
StrCmp $3 "start" lbl_start
StrCmp $3 "stop" lbl_stop
StrCmp $3 "pause" lbl_pause
StrCmp $3 "continue" lbl_continue
StrCmp $3 "installed" lbl_installed
StrCmp $3 "running" lbl_running
StrCmp $3 "status" lbl_status
StrCmp $3 "processid" lbl_processid
Goto lbl_done
; create service
lbl_create:
Push $R1 ;depend
Push $R2 ;user
Push $R3 ;password
Push $R4 ;servicetype/interact
Push $R5 ;starttype/autostart
Push $R6 ;path
Push $R7 ;display
Push $R8 ;description
!insertmacro CALL_GETPARAM $R1 "depend" "n" "lbl_depend"
StrCpy $R1 't "$R1"'
lbl_depend:
StrCmp $R1 "n" 0 lbl_machine ;old name of depend param
!insertmacro CALL_GETPARAM $R1 "machine" "n" "lbl_machine"
StrCpy $R1 't "$R1"'
lbl_machine:
!insertmacro CALL_GETPARAM $R2 "user" "n" "lbl_user"
StrCpy $R2 't "$R2"'
lbl_user:
!insertmacro CALL_GETPARAM $R3 "password" "n" "lbl_password"
StrCpy $R3 't "$R3"'
lbl_password:
!insertmacro CALL_GETPARAM $R4 "interact" "${SERVICE_WIN32_OWN_PROCESS}" "lbl_interact"
StrCpy $6 ${SERVICE_WIN32_OWN_PROCESS}
IntCmp $R4 0 +2
IntOp $6 $6 | ${SERVICE_INTERACTIVE_PROCESS}
StrCpy $R4 $6
lbl_interact:
!insertmacro CALL_GETPARAM $R4 "servicetype" "$R4" "lbl_servicetype"
lbl_servicetype:
!insertmacro CALL_GETPARAM $R5 "autostart" "${SERVICE_DEMAND_START}" "lbl_autostart"
StrCpy $6 ${SERVICE_DEMAND_START}
IntCmp $R5 0 +2
StrCpy $6 ${SERVICE_AUTO_START}
StrCpy $R5 $6
lbl_autostart:
!insertmacro CALL_GETPARAM $R5 "starttype" "$R5" "lbl_starttype"
lbl_starttype:
!insertmacro CALL_GETPARAM $R6 "path" "n" "lbl_path"
lbl_path:
!insertmacro CALL_GETPARAM $R7 "display" "$2" "lbl_display"
lbl_display:
!insertmacro CALL_GETPARAM $R8 "description" "$2" "lbl_description"
lbl_description:
System::Call 'advapi32::CreateService${APITAG}(i r4, t r2, t R7, i ${SERVICE_ALL_ACCESS}, \
i R4, i R5, i 0, t R6, n, n, $R1, $R2, $R3) i.r6'
; write description of service (SERVICE_CONFIG_DESCRIPTION)
System::Call 'advapi32::ChangeServiceConfig2${APITAG}(ir6,i1,*t "$R8")i.R7'
strcmp $R7 "error" 0 lbl_descriptioncomplete
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\$2" "Description" $R8
lbl_descriptioncomplete:
Pop $R8
Pop $R7
Pop $R6
Pop $R5
Pop $R4
Pop $R3
Pop $R2
Pop $R1
StrCmp $6 0 lbl_done lbl_good
; delete service
lbl_delete:
System::Call 'advapi32::DeleteService(i r5) i.r6'
StrCmp $6 0 lbl_done lbl_good
; start service
lbl_start:
System::Call 'advapi32::StartService${APITAG}(i r5, i 0, i 0) i.r6'
StrCmp $6 0 lbl_done lbl_good
; stop service
lbl_stop:
Push $R1
System::Call '*(i,i,i,i,i,i,i) i.R1'
System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_STOP}, i $R1) i'
System::Free $R1
Pop $R1
StrCmp $6 0 lbl_done lbl_good
; pause service
lbl_pause:
Push $R1
System::Call '*(i,i,i,i,i,i,i) i.R1'
System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_PAUSE}, i $R1) i'
System::Free $R1
Pop $R1
StrCmp $6 0 lbl_done lbl_good
; continue service
lbl_continue:
Push $R1
System::Call '*(i,i,i,i,i,i,i) i.R1'
System::Call 'advapi32::ControlService(i r5, i ${SERVICE_CONTROL_CONTINUE}, i $R1) i'
System::Free $R1
Pop $R1
StrCmp $6 0 lbl_done lbl_good
; is installed
lbl_installed:
!insertmacro CALL_GETPARAM $7 "action" "" "lbl_good"
StrCpy $3 $7
Goto lbl_select
; is service running
lbl_running:
Push $R1
System::Call '*(i,i,i,i,i,i,i) i.R1'
System::Call 'advapi32::QueryServiceStatus(i r5, i $R1) i'
System::Call '*$R1(i, i.r6)'
System::Free $R1
Pop $R1
IntFmt $6 "0x%X" $6
StrCmp $6 ${SERVICE_RUNNING} 0 lbl_done
!insertmacro CALL_GETPARAM $7 "action" "" "lbl_good"
StrCpy $3 $7
Goto lbl_select
lbl_status:
Push $R1
System::Call '*(i,i,i,i,i,i,i) i.R1'
System::Call 'advapi32::QueryServiceStatus(i r5, i $R1) i'
System::Call '*$R1(i, i .r6)'
System::Free $R1
Pop $R1
IntFmt $6 "0x%X" $6
StrCpy $0 "running"
IntCmp $6 ${SERVICE_RUNNING} lbl_done
StrCpy $0 "stopped"
IntCmp $6 ${SERVICE_STOPPED} lbl_done
StrCpy $0 "start_pending"
IntCmp $6 ${SERVICE_START_PENDING} lbl_done
StrCpy $0 "stop_pending"
IntCmp $6 ${SERVICE_STOP_PENDING} lbl_done
StrCpy $0 "running"
IntCmp $6 ${SERVICE_RUNNING} lbl_done
StrCpy $0 "continue_pending"
IntCmp $6 ${SERVICE_CONTINUE_PENDING} lbl_done
StrCpy $0 "pause_pending"
IntCmp $6 ${SERVICE_PAUSE_PENDING} lbl_done
StrCpy $0 "paused"
IntCmp $6 ${SERVICE_PAUSED} lbl_done
StrCpy $0 "unknown"
Goto lbl_done
lbl_processid:
Push $R1
Push $R2
System::Call '*(i,i,i,i,i,i,i,i,i) i.R1'
System::Call '*(i 0) i.R2'
System::Call "advapi32::QueryServiceStatusEx(i r5, i ${SC_STATUS_PROCESS_INFO}, i $R1, i 36, i $R2) i"
System::Call "*$R1(i,i,i,i,i,i,i, i .r0)"
System::Free $R2
System::Free $R1
Pop $R2
Pop $R1
Goto lbl_done
lbl_good:
StrCpy $0 "true"
lbl_done:
IntCmp $5 0 +2
System::Call 'advapi32::CloseServiceHandle(i r5) n'
IntCmp $4 0 +2
System::Call 'advapi32::CloseServiceHandle(i r4) n'
Pop $4
Pop $3
Pop $2
Pop $1
Exch 3
Pop $5
Pop $7
Pop $6
Exch $0
!macroend
Function Service
!insertmacro FUNC_SERVICE ""
FunctionEnd
Function GetParam
!insertmacro FUNC_GETPARAM
FunctionEnd
!undef APITAG
!endif

View File

Binary file not shown.

View File

Binary file not shown.

View File

@@ -4,7 +4,7 @@
#set global $root = '../../'#
#end if#
<!DOCTYPE HTML>
<html lang="$active_lang" #if $rtl#dir="rtl"#end if#>
<html lang="$active_lang">
<head>
<title>
SABnzbd $T('menu-config')

View File

@@ -1,5 +1,5 @@
<!--#set global $pane="Config"#-->
<!--#set global $help_uri="configuration/3.5/configure"#-->
<!--#set global $help_uri="configuration/3.1/configure"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->
<!--#from sabnzbd.encoding import CODEPAGE#-->
@@ -124,7 +124,7 @@
<div class="colmask">
<div class="padding alt">
<h5 class="copyright">Copyright &copy; 2007-2022 The SABnzbd Team &lt;<a href="mailto:team@sabnzbd.org">team@sabnzbd.org</a>&gt;</h5>
<h5 class="copyright">Copyright &copy; 2007-2020 The SABnzbd Team &lt;<a href="mailto:team@sabnzbd.org">team@sabnzbd.org</a>&gt;</h5>
<p class="copyright"><small>$T('yourRights')</small></p>
</div>

View File

@@ -1,5 +1,5 @@
<!--#set global $pane="Categories"#-->
<!--#set global $help_uri="configuration/3.5/categories"#-->
<!--#set global $help_uri="configuration/3.1/categories"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->
<div class="colmask">
<div class="section">

View File

@@ -1,5 +1,5 @@
<!--#set global $pane="Folders"#-->
<!--#set global $help_uri="configuration/3.5/folders"#-->
<!--#set global $help_uri="configuration/3.1/folders"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->
<div class="colmask">
@@ -10,7 +10,6 @@
</div>
<form action="saveDirectories" method="post" name="fullform" class="fullform" autocomplete="off">
<input type="hidden" id="apikey" name="apikey" value="$apikey" />
<input type="hidden" name="output" value="json" />
<input type="hidden" id="ajax" name="ajax" value="1" />
<div class="section">
<div class="col2">
@@ -29,7 +28,7 @@
</div>
<div class="field-pair advanced-settings">
<label class="config" for="download_free">$T('opt-download_free')</label>
<input type="text" name="download_free" id="download_free" value="$download_free" class="smaller_input" />
<input type="text" name="download_free" id="download_free" value="$download_free" class="smaller_input" />
<span class="desc">$T('explain-download_free')</span>
</div>
<div class="field-pair">
@@ -37,16 +36,6 @@
<input type="text" name="complete_dir" id="complete_dir" value="$complete_dir" data-initialdir="$my_home" />
<span class="desc">$T('explain-complete_dir')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="complete_free">$T('opt-complete_free')</label>
<input type="text" name="complete_free" id="complete_free" value="$complete_free" class="smaller_input" />
<span class="desc">$T('explain-download_free') <br>$T('explain-complete_free')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="fulldisk_autoresume">$T('opt-fulldisk_autoresume')</label>
<input type="checkbox" name="fulldisk_autoresume" id="fulldisk_autoresume" value="1" <!--#if int($fulldisk_autoresume) > 0 then 'checked="checked"' else ""#--> />
<span class="desc">$T('explain-fulldisk_autoresume')</span>
</div>
<!--#if not $nt#-->
<div class="field-pair advanced-settings">
<label class="config" for="permissions">$T('opt-permissions')</label>

View File

@@ -1,5 +1,5 @@
<!--#set global $pane="General"#-->
<!--#set global $help_uri="configuration/3.5/general"#-->
<!--#set global $help_uri="configuration/3.1/general"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->
<div class="colmask">
@@ -10,8 +10,7 @@
</div>
<form action="saveGeneral" method="post" name="fullform" class="fullform" autocomplete="off">
<input type="hidden" id="apikey" name="apikey" value="$apikey" />
<input type="hidden" id="ajax" name="ajax" value="1" />
<input type="hidden" name="output" value="json" />
<input type="hidden" id="ajax" name="ajax" value=1 />
<div class="section">
<div class="col2">
<h3>$T('webServer') <a href="$helpuri$help_uri" target="_blank"><span class="glyphicon glyphicon-question-sign"></span></a></h3>
@@ -33,7 +32,6 @@
<label class="config" for="enable_https">$T('opt-enable_https')</label>
<input type="checkbox" name="enable_https" id="enable_https" value="1" <!--#if int($enable_https) > 0 then 'checked="checked" data-original="1"' else ""#-->/>
<span class="desc">$T('explain-enable_https')</span>
<span class="desc"><span class="label label-warning">$T('warning').upper()</span> $T('explain-enable_https_warning')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="web_dir">$T('opt-web_dir')</label>
@@ -132,7 +130,12 @@
<option value="5" <!--#if $inet_exposure == 5 then 'selected="selected"' else ""#-->>$T('inet-ui') - $T('inet-external_login')</option>
</optgroup>
</select>
<span class="desc">$T('explain-inet_exposure')</span>
<span class="desc">$T('explain-inet_exposure').replace('. ','.<br><span class="label label-warning">'+$T('warning').upper()+'</span> ')</span>
</div>
<div class="field-pair">
<label class="config" for="local_ranges">$T('opt-local_ranges')</label>
<input type="text" name="local_ranges" id="local_ranges" value="$local_ranges" />
<span class="desc">$T('explain-local_ranges')</span>
</div>
<div class="field-pair">
<label class="config" for="apikey_display">$T('opt-apikey')</label>
@@ -179,11 +182,6 @@
<input type="checkbox" name="enable_https_verification" id="enable_https_verification" value="1" <!--#if int($enable_https_verification) > 0 then 'checked="checked"' else ""#--> <!--#if int($certificate_validation) == 0 then "disabled=\"disabled\"" else ""#--> />
<span class="desc">$T('explain-enable_https_verification')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="socks5_proxy_url">$T('opt-socks5_proxy_url')</label>
<input type="text" name="socks5_proxy_url" id="socks5_proxy_url" value="$socks5_proxy_url" placeholder="socks5://username:password@hostname:port" />
<span class="desc">$T('explain-socks5_proxy_url') <br/>$T('readwiki')</span>
</div>
<div class="field-pair">
<button class="btn btn-default saveButton"><span class="glyphicon glyphicon-ok"></span> $T('button-saveChanges')</button>
</div>
@@ -261,18 +259,17 @@
// Highlight in case user is not safe
// So when exposed to internet and no password, no external limit or no username/password
var safeCheck = \$('#host, #inet_exposure, #${pid}_wu, #${pid}_wp')
var safeCheck = \$('#host, #local_ranges, #inet_exposure, #${pid}_wu, #${pid}_wp')
function checkSafety() {
if(\$('#host').val() != 'localhost' && \$('#host').val() != '127.0.0.1') {
// No limitation on local-network
if(\$('#inet_exposure').val() > 3) {
if(!\$('#local_ranges').val() || \$('#inet_exposure').val() > 3) {
// And no username and password?
if(!\$('#${pid}_wu').val() || !\$('#${pid}_wp').val()) {
// Add warning icon if not there already
if(!\$('.host-warning').length) {
safeCheck.after('<span class="glyphicon glyphicon-alert host-warning"></span>')
\$('.host-warning').tooltip({'title': '$T('checkSafety')'})
safeCheck.addClass('host-warning-highlight')
}
return
}
@@ -289,7 +286,7 @@
\$('#apikey, #nzbkey').click(function () { \$(this).select() });
\$('#generate_new_apikey').click(function () {
if (confirm("$T('confirm')")) {
if (confirm("$T('Plush-confirm')")) {
$.ajax({
type: "POST",
url: "../../api",
@@ -302,7 +299,7 @@
}
});
\$('#generate_new_nzbkey').click(function () {
if (confirm("$T('confirm')")) {
if (confirm("$T('Plush-confirm')")) {
$.ajax({
type: "POST",
url: "../../api",

View File

@@ -1,5 +1,5 @@
<!--#set global $pane="Email"#-->
<!--#set global $help_uri="configuration/3.5/notifications"#-->
<!--#set global $help_uri="configuration/3.1/notifications"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->
<!--#def show_notify_checkboxes($section_label)#-->
@@ -22,14 +22,12 @@
<option value="$ct" <!--#if $ct in $getVar($section_label + '_cats') then 'selected="selected"' else ""#-->>$Tspec($ct)</option>
<!--#end for#-->
</select>
<p>$T('defaultNotifiesAll')</p>
</div>
<!--#end def#-->
<div class="colmask">
<form action="saveNotify" method="post" name="fullform" class="fullform" autocomplete="off">
<form action="saveEmail" method="post" name="fullform" class="fullform" autocomplete="off">
<input type="hidden" id="apikey" name="apikey" value="$apikey" />
<input type="hidden" name="output" value="json" />
<input type="hidden" id="ajax" name="ajax" value="1" />
<div class="section" id="email">
<div class="col2">
@@ -41,7 +39,6 @@
<option value="$ct" <!--#if $ct in $email_cats then 'selected="selected"' else ""#-->>$Tspec($ct)</option>
<!--#end for#-->
</select>
<p>$T('defaultNotifiesAll')</p>
</div>
</div>
<div class="col1">
@@ -241,12 +238,12 @@
$T($notify_types[$type]).replace('/', ' / ')
</label>
<select name="${section_label}_prio_$type" id="${section_label}_prio_$type">
<option value="-3" <!--#if $getVar($section_label + '_prio_' + $type) == "-3" then 'selected="selected"' else ""#--> >$T('prowl-off')</option>
<option value="-2" <!--#if $getVar($section_label + '_prio_' + $type) == "-2" then 'selected="selected"' else ""#--> >$T('prowl-very-low')</option>
<option value="-1" <!--#if $getVar($section_label + '_prio_' + $type) == "-1" then 'selected="selected"' else ""#--> >$T('prowl-moderate')</option>
<option value="0" <!--#if $getVar($section_label + '_prio_' + $type) == "0" then 'selected="selected"' else ""#--> >$T('prowl-normal')</option>
<option value="1" <!--#if $getVar($section_label + '_prio_' + $type) == "1" then 'selected="selected"' else ""#--> >$T('prowl-high')</option>
<option value="2" <!--#if $getVar($section_label + '_prio_' + $type) == "2" then 'selected="selected"' else ""#--> >$T('prowl-emergency')</option>
<option value="-3" <!--#if $getVar($section_label + '_prio_' + $type) == -3 then 'selected="selected"' else ""#--> >$T('prowl-off')</option>
<option value="-2" <!--#if $getVar($section_label + '_prio_' + $type) == -2 then 'selected="selected"' else ""#--> >$T('prowl-very-low')</option>
<option value="-1" <!--#if $getVar($section_label + '_prio_' + $type) == -1 then 'selected="selected"' else ""#--> >$T('prowl-moderate')</option>
<option value="0" <!--#if $getVar($section_label + '_prio_' + $type) == 0 then 'selected="selected"' else ""#--> >$T('prowl-normal')</option>
<option value="1" <!--#if $getVar($section_label + '_prio_' + $type) == 1 then 'selected="selected"' else ""#--> >$T('prowl-high')</option>
<option value="2" <!--#if $getVar($section_label + '_prio_' + $type) == 2 then 'selected="selected"' else ""#--> >$T('prowl-emergency')</option>
</select>
</div>
<!--#end for#-->
@@ -307,12 +304,12 @@
$T($notify_types[$type]).replace('/', ' / ')
</label>
<select name="${section_label}_prio_$type" id="${section_label}_prio_$type">
<option value="-3" <!--#if $getVar($section_label + '_prio_' + $type) == "-3" then 'selected="selected"' else ""#--> >$T('pushover-off')</option>
<option value="-2" <!--#if $getVar($section_label + '_prio_' + $type) == "-2" then 'selected="selected"' else ""#--> >$T('prowl-very-low')</option>
<option value="-1" <!--#if $getVar($section_label + '_prio_' + $type) == "-1" then 'selected="selected"' else ""#--> >$T('pushover-low')</option>
<option value="0" <!--#if $getVar($section_label + '_prio_' + $type) == "0" then 'selected="selected"' else ""#--> >$T('prowl-normal')</option>
<option value="1" <!--#if $getVar($section_label + '_prio_' + $type) == "1" then 'selected="selected"' else ""#--> >$T('pushover-high')</option>
<option value="2" <!--#if $getVar($section_label + '_prio_' + $type) == "2" then 'selected="selected"' else ""#--> >$T('prowl-emergency')</option>
<option value="-3" <!--#if $getVar($section_label + '_prio_' + $type) == -3 then 'selected="selected"' else ""#--> >$T('pushover-off')</option>
<option value="-2" <!--#if $getVar($section_label + '_prio_' + $type) == -2 then 'selected="selected"' else ""#--> >$T('prowl-very-low')</option>
<option value="-1" <!--#if $getVar($section_label + '_prio_' + $type) == -1 then 'selected="selected"' else ""#--> >$T('pushover-low')</option>
<option value="0" <!--#if $getVar($section_label + '_prio_' + $type) == 0 then 'selected="selected"' else ""#--> >$T('prowl-normal')</option>
<option value="1" <!--#if $getVar($section_label + '_prio_' + $type) == 1 then 'selected="selected"' else ""#--> >$T('pushover-high')</option>
<option value="2" <!--#if $getVar($section_label + '_prio_' + $type) == 2 then 'selected="selected"' else ""#--> >$T('prowl-emergency')</option>
</select>
</div>
<!--#end for#-->

View File

@@ -1,7 +1,6 @@
<!--#set global $pane="RSS"#-->
<!--#set global $help_uri="configuration/3.5/rss"#-->
<!--#set global $help_uri="configuration/3.1/rss"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->
<!--#import html#-->
<div class="colmask">
<!--#if not $active_feed#-->
<div class="section">
@@ -10,21 +9,21 @@
<p>$T('explain-RSS')</p>
<form action="add_rss_feed" method="post" autocomplete="off">
<input type="hidden" name="apikey" value="$apikey" />
<table class="catTable addRssTable">
<table class="catTable">
<tr>
<th>&nbsp;</th>
<th>$T('name')</th>
<th>$T('feed') URLs</th>
<th>$T('feed') URL</th>
<th>&nbsp;</th>
</tr>
<tr class="even">
<td>
<input type="checkbox" name="enable" value="1" checked />
</td>
<td class="new-feed-title">
<input type="text" name="feed" value="$feed" />
<td>
<input type="text" name="feed" class="smaller_input" value="$feed" />
</td>
<td class="new-feed-url">
<td>
<input type="text" name="uri" placeholder="$T('addMultipleFeeds')" />
</td>
<td class="nowrap">
@@ -46,21 +45,20 @@
<!--#set $odd = False#-->
<!--#for $feed_item in $feeds#-->
<!--#set $odd = not $odd#-->
<!--#set $feed_item_html = html.escape($feed_item)#-->
<tr class="data-row <!--#if $odd then " alt " else " "#-->">
<td class="chk">
<input type="checkbox" class="toggleFeedCheckbox" name="enable" value="1" <!--#if int($rss[$feed_item]['enable']) !=0 then 'checked="checked"' else ""#--> rel="$feed_item_html" />
<input type="checkbox" class="toggleFeedCheckbox" name="enable" value="1" <!--#if int($rss[$feed_item]['enable']) !=0 then 'checked="checked"' else ""#--> rel="$feed_item" />
</td>
<td class="title">
<a href="?feed=$rss[$feed_item]['link']" class="subscription-title path feed <!--#if int($rss[$feed_item]['enable']) != 0 then 'feed_enabled' else 'feed_disabled'#-->">
$feed_item_html
$feed_item
</a>
</td>
<td class="controls">
<button type="button" class="btn btn-default testFeed" rel="$feed_item_html"><span class="glyphicon glyphicon-sort"></span> $T('button-preFeed')</button>
<button type="button" class="btn btn-default testFeed" rel="$feed_item"><span class="glyphicon glyphicon-sort"></span> $T('button-preFeed')</button>
<input type="hidden" name="uri" value="$rss[$feed_item]['uris']" />
<button type="button" class="btn btn-default editFeed" rel="$feed_item_html"><span class="glyphicon glyphicon-pencil"></span> $T('rss-edit')</button>
<button type="button" class="btn btn-default delFeed" rel="$feed_item_html"><span class="glyphicon glyphicon-trash"></span></button>
<button type="button" class="btn btn-default editFeed" rel="$feed_item"><span class="glyphicon glyphicon-pencil"></span> $T('Edit')</button>
<button type="button" class="btn btn-default delFeed" rel="$feed_item"><span class="glyphicon glyphicon-trash"></span></button>
</td>
</tr>
<!--#for $uri_index, $uri in enumerate($rss[$feed_item]['uri'])#-->
@@ -92,7 +90,7 @@
<label class="config narrow" for="rss_rate">$T('opt-rss_rate')</label>
<input type="number" name="rss_rate" id="rss_rate" value="$rss_rate" min="15" max="1440" />
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> $T('button-save')</button>
<span class="config narrow">&nbsp;&nbsp;$T('rss-nextscan'): $rss_next</span>
<span class="config narrow">&nbsp;&nbsp;$T('Next scan at:')&nbsp;$rss_next</span>
<span class="desc narrow">$T('explain-rss_rate')</span>
</div>
</fieldset>
@@ -102,13 +100,13 @@
</div>
<!--#end if#-->
<!--#if $active_feed#-->
<!--#set $feed = html.unescape($active_feed)#-->
<!--#set $feed = $active_feed#-->
<div class="section rss-section">
<div class="padTable">
<a class="main-helplink" href="$helpuri$help_uri" target="_blank"><span class="glyphicon glyphicon-question-sign"></span></a>
<h2 class="nomargin activeRSS">
<a href="${root}config/rss/">$T('cmenu-rss')</a> &raquo;
$active_feed
<a href="$rss[$active_feed]['uri']" onclick="window.open(this.href); return false;">$active_feed</a>
</h2>
<!--#if $error#-->
<div class="alert alert-danger">
@@ -118,7 +116,7 @@
<!--#end if#-->
<form action="upd_rss_feed" method="post">
<input type="hidden" name="apikey" value="$apikey" />
<input type="hidden" name="feed" value="$active_feed" />
<input type="hidden" name="feed" value="$feed" />
<input type="hidden" name="uri" value="$rss[$feed]['uris']" />
<table class="catTable">
<thead>
@@ -210,7 +208,7 @@
<form action="upd_rss_filter" method="post">
<input type="hidden" name="apikey" value="$apikey" />
<input type="hidden" name="index" value="$rss[$feed]['filtercount']" />
<input type="hidden" name="feed" value="$active_feed" />
<input type="hidden" name="feed" value="$feed" />
<table class="catTable">
<tbody>
<tr>
@@ -286,7 +284,7 @@
<form action="upd_rss_filter" method="post" autocomplete="off">
<input type="hidden" name="apikey" value="$apikey" />
<input type="hidden" name="index" value="$fnum" />
<input type="hidden" name="feed" value="$active_feed" />
<input type="hidden" name="feed" value="$feed" />
<table class="catTable">
<tbody>
<tr class="<!--#if $odd then " alt " else " "#--> <!--#if $filter[3]!="A" and $filter[3]!="S" then 'disabled_options_rule' else ""#-->">
@@ -302,8 +300,8 @@
<option value="M" <!--#if $filter[3]=="M" then 'selected="selected"' else ""#-->> $T('rss-must')</option>
<option value="R" <!--#if $filter[3]=="R" then 'selected="selected"' else ""#-->> $T('rss-reject')</option>
<option value="C" <!--#if $filter[3]=="C" then 'selected="selected"' else ""#-->> $T('rss-mustcat')</option>
<option value=">" <!--#if $filter[3]=="&gt;" then 'selected="selected"' else ""#-->> $T('rss-atleast')</option>
<option value="<" <!--#if $filter[3]=="&lt;" then 'selected="selected"' else ""#-->> $T('rss-atmost')</option>
<option value=">" <!--#if $filter[3]==">" then 'selected="selected"' else ""#-->> $T('rss-atleast')</option>
<option value="<" <!--#if $filter[3]=="<" then 'selected="selected"' else ""#-->> $T('rss-atmost')</option>
<option value="F" <!--#if $filter[3]=="F" then 'selected="selected"' else ""#-->> $T('rss-from')</option>
<option value="S" <!--#if $filter[3]=="S" then 'selected="selected"' else ""#-->> $T('rss-from-show') ($T('rss-accept'))</option>
</select>
@@ -363,13 +361,13 @@
<!--#end for#-->
<form action="download_rss_feed" method="post">
<input type="hidden" name="apikey" value="$apikey" />
<input type="hidden" name="feed" value="$active_feed" />
<input type="hidden" name="feed" value="$feed" />
<div class="padding">
<button type="button" class="btn btn-default testFeed" rel="$active_feed"><span class="glyphicon glyphicon-sort"></span> $T('button-preFeed')</button>
<button type="button" class="btn btn-default testFeed" rel="$feed"><span class="glyphicon glyphicon-sort"></span> $T('button-preFeed')</button>
<button type="submit" class="btn btn-default Save"><span class="glyphicon glyphicon-forward"></span> $T('button-forceFeed')</button>
<button type="button" class="btn btn-default cleanFeed"><span class="glyphicon glyphicon-trash"></span> $T('button-clear') $T('rss-done')</button>
<!--#if $evalButton#-->
<button type="button" class="btn btn-default evalFeed" rel="$active_feed"><span class="glyphicon glyphicon-ok-circle"></span> $T('button-evalFeed')</button>
<button type="button" class="btn btn-default evalFeed" rel="$feed"><span class="glyphicon glyphicon-ok-circle"></span> $T('button-evalFeed')</button>
<!--#end if#-->
</div>
</form>
@@ -402,7 +400,7 @@
<tr class="infoTableSeperator">
<td>
<form action="download" method="get">
<input type="hidden" value="$active_feed" name="feed" />
<input type="hidden" value="$feed" name="feed" />
<input type="hidden" name="apikey" value="$apikey" />
<input type="hidden" name="url" value="$job['url']" />
<input type="hidden" name="nzbname" value="$job['nzbname']" />
@@ -446,7 +444,7 @@
<tr class="infoTableSeperator">
<td>
<form action="download" method="get">
<input type="hidden" value="$active_feed" name="feed" />
<input type="hidden" value="$feed" name="feed" />
<input type="hidden" name="apikey" value="$apikey" />
<input type="hidden" name="url" value="$job['url']" />
<input type="hidden" name="nzbname" value="$job['nzbname']" />
@@ -475,7 +473,7 @@
<div class="tab-pane padTable" id="rss-tab-done">
<!--#if $downloaded#-->
<form action="clean_rss_jobs" method="post">
<input type="hidden" value="$active_feed" name="feed" />
<input type="hidden" value="$feed" name="feed" />
<input type="hidden" name="apikey" value="$apikey" />
<table class="catTable">
<thead>
@@ -510,37 +508,9 @@
</div>
<!--#end if#-->
</div>
</div>
<!-- /colmask -->
<form method="post" action="save_rss_feed" class="modal fade" id="rss_edit_modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">$T('Edit') <span id="feed_edit_name_label"></span></h4>
</div>
<div class="modal-body">
<div class="form-group">
<label for="feed_edit_new_name">$T('name')</label>
<input type="text" class="form-control" name="feed_new_name" id="feed_edit_new_name" placeholder="$T('name')" size="">
</div>
<div class="form-group">
<label for="feed_edit_url">$T('feed') URLs</label>
<input type="text" class="form-control" name="uri" id="feed_edit_url" placeholder="$T('feed') URLs" size="">
<span class="help-block">$T('addMultipleFeeds')</span>
</div>
<input type="hidden" name="feed" id="feed_edit_old_name" />
<input type="hidden" name="apikey" value="$apikey" />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> $T('cancel')</button>
<button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> $T('rss-accept')</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</form><!-- /.modal -->
<script type="text/javascript" src="${root}staticcfg/js/jquery.tablesort.min.js"></script>
<script type="text/javascript">
function urlencode(str) {
@@ -567,16 +537,20 @@ function urlencode(str) {
\$('.editFeed').click(function(){
var oldURI = \$(this).prev().val();
var whichFeed = \$(this).attr("rel");
// Fill the values
\$('#feed_edit_name_label').text(whichFeed)
\$('#feed_edit_old_name').val(whichFeed)
\$('#feed_edit_new_name').val(whichFeed)
\$('#feed_edit_url').val(oldURI)
// Show the modal
\$('#rss_edit_modal').modal('show');
var newURI = prompt("$T('feed') URL. \n$T('addMultipleFeeds').", oldURI );
if(newURI != "" && newURI !== null) {
var whichFeed = \$(this).attr("rel");
var isEnabled = \$('.toggleFeedCheckbox[rel="'+whichFeed+'"]').attr('checked') == "checked"? 1 : 0;
\$.ajax({
type: "POST",
url: "save_rss_feed",
data: {feed: whichFeed, uri: newURI, enable: isEnabled, apikey: "$apikey" }
}).done(function( msg ) {
location.reload();
});
} else {
return false;
}
});
\$('.delFeed').click(function(e){

View File

@@ -1,5 +1,5 @@
<!--#set global $pane="Scheduling"#-->
<!--#set global $help_uri="configuration/3.5/scheduling"#-->
<!--#set global $help_uri="configuration/3.1/scheduling"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->
<%

View File

@@ -1,15 +1,13 @@
<!--#set global $pane="Servers"#-->
<!--#set global $help_uri="configuration/3.5/servers"#-->
<!--#set global $help_uri="configuration/3.1/servers"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->
<!--#import json#-->
<!--#import datetime#-->
<script type="text/javascript" xmlns="http://www.w3.org/1999/html">
// Define variable needed for the server-statistics
var serverBandwithData = {}
var serverArticleTries = {}
var serverArticleFailed = {}
<script type="text/javascript">
// Define variable needed for the server-plots
var serverData = {}
</script>
<div class="colmask">
@@ -20,7 +18,7 @@
</label>
<div class="advanced-buttonSeperator"></div>
<div class="chart-selector-container" title="$T('selectedDates')">
<div class="chart-selector-container" title="$T('srv-bandwidth')">
<span class="glyphicon glyphicon-signal"></span>
<!--#set today = datetime.date.today()#-->
<input type="date" name="chart-start" id="chart-start" value="<!--#echo (today-datetime.timedelta(days=30)).strftime('%Y-%m-%d')#-->"> -
@@ -34,17 +32,12 @@
<div class="col1">
<form action="addServer" method="post" autocomplete="off" onsubmit="removeObfuscation();">
<input type="hidden" name="apikey" value="$apikey" />
<input type="hidden" name="output" value="json" />
<fieldset>
<div class="field-pair">
<label class="config" for="enable">$T('srv-enable')</label>
<input type="checkbox" name="enable" id="enable" value="1" checked="checked" />
<span class="desc">$T('srv-enable')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="displayname">$T('srv-displayname')</label>
<input type="text" name="displayname" id="displayname" />
</div>
<div class="field-pair">
<label class="config" for="host">$T('srv-host')</label>
<input type="text" name="host" id="host" required />
@@ -69,7 +62,7 @@
</div>
<div class="field-pair">
<label class="config" for="connections">$T('srv-connections')</label>
<input type="number" name="connections" id="connections" min="1" max="1000" value="8" required />
<input type="number" name="connections" id="connections" min="1" max="100" value="8" required />
</div>
<div class="field-pair">
<label class="config" for="priority">$T('srv-priority')</label>
@@ -103,25 +96,14 @@
<input type="checkbox" name="send_group" id="send_group" value="1" />
<span class="desc">$T('srv-explain-send_group')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="required">$T('srv-required')</label>
<input type="checkbox" name="required" id="required" value="1" />
<span class="desc">$T('explain-required')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="optional">$T('srv-optional')</label>
<input type="checkbox" name="optional" id="optional" value="1" />
<span class="desc">$T('explain-optional')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="expire_date">$T('srv-expire_date')</label>
<input type="date" name="expire_date" id="expire_date" />
<span class="desc">$T('srv-explain-expire_date')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="quota">$T('swtag-quota')</label>
<input type="text" name="quota" id="quota" class="smaller_input" />
<span class="desc">$T('srv-explain-quota')</span>
<label class="config" for="displayname">$T('srv-displayname')</label>
<input type="text" name="displayname" id="displayname" />
</div>
<div class="field-pair advanced-settings">
<label class="config" for="notes">$T('srv-notes')</label>
@@ -145,13 +127,12 @@
<!--#for $cur, $server in enumerate($servers) #-->
<form action="saveServer" method="post" class="fullform" autocomplete="off">
<input type="hidden" name="apikey" value="$apikey" />
<input type="hidden" name="output" value="json" />
<input type="hidden" name="server" value="$server['name']" />
<input type="hidden" id="ajax" name="ajax" value=1 />
<div class="section <!--#if int($server['enable']) == 0 then 'server-disabled' else ""#-->">
<div class="col2 <!--#if int($server['enable']) == 0 then 'server-disabled' else ""#-->">
<h3 title="$server['displayname']">$server['displayname'] <a href="$helpuri$help_uri" target="_blank"><span class="glyphicon glyphicon-question-sign"></span></a></h3>
<h3>$server['displayname'] <a href="$helpuri$help_uri" target="_blank"><span class="glyphicon glyphicon-question-sign"></span></a></h3>
<!--#if int($server['enable']) != 0 #-->
<!--#if $last_prio != $server['priority'] and $cur_prio_color+1 < len($prio_colors) #-->
<!--#set $cur_prio_color = $cur_prio_color+1 #-->
@@ -172,10 +153,6 @@
<div class="col1" style="display:none;">
<input type="hidden" name="enable" id="enable$cur" value="$int($server['enable'])" />
<fieldset>
<div class="field-pair advanced-settings">
<label class="config" for="displayname$cur">$T('srv-displayname')</label>
<input type="text" name="displayname" id="displayname$cur" value="$server['displayname']" />
</div>
<div class="field-pair">
<label class="config" for="host$cur">$T('srv-host')</label>
<input type="text" name="host" id="host$cur" value="$server['host']" required />
@@ -200,7 +177,7 @@
</div>
<div class="field-pair">
<label class="config" for="connections$cur">$T('srv-connections')</label>
<input type="number" name="connections" id="connections$cur" value="$server['connections']" min="1" max="1000" required />
<input type="number" name="connections" id="connections$cur" value="$server['connections']" min="1" max="100" required />
</div>
<div class="field-pair">
<label class="config" for="priority$cur">$T('srv-priority')</label>
@@ -230,11 +207,6 @@
<span class="desc">$T('explain-ssl_ciphers') <br>$T('readwiki')
<a href="${helpuri}advanced/ssl-ciphers" target="_blank">${helpuri}advanced/ssl-ciphers</a></span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="required$cur">$T('srv-required')</label>
<input type="checkbox" name="required" id="required$cur" value="1" <!--#if int($server['required']) != 0 then 'checked="checked"' else ""#--> />
<span class="desc">$T('explain-required')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="optional$cur">$T('srv-optional')</label>
<input type="checkbox" name="optional" id="optional$cur" value="1" <!--#if int($server['optional']) != 0 then 'checked="checked"' else ""#--> />
@@ -246,14 +218,8 @@
<span class="desc">$T('srv-explain-send_group')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="expire_date$cur">$T('srv-expire_date')</label>
<input type="date" name="expire_date" id="expire_date$cur" value="$server['expire_date']" />
<span class="desc">$T('srv-explain-expire_date')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="quota$cur">$T('swtag-quota')</label>
<input type="text" name="quota" id="quota$cur" value="$server['quota']" class="smaller_input" />
<span class="desc">$T('srv-explain-quota')</span>
<label class="config" for="displayname$cur">$T('srv-displayname')</label>
<input type="text" name="displayname" id="displayname$cur" value="$server['displayname']" />
</div>
<div class="field-pair advanced-settings">
<label class="config" for="notes$cur">$T('srv-notes')</label>
@@ -272,34 +238,19 @@
<div class="col1" style="display:block;">
<!--#if 'amounts' in $server#-->
<div class="server-amounts-text">
<p>
<b>$T('srv-bandwidth'):</b><br/>
$T('total'): $(server['amounts'][0])B<br/>
$T('today'): $(server['amounts'][3])B<br/>
$T('thisWeek'): $(server['amounts'][2])B<br/>
$T('thisMonth'): $(server['amounts'][1])B<br/>
$T('selectedDates'): <span id="server-bandwith-value-${cur}"></span>
</p>
<p title="$T('readwiki')">
<b>$T('srv-article-availability'):</b><br/>
$T('selectedDates'): <span id="server-article-value-${cur}"></span>
</p>
<!--#if $server['expire_date']#-->
<p><b>$T('srv-expire_date'):</b> $(server['expire_date'])</p>
<!--#end if#-->
<!--#if $server['quota']#-->
<p><b>$T('quota-left'):</b> $(server['quota_left'])B</p>
<!--#end if#-->
<b>$T('srv-bandwidth'):</b><br/>
$T('total'): $(server['amounts'][0])B<br/>
$T('today'): $(server['amounts'][3])B<br/>
$T('thisWeek'): $(server['amounts'][2])B<br/>
$T('thisMonth'): $(server['amounts'][1])B<br/>
$T('custom'): <span id="server-data-value-${cur}"></span>
</div>
<div class="server-chart" data-serverid="${cur}">
<div class="server-chart" data-serverid="${cur}"s>
<div id="server-chart-${cur}" class="ct-chart"></div>
</div>
<script type="text/javascript">
// Server data
serverBandwithData[${cur}] = <!--#echo json.dumps($server['amounts'][4])#-->
serverArticleTries[${cur}] = <!--#echo json.dumps($server['amounts'][5])#-->
serverArticleFailed[${cur}] = <!--#echo json.dumps($server['amounts'][6])#-->
serverData[${cur}] = <!--#echo json.dumps($server['amounts'][4])#-->
</script>
<!--#end if#-->
</div>
@@ -346,14 +297,12 @@
const labelStep = Math.round(nrDays/10)
// Save largest value
var maxBandwith = 0
var maxVal = 0
// For each chart
\$('.server-chart').each(function(j, elemn) {
const server_id = \$(elemn).data('serverid')
var totalBandwithThisRange = 0
var totalArticlesTriedThisRange = 0
var totalArticlesFailedThisRange = 0
var totalThisRange = 0
// Fill the data array
var data = {
@@ -377,42 +326,25 @@
const dateCheck = toFormattedDate(checkDate)
// Add data if we have it
if(dateCheck in serverBandwithData[server_id]) {
data['series'][0].push(serverBandwithData[server_id][dateCheck])
totalBandwithThisRange += serverBandwithData[server_id][dateCheck]
maxBandwith = Math.max(maxBandwith, serverBandwithData[server_id][dateCheck])
} else {
if(dateCheck in serverData[server_id]) {
data['series'][0].push(serverData[server_id][dateCheck])
totalThisRange += serverData[server_id][dateCheck]
maxVal = Math.max(maxVal, serverData[server_id][dateCheck])
} else {
data['series'][0].push(0)
}
// Article stats
if(dateCheck in serverArticleTries[server_id]) {
totalArticlesTriedThisRange += serverArticleTries[server_id][dateCheck]
totalArticlesFailedThisRange += serverArticleFailed[server_id][dateCheck]
}
}
// Update the text value
\$('#server-bandwith-value-' + server_id).text(filesize(totalBandwithThisRange, {round: 1}))
\$('#server-data-value-' + server_id).text(filesize(totalThisRange, {round: 1}))
// Calculate article success ratio, if available
var articleRatio = Math.round(100 * (1 - totalArticlesFailedThisRange/totalArticlesTriedThisRange))
// If values were missing
if(!isNaN(articleRatio)) {
// Use filesize to convert to unit-display
\$('#server-article-value-' + server_id).text('$T("srv-articles-tried")'.replace('%f', articleRatio).replace('%d', filesize(totalArticlesTriedThisRange, {unix: true, round: 0, spacer: "", base: 1})))
} else {
\$('#server-article-value-' + server_id).text('$T("notAvailable")')
}
// Save bandwidth data in a very ugly way, but we need to do this
// Save data in a very ugly way, but we need to do this
// so we can calculate the maximum Y-axis for all graphs
\$(elemn).data("chart-data", data)
})
// Set the maximum
chartOptions.axisY.high = maxBandwith
chartOptions.axisY.high = maxVal;
chartOptions.axisY.low = 0
// Update all the axis with the largest value and draw the graph
@@ -534,7 +466,7 @@
\$.ajax({
type: "POST",
url: "../../api",
data: "mode=config&name=test_server&" + \$(this).parents('form:first').serialize()
data: "mode=config&output=json&name=test_server&" + \$(this).parents('form:first').serialize()
}).then(function(data) {
// Let's replace the link
msg = data.value.message.replace('https://sabnzbd.org/certificate-errors', '<a href="https://sabnzbd.org/certificate-errors" class="alert-link" target="_blank">https://sabnzbd.org/certificate-errors</a>')
@@ -557,7 +489,7 @@
});
\$('.delServer').click(function(){
if( confirm("$T('confirm')") ) {
if( confirm("$T('Plush-confirm')") ) {
\$(this).parents('form:first').attr('action','delServer').submit();
// Let us leave!
formWasSubmitted = true;
@@ -568,7 +500,7 @@
});
\$('.clrServer').click(function(){
if( confirm("$T('confirm')") ) {
if( confirm("$T('Plush-confirm')") ) {
\$(this).parents('form:first').attr('action','clrServer').submit();
// Let us leave!
formWasSubmitted = true;

View File

@@ -1,5 +1,5 @@
<!--#set global $pane="Sorting"#-->
<!--#set global $help_uri="configuration/3.5/sorting"#-->
<!--#set global $help_uri="configuration/3.1/sorting"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->
<div class="colmask">
@@ -11,13 +11,12 @@
<h3>$T('seriesSorting') <a href="$helpuri$help_uri#toc0" target="_blank"><span class="glyphicon glyphicon-question-sign"></span></a></h3>
<p>
<b>$T('affectedCat')</b><br/>
<select name="tv_categories" multiple="multiple" class="multiple_cats" required="required">
<select name="tv_cat" multiple="multiple" class="multiple_cats">
<!--#for $ct in $categories#-->
<option value="$ct" <!--#if $ct in $tv_categories then 'selected="selected"' else ""#--> >$Tspec($ct)</option>
<!--#end for#-->
</select>
</p>
<p>$T('selectOneCat')</p>
</div>
<!-- /col2 -->
<div class="col1">
@@ -96,26 +95,6 @@
<td>%s_N</td>
<td>$T('show-us-name')</td>
</tr>
<tr>
<td class="align-right"><b>$T('Resolution'):</b></td>
<td>%r</td>
<td>1080p</td>
</tr>
<tr>
<td class="align-right"><b>$T('year'):</b></td>
<td>%y</td>
<td>2021</td>
</tr>
<tr>
<td class="align-right"><b>$T('decade'):</b></td>
<td>%decade</td>
<td>20</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%0decade</td>
<td>2020</td>
</tr>
<tr>
<td class="align-right"><b>$T('show-seasonNum'):</b></td>
<td>%s</td>
@@ -172,43 +151,6 @@
<td>$T('text')</td>
</tr>
</tbody>
<tbody>
<tr>
<th class="align-right"><b>GuessIt</b></th>
<th>$T('sort-pattern')</th>
<th>$T('sort-result')</th>
</tr>
</tbody>
<tbody>
<tr>
<td class="align-right"><b>$T('sort-guessitMeaning'):</b></td>
<td>%GI&lt;$T('sort-guessitProperty')&gt;</td>
<td>$T('guessit-sp-property')</td>
</tr>
<tr>
<td class="align-right"><b></b></td>
<td>%G.I&lt;$T('sort-guessitProperty')&gt;</td>
<td>$T('guessit-dot-property')</td>
</tr>
<tr>
<td class="align-right"><b></b></td>
<td>%G_I&lt;$T('sort-guessitProperty')&gt;</td>
<td>$T('guessit-us-property')</td>
</tr>
<tr>
<td class="align-right"><b>$T('Example')</b></td>
<td>%GI&lt;audio_codec&gt;</td>
<td>DTS</td>
</tr>
<tr>
<td class="align-right" style="vertical-align:top;"><b>$T('Valid properties')</b></td>
<td colspan=2>
<!--#for $prop in $guessit_properties#-->
$prop<br>
<!--#end for#-->
</td>
</tr>
</tbody>
</table>
</div>
<div class="field-pair">
@@ -224,13 +166,12 @@
<h3>$T('movieSort') <a href="$helpuri$help_uri#toc6" target="_blank"><span class="glyphicon glyphicon-question-sign"></span></a></h3>
<p>
<b>$T('affectedCat')</b><br/>
<select name="movie_categories" multiple="multiple" class="multiple_cats" required="required">
<select name="movie_cat" multiple="multiple" class="multiple_cats">
<!--#for $ct in $categories#-->
<option value="$ct" <!--#if $ct in $movie_categories then 'selected="selected"' else ""#--> >$Tspec($ct)</option>
<!--#end for#-->
</select>
</p>
<p>$T('selectOneCat')</p>
</div>
<!-- /col2 -->
<div class="col1">
@@ -284,21 +225,6 @@
</tr>
</thead>
<tbody>
<tr>
<td class="align-right"><b>$T('sort-title'):</b></td>
<td>%sn</td>
<td>$T('movie-sp-name') ($T('case-adjusted'))</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%s.n</td>
<td>$T('movie-dot-name') ($T('case-adjusted'))</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%s_n</td>
<td>$T('movie-us-name') ($T('case-adjusted'))</td>
</tr>
<tr>
<td class="align-right"><b>$T('sort-title'):</b></td>
<td>%title</td>
@@ -314,31 +240,26 @@
<td>%_title</td>
<td>$T('movie-us-name')</td>
</tr>
<tr>
<td class="align-right"><b>$T('Resolution'):</b></td>
<td>%r</td>
<td>1080p</td>
</tr>
<tr>
<td class="align-right"><b>$T('year'):</b></td>
<td>%y</td>
<td>2021</td>
</tr>
<tr>
<td class="align-right"><b>$T('decade'):</b></td>
<td>%decade</td>
<td>20</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%0decade</td>
<td>2020</td>
<td>2009</td>
</tr>
<tr>
<td class="align-right"><b>$T('extension'):</b></td>
<td>%ext</td>
<td>avi</td>
</tr>
<tr>
<td class="align-right"><b>$T('decade'):</b></td>
<td>%decade</td>
<td>00</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%0decade</td>
<td>2000</td>
</tr>
<tr>
<td class="align-right"><b>$T('orgFilename'):</b></td>
<td>%fn</td>
@@ -369,43 +290,6 @@
<td>1</td>
</tr>
</tbody>
<tbody>
<tr>
<th class="align-right"><b>GuessIt</b></th>
<th>$T('sort-pattern')</th>
<th>$T('sort-result')</th>
</tr>
</tbody>
<tbody>
<tr>
<td class="align-right"><b>$T('sort-guessitMeaning'):</b></td>
<td>%GI&lt;$T('sort-guessitProperty')&gt;</td>
<td>$T('guessit-sp-property')</td>
</tr>
<tr>
<td class="align-right"><b></b></td>
<td>%G.I&lt;$T('sort-guessitProperty')&gt;</td>
<td>$T('guessit-dot-property')</td>
</tr>
<tr>
<td class="align-right"><b></b></td>
<td>%G_I&lt;$T('sort-guessitProperty')&gt;</td>
<td>$T('guessit-us-property')</td>
</tr>
<tr>
<td class="align-right"><b>$T('Example')</b></td>
<td>%GI&lt;audio_codec&gt;</td>
<td>DTS</td>
</tr>
<tr>
<td class="align-right" style="vertical-align:top;"><b>$T('Valid properties')</b></td>
<td colspan=2>
<!--#for $prop in $guessit_properties#-->
$prop<br>
<!--#end for#-->
</td>
</tr>
</tbody>
</table>
</div>
<div class="field-pair">
@@ -421,13 +305,12 @@
<h3>$T('dateSorting') <a href="$helpuri$help_uri#toc9" target="_blank"><span class="glyphicon glyphicon-question-sign"></span></a></h3>
<p>
<b>$T('affectedCat')</b><br/>
<select name="date_categories" multiple="multiple" class="multiple_cats" required="required">
<select name="date_cat" multiple="multiple" class="multiple_cats">
<!--#for $ct in $categories#-->
<option value="$ct" <!--#if $ct in $date_categories then 'selected="selected"' else ""#--> >$Tspec($ct)</option>
<!--#end for#-->
</select>
</p>
<p>$T('selectOneCat')</p>
</div>
<!-- /col2 -->
<div class="col1">
@@ -474,21 +357,6 @@
</tr>
</thead>
<tbody>
<tr>
<td class="align-right"><b>$T('show-name'):</b></td>
<td>%sn</td>
<td>$T('show-sp-name') ($T('case-adjusted'))</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%s.n</td>
<td>$T('show-dot-name') ($T('case-adjusted'))</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%s_n</td>
<td>$T('show-us-name') ($T('case-adjusted'))</td>
</tr>
<tr>
<td class="align-right"><b>$T('show-name'):</b></td>
<td>%t</td>
@@ -504,25 +372,10 @@
<td>%_t</td>
<td>$T('show-us-name')</td>
</tr>
<tr>
<td class="align-right"><b>$T('Resolution'):</b></td>
<td>%r</td>
<td>1080p</td>
</tr>
<tr>
<td class="align-right"><b>$T('year'):</b></td>
<td>%y</td>
<td>2021</td>
</tr>
<tr>
<td class="align-right"><b>$T('decade'):</b></td>
<td>%decade</td>
<td>20</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%0decade</td>
<td>2020</td>
<td>2009</td>
</tr>
<tr>
<td class="align-right"><b>$T('month'):</b></td>
@@ -545,14 +398,14 @@
<td>02</td>
</tr>
<tr>
<td class="align-right"><b>$T('ep-name'):</b></td>
<td>%en</td>
<td>$T('ep-sp-name')</td>
<td class="align-right"><b>$T('decade'):</b></td>
<td>%decade</td>
<td>00</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>%e.n</td>
<td>$T('ep-dot-name')</td>
<td>%0decade</td>
<td>2000</td>
</tr>
<tr>
<td class="align-right"><b>$T('orgFilename'):</b></td>
@@ -570,43 +423,6 @@
<td>$T('text')</td>
</tr>
</tbody>
<tbody>
<tr>
<th class="align-right"><b>GuessIt</b></th>
<th>$T('sort-pattern')</th>
<th>$T('sort-result')</th>
</tr>
</tbody>
<tbody>
<tr>
<td class="align-right"><b>$T('sort-guessitMeaning'):</b></td>
<td>%GI&lt;$T('sort-guessitProperty')&gt;</td>
<td>$T('guessit-sp-property')</td>
</tr>
<tr>
<td class="align-right"><b></b></td>
<td>%G.I&lt;$T('sort-guessitProperty')&gt;</td>
<td>$T('guessit-dot-property')</td>
</tr>
<tr>
<td class="align-right"><b></b></td>
<td>%G_I&lt;$T('sort-guessitProperty')&gt;</td>
<td>$T('guessit-us-property')</td>
</tr>
<tr>
<td class="align-right"><b>$T('Example')</b></td>
<td>%GI&lt;audio_codec&gt;</td>
<td>DTS</td>
</tr>
<tr>
<td class="align-right" style="vertical-align:top;"><b>$T('Valid properties')</b></td>
<td colspan=2>
<!--#for $prop in $guessit_properties#-->
$prop<br>
<!--#end for#-->
</td>
</tr>
</tbody>
</table>
</div>
<div class="field-pair">

View File

@@ -1,5 +1,5 @@
<!--#set global $pane="Special"#-->
<!--#set global $help_uri="configuration/3.5/special"#-->
<!--#set global $help_uri="configuration/3.1/special"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->
<div class="colmask">

View File

@@ -1,5 +1,5 @@
<!--#set global $pane="Switches"#-->
<!--#set global $help_uri="configuration/3.5/switches"#-->
<!--#set global $help_uri="configuration/3.1/switches"#-->
<!--#include $webdir + "/_inc_header_uc.tmpl"#-->
<div class="colmask">
@@ -11,7 +11,6 @@
<form action="saveSwitches" method="post" name="fullform" class="fullform" autocomplete="off">
<input type="hidden" id="apikey" name="apikey" value="$apikey" />
<input type="hidden" id="ajax" name="ajax" value="1" />
<input type="hidden" name="output" value="json" />
<div class="section advanced-settings">
<div class="col2">
<h3>$T('swtag-server') <a href="$helpuri$help_uri#toc1" target="_blank"><span class="glyphicon glyphicon-question-sign"></span></a></h3>
@@ -121,10 +120,6 @@
</div>
<div class="field-pair">
<label class="config" for="unwanted_extensions">$T('opt-unwanted_extensions')</label>
<select name="unwanted_extensions_mode" id="unwanted_extensions_mode">
<option value="0" <!--#if int($unwanted_extensions_mode) == 0 then 'selected="selected"' else ""#--> >$T('unwanted_extensions_blacklist')</option>
<option value="1" <!--#if int($unwanted_extensions_mode) == 1 then 'selected="selected"' else ""#--> >$T('unwanted_extensions_whitelist')</option>
</select>
<input type="text" name="unwanted_extensions" id="unwanted_extensions" value="$unwanted_extensions"/>
<span class="desc">$T('explain-unwanted_extensions')</span>
</div>
@@ -141,8 +136,8 @@
<label class="config" for="auto_sort">$T('opt-auto_sort')</label>
<select name="auto_sort" id="auto_sort">
<option value="">$T('default')</option>
<option value="avg_age desc" <!--#if $auto_sort == "avg_age desc" then 'selected="selected"' else ""#--> >$T('Glitter-sortAgeAsc')</option>
<option value="avg_age asc" <!--#if $auto_sort == "avg_age asc" then 'selected="selected"' else ""#--> >$T('Glitter-sortAgeDesc')</option>
<option value="avg_age asc" <!--#if $auto_sort == "avg_age asc" then 'selected="selected"' else ""#--> >$T('Glitter-sortAgeAsc')</option>
<option value="avg_age desc" <!--#if $auto_sort == "avg_age desc" then 'selected="selected"' else ""#--> >$T('Glitter-sortAgeDesc')</option>
<option value="name asc" <!--#if $auto_sort == "name asc" then 'selected="selected"' else ""#--> >$T('Glitter-sortNameAsc')</option>
<option value="name desc" <!--#if $auto_sort == "name desc" then 'selected="selected"' else ""#--> >$T('Glitter-sortNameDesc')</option>
<option value="size asc" <!--#if $auto_sort == "size asc" then 'selected="selected"' else ""#--> >$T('Glitter-sortSizeAsc')</option>
@@ -245,7 +240,7 @@
<div class="field-pair">
<label class="config" for="deobfuscate_final_filenames">$T('opt-deobfuscate_final_filenames')</label>
<input type="checkbox" name="deobfuscate_final_filenames" id="deobfuscate_final_filenames" value="1" <!--#if int($deobfuscate_final_filenames) > 0 then 'checked="checked"' else ""#--> />
<span class="desc">$T('explain-deobfuscate_final_filenames') $T('explain-deobfuscate_final_filenames-ext')</span>
<span class="desc">$T('explain-deobfuscate_final_filenames')</span>
</div>
<div class="field-pair advanced-settings">
<label class="config" for="enable_meta">$T('opt-enable_meta')</label>

View File

File diff suppressed because one or more lines are too long

View File

@@ -550,31 +550,26 @@ tr.separator {
padding-right: 13px;
}
/* -- */
.RSS .addRssTable,
.RSS .addRssTable input[type="text"] {
width: 100%;
}
.RSS .addRssTable .new-feed-title {
max-width: 250px;
}
.RSS .addRssTable .new-feed-url {
width: 70%;
}
h2.activeRSS {
margin-bottom: 10px;
}
.activeRSS a,
.activeRSS a:visited {
.activeRSS a, .activeRSS a:visited {
text-decoration: none;
color: #000;
text-decoration: underline !important;
}
.activeRSS a:hover {
color: #4b4742;
}
.activeRSS a:first-of-type {
text-decoration: underline!important;
}
.favicon {
background-position: center center !important;
background-size: 22px 22px;
background-position: center center!important;
background-size: 16px 16px;
opacity: 1;
top: -1px;
height: 22px;
width: 22px;
height: 16px;
width: 16px;
float: left;
margin: 0 6px 0 2px;
text-align: center;
@@ -594,7 +589,6 @@ h2.activeRSS {
}
#subscriptions {
border: 1px solid #E5E5E5;
width: 100%;
}
.data-row {
border-top: 1px solid #E5E5E5;
@@ -606,7 +600,6 @@ h2.activeRSS {
#subscriptions .chk {
padding: 8px 5px 5px;
vertical-align: middle;
width: 40px;
}
#subscriptions .title {
font-weight: bold;
@@ -614,11 +607,10 @@ h2.activeRSS {
width: auto;
}
#subscriptions .favicon {
margin-left: 7px;
margin-top: -2px;
margin-left: 8px;
}
#subscriptions .glyphicon {
margin-top: 3px;
.ie6 .subscription-title {
width: 20em;
}
.subscription-title,
.subscription-title:hover {
@@ -1103,10 +1095,6 @@ input[type="checkbox"] {
font-size: 1.2em;
}
.host-warning-highlight {
border-color: #F0AD4E !important;
}
.fileBrowser .glyphicon {
margin-right: 2px;
top: 1px;
@@ -1185,31 +1173,6 @@ input[type="checkbox"] {
100% { transform: rotate(359deg); }
}
/***
RTL Fixes
***/
html[dir="rtl"] .col1 input[type='checkbox'],
html[dir="rtl"] .col2 h3 a {
left: 5px;
}
html[dir="rtl"] .modal-header .close {
float: left;
}
html[dir="rtl"] .field-pair {
position: relative;
}
html[dir="rtl"] .Sorting .presets.float-left,
html[dir="rtl"] .checkbox-days {
float: none;
}
html[dir="rtl"] .Scheduling form[action="addSchedule"] input[type="checkbox"] {
right: 5px;
}
@media screen and (min-width: 1200px) {
.Categories input[name="dir"] {
max-width: 240px !important;

View File

@@ -261,16 +261,16 @@ function do_restart() {
$('.main-restarting .restarting-url').text(urlTotal)
// Initiate restart
$.ajax({ url: '../../api?mode=restart&apikey=' + sabSession,
$.ajax({ url: '../../config/restart?apikey=' + sabSession,
complete: function() {
// Keep counter of failures
var loopCounter = 0;
var failureCounter = 0;
// Now we try until we can connect
setInterval(function() {
loopCounter = loopCounter+1;
// We skip the first one so we give it time to shutdown
if(loopCounter < 2) {
var refreshInterval = setInterval(function() {
// We skip the first one
if(failureCounter == 0) {
failureCounter = failureCounter+1;
return
}
$.ajax({ url: urlTotal,
@@ -279,16 +279,17 @@ function do_restart() {
location.href = urlTotal;
},
error: function(status, text) {
// Too many failures and we give up
if(loopCounter >= 10) {
failureCounter = failureCounter+1;
// Too many failuers and we give up
if(failureCounter >= 6) {
// If the port has changed 'Access-Control-Allow-Origin' header will not allow
// us to check if the server is back up. So after 10 failures (20 sec) we redirect
// us to check if the server is back up. So after 7 failures we redirect
// anyway in the hopes it works anyway..
location.href = urlTotal;
}
}
})
}, 2000)
}, 4000)
// Exception if we go from HTTPS to HTTP
// (this is not allowed by browsers and all of the above will be ignored)

View File

@@ -0,0 +1 @@
&nbsp;

View File

@@ -5,10 +5,8 @@
<tr>
<th style="width: 25px;"></th>
<th></th>
<th class="table-status-header" data-bind="css: { 'table-header-status-smaller' : extraHistoryColumns().length }"></th>
<!-- ko foreach: extraHistoryColumns -->
<th class="table-header-extra"></th>
<!-- /ko -->
<th class="table-status-header" data-bind="css: { 'table-header-status-smaller' : extraHistoryColumn }"></th>
<th class="table-header-extra" data-bind="css: { 'table-extra-header-visible' : extraHistoryColumn }"></th>
<th style="width: 130px;"></th>
<th style="width: 60px;"></th>
</tr>
@@ -139,11 +137,10 @@
<!-- /ko -->
</td>
<td class="status row-wrap-text" data-bind="text: statusText()" onclick="showDetails(this)"></td>
<!-- ko foreach: parent.parent.extraHistoryColumns -->
<td class="row-extra-text" onclick="showDetails(this)">
<div class="row-wrap-text" data-bind="text: \$parent.showColumn(\$data)"></div>
<div class="row-wrap-text" data-bind="text: extraText">
</div>
</td>
<!-- /ko -->
<td class="history-completedon row-wrap-text" data-bind="text: completedOn(), attr: { 'data-timestamp': completed }" onclick="showDetails(this)"></td>
<td class="delete">
<div class="dropdown">
@@ -224,10 +221,4 @@
<span data-bind="text: history.downloadedMonth"></span>B $T('Glitter-thisMonth')
<span data-bind="text: history.downloadedTotal"></span>B $T('Glitter-total')
</div>
</div>
<div class="info-container history-info" data-bind="visible: !hasHistory() && !displayTabbed()" style="display: none">
<span class="glyphicon glyphicon-save"></span>
<span data-bind="text: history.downloadedToday"></span>B $T('Glitter-today')
<span data-bind="text: history.downloadedMonth"></span>B $T('Glitter-thisMonth')
<span data-bind="text: history.downloadedTotal"></span>B $T('Glitter-total')
</div>

View File

@@ -26,15 +26,13 @@
<!-- /ko -->
<!-- ko foreach: allMessages -->
<tr>
<td class="table-messages-label" data-bind="attr: { 'colspan': 1 + !\$data.hasOwnProperty('clear') }">
<td class="table-messages-label">
<span class="label" data-bind="css: 'label-' + css, text: type"></span>
<span class="queue-message-text" data-bind="html: text"></span>
</td>
<!-- ko if: \$data.hasOwnProperty("clear") -->
<td class="table-messages-remove">
<a href="#" data-bind="click: clear" class="hover-button"><span class="glyphicon glyphicon-remove"></span></a>
<!-- ko if: \$data.hasOwnProperty("clear") --><a href="#" data-bind="click: clear" class="hover-button"><span class="glyphicon glyphicon-remove"></span></a><!-- /ko -->
</td>
<!-- /ko -->
</tr>
<!-- /ko -->
<!-- ko if: !hasMessages() && displayTabbed() -->

View File

@@ -85,81 +85,74 @@
</ul>
<div class="tab-content">
<div class="tab-pane fade in active" id="options-status">
<div class="row" data-bind="visible: statusInfo.active_socks5_proxy">
<div class="col-sm-6">$T('opt-socks5_proxy_url') &nbsp </div>
<div class="col-sm-6" data-bind="visible: hasStatusInfo, text: statusInfo.active_socks5_proxy"></div>
<div class="col-sm-6 col-loading" data-bind="visible: !hasStatusInfo()">$T('Glitter-loading')<span class="loader-dot-one">.</span><span class="loader-dot-two">.</span><span class="loader-dot-three">.</span></div>
</div>
<div class="row">
<div class="col-sm-6">$T('dashboard-localIP4') &nbsp; </div>
<div class="col-sm-6">$T('dashboard-localIP4')</div>
<div class="col-sm-6" data-bind="visible: hasStatusInfo, text: !statusInfo.localipv4() ? '$T('dashboard-connectionError')' : statusInfo.localipv4(), css: { 'options-bad-status' : !statusInfo.localipv4() }"></div>
<div class="col-sm-6 col-loading" data-bind="visible: !hasStatusInfo()">$T('Glitter-loading')<span class="loader-dot-one">.</span><span class="loader-dot-two">.</span><span class="loader-dot-three">.</span></div>
</div>
<div class="row">
<div class="col-sm-6">$T('dashboard-publicIP4') &nbsp; </div>
<div class="col-sm-6">$T('dashboard-publicIP4')</div>
<div class="col-sm-6" data-bind="visible: hasStatusInfo, text: !statusInfo.publicipv4() ? '$T('dashboard-connectionError')' : statusInfo.publicipv4(), css: { 'options-bad-status ' : !statusInfo.publicipv4() }"></div>
<div class="col-sm-6 col-loading" data-bind="visible: !hasStatusInfo()">$T('Glitter-loading')<span class="loader-dot-one">.</span><span class="loader-dot-two">.</span><span class="loader-dot-three">.</span></div>
</div>
<div class="row">
<div class="col-sm-6">$T('dashboard-IP6') &nbsp; </div>
<div class="col-sm-6">$T('dashboard-IP6')</div>
<div class="col-sm-6" data-bind="visible: hasStatusInfo, text: statusInfo.ipv6"></div>
<div class="col-sm-6 col-loading" data-bind="visible: !hasStatusInfo()">$T('Glitter-loading')<span class="loader-dot-one">.</span><span class="loader-dot-two">.</span><span class="loader-dot-three">.</span></div>
</div>
<div class="row">
<div class="col-sm-6">$T('dashboard-NameserverDNS') &nbsp; </div>
<div class="col-sm-6">$T('dashboard-NameserverDNS')</div>
<div class="col-sm-6" data-bind="visible: hasStatusInfo, text: !statusInfo.dnslookup() ? '$T('dashboard-connectionError')' : statusInfo.dnslookup(), css: { 'options-bad-status' : (statusInfo.dnslookup() != 'OK') }"></div>
<div class="col-sm-6 col-loading" data-bind="visible: !hasStatusInfo()">$T('Glitter-loading')<span class="loader-dot-one">.</span><span class="loader-dot-two">.</span><span class="loader-dot-three">.</span></div>
</div>
<hr/>
<div class="row">
<div class="col-sm-6">$T('cache') &nbsp; </div>
<div class="col-sm-6">$T('cache')</div>
<div class="col-sm-6">
<span data-bind="text: cacheSize"></span> (<span data-bind="text: cacheArticles"></span> $T('Glitter-articles'))
</div>
</div>
<div class="row">
<div class="col-sm-6">$T('dashboard-systemPerformance') &nbsp; </div>
<div class="col-sm-6">$T('dashboard-systemPerformance')</div>
<div class="col-sm-6" data-bind="visible: hasPerformanceInfo">
<span data-bind="text: statusInfo.pystone"></span>
<a href="#" class="diskspeed-button" data-bind="click: loadStatusInfo" data-tooltip="true" data-placement="right" title="$T('dashboard-repeatTest')"><span class="glyphicon glyphicon-repeat"></span></a>
<a href="#" data-bind="click: testDiskSpeed" data-tooltip="true" data-placement="right" title="$T('dashboard-repeatTest')"><span class="glyphicon glyphicon-repeat"></span></a>
<small data-bind="truncatedText: statusInfo.cpumodel, length: 25, attr: { 'data-original-title': statusInfo.cpumodel }" data-tooltip="true"></small>
</div>
<div class="col-sm-6 col-loading" data-bind="visible: !hasPerformanceInfo()">$T('Glitter-loading')<span class="loader-dot-one">.</span><span class="loader-dot-two">.</span><span class="loader-dot-three">.</span></div>
</div>
<div class="row">
<div class="col-sm-6">$T('dashboard-downloadDirSpeed') &nbsp; </div>
<div class="col-sm-6">$T('dashboard-downloadDirSpeed')</div>
<div class="col-sm-6" data-bind="visible: hasPerformanceInfo">
<span data-bind="text: statusInfo.downloaddirspeed()"></span> MB/s
<a href="#" class="diskspeed-button" data-bind="click: loadStatusInfo" data-tooltip="true" data-placement="right" title="$T('dashboard-repeatTest')"><span class="glyphicon glyphicon-repeat"></span></a>
<a href="#" class="diskspeed-button" data-bind="click: testDiskSpeed" data-tooltip="true" data-placement="right" title="$T('dashboard-repeatTest')"><span class="glyphicon glyphicon-repeat"></span></a>
<small>(<span data-bind="truncatedText: statusInfo.downloaddir, length: 24, attr: { 'data-original-title': statusInfo.downloaddir }" data-tooltip="true"></span>)</small>
</div>
<div class="col-sm-6 col-loading" data-bind="visible: !hasPerformanceInfo()">$T('Glitter-loading')<span class="loader-dot-one">.</span><span class="loader-dot-two">.</span><span class="loader-dot-three">.</span></div>
</div>
<div class="row">
<div class="col-sm-6">$T('dashboard-completeDirSpeed') &nbsp; </div>
<div class="col-sm-6">$T('dashboard-completeDirSpeed')</div>
<div class="col-sm-6" data-bind="visible: hasPerformanceInfo">
<span data-bind="text: statusInfo.completedirspeed()"></span> MB/s
<a href="#" class="diskspeed-button" data-bind="click: loadStatusInfo" data-tooltip="true" data-placement="right" title="$T('dashboard-repeatTest')"><span class="glyphicon glyphicon-repeat"></span></a>
<a href="#" class="diskspeed-button" data-bind="click: testDiskSpeed" data-tooltip="true" data-placement="right" title="$T('dashboard-repeatTest')"><span class="glyphicon glyphicon-repeat"></span></a>
<small>(<span data-bind="truncatedText: statusInfo.completedir, length: 24, attr: { 'data-original-title': statusInfo.completedir }" data-tooltip="true"></span>)</small>
</div>
<div class="col-sm-6 col-loading" data-bind="visible: !hasPerformanceInfo()">$T('Glitter-loading')<span class="loader-dot-one">.</span><span class="loader-dot-two">.</span><span class="loader-dot-three">.</span></div>
</div>
<div class="row">
<div class="col-sm-6">$T('dashboard-internetBandwidth') &nbsp; </div>
<div class="col-sm-6">$T('dashboard-internetBandwidth')</div>
<div class="col-sm-6" data-bind="visible: hasPerformanceInfo">
<span data-bind="text: statusInfo.internetbandwidth()"></span> MB/s
<a href="#" class="diskspeed-button" data-bind="click: loadStatusInfo" data-tooltip="true" data-placement="right" title="$T('dashboard-repeatTest')"><span class="glyphicon glyphicon-repeat"></span></a>
<a href="#" class="diskspeed-button" data-bind="click: testDiskSpeed" data-tooltip="true" data-placement="right" title="$T('dashboard-repeatTest')"><span class="glyphicon glyphicon-repeat"></span></a>
<small>(<span data-bind="text: statusInfo.internetbandwidth()*8"></span> Mbps)</small>
</div>
<div class="col-sm-6 col-loading" data-bind="visible: !hasPerformanceInfo()">$T('Glitter-loading')<span class="loader-dot-one">.</span><span class="loader-dot-two">.</span><span class="loader-dot-three">.</span></div>
</div>
<div class="row test-download">
<div class="col-sm-6">$T('dashboard-testDownload') &nbsp; </div>
<div class="col-sm-6">$T('dashboard-testDownload')</div>
<div class="col-sm-6">
<a href="#" class="btn btn-default" data-bind="click: testDownload" data-size="100MB" data-tooltip="true" data-placement="top" title="$T('dashboard-testDownload-explain')"><span class="glyphicon glyphicon-download-alt"></span> 100 MB</a>
<a href="#" class="btn btn-default" data-bind="click: testDownload" data-size="1000MB" data-tooltip="true" data-placement="top" title="$T('dashboard-testDownload-explain')"><span class="glyphicon glyphicon-download-alt"></span> 1 GB</a>
<a href="#" class="btn btn-default" data-bind="click: testDownload" data-size="10GB" data-tooltip="true" data-placement="top" title="$T('dashboard-testDownload-explain')"><span class="glyphicon glyphicon-download-alt"></span> 10 GB</a>
<a href="#" class="btn btn-default" data-bind="click: testDownload" data-size="1000MB" data-tooltip="true" data-placement="top" title="$T('dashboard-testDownload-explain')"><span class="glyphicon glyphicon-download-alt"></span> 1000 MB</a>
</div>
</div>
<hr />
@@ -175,7 +168,7 @@
</div>
<div class="row options-function-box">
<div class="col-sm-6">
<a href="./api?mode=showlog&apikey=$apikey" target="_blank" class="btn btn-default" data-tooltip="true" data-placement="top" title="$T('Glitter-logText')">
<a href="./status/showlog?apikey=$apikey" target="_blank" class="btn btn-default" data-tooltip="true" data-placement="top" title="$T('Glitter-logText')">
<span class="glyphicon glyphicon-file"></span> $T('link-showLog')
</a>
</div>
@@ -224,10 +217,6 @@
<span data-bind="text: servertotalconn"></span>
</div>
</div>
<div class="row">
<div class="col-sm-6">$T('Glitter-speed')</div>
<div class="col-sm-6"><span data-bind="text: serverbps"></span>B/s</div>
</div>
<div class="row" data-bind="visible: servererror()">
<div class="col-sm-12">
<div class="alert alert-danger">
@@ -290,8 +279,8 @@
<tr>
<td><span class="glyphicon glyphicon-folder-open"></span></td>
<td class="row-wrap-text"><strong data-bind="html: \$data"></strong></td>
<td><a href="#" data-bind="click: \$root.folderProcess" data-action="add_orphan" class="hover-button" data-tooltip="true" data-placement="left" title="$T('Glitter-backToQueue')"><span class="glyphicon glyphicon-plus-sign"></span></a></td>
<td><a href="#" data-bind="click: \$root.folderProcess" data-action="delete_orphan" class="hover-button" data-tooltip="true" data-placement="left" title="$T('Glitter-deleteJobAndFolders')"><span class="glyphicon glyphicon-trash"></span></a></td>
<td><a href="#" data-bind="click: \$root.folderProcess" data-action="add" class="hover-button" data-tooltip="true" data-placement="left" title="$T('Glitter-backToQueue')"><span class="glyphicon glyphicon-plus-sign"></span></a></td>
<td><a href="#" data-bind="click: \$root.folderProcess" data-action="delete" class="hover-button" data-tooltip="true" data-placement="left" title="$T('Glitter-deleteJobAndFolders')"><span class="glyphicon glyphicon-trash"></span></a></td>
</tr>
</tbody>
</table>
@@ -353,6 +342,7 @@
</select>
</div>
</div>
<div class="options-switch"></div>
<div class="form-group">
<label class="col-sm-6 control-label">$T('Glitter-dateFormat')</label>
<div class="col-sm-4">
@@ -377,7 +367,8 @@
<span class="label label-warning">&gt; 1200 pixels</span>
</label>
<div class="col-sm-4">
<select name="general-extra-column" class="form-control-multiselect form-control" data-bind="selectedOptions: extraQueueColumns" multiple="true">
<select name="general-extra-column" class="form-control" data-bind="value: extraQueueColumn">
<option value="">$T('none')</option>
<option value="category">$T('category')</option>
<option value="priority">$T('priority')</option>
<option value="processing">$T('swtag-pp')</option>
@@ -392,7 +383,8 @@
<span class="label label-warning">&gt; 1200 pixels</span>
</label>
<div class="col-sm-4">
<select name="general-extra-column" class="form-control-multiselect form-control" data-bind="selectedOptions: extraHistoryColumns" multiple="true">
<select name="general-extra-column" class="form-control" data-bind="value: extraHistoryColumn">
<option value="">$T('none')</option>
<option value="category">$T('category')</option>
<option value="size">$T('size')</option>
<option value="speed">$T('Glitter-speed')</option>
@@ -407,14 +399,6 @@
<input type="checkbox" name="displayCompact" value="true" data-bind="checked: displayCompact" />
</div>
</div>
<div class="form-group form-checkbox">
<label class="col-sm-6 control-label">
$T("Glitter-displayFullWidth")
</label>
<div class="col-sm-4">
<input type="checkbox" name="displayFullWidth" value="true" data-bind="checked: displayFullWidth" />
</div>
</div>
<div class="form-group form-checkbox">
<label class="col-sm-6 control-label">
$T("Glitter-displayTabbed")
@@ -450,14 +434,14 @@
<div id="modal-add-nzb" class="modal fade" tabindex="-1">
<div class="modal-dialog">
<form class="modal-content" data-bind="submit: addNZB">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">$T('Glitter-addNZB')</h4>
</div>
<div class="modal-body form-horizontal">
<div class="row">
<div class="col-sm-6">
<form data-bind="submit: addNZBFromURL" class="col-sm-6">
<fieldset>
<legend class="row-wrap-text">$T('Glitter-addFromURL')</legend>
<div class="input-group" data-tooltip="true" data-placement="bottom" title="$file_exts">
@@ -467,8 +451,8 @@
</span>
</div>
</fieldset>
</div>
<div class="col-sm-6">
</form>
<form data-bind="submit: addNZBFromFileForm" class="col-sm-6">
<fieldset>
<legend class="row-wrap-text">$T('Glitter-addFromFile')</legend>
<div class="input-group" data-tooltip="true" data-placement="bottom" title="$file_exts">
@@ -482,7 +466,7 @@
</span>
</div>
</fieldset>
</div>
</form>
</div>
<div class="clearfix"></div>
<hr />
@@ -528,7 +512,7 @@
</div>
<div class="clearfix"></div>
</div>
</form>
</div>
</div>
</div>
@@ -683,7 +667,7 @@
</tbody>
</table>
<hr/>
<p><small>Copyright (C) 2007-2021 The SABnzbd Team &lt;team@sabnzbd.org&gt;<br/>$T('yourRights') </small></p>
<p><small>Copyright (C) 2007-2020 The SABnzbd Team &lt;team@sabnzbd.org&gt;<br/>$T('yourRights') </small></p>
</div>
</div>
</div>

View File

@@ -67,10 +67,8 @@
<tr>
<th style="width: 25px;"></th>
<th></th>
<!-- ko foreach: extraQueueColumns -->
<th class="table-header-extra"></th>
<!-- /ko -->
<th class="table-header-progress" data-bind="css: { 'table-header-progress-smaller' : extraQueueColumns().length }"></th>
<th class="table-header-extra" data-bind="css: { 'table-extra-header-visible' : extraQueueColumn }"></th>
<th class="table-header-progress" data-bind="css: { 'table-header-progress-smaller' : extraQueueColumn }"></th>
<th style="width: 85px;"></th>
<th style="width: 60px;"></th>
</tr>
@@ -78,7 +76,7 @@
<!-- ko if: !hasQueue() -->
<tbody class="no-downloads">
<tr>
<td colspan="6" data-bind="attr: { 'colspan': 5 + extraQueueColumns().length }">
<td colspan="6">
<a href="#modal-add-nzb" class="hover-button" data-toggle="modal">
<span title="$T('Glitter-dragAndDrop')" data-tooltip="true"><span class="glyphicon glyphicon-plus-sign"></span> $T('Glitter-addNZB')</span>
</a>
@@ -109,7 +107,7 @@
<form data-bind="submit: editingNameSubmit">
<input type="text" data-bind="value: nameForEdit, visible: editingName(), hasfocus: editingName" />
</form>
<div class="name-icons direct-unpack hover-button" data-bind="visible: direct_unpack() && !editingName()">
<div class="name-icons direct-unpack hover-button" data-bind="visible: direct_unpack">
<span class="glyphicon glyphicon-compressed"></span> <span data-bind="text: direct_unpack"></span>
</div>
<div class="name-options" data-bind="visible: !editingName(), css: { disabled: isGrabbing() }">
@@ -120,11 +118,10 @@
<small data-bind="text: avg_age"></small>
</div>
</td>
<!-- ko foreach: parent.parent.extraQueueColumns -->
<td class="row-extra-text">
<div class="row-wrap-text" data-bind="text: \$parent.showColumn(\$data)"></div>
<div class="row-wrap-text" data-bind="text: extraText">
</div>
</td>
<!-- /ko -->
<td class="progress-indicator">
<div class="progress">
<div class="progress-bar progress-bar-info" data-bind="attr: { 'style': 'width: ' + percentage() + '%; background-color: ' + progressColor() + ';' }">

View File

@@ -1,6 +1,6 @@
<!DOCTYPE html>
<!--#set $active_lang=$active_lang.replace('_', '-').lower()#-->
<html lang="$active_lang" <!--#if $rtl#-->dir="rtl"<!--#end if#--> id="sabnzbd" data-bind="filedrop: { overlaySelector: '.main-filedrop', onFileDrop: addNZBFromFile }">
<html lang="$active_lang" id="sabnzbd" data-bind="filedrop: { overlaySelector: '.main-filedrop', onFileDrop: addNZBFromFile }">
<head>
<!--
Glitter V2
@@ -36,7 +36,7 @@
<link rel="stylesheet" type="text/css" href="./static/bootstrap/css/bootstrap.min.css?v=$version" />
<link rel="stylesheet" type="text/css" href="./static/stylesheets/glitter.css?v=$version" />
<link rel="stylesheet" type="text/css" href="./static/stylesheets/glitter.mobile.css?v=$version" media="all and (max-width: 768px)" />
<!--#if $color_scheme not in ('Light', '') #-->
<!--#if $color_scheme not in ('Default', '') #-->
<link rel="stylesheet" type="text/css" href="./static/stylesheets/colorschemes/${color_scheme}.css?v=$version"/>
<!--#end if#-->
@@ -52,17 +52,15 @@
var glitterTranslate = new Object();
glitterTranslate.paused = "$T('post-Paused')";
glitterTranslate.left = "$T('Glitter-left')";
glitterTranslate.clearWarn = "$T('confirm')";
glitterTranslate.clearWarn = "$T('Glitter-confirmClearWarnings')";
glitterTranslate.pausePromptFail = "$T('Glitter-pausePromptFail')"
glitterTranslate.pauseFor = "$T('pauseFor')"
glitterTranslate.minutes = "$T('mins')"
glitterTranslate.shutdown = "$T('shutdownOK?')";
glitterTranslate.restart = "$T('explain-Restart') $T('explain-needNewLogin')".replace(/\<br(\s*\/|)\>/g, '\n');
glitterTranslate.repair = "$T('explain-Repair')".replace(/<br \/>/g, "\n").replace(/&quot;/g,'"');
glitterTranslate.deleteMsg = "$T('nzo-delete')";
glitterTranslate.removeDown = "$T('confirm')";
glitterTranslate.removeDow1 = "$T('confirm')";
glitterTranslate.renameAbort = "$T('Glitter-confirmAbortDirectUnpack')\n$T('confirm')";
glitterTranslate.removeDown = "$T('Glitter-confirmClearDownloads')";
glitterTranslate.removeDow1 = "$T('Glitter-confirmClear1Download')";
glitterTranslate.retryAll = "$T('link-retryAll')?";
glitterTranslate.fetch = "$T('Glitter-fetch')";
glitterTranslate.encrypted = "$T('Glitter-encrypted')";

View File

@@ -0,0 +1 @@
&nbsp;

View File

@@ -0,0 +1,40 @@
<!--#if $paused#-->
<!--#if $pause_int != '0' #-->
<!--#from math import floor#-->
<!--#set pauseSplit = $pause_int.split(':')#-->
<!--#set seconds = int(pauseSplit[0]) * 60 + int(pauseSplit[1])#-->
<!--#set hours = floor(seconds/3600)#-->
<!--#set minutes = floor((seconds - hours * 3600) / 60)#-->
<!--#set seconds = seconds - minutes * 60 - hours * 3600#-->
<!--#if seconds < 10 #-->
<!--#set seconds = '0' + str(int(seconds)) #-->
<!--#else#-->
<!--#set seconds = str(int(seconds)) #-->
<!--#end if#-->
<!--#if (minutes < 10) & (hours > 0) #-->
<!--#set minutes = '0' + str(int(minutes)) #-->
<!--#else#-->
<!--#set minutes = str(int(minutes)) #-->
<!--#end if#-->
<!--#if hours > 0 #-->
<!--#set timeString = str(int(hours)) + ":" + minutes + ":" + seconds#-->
<!--#else#-->
<!--#set timeString = minutes + ":" + seconds#-->
<!--#end if#-->
<!--#end if#-->
$T('post-Paused') <!--#if $pause_int != '0' #-->($timeString) <!--#end if#-->
<!--#if float($mbleft) > 0#-->
- $sizeleft $T('Glitter-left')
<!--#end if#-->
- SABnzbd
<!--#else if float($mbleft) < 0.1#-->
SABnzbd
<!--#else#-->
${speed}B/s - $sizeleft $T('Glitter-left') - SABnzbd
<!--#end if#-->
|||<!--#echo "%.0f" % float($kbpersec)#-->

View File

@@ -1,6 +1,7 @@
/**
Base variables and functions
**/
var fadeOnDeleteDuration = 400; // ms after deleting a row
var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
// To avoid problems when localStorage is disabled
@@ -56,6 +57,42 @@ function callSpecialAPI(url, data) {
return $.when(ajaxQuery);
}
/**
Handle visibility changes so we
do only incremental update when not visible
**/
var pageIsVisible = true;
// Set the name of the hidden property and the change event for visibility
var hidden, visibilityChange;
if(typeof document.hidden !== "undefined") { // Opera 12.10 and Firefox 18 and later support
hidden = "hidden";
visibilityChange = "visibilitychange";
} else if(typeof document.mozHidden !== "undefined") {
hidden = "mozHidden";
visibilityChange = "mozvisibilitychange";
} else if(typeof document.msHidden !== "undefined") {
hidden = "msHidden";
visibilityChange = "msvisibilitychange";
} else if(typeof document.webkitHidden !== "undefined") {
hidden = "webkitHidden";
visibilityChange = "webkitvisibilitychange";
}
// Set the global visibility
function handleVisibilityChange() {
if(document[hidden]) {
pageIsVisible = false;
} else {
pageIsVisible = true;
}
}
// Add event listener only for supported browsers
if(typeof document.addEventListener !== "undefined" && typeof document[hidden] !== "undefined") {
// Handle page visibility change
document.addEventListener(visibilityChange, handleVisibilityChange, false);
}
/***
GENERAL FUNCTIONS
***/
@@ -227,13 +264,18 @@ function showNotification(notiName, notiTimeout, fileCounter) {
// Remove after timeout
if(notiTimeout) {
setTimeout(function() {
hideNotification();
hideNotification(true);
}, notiTimeout)
}
}
// Hide notification
function hideNotification() {
// Hide the box with effect
$('.main-notification-box').fadeOut()
function hideNotification(fadeItOut) {
// Hide the box with or without effect
if(fadeItOut) {
$('.main-notification-box').fadeOut()
} else {
$('.main-notification-box').hide()
}
}

View File

@@ -4,9 +4,6 @@ function Fileslisting(parent) {
self.parent = parent;
self.fileItems = ko.observableArray([]);
// Prevent flash of unstyled content when deleting items
self.fileItems.extend({ rateLimit: 50 })
// Need to reserve these names to be overwritten
self.filelist_name = ko.observable();
self.filelist_password = ko.observable();
@@ -33,17 +30,42 @@ function Fileslisting(parent) {
$('#modal-item-files').modal('show');
// Stop updating on closing of the modal
$('#modal-item-files').on('hidden.bs.modal', function () {
$('#modal-item-files').on('hidden.bs.modal', function() {
self.removeUpdate();
})
}
// Move to top and bottom buttons
self.moveButton = function (item,event) {
var targetRow, sourceRow, tbody;
sourceRow = $(event.currentTarget).parents("tr").filter(":first");
tbody = sourceRow.parents("tbody").filter(":first");
ko.utils.domData.set(sourceRow[0], "ko_sourceIndex", ko.utils.arrayIndexOf(sourceRow.parent().children(), sourceRow[0]));
sourceRow = sourceRow.detach();
if ($(event.currentTarget).is(".buttonMoveToTop")) {
// we are moving to the top
targetRow = tbody.children(".files-done").filter(":last");
} else {
//we are moving to the bottom
targetRow = tbody.children(".files-sortable").filter(":last");
}
if(targetRow.length < 1 ){
// we found an edge case and need to do something special
targetRow = tbody.children(".files-sortable").filter(":first");
sourceRow.insertBefore(targetRow[0]);
} else {
sourceRow.insertAfter($(targetRow[0]));
}
tbody.sortable('option', 'update').call(tbody[0],null, { item: sourceRow });
};
// Trigger update
self.triggerUpdate = function() {
// Call API
callAPI({
mode: 'get_files',
value: self.currentItem.id
value: self.currentItem.id,
limit: 5
}).then(function(response) {
// When there's no files left we close the modal and the update will be stopped
// For example when the job has finished downloading
@@ -102,57 +124,39 @@ function Fileslisting(parent) {
self.move = function(event) {
// How much did we move?
var nrMoves = event.sourceIndex - event.targetIndex;
var direction = (nrMoves > 0 ? 'up' : 'down')
var direction = (nrMoves > 0 ? 'Up' : 'Down')
callAPI({
mode: 'move_nzf_bulk',
name: direction,
value: self.currentItem.id,
nzf_ids: event.item.nzf_id(),
size: Math.abs(nrMoves)
}).then(function() {
// Refresh all the files
self.loadFiles(self.currentItem)
})
};
// We have to create the data-structure before, to be able to use the name as a key
var dataToSend = {};
dataToSend[event.item.nzf_id()] = 'on';
dataToSend['apikey'] = apiKey;
dataToSend['action_key'] = direction;
dataToSend['action_size'] = Math.abs(nrMoves);
// Move to top and bottom buttons
self.moveButton = function (item, event) {
// Up or down?
var direction = "bottom"
if ($(event.currentTarget).is(".buttonMoveToTop")) {
// we are moving to the top
direction = "top"
}
callAPI({
mode: 'move_nzf_bulk',
name: direction,
value: self.currentItem.id,
nzf_ids: item.nzf_id()
}).then(function() {
// Refresh all the files
self.loadFiles(self.currentItem)
})
// Activate with this weird URL "API"
callSpecialAPI("./nzb/" + self.currentItem.id + "/bulk_operation/", dataToSend)
};
// Remove selected files
self.removeSelectedFiles = function() {
// We have to create the data-structure before, to be able to use the name as a key
var dataToSend = {};
dataToSend['apikey'] = apiKey;
dataToSend['action_key'] = 'Delete';
// Get all selected ones
var nzfIds = []
$('.item-files-table input:checked:not(:disabled)').each(function() {
// Add this item
nzfIds.push($(this).prop('name'))
dataToSend[$(this).prop('name')] = 'on';
})
callAPI({
mode: 'queue',
name: 'delete_nzf',
value: self.currentItem.id,
value2: nzfIds.join()
}).then(function() {
// Refresh all the files
self.loadFiles(self.currentItem)
// Activate with this weird URL "API"
callSpecialAPI("./nzb/" + self.currentItem.id + "/bulk_operation/", dataToSend).then(function() {
// Fade it out
$('.item-files-table input:checked:not(:disabled)').parents('tr').fadeOut(fadeOnDeleteDuration, function() {
// Set state of the check-all
setCheckAllState('#modal-item-files .multioperations-selector input[type="checkbox"]', '#modal-item-files .files-sortable input')
})
})
}

View File

@@ -8,7 +8,7 @@ function HistoryListModel(parent) {
// Variables
self.lastUpdate = 0;
self.historyItems = ko.observableArray([])
self.showFailed = ko.observable(false).extend({ persist: 'historyShowFailed' });
self.showFailed = ko.observable(false);
self.isLoading = ko.observable(false).extend({ rateLimit: 100 });
self.searchTerm = ko.observable('').extend({ rateLimit: { timeout: 200, method: "notifyWhenChangesStop" } });
self.paginationLimit = ko.observable(10).extend({ persist: 'historyPaginationLimit' });
@@ -116,15 +116,14 @@ function HistoryListModel(parent) {
self.retryJob = function(form) {
// Adding a extra retry file happens through this special function
var data = new FormData();
data.append("mode", "retry");
data.append("nzbfile", $(form.nzbFile)[0].files[0]);
data.append("value", $('#modal-retry-job input[name="retry_job_id"]').val());
data.append("job", $('#modal-retry-job input[name="retry_job_id"]').val());
data.append("password", $('#retry_job_password').val());
data.append("apikey", apiKey);
// Add
$.ajax({
url: "./api",
url: "./retry_pp",
type: "POST",
cache: false,
processData: false,
@@ -334,10 +333,10 @@ function HistoryModel(parent, data) {
return self.script_line();
});
// Extra history columns
self.showColumn = function(param) {
// Extra history column
self.extraText = ko.pureComputed(function() {
// Picked anything?
switch(param) {
switch(self.parent.parent.extraHistoryColumn()) {
case 'speed':
// Anything to calculate?
if(self.historyStatus.bytes() > 0 && self.historyStatus.download_time() > 0) {
@@ -360,7 +359,7 @@ function HistoryModel(parent, data) {
return self.historyStatus.size();
}
return;
};
})
// Format completion time
self.completedOn = ko.pureComputed(function() {
@@ -422,7 +421,7 @@ function HistoryModel(parent, data) {
// Delete button
self.deleteSlot = function(item, event) {
// Confirm?
if(!self.parent.parent.confirmDeleteHistory() || confirm(glitterTranslate.deleteMsg + ":\n" + item.historyStatus.name() + "\n\n" + glitterTranslate.removeDow1)) {
if(!self.parent.parent.confirmDeleteHistory() || confirm(glitterTranslate.removeDow1)) {
// Are we still processing and it can be stopped?
if(item.processingDownload() == 2) {
callAPI({
@@ -439,10 +438,13 @@ function HistoryModel(parent, data) {
value: self.nzo_id
}).then(function(response) {
if(response.status) {
// Make sure no flickering (if there are more items left) and then remove
self.parent.isLoading(self.parent.totalItems() > 1)
self.parent.historyItems.remove(self);
self.parent.parent.refresh();
// Fade and remove
$(event.currentTarget).parent().parent().fadeOut(fadeOnDeleteDuration, function() {
// Make sure no flickering (if there are more items left) and then remove
self.parent.isLoading(self.parent.totalItems() > 1)
self.parent.historyItems.remove(self);
self.parent.parent.refresh();
})
}
});
}

View File

@@ -15,13 +15,12 @@ function ViewModel() {
self.dateFormat = ko.observable('fromNow').extend({ persist: 'pageDateFormat' });
self.displayTabbed = ko.observable().extend({ persist: 'displayTabbed' });
self.displayCompact = ko.observable(false).extend({ persist: 'displayCompact' });
self.displayFullWidth = ko.observable(false).extend({ persist: 'displayFullWidth' });
self.confirmDeleteQueue = ko.observable(true).extend({ persist: 'confirmDeleteQueue' });
self.confirmDeleteHistory = ko.observable(true).extend({ persist: 'confirmDeleteHistory' });
self.extraQueueColumns = ko.observableArray([]).extend({ persist: 'extraColumns' });
self.extraHistoryColumns = ko.observableArray([]).extend({ persist: 'extraHistoryColumns' });
self.extraQueueColumn = ko.observable('').extend({ persist: 'extraColumn' });
self.extraHistoryColumn = ko.observable('').extend({ persist: 'extraHistoryColumn' });
self.showActiveConnections = ko.observable(false).extend({ persist: 'showActiveConnections' });
self.speedMetrics = { '': "B/s", K: "KB/s", M: "MB/s", G: "GB/s" };
self.speedMetrics = { K: "KB/s", M: "MB/s", G: "GB/s" };
// Set information varibales
self.title = ko.observable();
@@ -55,7 +54,6 @@ function ViewModel() {
self.statusInfo = {};
self.statusInfo.folders = ko.observableArray([]);
self.statusInfo.servers = ko.observableArray([]);
self.statusInfo.active_socks5_proxy = ko.observable();
self.statusInfo.localipv4 = ko.observable();
self.statusInfo.publicipv4 = ko.observable();
self.statusInfo.ipv6 = ko.observable();
@@ -237,12 +235,6 @@ function ViewModel() {
values: sabSpeedHistory
})
// Add option to open the server details tab
$('.sparkline-container').click(function() {
$('a[href="#modal-options"]').trigger('click')
$('a[href="#options_connections"]').trigger('click')
})
} else {
// Update
$('.sparkline').text(self.speedHistory.join(",")).change()
@@ -330,6 +322,47 @@ function ViewModel() {
// Clear previous timeout to prevent double-calls
clearTimeout(self.interval);
/**
Limited refresh
**/
// Only update the title when page not visible
if(!pageIsVisible) {
// Request new title
callSpecialAPI('./queue/', { limit: 1, start: 0 }).done(function(data) {
// Split title & speed
var dataSplit = data.split('|||');
// Maybe the result is actually the login page?
if(dataSplit[0].substring(0, 11) === '<html lang=') {
// Redirect
document.location = document.location
return
}
// Set title
self.title(dataSplit[0]);
// Update sparkline data
if(self.speedHistory.length >= 50) {
// Remove first one
self.speedHistory.shift();
}
// Add
self.speedHistory.push(dataSplit[1]);
// Does it contain 'Paused'? Update icon!
self.downloadsPaused(data.indexOf(glitterTranslate.paused) > -1)
// Force the next full update to be full
self.history.lastUpdate = 0
}).always(self.setNextUpdate)
// Do not continue!
return;
}
/**
Full refresh
**/
// Do requests for full information
// Catch the fail to display message
var queueApi = callAPI({
@@ -516,12 +549,10 @@ function ViewModel() {
});
})
// Clear warnings
// Clear warnings through this special URL..
self.clearWarnings = function() {
callAPI({
mode: "warnings",
name: "clear"
}).done(self.refresh)
// Activate
callSpecialAPI("./status/clearwarnings/").done(self.refresh)
}
// Clear messages
@@ -608,47 +639,55 @@ function ViewModel() {
if(fileName) $('.btn-file em').text(fileName)
}
// Add NZB form
self.addNZB = function(form) {
// From the upload
self.addNZBFromFileForm = function(form) {
// Anything?
if(!$(form.nzbFile)[0].files[0] && !$(form.nzbURL).val()) {
$('.btn-file, input[name="nzbURL"]').attr('style', 'border-color: red !important')
setTimeout(function() { $('.btn-file, input[name="nzbURL"]').css('border-color', '') }, 2000)
if(!$(form.nzbFile)[0].files[0]) {
$('.btn-file').attr('style', 'border-color: red !important')
setTimeout(function() { $('.btn-file').css('border-color', '') }, 2000)
return false;
}
// Upload file using the method we also use for drag-and-drop
if($(form.nzbFile)[0].files[0]) {
self.addNZBFromFile($(form.nzbFile)[0].files);
// Hide modal, upload will reset the form
$("#modal-add-nzb").modal("hide");
} else if($(form.nzbURL).val()) {
// Or add URL
var theCall = {
mode: "addurl",
name: $(form.nzbURL).val(),
nzbname: $('#nzbname').val(),
password: $('#password').val(),
script: $('#modal-add-nzb select[name="Post-processing"]').val(),
priority: $('#modal-add-nzb select[name="Priority"]').val(),
pp: $('#modal-add-nzb select[name="Processing"]').val()
}
// Upload
self.addNZBFromFile($(form.nzbFile)[0].files);
// Optional, otherwise they get mis-labeled if left empty
if($('#modal-add-nzb select[name="Category"]').val() != '*') theCall.cat = $('#modal-add-nzb select[name="Category"]').val()
if($('#modal-add-nzb select[name="Processing"]').val()) theCall.pp = $('#modal-add-nzb select[name="Category"]').val()
// Add
callAPI(theCall).then(function(r) {
// Hide and reset/refresh
self.refresh()
$("#modal-add-nzb").modal("hide");
form.reset()
$('#nzbname').val('')
});
}
// Hide modal, upload will reset the form
$("#modal-add-nzb").modal("hide");
}
// From URL
self.addNZBFromURL = function(form) {
// Anything?
if(!$(form.nzbURL).val()) {
$(form.nzbURL).attr('style', 'border-color: red !important')
setTimeout(function() { $(form.nzbURL).css('border-color', '') }, 2000)
return false;
}
// Build request
var theCall = {
mode: "addurl",
name: $(form.nzbURL).val(),
nzbname: $('#nzbname').val(),
password: $('#password').val(),
script: $('#modal-add-nzb select[name="Post-processing"]').val(),
priority: $('#modal-add-nzb select[name="Priority"]').val(),
pp: $('#modal-add-nzb select[name="Processing"]').val()
}
// Optional, otherwise they get mis-labeled if left empty
if($('#modal-add-nzb select[name="Category"]').val() != '*') theCall.cat = $('#modal-add-nzb select[name="Category"]').val()
if($('#modal-add-nzb select[name="Processing"]').val()) theCall.pp = $('#modal-add-nzb select[name="Category"]').val()
// Add
callAPI(theCall).then(function(r) {
// Hide and reset/refresh
self.refresh()
$("#modal-add-nzb").modal("hide");
form.reset()
$('#nzbname').val('')
});
}
// From the upload or filedrop
self.addNZBFromFile = function(files, fileindex) {
// First file
@@ -695,13 +734,14 @@ function ViewModel() {
// Refresh
self.refresh();
// Hide notification
hideNotification()
hideNotification('.main-notification-box-uploading')
// Reset the form
$('#modal-add-nzb form').trigger('reset');
$('#nzbname').val('')
$('.btn-file em').html(glitterTranslate.chooseFile + '&hellip;')
}
});
}
// Load status info
@@ -709,26 +749,11 @@ function ViewModel() {
// Full refresh? Only on click and for the status-screen
var statusFullRefresh = (event != undefined) && $('#options-status').hasClass('active');
// Measure performance? Takes a while
var statusPerformance = (event != undefined) && $(event.currentTarget).hasClass('diskspeed-button');
// Make it spin if the user requested it otherwise we don't,
// because browsers use a lot of CPU for the animation
if(statusFullRefresh) {
self.hasStatusInfo(false)
}
// Show loading text for performance measures
if(statusPerformance) {
self.hasPerformanceInfo(false)
}
// Make it spin
self.hasStatusInfo(false)
// Load the custom status info
callAPI({
mode: 'status',
calculate_performance: statusPerformance*1,
skip_dashboard: (!statusFullRefresh)*1
}).then(function(data) {
callAPI({ mode: 'fullstatus', skip_dashboard: (!statusFullRefresh)*1 }).then(function(data) {
// Update basic
self.statusInfo.loglevel(data.status.loglevel)
self.statusInfo.folders(data.status.folders)
@@ -743,7 +768,6 @@ function ViewModel() {
self.statusInfo.completedirspeed(data.status.completedirspeed)
self.statusInfo.internetbandwidth(data.status.internetbandwidth)
self.statusInfo.dnslookup(data.status.dnslookup)
self.statusInfo.active_socks5_proxy(data.status.active_socks5_proxy)
self.statusInfo.localipv4(data.status.localipv4)
self.statusInfo.publicipv4(data.status.publicipv4)
self.statusInfo.ipv6(data.status.ipv6 || glitterTranslate.noneText)
@@ -757,11 +781,8 @@ function ViewModel() {
if(self.statusInfo.servers().length == 0) {
self.statusInfo.loglevel.subscribe(function(newValue) {
// Update log-level
callAPI({
mode: "set_config",
section: "logging",
keyword: "log_level",
value: newValue
callSpecialAPI('./status/change_loglevel/', {
loglevel: newValue
});
})
}
@@ -781,8 +802,7 @@ function ViewModel() {
'serveractiveconn': ko.observable(this.serveractiveconn),
'servererror': ko.observable(this.servererror),
'serveractive': ko.observable(this.serveractive),
'serverconnections': ko.observableArray(this.serverconnections),
'serverbps': ko.observable(this.serverbps)
'serverconnections': ko.observableArray(this.serverconnections)
})
})
} else {
@@ -798,8 +818,7 @@ function ViewModel() {
activeServer.serveractiveconn(this.serveractiveconn),
activeServer.servererror(this.servererror),
activeServer.serveractive(this.serveractive),
activeServer.serverconnections(this.serverconnections),
activeServer.serverbps(this.serverbps)
activeServer.serverconnections(this.serverconnections)
})
}
@@ -811,6 +830,16 @@ function ViewModel() {
});
}
// Do a disk-speedtest
self.testDiskSpeed = function(item, event) {
self.hasPerformanceInfo(false)
// Run it and then display it
callSpecialAPI('./status/dashrefresh/').then(function() {
self.loadStatusInfo(true, true)
})
}
// Download a test-NZB
self.testDownload = function(data, event) {
var nzbSize = $(event.target).data('size')
@@ -837,10 +866,8 @@ function ViewModel() {
// Unblock server
self.unblockServer = function(servername) {
callAPI({
mode: "status",
name: "unblock_server",
value: servername
callSpecialAPI("./status/unblock_server/", {
server: servername
}).then(function() {
$("#modal-options").modal("hide");
})
@@ -863,9 +890,10 @@ function ViewModel() {
clearInterval(connectionRefresh)
return
}
// Update the server stats (speed/connections)
self.loadStatusInfo()
// Only when we show them
if(self.showActiveConnections()) {
self.loadStatusInfo()
}
}, self.refreshRate() * 1000)
})
@@ -898,7 +926,7 @@ function ViewModel() {
$('#options-orphans [data-tooltip="true"]').tooltip('hide')
// Show notification on delete
if($(htmlElement.currentTarget).data('action') == 'delete_orphan') {
if($(htmlElement.currentTarget).data('action') == 'delete') {
showNotification('.main-notification-box-removing', 1000)
} else {
// Adding back to queue
@@ -906,15 +934,15 @@ function ViewModel() {
}
// Activate
callAPI({
mode: "status",
name: $(htmlElement.currentTarget).data('action'),
value: $("<div/>").html(folder).text()
callSpecialAPI("./status/" + $(htmlElement.currentTarget).data('action'), {
name: $("<div/>").html(folder).text()
}).then(function() {
// Remove item and load status data
$(htmlElement.currentTarget).parent().parent().fadeOut(fadeOnDeleteDuration)
// Refresh
self.loadStatusInfo(true, true)
// Hide notification
hideNotification()
hideNotification(true)
})
}
@@ -924,12 +952,9 @@ function ViewModel() {
// Show notification
showNotification('.main-notification-box-removing-multiple', 0, self.statusInfo.folders().length)
// Delete them all
callAPI({
mode: "status",
name: "delete_all_orphan"
}).then(function() {
callSpecialAPI("./status/delete_all/").then(function() {
// Remove notifcation and update screen
hideNotification()
hideNotification(true)
self.loadStatusInfo(true, true)
})
}
@@ -941,12 +966,9 @@ function ViewModel() {
// Show notification
showNotification('.main-notification-box-sendback')
// Delete them all
callAPI({
mode: "status",
name: "add_all_orphan"
}).then(function() {
callSpecialAPI("./status/add_all/").then(function() {
// Remove notifcation and update screen
hideNotification()
hideNotification(true)
self.loadStatusInfo(true, true)
})
}
@@ -957,21 +979,11 @@ function ViewModel() {
$('body').toggleClass('container-compact')
})
// Toggle full width
self.displayFullWidth.subscribe(function() {
$('body').toggleClass('container-full-width')
})
// Toggle Glitter's tabbed modus
self.displayTabbed.subscribe(function() {
$('body').toggleClass('container-tabbed')
})
// Change hash for page-reload
$('.history-queue-swicher .nav-tabs a').on('shown.bs.tab', function (e) {
window.location.hash = e.target.hash;
})
/**
SABnzb options
**/
@@ -987,7 +999,7 @@ function ViewModel() {
self.restartSAB = function() {
if(!confirm(glitterTranslate.restart)) return;
// Call restart function
callAPI({ mode: "restart" })
callSpecialAPI("./config/restart/")
// Set counter, we need at least 15 seconds
self.isRestarting(Math.max(1, Math.floor(15 / self.refreshRate())));
@@ -1012,16 +1024,18 @@ function ViewModel() {
if(!confirm(glitterTranslate.repair)) return;
// Hide the modal and show the notifucation
$("#modal-options").modal("hide");
showNotification('.main-notification-box-queue-repair', 5000)
showNotification('.main-notification-box-queue-repair')
// Call the API
callAPI({ mode: "restart_repair" })
callSpecialAPI("./config/repair/").then(function() {
hideNotification(true)
})
}
// Force disconnect
self.forceDisconnect = function() {
// Show notification
showNotification('.main-notification-box-disconnect', 3000)
// Call API
callAPI({ mode: "disconnect" }).then(function() {
callSpecialAPI("./status/disconnect/").then(function() {
$("#modal-options").modal("hide");
})
}
@@ -1035,39 +1049,9 @@ function ViewModel() {
$('body').addClass('container-compact')
}
if(localStorageGetItem('displayFullWidth') === 'true') {
// Add extra class
$('body').addClass('container-full-width')
}
// Tabbed layout?
if(localStorageGetItem('displayTabbed') === 'true') {
$('body').addClass('container-tabbed')
var tab_from_hash = location.hash.replace(/^#/, '');
if (tab_from_hash) {
$('.history-queue-swicher .nav-tabs a[href="#' + tab_from_hash + '"]').tab('show');
}
}
// Save the rest in config if global-settings
var saveInterfaceSettings = function(newValue) {
var interfaceSettings = {
"dateFormat": self.dateFormat,
"extraQueueColumns": self.extraQueueColumns,
"extraHistoryColumns": self.extraHistoryColumns,
"displayCompact": self.displayCompact,
"displayFullWidth": self.displayFullWidth,
"displayTabbed": self.displayTabbed,
"confirmDeleteQueue": self.confirmDeleteQueue,
"confirmDeleteHistory": self.confirmDeleteHistory
};
callAPI({
mode: "set_config",
section: "misc",
keyword: "interface_settings",
value: ko.toJSON(interfaceSettings)
})
}
// Get the speed-limit, refresh rate and server names
@@ -1085,29 +1069,6 @@ function ViewModel() {
// Set queue limit
self.queue.paginationLimit(response.config.misc.queue_limit.toString())
// Import the rest of the settings
if(response.config.misc.interface_settings) {
var interfaceSettings = JSON.parse(response.config.misc.interface_settings);
self.dateFormat(interfaceSettings['dateFormat']);
self.extraQueueColumns(interfaceSettings['extraQueueColumns']);
self.extraHistoryColumns(interfaceSettings['extraHistoryColumns']);
self.displayCompact(interfaceSettings['displayCompact']);
self.displayFullWidth(interfaceSettings['displayFullWidth']);
self.displayTabbed(interfaceSettings['displayTabbed']);
self.confirmDeleteQueue(interfaceSettings['confirmDeleteQueue']);
self.confirmDeleteHistory(interfaceSettings['confirmDeleteHistory']);
}
// Only subscribe now to prevent collisions between localStorage and config settings updates
self.dateFormat.subscribe(saveInterfaceSettings);
self.extraQueueColumns.subscribe(saveInterfaceSettings);
self.extraHistoryColumns.subscribe(saveInterfaceSettings);
self.displayCompact.subscribe(saveInterfaceSettings);
self.displayFullWidth.subscribe(saveInterfaceSettings);
self.displayTabbed.subscribe(saveInterfaceSettings);
self.confirmDeleteQueue.subscribe(saveInterfaceSettings);
self.confirmDeleteHistory.subscribe(saveInterfaceSettings);
}
// Set bandwidth limit
@@ -1117,9 +1078,6 @@ function ViewModel() {
// Save servers (for reporting functionality of OZnzb)
self.servers = response.config.servers;
// Already set if we are using a proxy
if(response.config.misc.socks5_proxy_url) self.statusInfo.active_socks5_proxy(true)
// Update message
if(newRelease) {
self.allMessages.push({
@@ -1235,4 +1193,4 @@ function ViewModel() {
// Activate tooltips
if(!isMobile) $('[data-tooltip="true"]').tooltip({ trigger: 'hover', container: 'body' })
}
}

View File

@@ -34,7 +34,7 @@ function QueueListModel(parent) {
// External var's
self.queueItems = ko.observableArray([]);
self.totalItems = ko.observable(0);
self.isMultiEditing = ko.observable(false).extend({ persist: 'queueIsMultiEditing' });
self.isMultiEditing = ko.observable(false);
self.isLoading = ko.observable(false).extend({ rateLimit: 100 });
self.multiEditItems = ko.observableArray([]);
self.categoriesList = ko.observableArray([]);
@@ -440,11 +440,12 @@ function QueueListModel(parent) {
if(response.status) {
// Make sure the queue doesnt flicker and then fade-out
self.isLoading(true)
$('.delete input:checked').parents('tr').fadeOut(fadeOnDeleteDuration)
self.parent.refresh()
// Empty it
self.multiEditItems.removeAll();
// Hide notification
hideNotification()
hideNotification(true)
}
})
}
@@ -531,10 +532,11 @@ function QueueModel(parent, data) {
return self.name()
})
self.missingText = ko.pureComputed(function() {
// Check for missing data, can show 0 if article-size is smaller than 500K, but we accept that
if(self.missingMB()) {
// Check for missing data, the value is arbitrary! (1%)
if(self.missingMB()/self.totalMB() > 0.01) {
return self.missingMB().toFixed(0) + ' MB ' + glitterTranslate.misingArt
}
return;
})
self.statusText = ko.computed(function() {
// Checking
@@ -565,9 +567,10 @@ function QueueModel(parent, data) {
return 'glyphicon-pause'
})
// Extra queue columns
self.showColumn = function(param) {
switch(param) {
// Extra queue column
self.extraText = ko.pureComputed(function() {
// Picked anything?
switch(self.parent.parent.extraQueueColumn()) {
case 'category':
// Exception for *
if(self.category() == "*")
@@ -587,7 +590,7 @@ function QueueModel(parent, data) {
return self.avg_age();
}
return;
};
})
// Every update
self.updateFromData = function(data) {
@@ -651,9 +654,6 @@ function QueueModel(parent, data) {
// Anything change or empty?
if(!newName || self.name() == newName) return;
// Rename would abort Direct Unpack, so ask if user is sure
if(self.direct_unpack() && !confirm(glitterTranslate.renameAbort)) return;
// Send rename
callAPI({
mode: 'queue',
@@ -726,7 +726,7 @@ function QueueModel(parent, data) {
// Remove 1 download from queue
self.removeDownload = function(item, event) {
// Confirm and remove
if(!self.parent.parent.confirmDeleteQueue() || confirm(glitterTranslate.deleteMsg + ":\n" + item.name() + "\n\n" + glitterTranslate.removeDow1)) {
if(!self.parent.parent.confirmDeleteQueue() || confirm(glitterTranslate.removeDow1)) {
var itemToDelete = this;
// Show notification
@@ -738,13 +738,16 @@ function QueueModel(parent, data) {
del_files: 1,
value: item.id
}).then(function(response) {
// Make sure no flickering (if there are more items left) and then remove
self.parent.isLoading(self.parent.totalItems() > 1)
parent.queueItems.remove(itemToDelete);
parent.multiEditItems.remove(function(inList) { return inList.id == itemToDelete.id; })
self.parent.parent.refresh();
// Hide notifcation
hideNotification()
// Fade and remove
$(event.currentTarget).parent().parent().fadeOut(fadeOnDeleteDuration, function() {
// Make sure no flickering (if there are more items left) and then remove
self.parent.isLoading(self.parent.totalItems() > 1)
parent.queueItems.remove(itemToDelete);
parent.multiEditItems.remove(function(inList) { return inList.id == itemToDelete.id; })
self.parent.parent.refresh();
// Hide notifcation
hideNotification(true)
})
});
}
};

View File

@@ -1 +0,0 @@
@import url('Night.css') screen and (prefers-color-scheme: dark);

View File

@@ -55,10 +55,6 @@ legend,
opacity: 0.7;
}
.form-control[disabled] {
opacity: 0.65;
}
.progress {
background-color: #DADADA;
}
@@ -130,10 +126,6 @@ select.form-control,
.main-content .btn-default,
.modal-body .btn-default,
.modal-footer .btn-default,
.btn-default.disabled:hover,
.btn-default.disabled:active,
.btn-default.disabled:focus,
.form-control[disabled],
#modal-options .options-function-box .input-group-addon {
background-color: #555555;
color: #EBEBEB;
@@ -165,8 +157,6 @@ tbody>tr:last-child td,
input,
input.form-control,
.input-group-addon,
.search-box input:focus,
.search-box input:valid,
select.form-control,
#modal-options .table-server-connections th,
.main-content .btn-default,
@@ -258,13 +248,6 @@ hr {
border-top: none;
}
.form-control:focus,
input[type="submit"]:focus,
button:focus {
box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.3) !important;
outline: initial;
}
/* Placeholders - Will not work if grouped! */
::-webkit-input-placeholder {
color: #EBEBEB !important;

View File

@@ -23,7 +23,6 @@ h2 {
.sparkline-container svg {
margin: 10px 15px 8px;
float: left;
cursor: pointer;
}
.main-navbar .sparkline {
@@ -1736,6 +1735,7 @@ input[name="nzbURL"] {
.container-compact .search-box .form-control {
height: 28px;
}
.container-compact,
.container-compact .dropdown-menu,
.container-compact .btn,
@@ -1761,9 +1761,6 @@ input[name="nzbURL"] {
.container-compact .form-control {
height: 29px;
}
.container-compact .form-control-multiselect {
height: 60px;
}
.container-compact .modal-header {
padding: 5px 12px;
}
@@ -1843,22 +1840,18 @@ input[name="nzbURL"] {
padding-top: 5px;
}
.container-full-width .container {
width: calc(100% - 60px);
}
/***
Dynamic sizing
***/
@media screen and (min-width: 1200px) {
.queue-table .table-header-extra,
.history-table .table-header-extra {
width: 6%;
.queue-table .table-extra-header-visible,
.history-table .table-extra-header-visible {
width: 10%;
}
.queue-table .table-header-progress-smaller,
.history-table .table-header-progress-smaller {
width: 25%;
width: 35%;
}
#options-interface .label {
@@ -1980,45 +1973,6 @@ input[name="nzbURL"] {
}
}
/***
RTL Fixes
***/
html[dir="rtl"] .navbar-nav {
padding-right: 0;
}
html[dir="rtl"] .queue h2,
html[dir="rtl"] .history h2 {
float: right;
}
html[dir="rtl"] .dropdown-menu {
text-align: right;
direction: rtl;
}
html[dir="rtl"] .speedlimit-dropdown,
html[dir="rtl"] .progress-indicator,
html[dir="rtl"] #modal-item-filelist,
html[dir="rtl"] #modal-item-files .modal-title,
html[dir="rtl"] .info-container-box,
html[dir="rtl"] .queue-table,
html[dir="rtl"] .history-table {
direction: ltr;
}
html[dir="rtl"] .search-box a {
right: initial;
left: 8px;
}
html[dir="rtl"] .navbar-logo,
html[dir="rtl"] .info-container,
html[dir="rtl"] .modal-header .close,
html[dir="rtl"] #modal-options .modal-header a {
float: left;
}
/***
Bootstrap overwrites

View File

@@ -0,0 +1 @@
&nbsp;

106
interfaces/Plush/README.txt Normal file
View File

@@ -0,0 +1,106 @@
Plush for SABnzbd 0.6.x | Feb. 21 2010
assembled by pairofdimes - see LICENSE-CC.txt
https://forums.sabnzbd.org contributions welcome
======================
THANKS TO CONTRIBUTORS
Unmentioned imagery provided by: inpheaux, injectx, real_scud, jbw, sbultez, rAf
==============
LIBRARIES USED
jQuery
http://jquery.com
Copyright (c) 2010 John Resig
See LICENSE-MIT & LICENSE-GPL
jQuery UI
http://jqueryui.com/about
Copyright (c) 2010 jQuery UI Team
See LICENSE-MIT & LICENSE-GPL
(includes files in templates/static/stylesheets/jqueryui/*)
Sizzle CSS Selector Engine
http://sizzlejs.com/
Copyright (c) 2010 The Dojo Foundation
See LICENSE-MIT, LICENSE-BSD, & LICENSE-GPL
jQuery ColorBox
http://colorpowered.com/colorbox/
Copyright (c) 2009 Jack Moore
See LICENSE-MIT
jQuery Cookie
http://www.stilbuero.de
Copyright (c) 2006 Klaus Hartl
See LICENSE-MIT & LICENSE-GPL
jQuery hoverIntent
http://cherne.net/brian/resources/jquery.hoverIntent.html
Brian Cherne
See LICENSE-MIT & LICENSE-GPL
jQuery Live Query
http://plugins.jquery.com/project/livequery
Copyright (c) 2007 Brandon Aaron
See LICENSE-MIT & LICENSE-GPL
jQuery Pagination (with modifications from pairofdimes, where noted)
http://plugins.jquery.com/project/pagination
Author: Gabriel Birke, Describe Europe Ltd.
See LICENSE-MIT & LICENSE-GPL
jQuery Superfish
http://users.tpg.com.au/j_birch/plugins/superfish
Copyright (c) 2008 Joel Birch
See LICENSE-MIT & LICENSE-GPL
jQuery Table Drag & Drop
http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin
Copyright (c) 2008 Denis Howlett
See LICENSE-MIT & LICENSE-GPL
WebToolkit
http://www.webtoolkit.info/ajax-file-upload.html
Copyright (c) 2006-2008 www.webtoolkit.info
See LICENSE-GPL3 & LICENSE-WebToolkit
www.AjaxLoad.info generated:
templates/static/images/plush-default/loading-*.gif
Nuvola Icon Set
http://www.icon-king.com/?p=15
Copyright (c) 2003-2004 David Vignoni
See LICENSE-LGPL
The following image is composed of graphics from the Nuvola icon set:
templates/static/stylesheets/colorschemes/gold/images/sprite-config.png
The above image was generated by http://spritegen.website-performance.org/
templates/static/stylesheets/colorschemes/gold/images/colorbox-*.png comes from jQuery ColorBox plugin -- See LICENSE-MIT
========================
SPRITE GENERATION METHOD
There are two sprite images, sprite-config.png and sprite-main.png, which are used to reduce the number of connections when loading Plush. Here is how to go about modifying these as easily as possible. This is oriented for the main sprite, but works the same for the config sprite.
1. Extract images/plush-default-split.tar.gz
2. Pop your new images into /plush-default-split/main/
3. Zip up main/ (not config/)
4. Head on over to http://spritegen.website-performance.org/
5a. Upload the main.zip
5b. Set Horizontal Offset & Vertical Offset to something like 150px (prevents bleeding)
5c. Check "Compress Image with OptiPNG"
5d. Change Class Prefix from "sprite-" to "sprite_"
5e. Click "Create Sprite Image & CSS"
6. You are now provided with an image and CSS
6a. Download the image, rename to sprite-main.png, place in images/plush-default replacing what is there
6b. Copy/paste the generated CSS definitions in the textarea, replace what is in plush-default.css
6c. Change the generated .sprite_topright_queue position: "background-position: right" (instead of 0)
6d. Open queue.tmpl, find <div class="sprite_progress_done", and reset "-1299px" to the new offset (from 6b)
7. Re-archive the split folder, unix command: tar -czf plush-default-split.tar.gz plush-default-split
7a. Make sure to remove any Thumbs.db or .DS_Store files beforehand
8. Of course, test changes

View File

@@ -0,0 +1,18 @@
<OWNER> = Regents of the University of California
<ORGANIZATION> = University of California, Berkeley
<YEAR> = 1998
In the original BSD license, both occurrences of the phrase "COPYRIGHT HOLDERS AND CONTRIBUTORS" in the disclaimer read "REGENTS AND CONTRIBUTORS".
Here is the license template:
Copyright (c) <YEAR>, <OWNER>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,63 @@
http://creativecommons.org/licenses/by/3.0/
http://creativecommons.org/licenses/by/3.0/legalcode
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
1. "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
2. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
3. "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
4. "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
5. "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
6. "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
7. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
8. "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
9. "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
1. to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
2. to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
3. to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
4. to Distribute and Publicly Perform Adaptations.
5.
For the avoidance of doubt:
1. Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
2. Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
3. Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
1. You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested.
2. If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
3. Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
1. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
2. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
1. Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
2. Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
3. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
4. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
5. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
6. The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.

View File

@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -0,0 +1,502 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -0,0 +1,21 @@
The MIT License
Copyright (c) <year> <copyright holders>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,11 @@
The module webtoolkit.aim.js is extracted from this source:
http://www.webtoolkit.info/demo/javascript/aim/webtoolkit.aim.js
The module does not include an explicit license.
In a private communication the author has told us that we can
assume the GPL3 license.
The home of the module is:
http://www.webtoolkit.info/ajax-file-upload.html

View File

@@ -0,0 +1,18 @@
#if $pane=="Main"#
<!-- start Main footer-->
#else if $pane=="Nzo"
<!-- start Nzo footer -->
#else#
<!-- start other footer -->
#if $pane!="Status" and $pane !="RSS"#</div>#end if#
</div>
<div class="clearfix"></div>
</div>
</div>
#end if#
#include $webdir + "/_inc_modals.tmpl"#
</div> <!-- close for the master-width div -->
</body>
</html>

View File

@@ -0,0 +1,124 @@
#if $pane=="Status" or $pane=="Config"#
#set global $path = '../'#
#else if $pane=="Main"#
#set global $path = ''#
#else#
#set global $path = '../../'#
#end if#
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SABnzbd $version</title>
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="${path}rss?mode=history"/>
<link rel="stylesheet" type="text/css" href="${path}static/stylesheets/jqueryui/overcast/jquery-ui-1.8.15.custom.css?$version"/>
<link rel="stylesheet" type="text/css" href="${path}static/stylesheets/rateit/rateit.css"/>
<link rel="shortcut icon" type="image/ico" href="${path}staticcfg/ico/favicon.ico?v=1.1.0"/>
#if $color_scheme#
<link rel="stylesheet" type="text/css" href="${path}static/stylesheets/colorschemes/$color_scheme/${color_scheme}.css?$version"/>
#else#
<link rel="stylesheet" type="text/css" href="${path}static/stylesheets/colorschemes/gold/gold.css?$version"/>
#end if#
<meta name="apple-mobile-web-app-title" content="SABnzbd" />
<link rel="apple-touch-icon" sizes="76x76" href="${path}staticcfg/ico/apple-touch-icon-76x76-precomposed.png" />
<link rel="apple-touch-icon" sizes="120x120" href="${path}staticcfg/ico/apple-touch-icon-120x120-precomposed.png" />
<link rel="apple-touch-icon" sizes="152x152" href="${path}staticcfg/ico/apple-touch-icon-152x152-precomposed.png" />
<link rel="apple-touch-icon" sizes="180x180" href="${path}staticcfg/ico/apple-touch-icon-180x180-precomposed.png" />
<link rel="apple-touch-icon" sizes="192x192" href="${path}staticcfg/ico/android-192x192.png" />
<link rel="mask-icon" href="${path}staticcfg/ico/safari-pinned-tab.svg" color="#383F45">
<script type="text/javascript" src="${path}static/javascripts/lib.js?$version"></script>
#if $pane=="Main"#
<script type="text/javascript" src="${path}static/javascripts/plush.js?$version"></script>
<script type="text/javascript">
jQuery(function($){
$.plush.apikey = "$apikey";
$.plush.Tprev = "$T('Plush-prev')"; // translations for pagination
$.plush.Tnext = "$T('Plush-next')";
$.plush.Tconfirmation = "$T('Plush-confirm')";
$.plush.TconfirmPurgeH = "$T('Plush-confirmPurgeH')";
$.plush.Init(); // Initialize Plush UI
$.plush.Refresh(); // Initiate Plush refresh cycle
});
</script>
#else if $pane=="Nzo"#
<script type="text/javascript" src="${path}static/javascripts/config.js?$version"></script>
<script type="text/javascript">
var config_pane = "NZO"; // re-uses config's js/css
var confirmWithoutSavingPrompt = "$T('Plush-confirmWithoutSavingPrompt')";
</script>
<script type="text/javascript" src="${path}static/javascripts/plush.js?$version"></script>
<script type="text/javascript">
jQuery(function($){
$.plush.apikey = "$apikey";
$.plush.Tprev = "$T('Plush-prev')"; // translations for pagination
$.plush.Tnext = "$T('Plush-next')";
$.plush.Tconfirmation = "$T('Plush-confirm')";
$.plush.TconfirmPurgeH = "$T('Plush-confirmPurgeH')";
$.plush.Init(); // Initialize Plush UI
$.plush.Refresh(); // Initiate Plush refresh cycle
});
</script>
#else#
<script type="text/javascript" src="${path}static/javascripts/config.js?$version"></script>
<script type="text/javascript">
var config_pane = "$pane";
var help_uri = "$help_uri";
var apikey = "$apikey";
var confirmWithoutSavingPrompt = "$T('Plush-confirmWithoutSavingPrompt')";
</script>
#end if#
</head>
<body#if $pane=="Nzo"# class="nzo"#else if $pane!="Main"# class="config_body"#end if#>
<div id="master-width">
<div class="wrapper">
<div id="topmenu_bar" style="display:none">
<div class="navigation">
<ul class="menu" id="navigation_menu_right">
#if $pane=="Main"#
<li class="first"><a href="#" id="add_nzb"><span class="icon_nav_addnzb">$T('Plush-addnzb')</span></a></li>
<li><a href="#" id="manual_refresh_wrapper"><span class="icon_nav_refresh">$T('Plush-button-refresh')</span></a></li>
<li><a href="#" id="plush_options"><span class="icon_nav_options">$T('Plush-options')</span></a></li>
<li class="last"><a href="#" id="help" target="_blank"><span class="icon_nav_help">$T('menu-help').capitalize()</span></a></li>
#else#
<li class="first last"><a href="#" id="help" target="_blank"><span class="icon_nav_help">$T('menu-help').capitalize()</span></a></li>
#end if#
</ul>
<ul class="menu" id="navigation_menu_left">
<li#if $pane=="Main"# class="active first"#else# class="first"#end if#><a href="${path}"><span class="icon_nav_download">#include $webdir + "/../../Config/templates/staticcfg/images/logo-arrow.svg"# $T('Plush-downloads').capitalize()</span></a></li>
<li#if $pane=="Status"# class="active"#end if#><a href="${path}status/"><span class="icon_nav_connections">$T('menu-cons').capitalize()</span></a></li>
<li#if $pane=="RSS"# class="active"#end if#><a href="${path}config/rss/"><span class="icon_nav_rss">$T('rss').upper()</span></a></li>
<li#if $pane!="RSS" and $pane!="Nzo" and ($pane=="Config" or $path=='../../')# class="active last"#else# class="last"#end if#><a href="${path}config/"><span class="icon_nav_config">$T('menu-config').capitalize()</span></a></li>
</ul>
</div>
<div id="nav_text_right">
#if $loadavg#$T('ft-sysload'):&nbsp;<span id="loadavg">$loadavg</span>#end if#
</div>
<div id="nav_text_left">
<span id="warning_box"><b><a href="${path}status/#tabs-warnings" id="last_warning"><span id="have_warnings">$have_warnings</span> $T('warnings')</a></b></span>
#if $pane=="Main"#
#if $new_release#&sdot; <a href="$new_rel_url" id="new_release" target="_blank">$T('Plush-updateAvailable').replace(' ','&nbsp;')</a>#end if#
This skin is no longer actively maintained! <a href="${path}config/general/#web_dir"><strong>We recommend using the Glitter skin.</strong></a>
#end if#
</div>
</div>
</div>
<noscript><h1 align="center">$T('Plush-enableJavascript')</h1></noscript>
#if $pane=="Main"#
#else if $pane=="Nzo"#
#else if $pane=="Status" or $pane =="RSS"#
<div id="config_container" class="config_margin_status lang-$active_lang">
<div id="config_content">
#else#
<div id="config_container" class="config_margin">
<div id="config_content">
<div id="config">
<div id="config-content" class="clearfix">
#end if#

View File

@@ -0,0 +1,217 @@
<script type="text/javascript">
function expired_host_changed(self) {
var host = document.getElementsByName('expired_host')[0];
host.value = self.value;
host.readOnly = self.value.length > 0;
}
function flag_modal_submit(self) {
var radios = document.getElementsByName('rating_flag');
for (var i = 0; i < radios.length; i++) {
if (radios[i].checked) {
document.getElementById('noopt').setAttribute('style', 'display:none;size:1');
document.getElementById('submitbtn').click();
return;
}
}
document.getElementById('noopt').removeAttribute('style');
}
</script>
<!-- modals -->
<div style='display:none'>
<div id="help_modal">
<table>
<tr><td><strong>$T('menu-wiki'):</strong></td><td><a href="$helpuri$help_uri" target="_blank">$helpuri$help_uri</a></td></tr>
<tr><td><strong>$T('menu-forums'):</strong></td><td><a href="https://forums.sabnzbd.org/" target="_blank">https://forums.sabnzbd.org/</a></td></tr>
<tr><td><strong>$T('menu-irc'):</strong></td><td><a href="https://sabnzbd.org/live-chat.html" target="_blank">https://sabnzbd.org/live-chat.html</a></td></tr>
</table>
<div class="sabnzbd_logo main_sprite_container sprite_sabnzbdplus_logo"></div>
<p><strong>SABnzbd $T('version'):</strong> $version</p>
<p><small>Copyright (C) 2008-2020 The SABnzbd Team &lt;team@sabnzbd.org&gt;</small></p>
<p><small>$T('yourRights')</small></p>
</div>
<div id="plush_options_modal">
<p><a href="status/disconnect?apikey=$apikey" class="juiButton">$T('link-forceDisc')</a></p>
<p><a href="config/restart?apikey=$apikey" class="juiButton" id="sabnzbd_restart" rel="#echo $T('explain-Restart').replace("<br />","\n")#">$T('sch-restart')</a>
<a href="shutdown?apikey=$apikey&amp;pid=$pid" class="juiButton" id="sabnzbd_shutdown" rel="$T('shutdownOK?')">$T('sch-shutdown')</a></p>
<br/>
$T('Plush-refreshRate'):
<select id="refreshRate-option">
<option value="1">1 $T('second')</option>
<option value="2">2 $T('second')</option>
<option value="4">4 $T('second')</option>
<option value="8">8 $T('second')</option>
<option value="16">16 $T('second')</option>
<option value="30">30 $T('second')</option>
<option value="60">1 $T('minute')</option>
<option value="120">2 $T('minute')</option>
<option value="900">15 $T('minute')</option>
<option value="1800">30 $T('minute')</option>
<option value="0">$T('Plush-disabled')</option>
</select><br/><br/>
$T('Plush-containerWidth'):
<select id="containerWidth-option">
<option value="100%">100%</option>
<option value="90%">90%</option>
<option value="80%">80%</option>
<option value="70%">70%</option>
<option value="60%">60%</option>
<option value="50%">50%</option>
<option value="40%">40%</option>
</select><br/><br/>
<!-- <input type="checkbox" id="confirmDeleteQueue" checked="checked" /> $T("Plush-confirmDeleteQueue")<br/><br/>
<input type="checkbox" id="confirmDeleteHistory" checked="checked" /> $T("Plush-confirmDeleteHistory")<br/><br/> -->
<span id="explain-blockRefresh" title="$T("Plush-explain-blockRefresh")"><input type="checkbox" id="blockRefresh" checked="checked" /> $T("Plush-blockRefresh")</span>
</div>
#if $pane=="Main"#
<div id="add_nzb_modal">
<input type="text" id="addID_input" size="31" />
<input type="submit" id="addID" value="$T('Plush-fetch')" class="juiButton" />
<div id="add_nzb_hr"><hr></div>
<form action="api" id="uploadNZBForm" method="post" enctype="multipart/form-data">
<input type="hidden" name="apikey" value="$apikey" />
<input type="hidden" name="mode" value="addfile" />
<input type="file" id="uploadNZBFile" name="name" size="12" style="width:180px;" />
<input type="submit" value="$T('Plush-upload')" class="juiButton" />
<span id="uploadingSpinner" class="loading" style="display:none">&nbsp;</span>
<br/><i>$T('Plush-uploadTip')</i>
<div id="add_nzb_hr"><hr></div>
<i>$T('pp'):</i>
<table id="add_nzb_pp">
#if $categories#
<tr><td style="text-align:right">$T('category'):</td>
<td><select id="addID_cat" name="cat">
#for $ct in $categories#
<option value="$ct">$Tspec($ct)</option>
#end for#
</select>
</td></tr>
#end if#
<tr><td style="text-align:right">$T('priority'):</td>
<td><select id="addID_priority" name="priority">
<option value="-100" selected="selected">$T('default')</option>
<option value="2">$T('pr-force')</option>
<option value="1">$T('pr-high')</option>
<option value="0">$T('pr-normal')</option>
<option value="-1">$T('pr-low')</option>
</select>
</td></tr>
<tr><td style="text-align:right">$T('pp'):</td>
<td><select id="addID_pp" name="pp">
<option value="-1">$T('default')</option>
<option value="0">$T('pp-none')</option>
<option value="1">$T('pp-repair')</option>
<option value="2">$T('pp-unpack')</option>
<option value="3">$T('pp-delete')</option>
</select>
</td></tr>
#if $scripts#
<tr><td style="text-align:right">$T('script'):</td>
<td><select id="addID_script" name="script">
#for $sc in $scripts#
<option value="$sc">$Tspec($sc)</option>
#end for#
</select>
</td></tr>
#end if#
</table>
<div id="add_nzb_hr"><hr></div>
<i>$T('Plush-addnzb-filename'):</i><br/>
<input type="text" name="nzbname" id="addID_nzbname" size="38" />
</form>
</div>
<div id="queue_purge_modal" class="center">
<br/><br/><strong>$T('purgeQueue')</strong>
<br/><br/><input type="submit" name="all" value="$T('purgeNZBs')" class="juiButton" />
<br/><br/><input type="submit" name="delete" value="$T('purgeNZBs-Files')" class="juiButton" />
</div>
<div id="queue_retry_modal" class="center">
<br/><br/><strong>$T('retryQueue')</strong>
<br/><br/><input type="submit" name="all" value="$T('retryNZBs')" class="juiButton" />
</div>
<div id="history_purge_modal" class="center">
<br/><br/><strong>$T('purgeHist')</strong>
<!--<br/><br/><input type="submit" name="all" value="Purge All NZBs" class="juiButton" />-->
<br/><br/><input type="submit" name="failed" value="$T('purgeFailed')" class="juiButton" />
<br/><br/><input type="submit" name="delete" value="$T('purgeFailed-Files')" class="juiButton" />
<br/><br/><input type="submit" name="completed" value="$T('purgeCompl')" class="juiButton" />
</div>
<div id="retry_modal">
<form action="history/retry_pp" method="post" enctype="multipart/form-data">
<input type="hidden" id="retry_modal_job" name="job" />
<input type="hidden" name="apikey" value="$apikey" />
<br/><p><strong id="retry_modal_title">title</strong></p>
<br/><p>$T('opt-extra-NZB'):<br/><input type="file" name="nzbfile" /></p>
<br/><p>$T('srv-password'):<br/><input type="text" name="password" /></p>
<br/><p><input type="submit" value="$T('button-retry')" class="juiButton" /></p>
</form>
</div>
<div id="delete_nzb_modal" class="center">
<input type="hidden" id="delete_nzb_modal_job" />
<input type="hidden" id="delete_nzb_modal_mode" />
<br/><br/><strong id="delete_nzb_modal_title">title</strong><br/><br/>
<input type="submit" id="delete_nzb_modal_remove_nzb" value="$T('removeNZB')" class="juiButton" />
<input type="submit" id="delete_nzb_modal_remove_files" value="$T('removeNZB-Files')" class="juiButton" />
</div>
<div id="flag_modal">
<input type="hidden" id="flag_modal_job" />
<div class="rating_flag_radio"><input type="radio" name="rating_flag" value="spam">&nbsp;$T('spam')</div>
<div class="rating_flag_radio"><input type="radio" name="rating_flag" value="encrypted">&nbsp;$T('encrypted')</div>
<div class="rating_flag_radio">
<input type="radio" name="rating_flag" value="expired">&nbsp;$T('expired')
<div class="rating_modal_extra">
<div class="rating_modal_expired">$T('host')&nbsp;&nbsp;<input type="text" name="expired_host" value="www.altopia.com" readonly></div>
<select name="common_host" onchange="expired_host_changed(this)">
<option value='www.altopia.com' selected>Altopia</option>
<option value='www.astraweb.com'>Astraweb</option>
<option value='www.euroaccess.ln'>EuroAccess</option>
<option value='www.forteinc.com'>Forte Agent</option>
<option value='www.giganews.com'>Giganews</option>
<option value='www.highwinds.com'>Highwinds</option>
<option value='www.newsdemon.com'>Newsdemon</option>
<option value='www.newsgroupdirect.com'>NewsGroupDirect</option>
<option value='www.newshosting.com'>NewsHosting</option>
<option value='www.readnews.com'>Readnews</option>
<option value='www.supernews.com'>SuperNews</option>
<option value='www.thundernews.com'>ThunderNews</option>
<option value='www.tweaknews.eu'>Tweaknews</option>
<option value='www.usenetserver.com'>UsenetServer</option>
<option value='www.xentech.net'>XenTech</option>
<option value='www.xsnews.nl'>XSnews</option>
<option value=''>$T('other')</option>
</select>
</div>
</div>
<div class="rating_flag_radio">
<input type="radio" name="rating_flag" value="other">&nbsp;$T('otherProblem')
<div class="rating_modal_extra"><input style="width:99%" type="text" name="other"></div>
</div>
<div class="rating_flag_radio">
<input type="radio" name="rating_flag" value="comment">&nbsp;$T('comment')
<div class="rating_modal_extra"><input style="width:99%" type="text" name="comment"></div>
</div>
<br/>
<div class="center">
<input id="submitbtn" type="submit" style="display:none;size:1"/>
<input value="Send" class="juiButton" onclick="flag_modal_submit(this)"/>
<label id="noopt" class="rating_modal_noopt" style="display:none;size:1">No option selected</label>
</div>
</div>
#end if#
</div>

View File

@@ -0,0 +1,153 @@
<% import datetime %>
<% from sabnzbd.misc import time_format %>
<script type="text/javascript">
if (typeof( jQuery ) == 'undefined')
window.location = "../"; // redirect to main on direct template hit
jQuery(function($) {
$.plush.histnoofslots = $noofslots;
<!--#if $loadavg#-->
$.plush.SetLoadavg("$loadavg");
<!--#end if#-->
$.plush.SetHistoryStats("<!--#if $day_size#-->&nbsp;&nbsp;&nbsp;&nbsp;<strong>$day_size</strong>&nbsp;$T('today')<!--#end if #--><!--#if $week_size#-->&nbsp;&nbsp;&nbsp;&nbsp;<strong>$week_size</strong>&nbsp;$T('thisWeek')<!--#end if #--><!--#if $month_size#-->&nbsp;&nbsp;&nbsp;&nbsp;<strong>$month_size</strong>&nbsp;$T('thisMonth')<!--#end if #--><!--#if $total_size#-->&nbsp;&nbsp;&nbsp;&nbsp;<strong>$total_size</strong>&nbsp;$T('total')<!--#end if #-->");
});
</script>
<!--#if $limit > 1 or $search#-->
<table class="queueTable" id="historyTable" cellspacing="0">
<!--#set $cur = 0#-->
<!--#for $line in $lines #-->
<!--#set $cur = $cur + 1#-->
<tr id="$line.nzo_id" class="<!--#if $cur%2#-->alt<!--#end if#--> <!--#if $line.action_line #-->active<!--#end if#-->">
<td class="nzb_status_col">
&nbsp;<div class="nzb_status <!--#if $line.action_line or $line.status=="Queued"#-->Loaded<!--#else if $line.status=="Failed"#-->main_sprite_container sprite_hv_error<!--#else#-->main_sprite_container sprite_hv_star<!--#end if#-->">&nbsp;</div>
</td>
<td class="historyTitle" <!--#if $rating_enable#-->style="width:35%"<!--#end if#-->>
<a href="scriptlog?name=$line.nzo_id" class="modal-detail" rel="details">$line.name</a>
<div style="display:none">
<div id="details-$line.nzo_id">
<table width="100%" class="rssTable">
<% compl = datetime.datetime.fromtimestamp(float(line['completed'])).strftime(time_format('%Y-%m-%d %H:%M:%S')) %>
<tr><td><strong>$T('completed')</strong></td><td>$compl</td></tr>
<tr class="odd"><td><strong>$T('name')</strong></td><td>$line.name<!--#if $line.action_line#--> - $line.action_line<!--#else if $line.fail_message#--> - <span class="fail_message">$line.fail_message</span><!--#end if#--></td></tr>
<tr><td><strong>$T('size')</strong></td><td>$line.size</td></tr>
<tr class="odd"><td><strong>$T('status')</strong></td><td>$T('post-'+$line.status)</td></tr>
<!--#set $oddLine = not False#-->
<!--#if $line.category#-->
<!--#set $oddLine = not $oddLine#-->
<tr <!--#if $oddLine#-->class="odd"<!--#end if#-->><td><b>$T('category')</b></td><td>$line.category</td></tr>
<!--#end if#-->
<!--#if $line.storage#-->
<!--#set $oddLine = not $oddLine#-->
<tr <!--#if $oddLine#-->class="odd"<!--#end if#-->><td><b>$T('msg-path')</b></td><td>$line.storage</td></tr>
<!--#end if#-->
<!--#for $stage in $line.stage_log#-->
<!--#set $oddLine = not $oddLine#-->
<tr <!--#if $oddLine#-->class="odd"<!--#end if#-->><td><b>$T('stage-'+$stage.name.title.lower())</b></td><td>
<!--#for $action in $stage.actions#-->
$action<br/>
<!--#end for#-->
</td></tr>
<!--#end for#-->
</table>
</div>
</div>
</td>
<td>
<!--#if $line.url_info #-->
<a href="$line.url_info" target="_blank">
<div class="icon_history_verbose main_sprite_container sprite_hv_star pointer" title="$T('Plush-openInfoURL')<br><br>$line.url_info">&nbsp;</div>
</a>
<!--#end if#-->
<!--#if $line.size or $line.category or $line.path or $line.storage#-->
<div class="icon_history_verbose main_sprite_container sprite_hv_stats" title='<!--#if $line.size#-->$T('size'): $line.size<!--#end if#--><!--#if $line.category#--><br>$T('category'): $line.category<!--#end if#-->'>&nbsp;</div>
<!--#else#-->
<div class="icon_history_verbose main_sprite_container sprite_hv_stats hvFaded">&nbsp;</div>
<!--#end if#-->
<!--#for $stage in $line.stage_log#-->
<!--#if $stage.name.lower() == "script"#-->
<a href="scriptlog?name=$line.nzo_id" class="modal" rel="scriptlog">
<div class="icon_history_verbose main_sprite_container sprite_hv_$stage.name.lower() pointer" title='$T('Plush-viewScriptLog')'>&nbsp;</div>
</a>
<!--#if not $line.action_line#-->
<!--#for $action in $stage.actions#-->
<h3 class="hvMessageScript"><!--#echo $action.replace("'","&rsquo;").replace("<a href","<a class='modal' rel='scriptlog2' href") #--></h3>
<!--#end for#-->
<!--#end if#-->
<!--#else#-->
<!--#if $stage.name != "Source" and $stage.name != "Servers"#-->
<div class="icon_history_verbose main_sprite_container sprite_hv_$stage.name.lower()" title='<!--#for $action in $stage.actions#--><!--#echo $action.replace("'","&rsquo;") #--><br><!--#end for#-->'>&nbsp;</div>
<!--#end if#-->
<!--#end if#-->
<!--#end for#-->
<!--#if $line.retry#-->
<form action="history/retry_pp" method="post" enctype="multipart/form-data">
<input type="hidden" value="$line.nzo_id" name="job" />
<input type="hidden" name="apikey" value="$apikey" />
&nbsp;<a href="#" class="retry-nzbfile">$T('button-retry')</a>
</form>
<!--#end if#-->
<!--#if $line.action_line#-->
<h3 class="hvMessageAction">&raquo;&nbsp;$line.action_line&nbsp;</h3>
<!--#end if#-->
<!--#if $line.fail_message#-->
<h3 class="hvMessageFail">&raquo;&nbsp;$line.fail_message&nbsp;</h3>
<!--#end if#-->
</td>
<!--#if $rating_enable#-->
<!--#if $line.has_rating#-->
<td>
<div class="rating_stars_block_r">
<div class="rating_stars">
<div class="rating_icon_vision"></div><span class="avg_rate" value="$line.rating_avg_video"></span>
<input class="user_combo" type="hidden" value="$line.rating_user_video">
<select class="user_combo video" style="background:transparent">
<!--#if not $line.rating_user_video#--><option>-</option><!--#end if#-->
<!--#for $val in $range(1, 11)#--><option>$val</option><!--#end for#-->
</select>
</div>
<div class="rating_stars">
<div class="rating_icon_sound"></div><span class="avg_rate" value="$line.rating_avg_audio"></span>
<input class="user_combo" type="hidden" value="$line.rating_user_audio">
<select class="user_combo audio" style="background:transparent">
<!--#if not $line.rating_user_audio#--><option>-</option><!--#end if#-->
<!--#for $val in $range(1, 11)#--><option>$val</option><!--#end for#-->
</select>
</div>
</div>
</td>
<td>
<div class="rating_vote_block">
<div class="rating_icon_thumbup user_vote up"></div>
<!--#if $line.rating_user_vote==1#--><b><!--#end if#-->$line.rating_avg_vote_up<!--#if $line.rating_user_vote==1#--></b><!--#end if#-->
<div class="rating_icon_thumbdown user_vote down"></div>
<!--#if $line.rating_user_vote==2#--><b><!--#end if#-->$line.rating_avg_vote_down<!--#if $line.rating_user_vote==2#--></b><!--#end if#-->
</div>
<div class="rating_flag">
<a href="#" class="show_flags">$T('report')</a>
</div>
</td>
<!--#else#-->
<td></td><td></td>
<!--#end if#-->
<!--#end if#-->
<td class="options nowrap">
<!--#if not $line.loaded#-->
<% d = datetime.datetime.fromtimestamp(float(line['completed'])) %>
<small class="history_added">$d</small>
<div class="main_sprite_container icon_nzb_remove" title="$T('nzo-delete')">&nbsp;</div>
<!--#end if#-->
</td>
</tr>
<!--#end for#-->
</table>
<!--#end if#-->

View File

@@ -0,0 +1,241 @@
<!--#set global $pane="Main"#-->
<!--#set global $help_uri=""#-->
<!--#include $webdir + "/_inc_header.tmpl"#-->
<div id="page-wrap" class="tiley_sprite_container sprite_tile_queue_wrap">
<div id="hdr-queue" class="tilex_sprite_container sprite_tile_qh">
<div class="logo main_sprite_container sprite_topleft_queue"><h1><!--#if $active_lang in ('de', 'fr') then $T('menu-queue') else $T('menu-queue').upper()#--></h1></div>
<form id="queueSearchForm" action="#"><input id="queueSearchBox" type="text" size="8" class="listSearchBox main_sprite_container sprite_h_search" /></form>
<div class="queue-buttons queue-buttons-pause lang-$active_lang main_sprite_container sprite_topright_queue">
<ul>
<li class="main_sprite_container <!--#if $paused then 'sprite_q_pause_on' else 'sprite_q_pause'#-->" title="$T('link-pause') &frasl; $T('link-resume')" id="pause_resume"></li>
<li class="main_sprite_container sprite_q_menu_pausefor">
<a href="#"></a>
<ul id="set_pause_list">
<li><a href="javascript:void(0)" class="set_pause pointer" rel="5">$T('Plush-pause5m')</a></li>
<li><a href="javascript:void(0)" class="set_pause pointer" rel="15">$T('Plush-pause15m')</a></li>
<li><a href="javascript:void(0)" class="set_pause pointer" rel="30">$T('Plush-pause30m')</a></li>
<li><a href="javascript:void(0)" class="set_pause pointer" rel="60">$T('Plush-pause1h')</a></li>
<li><a href="javascript:void(0)" class="set_pause pointer" rel="180">$T('Plush-pause3h')</a></li>
<li><a href="javascript:void(0)" class="set_pause pointer" rel="360">$T('Plush-pause6h')</a></li>
<li><a href="javascript:void(0)" class="set_pause pointer" rel="custom" id="pauseForPrompt" title="$T('Plush-pauseForPrompt')">$T('Plush-pauseFor')</a></li>
</ul>
</li>
<li id="pause_int"></li>
<li class="main_sprite_container sprite_q_queue">
<a class="sf-with-ul">$T('menu-queue')</a>
<ul>
<!--#if $have_logout#--><li><a href="login?logout=1">$T('logout')</a></li><!--#end if#-->
<!--#if $have_quota#--><li><a id="reset_quota_now" class="pointer">$T('link-resetQuota')</a></li><!--#end if#-->
<!--#if $have_rss_defined#--><li><a id="get_rss_now" class="pointer">$T('button-rssNow')</a></li><!--#end if#-->
<!--#if $have_watched_dir#--><li><a id="get_watched_now" class="pointer">$T('sch-scan_folder')</a></li><!--#end if#-->
<!--#if $pp_pause_event#--><li><a id="resume_pp" class="pointer">$T('sch-resume_post')</a></li><!--#end if#-->
<li><a id="topmenu_toggle" class="pointer">$T('Plush-topMenu')</a></li>
<li><a id="multiops_toggle" class="pointer">$T('Plush-multiOperations')</a></li>
<li>
<a class="sf-with-ul">$T('Plush-onQueueFinish'):
<br/>
<select id="onQueueFinish-option">
<option value=""></option>
<optgroup label="$T('eoq-actions')">
<option value="shutdown_program" <!--#if $finishaction == 'shutdown_program' then 'selected' else ''#-->>$T('shutdownSab')</option>
<!--#if $power_options#-->
<option value="shutdown_pc" <!--#if $finishaction == 'shutdown_pc' then 'selected' else ''#-->>$T('shutdownPc')</option>
<option value="standby_pc" <!--#if $finishaction == 'standby_pc' then 'selected' else ''#-->>$T('standbyPc')</option>
<option value="hibernate_pc" <!--#if $finishaction == 'hibernate_pc' then 'selected' else ''#-->>$T('hibernatePc')</option>
<!--#end if#-->
</optgroup>
<!--#if $scripts#-->
<optgroup label="$T('eoq-scripts')">
<!--#for $sc in $scripts#-->
<!--#if $sc != 'None'#-->
<option value="script_$sc" <!--#if $finishaction == 'script_'+$sc then 'selected' else ''#-->>$sc</option>
<!--#end if#-->
<!--#end for#-->
</optgroup>
<!--#end if#-->
</select>
</a>
</li>
<li><a id="queue_purge" class="pointer" rel="$T('Plush-confirmPurgeQ')">$T('Plush-purge')</a></li>
<li><a id="queue_retry" class="pointer" rel="$T('Plush-confirmRetryQ')">$T('link-retryAll')</a></li>
<li>
<a class="sf-with-ul">$T('Plush-sort')</a>
<ul id="queue_sort_list">
<li class="queue_sort pointer" id="sortAgeAsc"><a>$T('Plush-sortAgeAsc')</a></li>
<li class="queue_sort pointer" id="sortAgeDesc"><a>$T('Plush-sortAgeDesc')</a></li>
<li class="queue_sort pointer" id="sortNameAsc"><a>$T('Plush-sortNameAsc')</a></li>
<li class="queue_sort pointer" id="sortNameDesc"><a>$T('Plush-sortNameDesc')</a></li>
<li class="queue_sort pointer" id="sortSizeAsc"><a>$T('Plush-sortSizeAsc')</a></li>
<li class="queue_sort pointer" id="sortSizeDesc"><a>$T('Plush-sortSizeDesc')</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="centerpiece">
<div class="main_sprite_container sprite_rounded_area_bg" id="time-left"><p><span id="stats_eta">&sdot;</span>&nbsp;$T('Plush-left')</p></div>
<div class="sabnzbd_logo main_sprite_container"><!--#include $webdir + "/../../Config/templates/staticcfg/images/logo-full.svg"#--></div>
<div class="main_sprite_container sprite_rounded_area_bg_edged" id="speed"><p><span id="stats_speed">&sdot;</span></p></div>
<div class="queue-buttons" id="speed-wrapper">
<ul>
<li class="main_sprite_container sprite_q_menu_pausefor">
<ul>
<li>
$T('Plush-maxSpeed'):&nbsp;&nbsp;
<input type="text" id="maxSpeed-option" size="4" />
<select id="maxSpeed-label">
<option value="%">%</option>
<option value="K">KB/s</option>
<option value="M">MB/s</option>
</select>
</li>
<li>
<input type="button" value="$T('Plush-reset')" id="maxSpeed-disable" />
<input type="button" value="$T('button-save')" id="maxSpeed-enable" />
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="queue-wrap" class="tiley_sprite_container sprite_tile_page_wrap">
<div class="box_banner_hr main_sprite_container sprite_tile_qh_seperator"></div>
<!-- multi-operations for queue processing -->
<div id="multiops_bar" class="tilex_sprite_container sprite_tile_qhistory" style="display:none">
<div id="multiops_inputs">
<div class="left">
<div id="multiops_title">$T('Plush-multiOperations')</div>
</div>
<div class="right">
<input type="button" id="multi_reset" value="$T('Plush-reset')" />
<input type="button" id="multi_apply" value="$T('Plush-applySelected')" />
</div>
<br class="clear"/>
<div class="left">
$T('nzo-selection'):&nbsp;
<a id="multiops_select_all">$T('nzo-all').capitalize()</a> &sdot;
<a id="multiops_select_range">$T('Plush-nzo-range').capitalize()</a> &sdot;
<a id="multiops_select_invert">$T('nzo-invert').capitalize()</a> &sdot;
<a id="multiops_select_none">$T('nzo-none').capitalize()</a>
</div>
<div class="right">
<select id="multi_status"><optgroup label="$T('status')">
<option value="">$T('status')</option>
<option value="pause">$T('sch-pause')</option>
<option value="resume">$T('sch-resume')</option>
</optgroup></select>
<!--#if $categories#-->
<select id="multi_cat"><optgroup label="$T('category')">
<option value="">$T('category')</option>
<!--#for $ct in $categories#-->
<option value="$ct">$Tspec($ct)</option>
<!--#end for#-->
</optgroup></select>
<!--#end if#-->
<select id="multi_priority"><optgroup label="$T('priority')">
<option value="">$T('priority')</option>
<option value="2">$T('pr-force')</option>
<option value="1">$T('pr-high')</option>
<option value="0">$T('pr-normal')</option>
<option value="-1">$T('pr-low')</option>
</optgroup></select>
<select id="multi_pp"><optgroup label="$T('pp')">
<option value="">$T('pp')</option>
<option value="0">$T('pp-none')</option>
<option value="1">$T('pp-repair')</option>
<option value="2">$T('pp-unpack')</option>
<option value="3">$T('pp-delete')</option>
</optgroup></select>
<!--#if $scripts#-->
<select id="multi_script"><optgroup label="$T('script')">
<option value="">$T('script')</option>
<!--#for $sc in $scripts#-->
<!--#if $sc != "Default"#--><option value="$sc">$Tspec($sc)</option><!--#end if#-->
<!--#end for#-->
</optgroup></select>
<!--#end if#-->
<div id="multi_delete" class="main_sprite_container icon_nzb_remove sprite_ql_cross_on" title="$T('nzo-delete')">&nbsp;</div>
</div>
</div>
</div>
<!-- Queue ( queue.tmpl )-->
<div id="queue"></div>
<div class="box_fatbottom tilex_sprite_container sprite_tile_qh_bottom" id="box_fatbottom_queue">
<div class="right_stats nowrap" id="queue_stats"></div>
<div class="left_stats">
<select id="queue-pagination-perpage" class="pagination-perpage">
<option value="5">5 / $T('Plush-page')</option>
<option value="10">10 / $T('Plush-page')</option>
<option value="20">20 / $T('Plush-page')</option>
<option value="30">30 / $T('Plush-page')</option>
<option value="40">40 / $T('Plush-page')</option>
<option value="50">50 / $T('Plush-page')</option>
<option value="9999999">$T('Plush-everything')</option>
</select>
<div class="initial-loading">&nbsp;</div>
<div id="queue-pagination" class="pagination"></div>
</div>
</div>
<!-- History Menu/Banner -->
<div id="hdr-history" class="box_banner_history tilex_sprite_container sprite_tile_qhistory">
<h1><!--#if $active_lang in ('de', 'fr') then $T('menu-history') else $T('menu-history').upper()#--> </h1>
<div class="box_banner_r">
<ul class="box_banner_menu">
<li class="main_sprite_container sprite_h_purge show" id="hist_purge" title="$T('purgeHist')"></li>
<li><select id="failed_only" style="margin-top:8px;">
<option value="0">$T('showAllHis')</option>
<option value="1">$T('showFailedHis')</option>
</select></li>
<li><form id="historySearchForm" action="#"><input id="historySearchBox" type="text" size="8" class="listSearchBox main_sprite_container sprite_h_search" /></form></li>
</ul>
</div>
</div>
<div class="box_banner_hr main_sprite_container sprite_tile_qh_seperator"></div>
<!-- History ( history.tmpl ) -->
<div id="history"></div>
<div class="box_fatbottom history_stats tilex_sprite_container sprite_tile_qh_bottom">
<div class="right_stats nowrap" id="history_stats"></div>
<div class="left_stats">
<select id="history-pagination-perpage" class="pagination-perpage">
<option value="5">5 / $T('Plush-page')</option>
<option value="10">10 / $T('Plush-page')</option>
<option value="20">20 / $T('Plush-page')</option>
<option value="30">30 / $T('Plush-page')</option>
<option value="40">40 / $T('Plush-page')</option>
<option value="50">50 / $T('Plush-page')</option>
<option value="9999999">$T('Plush-everything')</option>
<option value="1">$T('Plush-disabled')</option>
</select>
<div class="initial-loading">&nbsp;</div>
<div id="history-pagination" class="pagination"></div>
</div>
<div class="plush_wrapper"><div class="main_sprite_container sprite_sabnzbdplus_plush">&nbsp;</div></div>
</div>
</div>
<div id="btm-wrapper" class="tilex_sprite_container sprite_tile_bottom_wrap">
<div class="main_sprite_container sprite_btm_corner_right"></div>
<div class="main_sprite_container sprite_btm_corner_left"></div>
</div>
</div><!--#page_wrap-->
<!--#include $webdir + "/_inc_footer.tmpl"#-->

View File

@@ -0,0 +1,102 @@
<!--#set global $pane="Nzo"#-->
<!--#set global $help_uri=""#-->
<!--#include $webdir + "/_inc_header.tmpl"#-->
<!--#if $varExists('slot')#-->
<form action="save" method="post" class="nzo_save_form">
<input type="hidden" name="apikey" value="$apikey">
<input type="text" name="name" size="70" value="$slot.filename_clean" />
<input type="text" name="password" style="width:200px" size="100" value="$slot.password" placeholder="$T('srv-password')"/>
<div>
<select name="index"><optgroup label="$T('order')">
<!--#for $i in range($noofslots)#-->
<option value=$i <!--#if $i == $index then "selected" else ""#-->>$i</option>
<!--#end for#-->
</select>
<!--#if $categories#-->
<select name="cat"><optgroup label="$T('category')">
<!--#for $ct in $categories#-->
<option value="$ct" <!--#if $slot.cat.lower() == $ct.lower() then "selected" else ""#-->>$Tspec($ct)</option>
<!--#end for#-->
</optgroup></select>
<!--#end if#-->
<select name="priority"><optgroup label="$T('priority')">
<option value="-100" <!--#if $slot.priority == "-100" then "selected" else ""#-->>$T('default')</option>
<option value="2" <!--#if $slot.priority == "2" then "selected" else ""#-->>$T('pr-force')</option>
<option value="1" <!--#if $slot.priority == "1" then "selected" else ""#-->>$T('pr-high')</option>
<option value="0" <!--#if $slot.priority == "0" then "selected" else ""#-->>$T('pr-normal')</option>
<option value="-1" <!--#if $slot.priority == "-1" then "selected" else ""#-->>$T('pr-low')</option>
</optgroup></select>
<select name="pp"><optgroup label="$T('pp')">
<option value="0" <!--#if $slot.unpackopts == "0" then "selected" else ""#-->>$T('pp-none')</option>
<option value="1" <!--#if $slot.unpackopts == "1" then "selected" else ""#-->>$T('pp-repair')</option>
<option value="2" <!--#if $slot.unpackopts == "2" then "selected" else ""#-->>$T('pp-unpack')</option>
<option value="3" <!--#if $slot.unpackopts == "3" then "selected" else ""#-->>$T('pp-delete')</option>
</optgroup></select>
<!--#if $scripts#-->
<select name="script"><optgroup label="$T('script')">
<!--#for $sc in $scripts#-->
<option value="$sc" <!--#if $slot.script.lower() == $sc.lower() then "selected" else ""#-->>$Tspec($sc)</option>
<!--#end for#-->
</optgroup></select>
<!--#end if#-->
<input type="submit" class="juiButton" value="$T('button-save')" />
</div>
</form>
<!--#end if#-->
<form action="bulk_operation" id="bulk_operation">
<input type="hidden" name="apikey" value="$apikey">
<input type="hidden" name="action_key" id="action_key" />
<div class="config_nav lang-$active_lang">
<ul>
<li><a class="config_menu" id="nzo_reload"><span class="config_sprite_container sprite_nzo_reload">$T('Plush-button-refresh')</span></a></li>
<br/>&nbsp;$T('nzo-action'):
<li><a id="nzo_delete"><span class="config_sprite_container sprite_nzo_delete">$T('nzo-delete')</span></a></li>
<li><a id="nzo_top"><span class="config_sprite_container sprite_nzo_top">$T('nzo-top')</span></a></li>
<li><a id="nzo_up"><span class="config_sprite_container sprite_nzo_up">$T('nzo-up')</span></a></li>
<li><a id="nzo_down"><span class="config_sprite_container sprite_nzo_down">$T('nzo-down')</span></a></li>
<li><a id="nzo_bottom"><span class="config_sprite_container sprite_nzo_bottom">$T('nzo-bottom')</span></a></li>
<br/>&nbsp;$T('nzo-selection'):
<li><a id="nzo_select_all"><span class="config_sprite_container sprite_nzo_select_all">$T('nzo-all').capitalize()</span></a></li>
<li><a id="nzo_select_range"><span class="config_sprite_container sprite_nzo_select_range">$T('Plush-nzo-range').capitalize()</span></a></li>
<li><a id="nzo_select_invert"><span class="config_sprite_container sprite_nzo_select_invert">$T('nzo-invert').capitalize()</span></a></li>
<li><a id="nzo_select_none"><span class="config_sprite_container sprite_nzo_select_none">$T('nzo-none').capitalize()</span></a></li>
</ul>
</div>
<div id="config_container" class="config_margin config_margin_wide lang-$active_lang">
<div id="config_content">
<table class="nzoTable">
<tr><th></th><th>$T('Plush-progress')</th><th>$T('nzo-filename')/$T('nzo-subject')</th><th>$T('nzo-age')</th></tr>
<!--#set $oddLine = False#-->
<!--#for $file in $active_files#-->
<!--#set $oddLine = not $oddLine#-->
<tr id="$file.nzf_id" class="nzf_row <!--#if $oddLine then "oddLine" else "evenLine"#--> active">
<td><input type="checkbox" name="$file.nzf_id" id="box-$file.nzf_id" <!--#if $file.checked then "checked" else ""#-->></td>
<td valign="middle">
<div class="main_sprite_container sprite_progressbar_bg">
<div class="main_sprite_container sprite_progress_done" style="background-position: -<!--#if $file.mb == "0.00" then "120" else int(120 - 120.0 / 100.0 * int(100 - float($file.mbleft) / float($file.mb) * 100))#-->px -401px">
<div class="totalDownload">$file.mbleft&nbsp;<small>$T('Plush-left')</small></div>
<div class="currentDownload">$file.mb&nbsp;<small>$T('MB')</small></div>
</div>
</div>
</td>
<td class="filename">$file.filename</td>
<td class="alignRight">$file.age</td>
</tr>
<!--#end for#-->
</table>
</div>
</div>
</form>
<!--#include $webdir + "/_inc_footer.tmpl"#-->

View File

@@ -0,0 +1,132 @@
<script type="text/javascript">
if (typeof( jQuery ) == 'undefined')
window.location = "../"; // redirect to main on direct template hit
jQuery(function($) {
$.plush.queuenoofslots = $noofslots;
$.plush.SetQueueSpeedLimit('$speedlimit', '$speedlimit_abs');
$.plush.SetQueueFinishAction('$finishaction');
$.plush.SetWarnings($have_warnings,"");
$.plush.SetQueuePauseInfo(<!--#if $paused#-->true<!--#else#-->false<!--#end if#-->,'$pause_int');
$.plush.SetQueueETAStats("<!--#if float($kbpersec) > 1023 #-->$speed<!--#else#--><!--#echo "%.0f" % float($kbpersec)#--> K<!--#end if#-->",<!--#echo "%.0f" % float($kbpersec)#-->,'$timeleft','$T('eta'): $eta');
// set lower-right queue stats
var stats = '';
<!--#if $have_quota#-->
stats += '<strong>$left_quota&nbsp;&nbsp;&frasl;&nbsp;&nbsp;$quota</strong>&nbsp;$T('quota-left')&nbsp;&nbsp;';
<!--#end if#-->
<!--#if $noofslots > 0#-->
stats += '<strong>$mbleft&nbsp;&nbsp;&frasl;&nbsp;&nbsp;$mb&nbsp;$T('MB')</strong>&nbsp;$T('Plush-remaining')';
<!--#end if#-->
<!--#if $diskspace1 == $diskspace2#-->
stats += '<div class="queue_footer_icon <!--#if float($diskspace1) < float($mbleft)/1024 #-->main_sprite_container sprite_q_stats_needspace" title="$T('Plush-notEnoughSpace')<!--#else#-->main_sprite_container sprite_q_stats_incomplete<!--#end if#-->">&nbsp;&nbsp;&nbsp;</div><strong>$diskspace1_norm$T('B')</strong>&nbsp;$T('Plush-freeSpace')';
<!--#else#-->
stats += '<div class="queue_footer_icon <!--#if float($diskspace1) < float($mbleft)/1024 #-->main_sprite_container sprite_q_stats_needspace" title="$T('Plush-notEnoughSpace')<!--#else#-->main_sprite_container sprite_q_stats_incomplete<!--#end if#-->">&nbsp;&nbsp;&nbsp;</div><strong>$diskspace1&nbsp;$T('GB')</strong>&nbsp;$T('Plush-freeSpaceTemp')'
+'<div class="queue_footer_icon <!--#if float($diskspace2) < float($mbleft)/1024 #-->main_sprite_container sprite_q_stats_needspace" title="$T('Plush-notEnoughSpace')<!--#else#-->main_sprite_container sprite_q_stats_complete<!--#end if#-->">&nbsp;&nbsp;&nbsp;</div><strong>$diskspace2_norm$T('B')</strong>&nbsp;$T('Plush-freeSpace')';
<!--#end if#-->
$.plush.SetQueueStats(stats);
});
// set the page title here (due to localizations)
<!--#if $noofslots < 1 #-->
<!--#if $paused#-->
document.title = '$T('ft-paused') | SABnzbd $version';
<!--#else#-->
document.title = '$T('Plush-idle') | SABnzbd $version';
<!--#end if#-->
<!--#else if $paused#-->
document.title = '$T('ft-paused') | <!--#echo "%.0f" % float($mbleft)#--> $T('MB') $T('Plush-left') | $noofslots NZBs';
<!--#else#-->
document.title = '<!--#if float($kbpersec) > 1023 #-->$speed<!--#else#--><!--#echo "%.0f" % float($kbpersec)#--> K<!--#end if#-->B/s | <!--#echo "%.0f" % float($mbleft)#--> $T('MB') | $timeleft $T('Plush-left')';
<!--#end if#-->
</script>
<table class="queueTable" id="queueTable" cellspacing="0">
<!--#set $cur = 0#-->
<!--#for $slot in $slots#-->
<!--#set $cur = $cur + 1#-->
<tr id="$slot.nzo_id"<!--#if $cur%2#--> class="alt"<!--#end if#-->>
<td class="nzb_status_col nowrap">
&nbsp;<div class="nzb_status <!--#if $slot.status == "Paused"#-->main_sprite_container sprite_ql_grip_pause<!--#else#-->main_sprite_container sprite_ql_grip_resume<!--#end if#-->">&nbsp;
</div>
<% # <!--#else if $slot.status == "Downloading"#-->main_sprite_container sprite_ql_grip_active %>
</td>
<td class="download-title" <!--#if $rating_enable#-->style="width:35%"<!--#end if#-->>
<!--#for $label in $slot.labels#-->
<span class="label">$label</span>
<!--#end for#-->
<a href="nzb/$slot.nzo_id/" title="$T('status'): $T('post-'+$slot.status)<br/>$T('nzo-age'): $slot.avg_age<br/><!--#if $slot.mbmissing!="0.00"#-->$T('missingArt'): $slot.mbmissing $T('MB')<!--#end if#-->">$slot.filename.replace('.', '.&#8203;').replace('_', '_&#8203;')<!--#if $slot.password#--> / $slot.password<!--#end if#--></a>
</td>
<!--#if $rating_enable#-->
<!--#if $slot.has_rating#-->
<td>
<div class="rating_stars_block_c">
<div class="rating_stars">
<div class="rating_icon_vision"></div><span class="avg_rate" value="$slot.rating_avg_video"></span>
</div>
<div class="rating_stars">
<div class="rating_icon_sound"></div><span class="avg_rate" value="$slot.rating_avg_audio"></span>
</div>
</div>
</td>
<!--#else#-->
<td></td>
<!--#end if#-->
<!--#end if#-->
<td>
<div class="main_sprite_container sprite_progressbar_bg">
<div class="main_sprite_container sprite_progress_done" style="background-position: -<!--#if $slot.mb == "0.00" then "120" else int(120 - 120.0 / 100.0 * int(100 - float($slot.mbleft) / float($slot.mb) * 100))#-->px -401px">
<div class="totalDownload">$slot.mb_fmt&nbsp;<small>$T('MB')</small></div>
<div class="currentDownload"><!--#if $slot.mb!=$slot.mbleft#-->$slot.mbdone_fmt&nbsp;<small>$T('MB')&nbsp;$T('AofB')</small><!--#end if#--></div>
</div>
</div>
</td>
<td class="eta nowrap">
<!--#if (not $paused and $slot.status not in ("Paused", "Checking")) or $slot.priority == 'Force'#-->
<span title="$slot.eta">$slot.timeleft&nbsp;$T('Plush-left')</span>
<!--#else#-->
$T('post-'+$slot.status)
<!--#end if#-->
</td>
<td class="options nowrap">
<!--#if $categories#-->
<select class="change_cat"><optgroup label="$T('category')">
<!--#for $ct in $categories#-->
<option value="$ct" <!--#if $slot.cat.lower() == $ct.lower() then "selected" else ""#-->>$Tspec($ct)</option>
<!--#end for#-->
</optgroup></select>
<!--#end if#-->
<select class="proc_priority"><optgroup label="$T('priority')">
<option value="2" <!--#if $slot.priority == "Force" then "selected" else ""#-->>$T('pr-force')</option>
<option value="1" <!--#if $slot.priority == "High" then "selected" else ""#-->>$T('pr-high')</option>
<option value="0" <!--#if $slot.priority == "Normal" then "selected" else ""#-->>$T('pr-normal')</option>
<option value="-1" <!--#if $slot.priority == "Low" then "selected" else ""#-->>$T('pr-low')</option>
<option value="-4" <!--#if $slot.priority == "Stop" then "selected" else ""#-->>$T('pr-stop')</option>
</optgroup></select>
<select class="change_opts"><optgroup label="$T('pp')">
<option value="0" <!--#if $slot.unpackopts == "0" then "selected " else ""#-->>$T('pp-none')</option>
<option value="1" <!--#if $slot.unpackopts == "1" then "selected " else ""#-->>$T('pp-repair')</option>
<option value="2" <!--#if $slot.unpackopts == "2" then "selected " else ""#-->>$T('pp-unpack')</option>
<option value="3" <!--#if $slot.unpackopts == "3" then "selected " else ""#-->>$T('pp-delete')</option>
</optgroup></select>
<!--#if $scripts#-->
<select class="change_script"><optgroup label="$T('script')">
<!--#for $sc in $scripts#-->
<option value="$sc" <!--#if $slot.script == $sc then "selected" else ""#-->>$Tspec($sc)</option>
<!--#end for#-->
</optgroup></select>
<!--#end if#-->
<div class="main_sprite_container icon_nzb_remove" title="$T('nzo-delete')">&nbsp;</div>
</td>
</tr>
<!--#end for#-->
</table>

View File

@@ -0,0 +1,233 @@
// *****************************************************************
// Plush Config code as follows, by pairofdimes (see LICENSE-CC.txt)
jQuery(document).ready(function($){
// Top Menu
var noTopMenu = $.cookie('plushNoTopMenu') ? $.cookie('plushNoTopMenu') : 0;
$('#topmenu_bar').show();
// Container width
var containerWidth = $.cookie('plushContainerWidth') ? $.cookie('plushContainerWidth') : '100%';
$('#master-width').css('width',containerWidth);
// Confirm user exits without saving changes first
if (config_pane != 'NZO') {
$(':input','form').change(function(){
window.onbeforeunload = function(){return confirmWithoutSavingPrompt;}
});
$('form').submit(function(){
window.onbeforeunload = null;
});
}
// modals
$("#help").colorbox({ inline:true, href:"#help_modal", title:$("#help").text(),
innerWidth:"375px", innerHeight:"350px", initialWidth:"375px", initialHeight:"350px", speed:0, opacity:0.7
});
$(".show_qrcode").colorbox({ photo:true, innerHeight:"300px", innerWidth:"300px", speed:0, opacity: 0.7, scrolling:false });
// jqueryui tabs/buttons
$('.juiButton').button();
$( ".tabs" ).tabs({
cookie: {
expires: 1 // store cookie for a day, without, it would be a session cookie
}
});
$(".vertical-tabs").tabs().addClass('ui-tabs-vertical ui-helper-clearfix');
$(".vertical-tabs li").removeClass('ui-corner-top').addClass('ui-corner-left');
// kludge for jqueryui tabs, using cookie option above for some reason does not select the default 1st tab
$('.tabs').each(function(index) {
if (!$(this).children('ul.ui-tabs-nav').children('li.ui-tabs-selected').length)
$(this).tabs('select',0);
});
// kludge for jqueryui tabs, clicking for an existing tab doesnt switch to it
$('#activeFeedLink').click(function(){
// tab-feed focus
$( ".tabs" ).tabs("select",1)
return false;
});
switch(config_pane) {
// not a config page, rather queued nzb file listing page
case 'NZO':
$('#nzo_reload').click(function(){ document.location.reload(); });
// operations
$('#nzo_delete').click(function(){
$('#action_key').val('Delete');
$('#bulk_operation').submit();
});
$('#nzo_top').click(function(){
$('#action_key').val('Top');
$('#bulk_operation').submit();
});
$('#nzo_up').click(function(){
$('#action_key').val('Up');
$('#bulk_operation').submit();
});
$('#nzo_down').click(function(){
$('#action_key').val('Down');
$('#bulk_operation').submit();
});
$('#nzo_bottom').click(function(){
$('#action_key').val('Bottom');
$('#bulk_operation').submit();
});
// selections
$("#nzo_select_all").click(function(){
$("INPUT[type='checkbox']").prop('checked', true).trigger('change');
});
var last1, last2;
$("#nzo_select_range").click(function(){
if (last1 && last2 && last1 < last2)
$("INPUT[type='checkbox']").slice(last1,last2).prop('checked', true).trigger('change');
else if (last1 && last2)
$("INPUT[type='checkbox']").slice(last2,last1).prop('checked', true).trigger('change');
});
$("#nzo_select_invert").click(function(){
$("INPUT[type='checkbox']").each( function() {
$(this).prop('checked', !$(this).prop('checked')).trigger('change');
});
});
$("#nzo_select_none").click(function(){
$("INPUT[type='checkbox']").prop('checked', false).trigger('change');
});
// click filenames to select
$('#config_content .nzoTable .nzf_row').click(function(event) {
$('#box-'+$(event.target).parent().attr('id')).prop('checked', !$('#box-'+$(event.target).parent().attr('id')).prop('checked')).trigger('change');
// range event interaction -- see further above
if (last1) last2 = last1;
last1 = $(event.target).parent()[0].rowIndex ? $(event.target).parent()[0].rowIndex : $(event.target).parent().parent()[0].rowIndex;
});
//
$('#config_content .nzoTable .nzf_row input').change(function(e){
if ($(e.target).prop('checked'))
$(e.target).parent().parent().addClass("nzo_highlight");
else
$(e.target).parent().parent().removeClass("nzo_highlight");
});
// set highlighted property for checked rows upon reload
$('#config_content .nzoTable .nzf_row input:checked').parent().parent().addClass("nzo_highlight");
return; // skip the rest of the config methods
break;
case 'Status':
$('#logging_level').change(function(event){
window.location = './change_loglevel?loglevel='+$(event.target).val()+'&apikey='+apikey;
});
break;
case 'General':
$('#apikey').click(function(){ $('#apikey').select() });
$('#generate_new_apikey').click(function(){
if (confirm($(this).attr('rel'))) {
$.ajax({
type: "POST",
url: "../../api",
data: {mode:'config', name:'set_apikey', apikey: $('#apikey').val()},
success: function(msg){
$('#apikey,#session').val(msg);
window.location.reload();
}
});
}
});
$('#generate_new_nzbkey').click(function(){
if (confirm($(this).attr('rel'))) {
$.ajax({
type: "POST",
url: "../../api",
data: {mode:'config', name:'set_nzbkey', apikey: $('#apikey').val()},
success: function(msg){
$('#nzbkey,#session').val(msg);
window.location.reload();
}
});
}
});
$('#sabnzbd_restart').click(function(){
return confirm($(this).attr('rel'));
});
break;
case 'Servers':
$('form .testServer').click(function(event){ // test server
$(event.target).next('span').addClass('loading');
$.ajax({
type: "POST",
url: "../../api",
data: "mode=config&name=test_server&"+ $(event.target).parents('form:first').serialize() +"&apikey="+$('#apikey').val(),
success: function(msg){
alert(msg);
$(event.target).next('span').removeClass('loading');
}
});
});
$('form .delServer').click(function(event){ // delete server
if(confirm($(event.target).attr('rel')))
$(event.target).parents('form:first').attr('action','delServer').submit();
return false;
});
$('form .clrServer').click(function(event){ // clear server
if(confirm($(event.target).attr('rel')))
$(event.target).parents('form:first').attr('action','clrServer').submit();
return false;
});
break;
case 'Categories':
$(':button').click(function(event){ // delete category
window.location="delete/?name="+$(event.target).attr('name')+'&apikey='+apikey;
});
break;
case 'RSS':
$('.toggleFeedCheckbox').click(function(){ // enable/disable feed
window.onbeforeunload = null; // lose data?
this.form.action='toggle_rss_feed?apikey=$apikey';
this.form.submit();
return false;
});
$('.rssOrderSelect').change(function(){ // change filter order
window.onbeforeunload = null; // lose data?
location = this.options[this.selectedIndex].value;
});
break;
case 'Email':
$('#test_email').click(function(){
return confirm($('#test_email').attr('rel'));
});
break;
case 'Index Sites':
$('#getBookmarks').click(function(){ window.location='getBookmarks?apikey='+apikey; });
$('#hideBookmarks').click(function(){ window.location='hideBookmarks?apikey='+apikey; });
$('#showBookmarks').click(function(){ window.location='showBookmarks?apikey='+apikey; });
break;
case 'Sorting':
previewtv(); previewmovie(); previewdate(); // display sorting previews -- these functions are defined below
break;
};
// page's save button for those pages that use it
$('#save').click(function(){
window.onbeforeunload = null;
$('form').submit();
});
}); // end Plush code

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 809 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Some files were not shown because too many files have changed in this diff Show More