Merge pull request #2445 from buinsky/WebUI3

Web API: rename 'json' scope to 'query'
This commit is contained in:
sledgehammer999 2015-01-23 16:41:42 +02:00
commit 39c9bb0800
6 changed files with 22 additions and 22 deletions

View file

@ -77,12 +77,12 @@ QMap<QString, QMap<QString, RequestHandler::Action> > RequestHandler::initialize
ADD_ACTION(public, logout);
ADD_ACTION(public, theme);
ADD_ACTION(public, images);
ADD_ACTION(json, torrents);
ADD_ACTION(json, preferences);
ADD_ACTION(json, transferInfo);
ADD_ACTION(json, propertiesGeneral);
ADD_ACTION(json, propertiesTrackers);
ADD_ACTION(json, propertiesFiles);
ADD_ACTION(query, torrents);
ADD_ACTION(query, preferences);
ADD_ACTION(query, transferInfo);
ADD_ACTION(query, propertiesGeneral);
ADD_ACTION(query, propertiesTrackers);
ADD_ACTION(query, propertiesFiles);
ADD_ACTION(sync, maindata);
ADD_ACTION(command, shutdown);
ADD_ACTION(command, download);
@ -222,7 +222,7 @@ void RequestHandler::action_public_images()
// - reverse (bool): enable reverse sorting
// - limit (int): set limit number of torrents returned (if greater than 0, otherwise - unlimited)
// - offset (int): set offset (if less than 0 - offset from end)
void RequestHandler::action_json_torrents()
void RequestHandler::action_query_torrents()
{
CHECK_URI(0);
const QStringMap& gets = request().gets;
@ -233,31 +233,31 @@ void RequestHandler::action_json_torrents()
), CONTENT_TYPE_JS);
}
void RequestHandler::action_json_preferences()
void RequestHandler::action_query_preferences()
{
CHECK_URI(0);
print(prefjson::getPreferences(), CONTENT_TYPE_JS);
}
void RequestHandler::action_json_transferInfo()
void RequestHandler::action_query_transferInfo()
{
CHECK_URI(0);
print(btjson::getTransferInfo(), CONTENT_TYPE_JS);
}
void RequestHandler::action_json_propertiesGeneral()
void RequestHandler::action_query_propertiesGeneral()
{
CHECK_URI(1);
print(btjson::getPropertiesForTorrent(args_.front()), CONTENT_TYPE_JS);
}
void RequestHandler::action_json_propertiesTrackers()
void RequestHandler::action_query_propertiesTrackers()
{
CHECK_URI(1);
print(btjson::getTrackersForTorrent(args_.front()), CONTENT_TYPE_JS);
}
void RequestHandler::action_json_propertiesFiles()
void RequestHandler::action_query_propertiesFiles()
{
CHECK_URI(1);
print(btjson::getFilesForTorrent(args_.front()), CONTENT_TYPE_JS);

View file

@ -50,12 +50,12 @@ private:
void action_public_logout();
void action_public_theme();
void action_public_images();
void action_json_torrents();
void action_json_preferences();
void action_json_transferInfo();
void action_json_propertiesGeneral();
void action_json_propertiesTrackers();
void action_json_propertiesFiles();
void action_query_torrents();
void action_query_preferences();
void action_query_transferInfo();
void action_query_propertiesGeneral();
void action_query_propertiesTrackers();
void action_query_propertiesFiles();
void action_sync_maindata();
void action_command_shutdown();
void action_command_download();

View file

@ -636,7 +636,7 @@ time_padding = function(val) {
}
loadPreferences = function() {
var url = 'json/preferences';
var url = 'query/preferences';
var request = new Request.JSON({
url: url,
method: 'get',

View file

@ -289,7 +289,7 @@ var loadTorrentFilesData = function() {
fTable.removeAllRows();
current_hash = new_hash;
}
var url = 'json/propertiesFiles/' + current_hash;
var url = 'query/propertiesFiles/' + current_hash;
var request = new Request.JSON({
url: url,
noCache: true,

View file

@ -29,7 +29,7 @@ var loadTorrentData = function() {
}
// Display hash
$('torrent_hash').set('html', current_hash);
var url = 'json/propertiesGeneral/' + current_hash;
var url = 'query/propertiesGeneral/' + current_hash;
var request = new Request.JSON({
url: url,
noCache: true,

View file

@ -69,7 +69,7 @@ var loadTrackersData = function() {
tTable.removeAllRows();
current_hash = new_hash;
}
var url = 'json/propertiesTrackers/' + current_hash;
var url = 'query/propertiesTrackers/' + current_hash;
var request = new Request.JSON({
url: url,
noCache: true,