diff --git a/src/tr-web-control/config.js b/src/tr-web-control/config.js index 0edaa6d..2adf966 100644 --- a/src/tr-web-control/config.js +++ b/src/tr-web-control/config.js @@ -20,7 +20,9 @@ system.config = $.extend(system.config, { // theme theme: "default", // 是否显示BT服务器 - showBTServers: false + showBTServers: false, + // ipinfo.io token + ipInfoToken: '' }); // 主题样式 @@ -99,4 +101,4 @@ system.themes = [{ text: 'Sunny', group: 'UI' } -] \ No newline at end of file +] diff --git a/src/tr-web-control/i18n/en.json b/src/tr-web-control/i18n/en.json index 19f02ba..baf21f4 100644 --- a/src/tr-web-control/i18n/en.json +++ b/src/tr-web-control/i18n/en.json @@ -225,7 +225,8 @@ "import-config": "Import configuration from file", "export-config": "Export current configuration", "import-config-confirm": "Do you want to import these configurations? This overrides the current configuration.", - "script-torrent-done-enabled": "Execute the following script when the torrent download is complete:" + "script-torrent-done-enabled": "Execute the following script when the torrent download is complete:", + "ipinfo": "ipinfo.io Token" }, "public": { "button-ok": "OK", @@ -466,4 +467,4 @@ "text-ignore-this-version": "Ignore this version", "text-json-file-parsing-failed": "JSON file parsing failed!" } -} \ No newline at end of file +} diff --git a/src/tr-web-control/script/min/system.min.js b/src/tr-web-control/script/min/system.min.js index 036ed4c..61172e1 100644 --- a/src/tr-web-control/script/min/system.min.js +++ b/src/tr-web-control/script/min/system.min.js @@ -1 +1 @@ -var system={version:"1.6.0",rootPath:"tr-web-control/",codeupdate:"20190724",configHead:"transmission-web-control",config:{autoReload:!0,reloadStep:5e3,pageSize:30,pagination:!0,pageList:[10,20,30,40,50,100,150,200,250,300,5e3],defaultSelectNode:null,autoExpandAttribute:!1,defaultLang:"",foldersShow:!1,theme:"default",showBTServers:!1,ui:{status:{tree:{},layout:{main:{},body:{},left:{}},panel:{},size:{nav:{},attribute:{}}}},hideSubfolders:!1,simpleCheckMode:!1,nav:{servers:!0,folders:!0,statistics:!0,labels:!1},labels:[],labelMaps:{},ignoreVersion:[]},storageKeys:{dictionary:{folders:"dictionary.folders"}},dictionary:{folders:null},checkUpdateScript:"https://api.github.com/repos/ronggang/transmission-web-control/releases/latest",contextMenus:{},panel:null,lang:null,reloading:!1,autoReloadTimer:null,downloadDir:"",islocal:!1,B64:new Base64,currentTorrentId:0,control:{tree:null,torrentlist:null},userConfig:{torrentList:{fields:[],sortName:null,sortOrder:"asc"}},serverConfig:null,serverSessionStats:null,templates:{},checkedRows:[],uiIsInitialized:!1,popoverCount:0,currentListDir:"",setlang:function(t,e){t||(t=this.config.defaultLang?this.config.defaultLang:navigator.language||navigator.browserLanguage),t||(t="zh-CN"),-1!=t.indexOf("-")&&(t=t.split("-")[0].toLocaleLowerCase()+"-"+t.split("-")[1].toLocaleUpperCase()),this.languages[t]||(t="en"),t=t.replace("-","_"),$.getJSON(system.rootPath+"i18n/"+t+".json",(function(s){s&&(system.lang=$.extend(!0,system.defaultLang,s)),system.resetLangText(),$.getScript(system.rootPath+"script/easyui/locale/easyui-lang-"+t+".js").done((function(t,s){e&&e()})).fail((function(t,s,n){$.getScript(system.rootPath+"script/easyui/locale/easyui-lang-en.js",(function(){e&&e()}))}))}))},init:function(t,e,s){this.readConfig(),this.lastUIStatus=JSON.parse(JSON.stringify(this.config.ui.status)),this.islocal=1==e,this.panel={main:$("#main"),top:$("#m_top"),toolbar:$("#m_toolbar"),left_layout:$("#m_left_layout"),left:$("#m_left"),body:$("#m_body"),layout_body:$("#layout_body"),layout_left:$("#layout_left"),list:$("#m_list"),attribute:$("#m_attribute"),bottom:$("#m_bottom"),title:$("#m_title"),status:$("#m_status"),statusbar:$("#m_statusbar"),status_text:$("#status_text"),droparea:$("#dropArea")},null==this.lang?this.setlang(t,(function(){system.initdata()})):this.initdata(),this.initThemes(),this.clipboard=new ClipboardJS("#toolbar_copyPath")},resetLangText:function(parent){parent||(parent=$);var items=parent.find("*[system-lang]");$.each(items,(function(key,item){var name=$(item).attr("system-lang");"["==name.substr(0,1)?$(item).html(eval("system.lang"+name)):$(item).html(eval("system.lang."+name))})),items=parent.find("*[system-tip-lang]"),$.each(items,(function(key,item){var name=$(item).attr("system-tip-lang");"["==name.substr(0,1)?$(item).attr("title",eval("system.lang"+name)):$(item).attr("title",eval("system.lang."+name))}))},initdata:function(){$(document).attr("title",this.lang.system.title+" "+this.version),$.fn.switchbutton.defaults.onText=this.lang.public["text-on"],$.fn.switchbutton.defaults.offText=this.lang.public["text-off"];var t=new Array,e=""+this.lang.title.left+"";if(t.length>1)for(var s in e+=t.join(""),this.panel.left_layout.panel("setTitle",e),this.lang.tree.toolbar.nav)switch($("#tree-toolbar-nav-"+s).linkbutton(),s){case"folders":system.config.foldersShow?$("tree-toolbar-nav-"+s).linkbutton({iconCls:"icon-enabled"}).data("status",1):$("tree-toolbar-nav-"+s).linkbutton({iconCls:"icon-disabled"}).data("status",0)}else this.panel.left_layout.panel("setTitle",e);if(e=""+this.lang.title.list+"",t.length=0,t.length>1)for(var s in e+=t.join(""),this.panel.body.panel("setTitle",e),this.lang["torrent-head"].buttons)switch($("#torrent-head-buttons-"+s).linkbutton(),s){case"autoExpandAttribute":system.config.autoExpandAttribute?$("#torrent-head-buttons-"+s).linkbutton({iconCls:"icon-enabled"}).data("status",1):$("#torrent-head-buttons-"+s).linkbutton({iconCls:"icon-disabled"}).data("status",0)}else this.panel.body.panel("setTitle",e);this.panel.status.panel("setTitle",this.lang.title.status),this.panel.attribute.panel({title:this.lang.title.attribute,onExpand:function(){0!=system.currentTorrentId&&$(this).data("isload")?system.getTorrentInfos(system.currentTorrentId):system.clearTorrentAttribute()},onLoad:function(){$(this).data("isload")||($(this).data("isload",!0),0!=system.currentTorrentId&&setTimeout((function(){system.getTorrentInfos(system.currentTorrentId)}),500))}}),$.each(this.languages,(function(t,e){$("