{template "header.html"}
<div class="note note-danger">
    <p><a href="javascript:dr_update_cache();">{dr_lang('更改配置之后需要更新缓存之后才能生效')}</a></p>
</div>

<div class="">
<form class="form-horizontal" role="form" id="myform">
    {dr_form_hidden()}
    <div class="table-scrollable">
        <table class="table table-striped table-bordered table-hover table-checkable dataTable">
            <thead>
            <tr class="heading">
                <th width="60" style="text-align:center">  </th>
                <th width="330"> {dr_lang('名称')} / {dr_lang('目录')}</th>
                {if !$is_oem}
                <th width="150"> {dr_lang('开发者')} </th>
                {/if}
                <th width="80"> {dr_lang('版本')} </th>
                <th> {dr_lang('操作')} </th>
            </tr>
            </thead>
            <tbody>
            {php $i=1;}
            {loop $list $dir $t}
            <tr class="odd gradeX">
                <td style="text-align:center">
                    <span class="badge badge-success"> {$i} </span>
                </td>
                <td><i class="{$t.icon}"></i> {$t.name} / {$dir}</td>
                {if !$is_oem}
                <td>{if $t.store}<a href="{$t.store}" target="_blank">{$t.author}</a>{else}{$t.author}{/if}</td>
                {/if}
                <td> {if $is_oem}{$t.version}{else}<a href="javascript:dr_show_log('app-{$t.id}', '{$t.version}');">{$t.version}</a>{/if}</td>
                <td>
                    {if $t.install}
                    <label><a href="javascript:dr_load_ajax('{dr_lang('确定卸载此程序吗？')}', '{dr_url('cloud/uninstall', ['dir'=>$dir])}', 1);" class="btn btn-xs red"> <i class="fa fa-trash"></i> {dr_lang('卸载')} </a></label>
                    {else}
                    <label><a href="javascript:{if !$t.mtype && $t.ftype=='module'}dr_install_module_select('{dr_url('cloud/install', ['dir'=>$dir])}'){else}dr_load_ajax('{dr_lang('确定安装此程序吗？')}', '{dr_url('cloud/install', ['dir'=>$dir])}', 1){/if};" class="btn btn-xs blue"> <i class="fa fa-plus"></i> {dr_lang('安装')} </a></label>
                    {/if}
                </td>
            </tr>
            {php $i++;}
            {/loop}

            {loop $error $dir $t}
            <tr class="odd gradeX">
                <td style="text-align:center">
                    <span class="badge badge-no"><i class="fa fa-times"></i></span>
                </td>
                <td><i class="{$t.icon}"></i> {$t.name} / {$dir}</td>
                {if !$is_oem}
                <td>{if $t.store}<a href="{$t.store}" target="_blank">{$t.author}</a>{else}{$t.author}{/if}</td>
                {/if}
                <td> {$t.version} </td>
                <td>
                    <a href="javascript:dr_help(1075);" style="color: red">{dr_lang('此应用无法被识别')}</a>
                </td>
            </tr>
            {/loop}
            </tbody>
        </table>
    </div>


</form>
</div>

<script type="text/javascript">

    function dr_show_log(id, v) {
        layer.open({
            type: 2,
            title: '版本日志',
            scrollbar: false,
            resize: true,
            maxmin: true, //开启最大化最小化按钮
            shade: 0,
            area: ['80%', '80%'],
            content: '{dr_url("cloud/log_show")}&id='+id+'&version='+v,
        });
    }

</script>
{template "footer.html"}