function page_sys_site(c){
  api('/api/admin/system-configs').then(function(d){
    var h = '<div class="card"><div class="card-title">网站设置</div>';
    h += '<div class="form-group"><label>网站名称</label><input id="site_name" class="form-control" value="'+(d.site_name||'')+'"></div>';
    h += '<button class="btn btn-pri" onclick="saveSite()">保存</button></div>';
    c.innerHTML = h;
  });
}
function saveSite(){
  var name = document.getElementById('site_name').value;
  api('/api/admin/system-configs', {method:'PUT',headers:{'Content-Type':'application/json'},
    body:JSON.stringify({entries:[{key:'site_name',value:name}]})})
    .then(function(d){ toast(d.error||'保存成功', d.error?'error':'success'); });
}
