mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-28 21:31:37 +08:00
版本发布信息改用ajax异步获取
This commit is contained in:
parent
ab3e04c8a2
commit
55401cf451
@ -39,12 +39,23 @@ class IndexController extends Controller
|
|||||||
$todayStat = $indexService->getTodayStat();
|
$todayStat = $indexService->getTodayStat();
|
||||||
$appInfo = $indexService->getAppInfo();
|
$appInfo = $indexService->getAppInfo();
|
||||||
$serverInfo = $indexService->getServerInfo();
|
$serverInfo = $indexService->getServerInfo();
|
||||||
$releases = $indexService->getReleases();
|
|
||||||
|
|
||||||
$this->view->setVar('global_stat', $globalStat);
|
$this->view->setVar('global_stat', $globalStat);
|
||||||
$this->view->setVar('today_stat', $todayStat);
|
$this->view->setVar('today_stat', $todayStat);
|
||||||
$this->view->setVar('app_info', $appInfo);
|
$this->view->setVar('app_info', $appInfo);
|
||||||
$this->view->setVar('server_info', $serverInfo);
|
$this->view->setVar('server_info', $serverInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Get("/releases", name="admin.releases")
|
||||||
|
*/
|
||||||
|
public function releasesAction()
|
||||||
|
{
|
||||||
|
$indexService = new IndexService();
|
||||||
|
|
||||||
|
$releases = $indexService->getReleases();
|
||||||
|
|
||||||
|
$this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
|
||||||
$this->view->setVar('releases', $releases);
|
$this->view->setVar('releases', $releases);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ class Index extends Service
|
|||||||
|
|
||||||
$client = new Client();
|
$client = new Client();
|
||||||
|
|
||||||
$response = $client->get($url, ['timeout' => 3]);
|
$response = $client->get($url);
|
||||||
|
|
||||||
$content = json_decode($response->getBody(), true);
|
$content = json_decode($response->getBody(), true);
|
||||||
|
|
||||||
|
@ -28,4 +28,22 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block inline_js %}
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
layui.use(['jquery', 'layer', 'helper'], function () {
|
||||||
|
|
||||||
|
var $ = layui.jquery;
|
||||||
|
var helper = layui.helper;
|
||||||
|
|
||||||
|
var $appTrend = $('#app-trend');
|
||||||
|
helper.ajaxLoadHtml($appTrend.data('url'), $appTrend.attr('id'));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -1,19 +1,6 @@
|
|||||||
<div class="layui-card layui-text">
|
<div class="layui-card layui-text">
|
||||||
<div class="layui-card-header">产品动态</div>
|
<div class="layui-card-header">产品动态</div>
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
<table class="layui-table">
|
<div id="app-trend" data-url="{{ url({'for':'admin.releases'}) }}"></div>
|
||||||
<colgroup>
|
|
||||||
<col width="80%">
|
|
||||||
<col>
|
|
||||||
</colgroup>
|
|
||||||
<tbody>
|
|
||||||
{% for release in releases %}
|
|
||||||
<tr>
|
|
||||||
<td><a href="{{ release.url }}" target="_blank">{{ release.title }}</a></td>
|
|
||||||
<td>{{ release.date }}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
14
app/Http/Admin/Views/index/releases.volt
Normal file
14
app/Http/Admin/Views/index/releases.volt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<table class="layui-table">
|
||||||
|
<colgroup>
|
||||||
|
<col width="80%">
|
||||||
|
<col>
|
||||||
|
</colgroup>
|
||||||
|
<tbody>
|
||||||
|
{% for release in releases %}
|
||||||
|
<tr>
|
||||||
|
<td><a href="{{ release.url }}" target="_blank">{{ release.title }}</a></td>
|
||||||
|
<td>{{ release.date }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
@ -34,6 +34,11 @@
|
|||||||
list-style: decimal;
|
list-style: decimal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.loading {
|
||||||
|
padding: 30px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
.kg-layer-content {
|
.kg-layer-content {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user