Commit acf55d6b authored by GaiaXalter's avatar GaiaXalter 💬

fix:同步生产版本且修复单卡链接

parent cab5ce83
Pipeline #24358 failed with stages
in 6 seconds
...@@ -10,154 +10,159 @@ const URL = "https://sapi.moecube.com:444/ygopro/arena" ...@@ -10,154 +10,159 @@ const URL = "https://sapi.moecube.com:444/ygopro/arena"
export default class Api { export default class Api {
static uploadUrl = `${URL}/upload` static uploadUrl = `${URL}/upload`
static implUrl = `${URL}/impltrack`
static clkUrl = `${URL}/clktrack`
static getMonthlyWinRate() {
let monthlyWinRateUrl = 'https://sapi.moecube.com:444/ygopro/analytics/matchup/type?source=mycard-athletic'
return Vue.http.get(monthlyWinRateUrl)
}
static getDownloadUrl(url) {
url = url.slice(7)
var downloadUrl = `${URL}/download/${url}`
return downloadUrl
}
static getCount(opt) {
var request = query.stringify(opt);
const url = `${config.COUNTER_URL}?${request}`;
return Vue.http.get(url);
}
static getUserInfo(opt) {
var request = query.stringify(opt);
const url = `${URL}/user?${request}`;
return Vue.http.get(url);
}
static getUsers(opt) {
var request = query.stringify(opt);
const url = `${URL}/users?${request}`;
return Vue.http.get(url);
}
static getUserDueHistory(opt) {
return Vue.http.get(`${URL}/history`, { 'params': opt });
}
static getDownloadUrls() {
return Vue.http.get('https://api.github.com/repos/mycard/mycard/releases/latest')
}
static getAvatar(opt) {
return Vue.http.get(`https://sapi.moecube.com:444/accounts/users/${opt.username}.avatar`)
}
static getCardInfo(opt) {
var request = query.stringify(opt);
const url = `${URL}/cardinfo?${request}`;
return Vue.http.get(url);
}
static getDeckInfo(opt) {
return Vue.http.get(`${URL}/deckinfo`, { 'params': opt });
}
static saveDeck(opt) {
const url = `${URL}/deckinfo`
return Vue.http.post(url, opt, { 'emulateJSON': true });
}
static saveDeckDemo(opt) {
const url = `${URL}/deckdemo`
return Vue.http.post(url, opt, { 'emulateJSON': true });
}
static getReport(opt) {
return Vue.http.get(`${URL}/report`, { 'params': opt });
}
static getVoteList(opt) {
return Vue.http.get(`${URL}/votes`, { 'params': opt });
}
static saveVote(opt) {
const url = `${URL}/votes`
return Vue.http.post(url, opt, { 'emulateJSON': true });
}
static voteStatus(opt) {
const url = `${URL}/voteStatus`
return Vue.http.post(url, opt, { 'emulateJSON': true });
}
static getVote(opt) {
return Vue.http.get(`${URL}/vote`, { 'params': opt });
}
static submitVote(opt) {
const url = `${URL}/submitVote`
return Vue.http.post(url, opt, { 'emulateJSON': true });
}
static saveAds(opt) {
const url = `${URL}/ads`
return Vue.http.post(url, opt, { 'emulateJSON': true });
}
static getAdsList(opt) {
return Vue.http.get(`${URL}/ads`, { 'params': opt });
}
static adsStatus(opt) {
const url = `${URL}/adsStatus`
return Vue.http.post(url, opt, { 'emulateJSON': true });
}
static getAd(opt) {
return Vue.http.get(`${URL}/getAd`, { 'params': opt });
}
static adClick(opt) {
const url = `${URL}/adClick`
return Vue.http.post(url, opt, { 'emulateJSON': true });
}
static adImpl(opt) {
const url = `${URL}/adImpl`
return Vue.http.post(url, opt, { 'emulateJSON': true });
}
static getFirstWin(opt) {
var request = query.stringify(opt);
const url = `${URL}/firstwin?${request}`;
return Vue.http.get(url);
}
static adSwitchChange(opt) {
const url = `${URL}/adSwitchChange`
return Vue.http.post(url, opt, { 'emulateJSON': true });
}
static saveActivity(opt) {
const url = `${URL}/activity`
return Vue.http.post(url, opt, { 'emulateJSON': true });
}
static saveLabel(opt) {
const url = `${URL}/label`
return Vue.http.post(url, opt, { 'emulateJSON': true });
}
static getLabel(opt) {
return Vue.http.get(`${URL}/label`, { 'params': {} });
}
static implUrl = `${URL}/impltrack`
static clkUrl = `${URL}/clktrack`
static getMonthlyWinRate() {
let monthlyWinRateUrl = 'https://sapi.moecube.com:444/ygopro/analytics/matchup/type?source=mycard-athletic'
return Vue.http.get(monthlyWinRateUrl)
}
static getDownloadUrl(url) {
url = url.slice(7)
var downloadUrl = `${URL}/download/${url}`
return downloadUrl
}
static getCount(opt) {
var request = query.stringify(opt);
const url = `${config.COUNTER_URL}?${request}`;
return Vue.http.get(url);
}
static getUserInfo(opt) {
var request = query.stringify(opt);
const url = `${URL}/user?${request}`;
return Vue.http.get(url);
}
static getUsers(opt) {
var request = query.stringify(opt);
const url = `${URL}/users?${request}`;
return Vue.http.get(url);
}
static getUserDueHistory(opt) {
return Vue.http.get(`${URL}/history`, {'params': opt});
}
static getDownloadUrls() {
return Vue.http.get('https://api.github.com/repos/mycard/mycard/releases/latest')
}
static getAvatar(opt) {
return Vue.http.get(`https://sapi.moecube.com:444/accounts/users/${opt.username}.avatar`)
}
static getCardInfo(opt) {
var request = query.stringify(opt);
const url = `${URL}/cardinfo?${request}`;
return Vue.http.get(url);
}
static getDeckInfo(opt) {
return Vue.http.get(`${URL}/deckinfo`, {'params': opt});
}
static saveDeck(opt) {
const url = `${URL}/deckinfo`
return Vue.http.post(url, opt, {'emulateJSON': true});
}
static saveDeckDemo(opt) {
const url = `${URL}/deckdemo`
return Vue.http.post(url, opt, {'emulateJSON': true});
}
static getReport(opt) {
return Vue.http.get(`${URL}/report`, {'params': opt});
}
static getVoteList(opt) {
return Vue.http.get(`${URL}/votes`, {'params': opt});
}
static saveVote(opt) {
const url = `${URL}/votes`
return Vue.http.post(url, opt, {'emulateJSON': true});
}
static voteStatus(opt) {
const url = `${URL}/voteStatus`
return Vue.http.post(url, opt, {'emulateJSON': true});
}
static getVote(opt) {
return Vue.http.get(`${URL}/vote`, {'params': opt});
}
static submitVote(opt) {
const url = `${URL}/submitVote`
return Vue.http.post(url, opt, {'emulateJSON': true});
}
static saveAds(opt) {
const url = `${URL}/ads`
return Vue.http.post(url, opt, {'emulateJSON': true});
}
static getAdsList(opt) {
return Vue.http.get(`${URL}/ads`, {'params': opt});
}
static adsStatus(opt) {
const url = `${URL}/adsStatus`
return Vue.http.post(url, opt, {'emulateJSON': true});
}
static getAd(opt) {
return Vue.http.get(`${URL}/getAd`, {'params': opt});
}
static adClick(opt) {
const url = `${URL}/adClick`
return Vue.http.post(url, opt, {'emulateJSON': true});
}
static adImpl(opt) {
const url = `${URL}/adImpl`
return Vue.http.post(url, opt, {'emulateJSON': true});
}
static getFirstWin(opt) {
var request = query.stringify(opt);
const url = `${URL}/firstwin?${request}`;
return Vue.http.get(url);
}
static adSwitchChange(opt) {
const url = `${URL}/adSwitchChange`
return Vue.http.post(url, opt, {'emulateJSON': true});
}
static saveActivity(opt) {
const url = `${URL}/activity`
return Vue.http.post(url, opt, {'emulateJSON': true});
}
static saveLabel(opt) {
const url = `${URL}/label`
return Vue.http.post(url, opt, {'emulateJSON': true});
}
static getLabel(opt) {
return Vue.http.get(`${URL}/label`, {'params': {}});
}
static getMonthlyHistory(opt) {
const url = `https://sapi.moecube.com:444/ygopro/arena/historyScore`;
return Vue.http.get(url, {params: opt});
}
// https://sapi.moecube.com:444/ygopro/arena/historyScore?username=id&season=yyyy-mm
} }
This diff is collapsed.
This diff is collapsed.
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
}, },
mounted: function() { mounted: function() {
this.init2(); this.init2();
}, },
computed: { computed: {
...mapGetters({ ...mapGetters({
...@@ -150,74 +150,108 @@ ...@@ -150,74 +150,108 @@
} }
} }
function renderExpTable(tableData) { function renderArenaTable(tableData) {
tableData = tableData || []; tableData = tableData || [];
var lang = localStorage.getItem('lang') || 'cn'; var lang = localStorage.getItem('lang') || 'cn';
var rank = 1; var rank = 1;
var processData = tableData.map(function(d) { var processData = tableData.map(function (d) {
return [rank++, d.username, parseInt(d.exp), d.entertain_win, d.entertain_lose]; let ratio = 0
if (d.athletic_all > 0) {
ratio = (d.athletic_win / d.athletic_all * 100).toFixed(2)
}
var iconSrc = 'https://sapi.moecube.com:444/avatar/avatar/' + d.username + '/100/pic.png';
return [rank++, iconSrc, String(d.username), parseInt(d.pt), d.athletic_win, d.athletic_lose, ratio + "%"];
}); });
var table = $('#exp_table').DataTable({ var table = $('#pt_table').DataTable({
"autoWidth": false,
data: processData, data: processData,
pageLength: 25, pageLength: 25,
order: [ order: [
[0, "asc"] [0, "asc"]
], ],
"ordering": true, "ordering": true,
columns: [{ columns: [
title: tb_language[lang].rank {
title: tb_language[lang].rank,
},
{
title: tb_language[lang].name, // Display icon + username in this column
render: function (data, type, row) {
var iconSrcWithUsername = row[1]; // 获取图像链接
var username = row[2]; // 获取用户名
return '<div style="display: flex; align-items: center;">' +
'<img src="' + iconSrcWithUsername + '" style="width: 35px; height: 35px; margin-right: 3px;"> ' +
'<a href="#/userinfo?username=' + encodeURIComponent(username) + '">' + username + '</a>' +
'</div>';
},
}, },
{ {
title: tb_language[lang].name visible: false, // Hide the username column,
}, },
{ {
title: tb_language[lang].exp title: tb_language[lang].pt,
}, },
{ {
title: tb_language[lang].win title: tb_language[lang].win,
}, },
{ {
title: tb_language[lang].lose title: tb_language[lang].lose,
},
{
title: tb_language[lang].wl,
}, },
], ],
"columnDefs": [{ "columnDefs": [{
"render": function(data, type, row) { "render": function (data, type, row) {
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'>" + data + "</a>"; return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'>" + data + "</a>";
}, },
"targets": 1 "targets": 2
}, ], },],
"language": lang === 'en' ? tb_language.en : tb_language.cn "language": tb_language[lang],
}); });
$(".input-sm").attr("placeholder",placeholder) $(".input-sm").attr("placeholder", placeholder)
return table; return table;
} }
function renderArenaTable(tableData) { function renderExpTable(tableData) {
tableData = tableData || []; tableData = tableData || [];
var lang = localStorage.getItem('lang') || 'cn'; var lang = localStorage.getItem('lang') || 'cn';
var rank = 1; var rank = 1;
var processData = tableData.map(function(d) { var processData = tableData.map(function (d) {
let ratio = 0 var iconSrc = 'https://sapi.moecube.com:444/avatar/avatar/' + d.username + '/100/pic.png';
if (d.athletic_all > 0) { return [rank++, iconSrc, String(d.username), parseInt(d.exp), d.entertain_win, d.entertain_lose];
ratio = (d.athletic_win / d.athletic_all * 100).toFixed(2)
}
return [rank++, d.username, parseInt(d.pt), d.athletic_win, d.athletic_lose, ratio + "%"];
}); });
var table = $('#pt_table').DataTable({
var table = $('#exp_table').DataTable({
data: processData, data: processData,
pageLength: 25, pageLength: 25,
order: [ order: [[0, "asc"]],
[0, "asc"]
],
"ordering": true, "ordering": true,
columns: [{ columns: [
{
title: tb_language[lang].rank title: tb_language[lang].rank
}, },
{ {
title: tb_language[lang].name title: tb_language[lang].name, // Display icon + username in this column
render: function (data, type, row) {
var iconSrcWithUsername = row[1]; // 获取图像链接
var username = row[2]; // 获取用户名
return '<div style="display: flex; align-items: center;"><img src="' + iconSrcWithUsername + '" style="width: 35px; height: 35px; margin-right: 3px;"> <a href="#/userinfo?username=' + encodeURIComponent(username) + '">' + username + '</a></div>';
},
}, },
{ {
title: tb_language[lang].pt visible: false, // Hide the username column
},
{
title: tb_language[lang].exp
}, },
{ {
title: tb_language[lang].win title: tb_language[lang].win
...@@ -225,19 +259,16 @@ ...@@ -225,19 +259,16 @@
{ {
title: tb_language[lang].lose title: tb_language[lang].lose
}, },
],
"columnDefs": [
{ {
title: tb_language[lang].wl "targets": [0, 3, 4, 5], // Target other columns (exp, win, lose) to make them non-orderable
"orderable": false
}, },
], ],
"columnDefs": [{ "language": lang === 'en' ? tb_language.en : tb_language.cn,
"render": function(data, type, row) {
return "<a href='#/userinfo?username=" + encodeURIComponent(data) + "'>" + data + "</a>";
},
"targets": 1
}, ],
"language": tb_language[lang]
}); });
$(".input-sm").attr("placeholder",placeholder) $(".input-sm").attr("placeholder", placeholder);
return table; return table;
} }
renderPage(); renderPage();
...@@ -245,9 +276,9 @@ ...@@ -245,9 +276,9 @@
renderPage(); renderPage();
return false; return false;
}) })
} }
}, },
...@@ -255,7 +286,7 @@ ...@@ -255,7 +286,7 @@
'lang-change': function(lang) { 'lang-change': function(lang) {
this.init(lang) this.init(lang)
$("#search").trigger('click') $("#search").trigger('click')
} }
}, },
} }
...@@ -270,4 +301,17 @@ ...@@ -270,4 +301,17 @@
.scroll { .scroll {
width: 250%; width: 250%;
} }
</style> </style>
\ No newline at end of file <style>
#pt_table tr td:first-child, #pt_table tr th:first-child, #exp_table tr td:first-child, #exp_table tr th:first-child {
width: 1%;
white-space: nowrap;
}
#pt_table td, #pt_table th {
text-align: left;
vertical-align: middle}
#epx_table td, #exp_table th {
text-align: left;
vertical-align: middle}
</style>
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
class="winRateTitle-color-3">上月胜率</div>。在每个月<div class="winRateTitle-color-3">20日</div> class="winRateTitle-color-3">上月胜率</div>。在每个月<div class="winRateTitle-color-3">20日</div>
以及之后,胜率为<div class="winRateTitle-color-3">当月胜率</div> </div>--> 以及之后,胜率为<div class="winRateTitle-color-3">当月胜率</div> </div>-->
<div id="winRateTitle-2">更新:<div class="winRateTitle-color-3">每天更新,当月胜率</div></div> <div id="winRateTitle-2">更新:<div class="winRateTitle-color-3">每天更新,当月胜率</div></div>
</div> </div>
<div class='winRateContent'> <div class='winRateContent'>
<div class='winRateContent-Tabs'> <div class='winRateContent-Tabs'>
......
...@@ -41,6 +41,7 @@ module.exports = { ...@@ -41,6 +41,7 @@ module.exports = {
dueHistory: '最近决斗记录', dueHistory: '最近决斗记录',
athleticDueHistory: '竞技场决斗记录', athleticDueHistory: '竞技场决斗记录',
entertainDueHistory: '娱乐场决斗记录', entertainDueHistory: '娱乐场决斗记录',
monthlyHistory: '每月决斗记录',
tagInfo: '绿色表示获胜方,红色则表示掉线。', tagInfo: '绿色表示获胜方,红色则表示掉线。',
rates: '卡组胜率', rates: '卡组胜率',
...@@ -155,6 +156,7 @@ module.exports = { ...@@ -155,6 +156,7 @@ module.exports = {
side: 'Side', side: 'Side',
extra: 'Extra', extra: 'Extra',
dueHistory: 'Recent Due History', dueHistory: 'Recent Due History',
monthlyHistory: 'Monthly Rank Record',
athleticDueHistory: 'Athletic Due History', athleticDueHistory: 'Athletic Due History',
entertainDueHistory: 'Entertain Due History', entertainDueHistory: 'Entertain Due History',
tagInfo: 'Green tag represents the winner.Red tag represents player lost connection.', tagInfo: 'Green tag represents the winner.Red tag represents player lost connection.',
......
module.exports = { module.exports = {
cn: { cn: {
"sProcessing": "处理中...", "sProcessing": "处理中...",
"sLengthMenu": "显示 _MENU_ 项结果", "sLengthMenu": "显示 _MENU_ 项结果",
"sZeroRecords": "没有匹配结果", "sZeroRecords": "没有匹配结果",
"sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项", "sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
"sInfoEmpty": "显示第 0 至 0 项结果,共 0 项", "sInfoEmpty": "显示第 0 至 0 项结果,共 0 项",
"sInfoFiltered": "(由 _MAX_ 项结果过滤)", "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
"sInfoPostFix": "", "sInfoPostFix": "",
"sSearch": "搜索:", "sSearch": "搜索:",
"sUrl": "", "sUrl": "",
"sEmptyTable": "表中数据为空", "sEmptyTable": "表中数据为空",
"sLoadingRecords": "载入中...", "sLoadingRecords": "载入中...",
"sInfoThousands": ",", "sInfoThousands": ",",
"oPaginate": { "oPaginate": {
"sFirst": "首页", "sFirst": "首页",
"sPrevious": "上页", "sPrevious": "上页",
"sNext": "下页", "sNext": "下页",
"sLast": "末页" "sLast": "末页"
}, },
"oAria": { "oAria": {
"sSortAscending": ": 以升序排列此列", "sSortAscending": ": 以升序排列此列",
"sSortDescending": ": 以降序排列此列" "sSortDescending": ": 以降序排列此列"
}, },
rank: "排名", rank: "排名",
name: "用户名", name: "用户名",
exp: "EXP", exp: "EXP",
pt: "D.P", pt: "D.P",
win: "胜局", win: "胜局",
lose: "负局", lose: "负局",
wl: "胜率", wl: "胜率",
athleticWin:'竞技场胜利',
cardName: "卡名", athleticLose:'竞技场失败',
used: "使用量", season:'时间',
put1: "投入1", total:'合计',
put2: "投入2", cardName: "卡名",
put3: "投入3", used: "使用量",
put1: "投入1",
put2: "投入2",
put3: "投入3",
deck: "卡组", deck: "卡组",
count: "使用数", count: "使用数",
topTags: "热门标签", PickRate : "使用率",
topTags: "热门标签",
playerA: '玩家A', playerA: '玩家A',
playerB: '玩家B', playerB: '玩家B',
startTime: '开始时间', startTime: '开始时间',
endTime: '结束时间', endTime: '结束时间',
},
en: {
"oPaginate": {
"sPrevious": "Pre",
}, },
en: { rank: "Rank",
"oPaginate": { name: "Name",
"sPrevious": "Pre", exp: "EXP",
}, pt: "D.P",
rank: "Rank", win: "Win",
name: "Name", lose: "Lose",
exp: "EXP", wl: "W/L",
pt: "D.P",
win: "Win",
lose: "Lose",
wl: "W/L",
cardName: "Card Name",
used: "Used",
put1: "Put one ",
put2: "Put two ",
put3: "Put three ",
deck: "Deck", cardName: "Card Name",
count: "Count", used: "Used",
topTags: "Top Tags", PickRate:"Pick Rate",
put1: "Put one ",
put2: "Put two ",
put3: "Put three ",
athleticWin:'Win',
athleticLose:'Lose',
season:'Time',
total:'Total',
deck: "Deck",
count: "Count",
topTags: "Top Tags",
playerA: 'PlayerA', playerA: 'PlayerA',
playerB: 'PlayerA', playerB: 'PlayerA',
startTime: 'Start Time', startTime: 'Start Time',
endTime: 'End Time', endTime: 'End Time',
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment