$(function(){

var img = "http://file.hu60.cn//////file-hash-jpg-86433bf86e6346d26fdaa5e76850be71463027.jpg" ,bc = "#1CC";

//  头像地址,头像边框颜色

var tail = "华为荣耀6Plus的孤单";

//  底部小尾巴内容

var bg = "#0DD", fc= "#FFF";

// 气泡背景颜色,气泡字体颜色

var header = "[div=width:100%;vertical-align:top][div=overflow-x:hidden;width:50px;height:50px;background:#fff url("+img+");background-size:50px auto;border:3px solid "+bc+";border-radius:50%;box-shadow:0 0 3px #000;margin:5px 15px 5px 5px;display:inline-block;vertical-align:top][/div][div=height:100%;display:inline-block;width:calc(100% - 90px);vertical-align:top][div=background:"+bg+";padding:20px;box-shadow:0 0 3px #000;color:"+fc+";border-radius:3px;margin:3px]";

var footer = " [/div][/div][/div][span=display:none]--[/span][div=padding:3px 0;text-align:center;font-size:7px;border:1px solid #1EE;border-style:solid none;margin-top:10px]"+tail+"[/div]";

//  Mark-1

$('#reply_topic_button,#quick_chat_button,#post_topic_button').click(function(){

var content = $('#content').val();

$('#content').val(header + content + footer);

})

})

$(document).ready(function () {

if (location.pathname == "/q.php/index.index.html") {

$('.layout-head').html('');

var ctx = document.getElementById('qiniu_traffic').getContext('2d');

window.myLine = new Chart(ctx, config);

$.get('https://hu60.cn/q.php/api.qiniu_traffic.json', function(result) {

if (result.data) {

config.data.labels = result.time.map(function(time) {

return time.split(' ')[0];

});

config.data.datasets[0].data = result.data.china;

config.data.datasets[1].data = result.data.oversea;

window.myLine = new Chart(ctx, config);

}

});

}

});

function bytes_format(bytes) {

if (bytes 

return bytes + ' B';

if (bytes 

return (bytes / 1024).toFixed(0) + ' KB';

if (bytes 

return (bytes / 1048576).toFixed(0) + ' MB';

return (bytes / 1073741824).toFixed(2) + ' GB';

}

var config = {

type: 'line',

data: {

labels: [],

datasets: [{

label: '中国',

backgroundColor: window.chartColors.red,

borderColor: window.chartColors.red,

data: [],

fill: false,

},{

label: '海外',

backgroundColor: window.chartColors.green,

borderColor: window.chartColors.green,

data: [],

fill: false,

}]

},

options: {

responsive: true,

title: {

display: true,

text: '七牛云流量图'

},

tooltips: {

mode: 'index',

intersect: false,

callbacks: {

label: function (item) {

return config.data.datasets[item.datasetIndex].label + ': ' + bytes_format(item.yLabel);

}

},

},

hover: {

mode: 'nearest',

intersect: true

},

scales: {

xAxes: [{

display: true,

scaleLabel: {

display: false,

labelString: '日期'

}

}],

yAxes: [{

display: true,

scaleLabel: {

display: false,

labelString: '流量'

},

ticks: {

callback: bytes_format

}

}]

}

}

};

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐