add flags in peers section (#443)
feat: Flags are added in peers The configuration for the flags is added in dialogs
@ -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'
|
||||
}
|
||||
]
|
||||
]
|
||||
|
@ -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!"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
src/tr-web-control/script/min/system.min.js
vendored
@ -19,6 +19,8 @@ var system = {
|
||||
theme: "default",
|
||||
// 是否显示BT服务器
|
||||
showBTServers: false,
|
||||
// ipinfo.io token
|
||||
ipInfoToken: '',
|
||||
ui: {
|
||||
status: {
|
||||
tree: {},
|
||||
@ -2848,12 +2850,37 @@ var system = {
|
||||
fillTorrentPeersList: function (torrent) {
|
||||
var peers = torrent.peers;
|
||||
var datas = new Array();
|
||||
let flag;
|
||||
for (var index in peers) {
|
||||
var item = peers[index];
|
||||
var rowdata = {};
|
||||
for (var key in item) {
|
||||
rowdata[key] = item[key];
|
||||
}
|
||||
|
||||
if (system.config.ipInfoToken !== '') {
|
||||
let flag = '';
|
||||
let ip = rowdata['address'];
|
||||
|
||||
if (this.flags[ip] === undefined) {
|
||||
let settings = {
|
||||
'url': 'https://ipinfo.io/' + ip + '/country?token=' + system.config.ipInfoToken,
|
||||
'method': 'GET',
|
||||
'async': false
|
||||
};
|
||||
|
||||
$.ajax(settings).done(function (response) {
|
||||
flag = response.toLowerCase().trim();
|
||||
});
|
||||
|
||||
this.flags[ip] = flag;
|
||||
} else {
|
||||
flag = this.flags[ip];
|
||||
}
|
||||
|
||||
rowdata['address'] += ' <img src="' + this.rootPath + '/style/flags/' + flag + '.png" alt="' + flag + '" title="' + flag + '">';
|
||||
}
|
||||
|
||||
// 使用同类已有的翻译文本
|
||||
rowdata.isUTP = system.lang.torrent.attribute["status"][item.isUTP];
|
||||
var percentDone = parseFloat(item.progress * 100).toFixed(2);
|
||||
|
BIN
src/tr-web-control/style/flags/ad.png
Executable file
After Width: | Height: | Size: 643 B |
BIN
src/tr-web-control/style/flags/ae.png
Executable file
After Width: | Height: | Size: 408 B |
BIN
src/tr-web-control/style/flags/af.png
Executable file
After Width: | Height: | Size: 604 B |
BIN
src/tr-web-control/style/flags/ag.png
Executable file
After Width: | Height: | Size: 591 B |
BIN
src/tr-web-control/style/flags/ai.png
Executable file
After Width: | Height: | Size: 643 B |
BIN
src/tr-web-control/style/flags/al.png
Executable file
After Width: | Height: | Size: 600 B |
BIN
src/tr-web-control/style/flags/am.png
Executable file
After Width: | Height: | Size: 497 B |
BIN
src/tr-web-control/style/flags/an.png
Executable file
After Width: | Height: | Size: 488 B |
BIN
src/tr-web-control/style/flags/ao.png
Normal file
After Width: | Height: | Size: 428 B |
BIN
src/tr-web-control/style/flags/ar.png
Executable file
After Width: | Height: | Size: 506 B |
BIN
src/tr-web-control/style/flags/as.png
Executable file
After Width: | Height: | Size: 647 B |
BIN
src/tr-web-control/style/flags/at.png
Executable file
After Width: | Height: | Size: 403 B |
BIN
src/tr-web-control/style/flags/au.png
Executable file
After Width: | Height: | Size: 673 B |
BIN
src/tr-web-control/style/flags/aw.png
Executable file
After Width: | Height: | Size: 524 B |
BIN
src/tr-web-control/style/flags/ax.png
Executable file
After Width: | Height: | Size: 663 B |
BIN
src/tr-web-control/style/flags/az.png
Executable file
After Width: | Height: | Size: 589 B |
BIN
src/tr-web-control/style/flags/ba.png
Executable file
After Width: | Height: | Size: 593 B |
BIN
src/tr-web-control/style/flags/bb.png
Executable file
After Width: | Height: | Size: 585 B |
BIN
src/tr-web-control/style/flags/bd.png
Executable file
After Width: | Height: | Size: 504 B |
BIN
src/tr-web-control/style/flags/be.png
Executable file
After Width: | Height: | Size: 449 B |
BIN
src/tr-web-control/style/flags/bf.png
Executable file
After Width: | Height: | Size: 497 B |
BIN
src/tr-web-control/style/flags/bg.png
Executable file
After Width: | Height: | Size: 462 B |
BIN
src/tr-web-control/style/flags/bh.png
Executable file
After Width: | Height: | Size: 457 B |
BIN
src/tr-web-control/style/flags/bi.png
Executable file
After Width: | Height: | Size: 675 B |
BIN
src/tr-web-control/style/flags/bj.png
Executable file
After Width: | Height: | Size: 486 B |
BIN
src/tr-web-control/style/flags/bm.png
Executable file
After Width: | Height: | Size: 611 B |
BIN
src/tr-web-control/style/flags/bn.png
Executable file
After Width: | Height: | Size: 639 B |
BIN
src/tr-web-control/style/flags/bo.png
Executable file
After Width: | Height: | Size: 500 B |
BIN
src/tr-web-control/style/flags/br.png
Executable file
After Width: | Height: | Size: 593 B |
BIN
src/tr-web-control/style/flags/bs.png
Executable file
After Width: | Height: | Size: 526 B |
BIN
src/tr-web-control/style/flags/bt.png
Executable file
After Width: | Height: | Size: 631 B |
BIN
src/tr-web-control/style/flags/bv.png
Executable file
After Width: | Height: | Size: 512 B |
BIN
src/tr-web-control/style/flags/bw.png
Executable file
After Width: | Height: | Size: 443 B |
BIN
src/tr-web-control/style/flags/by.png
Executable file
After Width: | Height: | Size: 514 B |
BIN
src/tr-web-control/style/flags/bz.png
Executable file
After Width: | Height: | Size: 600 B |
BIN
src/tr-web-control/style/flags/ca.png
Executable file
After Width: | Height: | Size: 628 B |
BIN
src/tr-web-control/style/flags/catalonia.png
Normal file
After Width: | Height: | Size: 398 B |
BIN
src/tr-web-control/style/flags/cc.png
Executable file
After Width: | Height: | Size: 625 B |
BIN
src/tr-web-control/style/flags/cd.png
Normal file
After Width: | Height: | Size: 528 B |
BIN
src/tr-web-control/style/flags/cf.png
Executable file
After Width: | Height: | Size: 614 B |
BIN
src/tr-web-control/style/flags/cg.png
Executable file
After Width: | Height: | Size: 521 B |
BIN
src/tr-web-control/style/flags/ch.png
Executable file
After Width: | Height: | Size: 367 B |
BIN
src/tr-web-control/style/flags/ci.png
Executable file
After Width: | Height: | Size: 453 B |
BIN
src/tr-web-control/style/flags/ck.png
Executable file
After Width: | Height: | Size: 586 B |
BIN
src/tr-web-control/style/flags/cl.png
Executable file
After Width: | Height: | Size: 450 B |
BIN
src/tr-web-control/style/flags/cm.png
Executable file
After Width: | Height: | Size: 525 B |
BIN
src/tr-web-control/style/flags/cn.png
Executable file
After Width: | Height: | Size: 472 B |
BIN
src/tr-web-control/style/flags/co.png
Executable file
After Width: | Height: | Size: 483 B |
BIN
src/tr-web-control/style/flags/cr.png
Executable file
After Width: | Height: | Size: 477 B |
BIN
src/tr-web-control/style/flags/cs.png
Executable file
After Width: | Height: | Size: 439 B |
BIN
src/tr-web-control/style/flags/cu.png
Executable file
After Width: | Height: | Size: 563 B |
BIN
src/tr-web-control/style/flags/cv.png
Executable file
After Width: | Height: | Size: 529 B |
BIN
src/tr-web-control/style/flags/cx.png
Executable file
After Width: | Height: | Size: 608 B |
BIN
src/tr-web-control/style/flags/cy.png
Executable file
After Width: | Height: | Size: 428 B |
BIN
src/tr-web-control/style/flags/cz.png
Executable file
After Width: | Height: | Size: 476 B |
BIN
src/tr-web-control/style/flags/de.png
Executable file
After Width: | Height: | Size: 545 B |
BIN
src/tr-web-control/style/flags/dj.png
Executable file
After Width: | Height: | Size: 572 B |
BIN
src/tr-web-control/style/flags/dk.png
Executable file
After Width: | Height: | Size: 495 B |
BIN
src/tr-web-control/style/flags/dm.png
Executable file
After Width: | Height: | Size: 620 B |
BIN
src/tr-web-control/style/flags/do.png
Executable file
After Width: | Height: | Size: 508 B |
BIN
src/tr-web-control/style/flags/dz.png
Executable file
After Width: | Height: | Size: 582 B |
BIN
src/tr-web-control/style/flags/ec.png
Executable file
After Width: | Height: | Size: 500 B |
BIN
src/tr-web-control/style/flags/ee.png
Executable file
After Width: | Height: | Size: 429 B |
BIN
src/tr-web-control/style/flags/eg.png
Executable file
After Width: | Height: | Size: 465 B |
BIN
src/tr-web-control/style/flags/eh.png
Executable file
After Width: | Height: | Size: 508 B |
BIN
src/tr-web-control/style/flags/england.png
Executable file
After Width: | Height: | Size: 496 B |
BIN
src/tr-web-control/style/flags/er.png
Executable file
After Width: | Height: | Size: 653 B |
BIN
src/tr-web-control/style/flags/es.png
Executable file
After Width: | Height: | Size: 469 B |
BIN
src/tr-web-control/style/flags/et.png
Executable file
After Width: | Height: | Size: 592 B |
BIN
src/tr-web-control/style/flags/europeanunion.png
Normal file
After Width: | Height: | Size: 479 B |
BIN
src/tr-web-control/style/flags/fam.png
Executable file
After Width: | Height: | Size: 532 B |
BIN
src/tr-web-control/style/flags/fi.png
Executable file
After Width: | Height: | Size: 489 B |
BIN
src/tr-web-control/style/flags/fj.png
Executable file
After Width: | Height: | Size: 610 B |
BIN
src/tr-web-control/style/flags/fk.png
Executable file
After Width: | Height: | Size: 648 B |
BIN
src/tr-web-control/style/flags/fm.png
Executable file
After Width: | Height: | Size: 552 B |
BIN
src/tr-web-control/style/flags/fo.png
Executable file
After Width: | Height: | Size: 474 B |
BIN
src/tr-web-control/style/flags/fr.png
Executable file
After Width: | Height: | Size: 545 B |
BIN
src/tr-web-control/style/flags/ga.png
Executable file
After Width: | Height: | Size: 489 B |
BIN
src/tr-web-control/style/flags/gb.png
Normal file
After Width: | Height: | Size: 599 B |
BIN
src/tr-web-control/style/flags/gd.png
Executable file
After Width: | Height: | Size: 637 B |
BIN
src/tr-web-control/style/flags/ge.png
Executable file
After Width: | Height: | Size: 594 B |
BIN
src/tr-web-control/style/flags/gf.png
Executable file
After Width: | Height: | Size: 545 B |
BIN
src/tr-web-control/style/flags/gh.png
Executable file
After Width: | Height: | Size: 490 B |
BIN
src/tr-web-control/style/flags/gi.png
Executable file
After Width: | Height: | Size: 463 B |
BIN
src/tr-web-control/style/flags/gl.png
Executable file
After Width: | Height: | Size: 470 B |
BIN
src/tr-web-control/style/flags/gm.png
Executable file
After Width: | Height: | Size: 493 B |
BIN
src/tr-web-control/style/flags/gn.png
Executable file
After Width: | Height: | Size: 480 B |
BIN
src/tr-web-control/style/flags/gp.png
Executable file
After Width: | Height: | Size: 488 B |
BIN
src/tr-web-control/style/flags/gq.png
Executable file
After Width: | Height: | Size: 537 B |
BIN
src/tr-web-control/style/flags/gr.png
Executable file
After Width: | Height: | Size: 487 B |
BIN
src/tr-web-control/style/flags/gs.png
Executable file
After Width: | Height: | Size: 630 B |
BIN
src/tr-web-control/style/flags/gt.png
Executable file
After Width: | Height: | Size: 493 B |
BIN
src/tr-web-control/style/flags/gu.png
Executable file
After Width: | Height: | Size: 509 B |
BIN
src/tr-web-control/style/flags/gw.png
Executable file
After Width: | Height: | Size: 516 B |
BIN
src/tr-web-control/style/flags/gy.png
Executable file
After Width: | Height: | Size: 645 B |
BIN
src/tr-web-control/style/flags/hk.png
Executable file
After Width: | Height: | Size: 527 B |