diff --git a/config/config.php b/config/config.php index 29a26e2938..01f269a5bf 100644 --- a/config/config.php +++ b/config/config.php @@ -164,6 +164,29 @@ $config->duplicateTime = 30; $config->maxCount = 500; $config->moreLinks = array(); +/* 渠成平台设置。CNE Api settings. */ +$config->demoAccounts = ''; // 用于演示的账号列表,该账号安装的应用30钟后会自动删除。 In account list for demo, app instance of demo will be removed in 30 minutes. +$config->demoAppLife = 30; // Demo安装的应用实例存续时长(分钟)。The minutes life of instance which demo account installed. +$config->CNE = new stdclass(); +$config->CNE->api = new stdclass(); +$config->CNE->api->host = ''; +$config->CNE->api->auth = 'X-Auth-Token'; +$config->CNE->api->token = 'reiquai7pei7thei4iePe5ait3Kaiquu'; // Please set token in my.php. +$config->CNE->api->headers = array('Content-Type: application/json'); +$config->CNE->api->channel = 'stable'; + +$config->CNE->app = new stdclass; +$config->CNE->app->domain = 'dev.haogs.cn'; + +$config->cloud = new stdclass; +$config->cloud->api = new stdclass; +$config->cloud->api->host = 'https://api.qucheng.com'; +$config->cloud->api->auth = 'X-Auth-Token'; +$config->cloud->api->token = 'gwaN4KynqNqQoPD7eN8s'; // Please set token in my.php. +$config->cloud->api->headers = array('Content-Type: application/json'); +$config->cloud->api->channel = 'stable'; +$config->cloud->api->switchChannel = false; + /* 配置参数过滤。Filter param settings. */ $filterConfig = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'filter.php'; if(file_exists($filterConfig)) include $filterConfig; @@ -204,26 +227,3 @@ else unset($config->bizVersion); unset($config->maxVersion); } - -/* 渠成平台设置。CNE Api settings. */ -$config->demoAccounts = ''; // 用于演示的账号列表,该账号安装的应用30钟后会自动删除。 In account list for demo, app instance of demo will be removed in 30 minutes. -$config->demoAppLife = 30; // Demo安装的应用实例存续时长(分钟)。The minutes life of instance which demo account installed. -$config->CNE = new stdclass(); -$config->CNE->api = new stdclass(); -$config->CNE->api->host = ''; -$config->CNE->api->auth = 'X-Auth-Token'; -$config->CNE->api->token = 'reiquai7pei7thei4iePe5ait3Kaiquu'; // Please set token in my.php. -$config->CNE->api->headers = array('Content-Type: application/json'); -$config->CNE->api->channel = 'stable'; - -$config->CNE->app = new stdclass; -$config->CNE->app->domain = 'dev.haogs.cn'; - -$config->cloud = new stdclass; -$config->cloud->api = new stdclass; -$config->cloud->api->host = 'https://api.qucheng.com'; -$config->cloud->api->auth = 'X-Auth-Token'; -$config->cloud->api->token = 'gwaN4KynqNqQoPD7eN8s'; // Please set token in my.php. -$config->cloud->api->headers = array('Content-Type: application/json'); -$config->cloud->api->channel = 'stable'; -$config->cloud->api->switchChannel = false; diff --git a/module/gitlab/ui/binduser.html.php b/module/gitlab/ui/binduser.html.php index 00c3e2f6aa..3c0006179e 100644 --- a/module/gitlab/ui/binduser.html.php +++ b/module/gitlab/ui/binduser.html.php @@ -109,5 +109,5 @@ form ), ), $tbody -) + ) ); diff --git a/module/store/css/appview.ui.css b/module/store/css/appview.ui.css new file mode 100644 index 0000000000..d89935a49e --- /dev/null +++ b/module/store/css/appview.ui.css @@ -0,0 +1,9 @@ +.detail-header .icon-info-sign {color: rgba(var(--color-secondary-500-rgb),var(--tw-bg-opacity));} +.app-name-container {margin: auto; margin-left: 8px; font-size: 24px;} +.img-thumbnail {width: 32%; height: auto; padding: 5px;} +.img-thumbnail img {width: 100%; height: auto; object-fit: contain; border: solid 1px #ddd; border-radius: 3px;} +.errorBox{padding: 20px; border: solid 1px #ddd;} +#dynamicPager {justify-content: flex-end;} +#dynamicPager .ghost {color: rgb(131, 138, 157);} +#dynamicTable a {color: inherit;} +#store-detail-action .install-btn {padding-left: 25px; padding-right: 25px;} \ No newline at end of file diff --git a/module/store/ui/appview.html.php b/module/store/ui/appview.html.php new file mode 100644 index 0000000000..a3e19df71d --- /dev/null +++ b/module/store/ui/appview.html.php @@ -0,0 +1,156 @@ + + * @package store + * @link http://www.zentao.net + */ + +namespace zin; + +$setting = usePager('dynamicPager'); +$screenshots = array_filter($cloudApp->screenshot_urls); +$screenshotsWg = array(); +foreach($screenshots as $screenshot) +{ + $screenshotsWg[] = div + ( + setClass('flex-1 img-thumbnail'), + img + ( + set::src($screenshot), + setClass('state'), + on::click('window.open("' . $screenshot . '")') + ) + ); +} + +$dynamicArticlesWd = array(); +foreach($dynamicArticles as $article) +{ + $dynamicArticlesWd[] = h::tr(h::td(a($article->title, set::href($article->url), set::target('_bland')))); +} + +$dropMenus = array(); +$dropMenus[] = array('text' => $lang->store->gitUrl, 'icon' => 'github', 'id' => 'git', 'target' => '_blank', 'url' => zget($cloudApp, 'git_url', '#')); +$dropMenus[] = array('text' => $lang->store->dockerfileUrl, 'icon' => 'docker', 'id' => 'docker', 'target' => '_blank', 'url' => zget($cloudApp, 'dockerfile_url', '#')); +$dropMenus[] = array('text' => $lang->store->forumUrl, 'icon' => 'forum', 'id' => 'forum', 'target' => '_blank', 'url' => 'https://www.qucheng.com/forum/usage.html'); + +detailHeader( + to::prefix + ( + backBtn + ( + set::icon('back'), + set::type('secondary'), + $lang->goback + ) + ), + to::title(''), + to::suffix + ( + div + ( + setID('store-detail-action'), + dropdown + ( + set::staticMenu(true), + btn + ( + setClass('ghost text-black mr-2'), + set::icon('info-sign'), + $lang->store->support, + ), + set::items($dropMenus), + ), + backBtn + ( + $lang->store->install, + setClass('primary btn size-sm install-btn'), + set::type('primary'), + set::url($this->createLink('instance', 'install', "id={$cloudApp->id}")), + setData('toggle', 'modal'), + ) + ) + ) +); +detailBody +( + sectionList + ( + section + ( + div + ( + setClass('flex'), + img(set::src($cloudApp->logo), setStyle(array('width' => '50px', 'height' => '50px'))), + div(setClass('app-name-container'),div($cloudApp->alias, setClass('app-name'))) + ), + ), + section + ( + set::title($lang->store->appBasicInfo), + set::content($cloudApp->desc), + set::useHtml(true), + h::table + ( + setStyle('min-width', '600px'), + setClass('table w-auto max-w-full bordered mt-4'), + h::tr + ( + h::th($lang->store->appVersion), + h::th($lang->store->appType), + h::th($lang->store->author), + h::th($lang->store->releaseDate), + ), + h::tr + ( + h::td($cloudApp->app_version), + h::td(trim(implode('/', array_column($cloudApp->categories, 'alias')), '/')), + h::td($cloudApp->author), + h::td((new \DateTime($cloudApp->publish_time))->format('Y-m-d')), + ) + ) + ), + section + ( + set::title($lang->store->screenshots), + div + ( + setClass('flex gap-5 flex-wrap'), + empty($screenshotsWg) ? div($lang->store->noScreenshot, setClass('errorBox')) : '', + ...$screenshotsWg + ) + ), + section + ( + set::title($lang->store->appDynamic), + set::content(empty($dynamicArticles) ? $lang->store->noDynamicArticle : ''), + empty($dynamicArticles) ? '' : div + ( + setClass('border pb-5 pt-5'), + h::table + ( + setID('dynamicTable'), + setClass('table borderless table-hover mb-3'), + ...$dynamicArticlesWd, + ), + pager( + setID('dynamicPager'), + set::page($setting['page']), + set::recTotal($setting['recTotal']), + set::recPerPage($setting['recPerPage']), + set::linkCreator($setting['linkCreator']), + set::items($setting['items']), + set::gap($setting['gap']), + ), + ) + ) + ) +); + diff --git a/module/store/ui/browse.html.php b/module/store/ui/browse.html.php index 3aae7d5dfd..2c539df1c7 100644 --- a/module/store/ui/browse.html.php +++ b/module/store/ui/browse.html.php @@ -137,4 +137,4 @@ sidebar set::items($tree), set::onClickItem(jsRaw('window.treeClick')), ) -); \ No newline at end of file +);