diff --git a/apps/Core/Views/Default/html/system/api/client/services/apis/repos/generic/form.html b/apps/Core/Views/Default/html/system/api/client/services/apis/repos/generic/form.html deleted file mode 100644 index 57604e56e..000000000 --- a/apps/Core/Views/Default/html/system/api/client/services/apis/repos/generic/form.html +++ /dev/null @@ -1,296 +0,0 @@ -{% if api['id'] is defined %} - {% set apiId = api['id'] %} - {% set apiSetup = api['setup'] %} - {% set apiName = api['name'] %} - {% set apiInUse = api['in_use'] %} - {% set apiUsedBy = api['used_by'] %} - {% set apiDescription = api['description'] %} - {% set apiApiUrl = api['api_url'] %} - {% set apiAuthType = api['auth_type'] %} - {% set apiUsername = api['username'] %} - {% set apiPassword = api['password'] %} - {% set apiToken = api['token'] %} - {% set apiAuthorization = api['authorization'] %} -{% else %} - {% set apiId = '' %} - {% set apiSetup = '' %} - {% set apiName = '' %} - {% set apiInUse = '0' %} - {% set apiUsedBy = '' %} - {% set apiDescription = '' %} - {% set apiApiUrl = '' %} - {% set apiAuthType = 'none' %} - {% set apiUsername = '' %} - {% set apiPassword = '' %} - {% set apiToken = '' %} - {% set apiAuthorization = '' %} -{% endif %} -{% if apiAuthType === 'auth' %} - {% set authDisabled = false %} - {% set authoDisabled = true %} - {% set tokenDisabled = true %} -{% elseif apiAuthType === 'token' %} - {% set authDisabled = true %} - {% set authoDisabled = true %} - {% set tokenDisabled = false %} -{% elseif apiAuthType === 'autho' %} - {% set authDisabled = true %} - {% set authoDisabled = false %} - {% set tokenDisabled = true %} -{% else %} - {% set authDisabled = true %} - {% set authoDisabled = true %} - {% set tokenDisabled = true %} -{% endif %} -
- \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/api/client/services/apis/repos/generic/view.html b/apps/Core/Views/Default/html/system/api/client/services/apis/repos/generic/view.html deleted file mode 100644 index a160eb78d..000000000 --- a/apps/Core/Views/Default/html/system/api/client/services/apis/repos/generic/view.html +++ /dev/null @@ -1,27 +0,0 @@ -{{adminltetags.useTag('content', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'parentComponentId' : parent, - 'sectionId' : 'main', - 'contentType' : 'sectionWithForm', - 'cardHeader' : true, - 'cardFooter' : true, - 'cardType' : 'primary', - 'cardIcon' : 'exchange-alt', - 'cardTitle' : title, - 'cardAdditionalClass' : 'rounded-0', - 'cardBodyInclude' : 'services/apis/repo/gitea/form', - 'formButtons' : - [ - 'updateButtonId' : apiId, - 'addActionUrl' : 'system/api/client/services/add', - 'addSuccessRedirectUrl' : 'system/api/client/services', - 'updateActionUrl' : 'system/api/client/services/update', - 'updateSuccessRedirectUrl' : 'system/api/client/services', - 'cancelActionUrl' : 'system/api/client/services', - 'closeActionUrl' : 'system/api/client/services' - ] - ] -)}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/api/client/services/view.html b/apps/Core/Views/Default/html/system/api/client/services/view.html index cb312ac08..4509c50a1 100644 --- a/apps/Core/Views/Default/html/system/api/client/services/view.html +++ b/apps/Core/Views/Default/html/system/api/client/services/view.html @@ -3,14 +3,6 @@ {% set title = 'API:' ~ api['category'] ~ ':' ~ api['provider'] ~ ' - ' ~ api['name'] %} {% else %} {% set apiId = '' %} - {% if api['repository'] is defined and api['repository'] === true %} - {% set title = 'New API:' ~ api['category'] %} - {% else %} - {% set title = 'New API:' ~ api['category'] ~ ':' ~ api['provider'] %} - {% endif %} + {% set title = 'New API:' ~ api['category'] ~ ':' ~ api['provider'] %} {% endif %} -{% if api['repository'] is defined and api['repository'] === true %} - {{view.getPartial('../../modules/repositories/view')}} -{% else %} - {{view.getPartial('services/apis/' ~ api['category'] ~ '/' ~ api['provider']|lower ~ '/view')}} -{% endif %} \ No newline at end of file +{{view.getPartial('services/apis/' ~ api['category'] ~ '/' ~ api['provider']|lower ~ '/view')}} \ No newline at end of file diff --git a/system/Base/Providers/BasepackagesServiceProvider/Packages/ApiClientServices/ApiClientServices.php b/system/Base/Providers/BasepackagesServiceProvider/Packages/ApiClientServices/ApiClientServices.php index 493df07e1..5dcecb075 100644 --- a/system/Base/Providers/BasepackagesServiceProvider/Packages/ApiClientServices/ApiClientServices.php +++ b/system/Base/Providers/BasepackagesServiceProvider/Packages/ApiClientServices/ApiClientServices.php @@ -95,13 +95,19 @@ protected function registerApiCategories() { $this->apiCategories = []; - $basepackagesApis = $this->modules->packages->getPackagesForCategory('basepackagesApis'); $apis = $this->modules->packages->getPackagesForCategory('appsApis'); - $apis = array_merge($basepackagesApis, $apis); + if ($this->apps->getAppInfo()['app_type'] === 'core') { + $basepackagesApis = $this->modules->packages->getPackagesForCategory('basepackagesApis'); + $apis = array_merge($basepackagesApis, $apis); + } if ($apis && is_array($apis) && count($apis) > 0) { foreach ($apis as $api) { + if ($this->apps->getAppInfo()['app_type'] !== $api['app_type']) { + continue; + } + $api['class'] = explode('\\', $api['class']); $category = strtolower($api['class'][$this->helper->lastKey($api['class']) - 2]);