finish api release.

This commit is contained in:
xiawenlong
2021-10-18 16:13:46 +08:00
parent 4f9086045a
commit e1bed5bc55
13 changed files with 401 additions and 153 deletions
+61 -50
View File
@@ -18,16 +18,25 @@
<div class="side-col" style="width:<?php echo $sideWidth; ?>px" data-min-width="<?php echo $sideWidth; ?>">
<div class="cell" style="min-height: 286px">
<div id='title'>
<li class='menu-title'><?php echo $this->lang->api->apiDoc; ?></li>
<li class='menu-title'><?php echo $this->lang->api->module; ?></li>
<?php
echo "<div class='menu-actions'>";
echo html::a('javascript:;', "<i class='icon icon-ellipsis-v'></i>", '', "data-toggle='dropdown' class='btn btn-link'");
echo "<ul class='dropdown-menu pull-right'>";
echo '<li>' . html::a($this->createLink('tree', 'browse', "rootID=$libID&view=api", '', true), '<i class="icon-cog-outline"></i> ' . $this->lang->api->manageType, '', "class='iframe'") . '</li>';
echo "<li class='divider'></li>";
echo '<li>' . html::a($this->createLink('api', 'editLib', "rootID=$libID"), '<i class="icon-edit"></i> ' . $lang->api->editLib, '', "class='iframe'") . '</li>';
echo '<li>' . html::a($this->createLink('api', 'deleteLib', "rootID=$libID"), '<i class="icon-trash"></i> ' . $lang->api->deleteLib, 'hiddenwin') . '</li>';
echo '</ul></div>';
if(!$isRelease)
{
echo "<div class='menu-actions'>";
echo html::a('javascript:;', "<i class='icon icon-ellipsis-v'></i>", '', "data-toggle='dropdown' class='btn btn-link'");
echo "<ul class='dropdown-menu pull-right'>";
echo '<li>' . html::a($this->createLink('tree', 'browse', "rootID=$libID&view=api", '', true), '<i class="icon-cog-outline"></i> ' . $this->lang->api->manageType, '', "class='iframe'") . '</li>';
echo "<li class='divider'></li>";
if(common::hasPriv('api', 'createLib'))
{
echo '<li>' . html::a($this->createLink('api', 'editLib', "rootID=$libID"), '<i class="icon-edit"></i> ' . $lang->api->editLib, '', "class='iframe'") . '</li>';
}
if(common::hasPriv('api', 'deleteLib'))
{
echo '<li>' . html::a($this->createLink('api', 'deleteLib', "rootID=$libID"), '<i class="icon-trash"></i> ' . $lang->api->deleteLib, 'hiddenwin') . '</li>';
}
echo '</ul></div>';
}
?>
</div>
<?php if(!$moduleTree): ?>
@@ -40,52 +49,54 @@
<?php endif;?>
<?php if($apiID):?>
<?php include './content.html.php';?>
<?php include './content.html.php'; ?>
<?php else: ?>
<?php if(empty($libs) || empty($apiList)): ?>
<div class="cell">
<div class="detail">
<li class="detail-title"><?php echo intval($libID) > 0 ? $lang->api->module : $lang->api->title; ?></li>
<?php if(empty($libs) || empty($apiList)): ?>
<div class="cell">
<div class="detail">
<li class="detail-title"><?php echo intval($libID) > 0 ? $lang->api->apiList : $lang->api->title; ?></li>
</div>
<div class="detail">
<div class="no-content"><img src="<?php echo $config->webRoot . 'theme/default/images/main/no_content.png' ?>"/>
</div>
<div class="detail">
<div class="no-content"><img src="<?php echo $config->webRoot . 'theme/default/images/main/no_content.png' ?>"/></div>
<div class="notice text-muted"><?php echo (empty($libs)) ? $lang->api->noLib : $lang->api->noApi; ?></div>
<div class="no-content-button">
<?php
$html = '';
if($libID && common::hasPriv('api', 'create'))
{
$html = html::a(helper::createLink('api', 'create', "libID={$libID}"), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-info btn-wide"');
}
else
{
$html = html::a(helper::createLink('api', 'createLib'), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-info btn-wide iframe"');
}
echo $html;
?>
</div>
<div class="notice text-muted"><?php echo (empty($libs)) ? $lang->api->noLib : $lang->api->noApi; ?></div>
<div class="no-content-button">
<?php
$html = '';
if($libID && common::hasPriv('api', 'create'))
{
$html = html::a(helper::createLink('api', 'create', "libID={$libID}"), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-info btn-wide"');
}
else
{
$html = html::a(helper::createLink('api', 'createLib'), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-info btn-wide iframe"');
}
echo $html;
?>
</div>
</div>
<?php else: ?>
<div class="cell">
<div class="detail">
<ul class="list-group">
<?php foreach($apiList as $api): ?>
<li class="list-group-item">
<div class="heading <?php echo $api->method;?>">
<a href="<?php echo helper::createLink('api', 'index', 'libID=0&moduleID=0&apiID='. $api->id) ?>">
<span class="label label-primary"><?php echo $api->method; ?></span>
<span class="label label-warning" style="width: 60px"><?php echo apiModel::getApiStatusText($api->status); ?></span>
<span class="path"><?php echo $api->path; ?></span>
<span class="desc"><?php echo $api->title; ?></span>
</a>
</div>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php else: ?>
<div class="cell">
<div class="detail">
<ul class="list-group">
<?php foreach($apiList as $api): ?>
<li class="list-group-item">
<div class="heading <?php echo $api->method;?>">
<a href="<?php echo helper::createLink('api', 'index', "libID={$api->lib}&moduleID=0&apiID={$api->id}&version=0&release=$release") ?>">
<span class="label label-primary"><?php echo $api->method; ?></span>
<span class="label label-warning"
style="width: 60px"><?php echo apiModel::getApiStatusText($api->status); ?></span>
<span class="path"><?php echo $api->path; ?></span>
<span class="desc"><?php echo $api->title; ?></span>
</a>
</div>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<?php include '../../common/view/footer.html.php'; ?>