feat: add IPA download button to channel list (super admin only)
- data() returns ipa_url if public/channel/<id>/app.ipa exists - Blade: warm-colored IPA button in ops column, super admin + has IPA only - Click to download the built IPA directly
This commit is contained in:
@@ -88,6 +88,7 @@ class ChannelController extends Controller
|
||||
'app_name' => $c->app_name ?: '',
|
||||
'bundle_id' => $c->bundle_id ?: '',
|
||||
'h5_url' => $c->h5_url ?: '',
|
||||
'ipa_url' => file_exists(public_path('channel/'.$c->channel_id.'/app.ipa')) ? '/channel/'.$c->channel_id.'/app.ipa' : '',
|
||||
'links' => $c->supportLinks(),
|
||||
'landing_path' => $c->landingPath(),
|
||||
'created_at' => optional($c->created_at)->format('Y-m-d H:i:s'),
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
<script type="text/html" id="LAY-ch-ops">
|
||||
<a class="layui-btn layui-btn-xs" lay-event="links">查看链接</a>
|
||||
<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">编辑</a>
|
||||
@{{# if(d._isSuperAdmin && d.ipa_url){ }}
|
||||
<a class="layui-btn layui-btn-warm layui-btn-xs" href="{{ d.ipa_url }}" download title="{{ (d.app_name || 'App') + '.ipa' }}">IPA</a>
|
||||
@{{# } }}
|
||||
@{{# if(d._isAdmin){ }}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
@{{# } }}
|
||||
@@ -88,7 +91,7 @@ layui.use(['table', 'form', 'layer'], function () {
|
||||
cols: [cols],
|
||||
page: true, limit: 20, limits: [10, 20, 30, 50],
|
||||
parseData: function (res) {
|
||||
(res.data || []).forEach(function (row) { row._isAdmin = isAdmin; });
|
||||
(res.data || []).forEach(function (row) { row._isAdmin = isAdmin; row._isSuperAdmin = isSuperAdmin; });
|
||||
return res;
|
||||
},
|
||||
request: { pageName: 'page', limitName: 'limit' },
|
||||
|
||||
Reference in New Issue
Block a user