This commit is contained in:
hufangzhou
2022-04-27 10:48:28 +08:00
parent 2d82ad3e79
commit 0424801e4e
11 changed files with 82 additions and 24 deletions
+1
View File
@@ -319,6 +319,7 @@ class api extends control
/* Record action for create api library. */
$this->action->create('docLib', $libID, 'Created');
if(!helper::isAjaxRequest()) return print(js::locate($this->createLink('api', 'index', "libID=$libID"), 'parent.parent'));
return $this->sendSuccess(array('locate' => $this->createLink('api', 'index', "libID=$libID")));
}
-3
View File
@@ -199,9 +199,6 @@ $lang->api->structParamsOptons = array_merge($lang->api->paramsTypeOptions, ar
$lang->api->allParamsTypeOptions = array_merge($lang->api->paramsTypeOptions, $lang->api->paramsTypeCustomOptions);
$lang->api->requiredOptions = array(0 => 'No', 1 => 'Yes');
$lang->doclib = new stdclass();
$lang->doclib->name = 'API Library Name';
$lang->apistruct = new stdClass();
$lang->apistruct->name = 'Name';
-3
View File
@@ -199,9 +199,6 @@ $lang->api->structParamsOptons = array_merge($lang->api->paramsTypeOptions, ar
$lang->api->allParamsTypeOptions = array_merge($lang->api->paramsTypeOptions, $lang->api->paramsTypeCustomOptions);
$lang->api->requiredOptions = array(0 => '否', 1 => '是');
$lang->doclib = new stdclass();
$lang->doclib->name = '接口库名称';
$lang->apistruct = new stdClass();
$lang->apistruct->name = '结构名';
-3
View File
@@ -199,9 +199,6 @@ $lang->api->structParamsOptons = array_merge($lang->api->paramsTypeOptions, ar
$lang->api->allParamsTypeOptions = array_merge($lang->api->paramsTypeOptions, $lang->api->paramsTypeCustomOptions);
$lang->api->requiredOptions = array(0 => '否', 1 => '是');
$lang->doclib = new stdclass();
$lang->doclib->name = '介面庫名稱';
$lang->apistruct = new stdClass();
$lang->apistruct->name = '結構名';
-12
View File
@@ -65,17 +65,5 @@
</div>
</div>
</div>
<div class='hidden'>
<table>
<tr id='aclBoxA'>
<th><?php echo $lang->api->control;?></th>
<td><?php echo html::radio('acl', $lang->api->aclListA, 'default', "onchange='toggleAcl(this.value, \"lib\")'")?></td>
</tr>
<tr id='aclBoxB'>
<th><?php echo $lang->api->control;?></th>
<td><?php echo html::radio('acl', $lang->api->aclListB, 'open', "onchange='toggleAcl(this.value, \"lib\")'")?></td>
</tr>
</table>
</div>
<?php js::set('noticeAcl', $lang->api->noticeAcl);?>
<?php include '../../common/view/footer.lite.html.php';?>
+2
View File
@@ -171,6 +171,8 @@ class doc extends control
if(empty($projects)) unset($libTypeList['project']);
if(empty($executions)) unset($libTypeList['execution']);
$this->app->loadLang('api');
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->users = $this->user->getPairs('nocode|noclosed');
$this->view->products = $products;
+1 -1
View File
@@ -42,7 +42,7 @@ function toggleAcl(acl, type)
var notice = typeof(noticeAcl[libType][acl]) != 'undefined' ? noticeAcl[libType][acl] : '';
$('#noticeAcl').html(notice);
if(libType == 'custom' && acl == 'private') $('#whiteListBox').addClass('hidden');
if((libType == 'custom' || libType == 'api') && acl == 'private') $('#whiteListBox').addClass('hidden');
if(libType == 'project' && typeof(doclibID) != 'undefined')
{
+53
View File
@@ -29,6 +29,14 @@ function changeByLibType(libType)
$('table tr.execution').addClass('hidden');
$('#execution').attr('disabled', true);
$('.normalLib').removeClass('hidden');
$('.normalLib input').attr('disabled', false);
$('table tr.apilib').addClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', true);
$('form').removeAttr('action');
changeDoclibAcl(libType);
}
else if(libType == 'project')
@@ -42,6 +50,14 @@ function changeByLibType(libType)
$('table tr.execution').addClass('hidden');
$('#execution').attr('disabled', true);
$('.normalLib').removeClass('hidden');
$('.normalLib input').attr('disabled', false);
$('table tr.apilib').addClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', true);
$('form').removeAttr('action');
changeDoclibAcl(libType);
}
else if(libType == 'execution')
@@ -55,6 +71,35 @@ function changeByLibType(libType)
$('table tr.project').addClass('hidden');
$('#project').attr('disabled', true);
$('.normalLib').removeClass('hidden');
$('.normalLib input').attr('disabled', false);
$('table tr.apilib').addClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', true);
$('form').removeAttr('action');
changeDoclibAcl(libType);
}
else if(libType == 'api')
{
$('table tr.product').addClass('hidden');
$('#product').attr('disabled', true);
$('table tr.project').addClass('hidden');
$('#project').attr('disabled', true);
$('table tr.execution').addClass('hidden');
$('#execution').attr('disabled', true);
$('.normalLib').addClass('hidden');
$('.normalLib input').attr('disabled', true);
$('table tr.apilib').removeClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', false);
$('form').attr('action', createLink('api', 'createLib'));
changeDoclibAcl(libType);
}
else
@@ -68,6 +113,14 @@ function changeByLibType(libType)
$('table tr.execution').addClass('hidden');
$('#execution').attr('disabled', true);
$('.normalLib').removeClass('hidden');
$('.normalLib input').attr('disabled', false);
$('table tr.apilib').addClass('hidden');
$('.apilib input, #desc, #baseUrl').attr('disabled', true);
$('form').removeAttr('action');
changeDoclibAcl(libType);
}
+4
View File
@@ -158,6 +158,7 @@ $lang->doc->allExecutions = 'All' . $lang->executionCommon . 's';
$lang->doc->libTypeList['product'] = $lang->productCommon . ' Library';
if($config->systemMode == 'new') $lang->doc->libTypeList['project'] = 'Project Library';
$lang->doc->libTypeList['execution'] = $lang->execution->common . ' Library';
$lang->doc->libTypeList['api'] = 'API Library';
$lang->doc->libTypeList['custom'] = 'Custom Library';
$lang->doc->libGlobalList['api'] = 'Api Libray';
@@ -248,6 +249,9 @@ $lang->doc->noticeAcl['lib']['project']['private'] = 'Users who can access the
$lang->doc->noticeAcl['lib']['project']['custom'] = 'Users in the whiltelist can access it.';
$lang->doc->noticeAcl['lib']['execution']['default'] = "Users who can access the selected {$lang->executionCommon} can access it.";
$lang->doc->noticeAcl['lib']['execution']['custom'] = "Users who can access the selected {$lang->executionCommon} or users in the whiltelist can access it.";
$lang->doc->noticeAcl['lib']['api']['open'] = 'All users can access it.';
$lang->doc->noticeAcl['lib']['api']['custom'] = 'Users in the whitelist can access it.';
$lang->doc->noticeAcl['lib']['api']['private'] = 'Only the one who created it can access it.';
$lang->doc->noticeAcl['lib']['custom']['open'] = 'All users can access it.';
$lang->doc->noticeAcl['lib']['custom']['custom'] = 'Users in the whitelist can access it.';
$lang->doc->noticeAcl['lib']['custom']['private'] = 'Only the one who created it can access it.';
+5
View File
@@ -21,6 +21,7 @@ $lang->doclib->execution = $lang->executionCommon . '库';
$lang->doclib->product = $lang->productCommon . '库';
$lang->doclib->apiLibName = '接口库名称';
$lang->doclib->aclListA = array();
$lang->doclib->aclListA['default'] = '默认';
$lang->doclib->aclListA['custom'] = '自定义';
@@ -158,6 +159,7 @@ $lang->doc->allExecutions = '所有' . $lang->executionCommon;
$lang->doc->libTypeList['product'] = $lang->productCommon . '文档库';
if($config->systemMode == 'new') $lang->doc->libTypeList['project'] = '项目文档库';
$lang->doc->libTypeList['execution'] = $lang->execution->common . '文档库';
$lang->doc->libTypeList['api'] = '接口库';
$lang->doc->libTypeList['custom'] = '自定义文档库';
$lang->doc->libGlobalList['api'] = '接口文档库';
@@ -248,6 +250,9 @@ $lang->doc->noticeAcl['lib']['project']['private'] = "有所选项目访问权
$lang->doc->noticeAcl['lib']['project']['custom'] = "白名单的用户可以访问。";
$lang->doc->noticeAcl['lib']['execution']['default'] = "有所选{$lang->executionCommon}访问权限的用户可以访问。";
$lang->doc->noticeAcl['lib']['execution']['custom'] = "有所选{$lang->executionCommon}访问权限或白名单里的用户可以访问。";
$lang->doc->noticeAcl['lib']['api']['open'] = '所有人都可以访问。';
$lang->doc->noticeAcl['lib']['api']['custom'] = '白名单的用户可以访问。';
$lang->doc->noticeAcl['lib']['api']['private'] = '只有创建者自己可以访问。';
$lang->doc->noticeAcl['lib']['custom']['open'] = '所有人都可以访问。';
$lang->doc->noticeAcl['lib']['custom']['custom'] = '白名单的用户可以访问。';
$lang->doc->noticeAcl['lib']['custom']['private'] = '只有创建者自己可以访问。';
+16 -2
View File
@@ -19,7 +19,7 @@
<div class='main-header'>
<h2><?php echo $lang->doc->createLib;?></h2>
</div>
<form method='post' target='hiddenwin' >
<form method='post' target='hiddenwin'>
<table class='table table-form'>
<tr>
<th class='w-110px'><?php echo $lang->doc->libType?></th>
@@ -45,10 +45,18 @@
<th><?php echo $lang->doc->execution?></th>
<td><?php echo html::select('execution', $executions, $type == 'execution' ? $objectID : '', "class='form-control chosen' data-drop_direction='down'")?></td>
</tr>
<tr>
<tr class="normalLib">
<th><?php echo $lang->doclib->name?></th>
<td><?php echo html::input('name', '', "class='form-control'")?></td>
</tr>
<tr class='apilib hidden'>
<th><?php echo $lang->api->name?></th>
<td><?php echo html::input('name', '', "class='form-control'")?></td>
</tr>
<tr class="apilib hidden">
<th><?php echo $lang->api->baseUrl?></th>
<td><?php echo html::input('baseUrl', '', "class='form-control' placeholder='" . $lang->api->baseUrlDesc . "'");?></td>
</tr>
<tr>
<th><?php echo $lang->doclib->control;?></th>
<td>
@@ -69,6 +77,12 @@
</div>
</td>
</tr>
<tr class="apilib hidden">
<th><?php echo $lang->api->desc;?></th>
<td>
<?php echo html::textarea('desc', '', "rows='8' class='form-control kindeditor' hidefocus='true' tabindex=''");?>
</td>
</tr>
<tr>
<td class='text-center form-actions' colspan='2'><?php echo html::submitButton();?></td>
</tr>