Skip to content

Commit

Permalink
Merge pull request #997 from longguikeji/v2.5-dev
Browse files Browse the repository at this point in the history
V2.5 dev 准备发版
  • Loading branch information
notevery authored Jul 4, 2022
2 parents a6e2b12 + 248844c commit 3194606
Show file tree
Hide file tree
Showing 39 changed files with 851 additions and 200 deletions.
33 changes: 33 additions & 0 deletions Dockerfile-doc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ARG BASEIMAGE=python:3.8-buster
FROM ${BASEIMAGE} as build_deps
WORKDIR /var/arkid
ARG DEBIAN=http://mirrors.aliyun.com/debian
ARG DEBIANSRT=http://mirrors.aliyun.com/debian-security
ARG PIP="https://mirrors.aliyun.com/pypi/simple/"
#ARG DEBIAN=http://deb.debian.org/debian
#ARG DEBIANSRT=http://security.debian.org/debian-security
#ARG PIP="https://pypi.python.org/simple"

RUN set -eux; \
sed -i 's/MinProtocol = TLSv1.2/MinProtocol = TLSv1.0/g' /etc/ssl/openssl.cnf; \
sed -i "s@http://deb.debian.org/debian@$DEBIAN/@g" /etc/apt/sources.list; \
sed -i "s@http://security.debian.org/debian-security@$DEBIANSRT@g" /etc/apt/sources.list ; \
apt-get update; \
apt-get install -y --no-install-recommends \
gettext \
freetds-dev freetds-bin \
python-dev python-pip \
python-dev ; \
# verify that the binary works
rm -rf /var/lib/apt/lists/*; \
groupadd -r arkid && useradd -r -g arkid arkid; \
setcap 'cap_net_bind_service=+ep' /usr/local/bin/python3.8

ADD . .
RUN pip install --no-cache-dir -r requirements.txt
RUN mkdocs build

FROM nginx:alpine
ENV TZ Asia/Shanghai
EXPOSE 80
COPY --from=build_deps /var/arkid/site /usr/share/nginx/html/
2 changes: 1 addition & 1 deletion api/v1/pages/permission_manage/permission_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
),
global_actions={
'confirm': actions.ConfirmAction(
path="/api/v1/tenant/{tenant_id}/permissions/{permission_id}"
path="/api/v1/tenant/{tenant_id}/permission/{permission_id}"
),
}
)
Expand Down
65 changes: 51 additions & 14 deletions api/v1/pages/platform_admin/extension_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@

store_page = pages.CardsPage(name='插件商店')
installed_page = pages.CardsPage(name='已安装')
order_page = pages.FormPage(name=_('Order', '购买'))
order_page = pages.StepPage(name=_('Order', '购买'))
bind_agent_page = pages.FormPage(name=_('Bind Agent', '绑定代理商'))
purchased_page = pages.CardsPage(name='已购买')
edit_page = pages.FormPage(name=_("编辑插件"))
markdown_page = pages.FormPage(name=_("文档"))
profile_page = pages.FormPage(name='插件配置')
price_page = pages.CardsPage(name='选择价格')
copies_page = pages.FormPage(name='人天份数')
payment_page = pages.FormPage(name='支付')


pages.register_front_pages(page)
Expand All @@ -22,8 +25,11 @@
pages.register_front_pages(order_page)
pages.register_front_pages(bind_agent_page)
pages.register_front_pages(purchased_page)
pages.register_front_pages(edit_page)
pages.register_front_pages(markdown_page)
pages.register_front_pages(profile_page)
pages.register_front_pages(price_page)
pages.register_front_pages(copies_page)
pages.register_front_pages(payment_page)


router = routers.FrontRouter(
Expand All @@ -45,6 +51,10 @@
method=actions.FrontActionMethod.GET,
),
local_actions={
"markdown": actions.OpenAction(
name='文档',
page=markdown_page
),
"update": actions.DirectAction(
name='更新',
path='/api/v1/tenant/{tenant_id}/arkstore/install/{uuid}/',
Expand Down Expand Up @@ -95,30 +105,57 @@
},
)

edit_page.create_actions(
markdown_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/extensions/{id}/',
path='/api/v1/extensions/{id}/markdown/',
method=actions.FrontActionMethod.GET
)
)

order_page.add_pages([
price_page,
copies_page,
payment_page
])

price_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/arkstore/order/extensions/{uuid}/',
method=actions.FrontActionMethod.GET
),
local_actions={
'next': actions.NextAction(
name="选择价格"
),
}
)

copies_page.create_actions(
init_action=actions.DirectAction(
path="/api/v1/tenant/{tenant_id}/arkstore/order/extensions/{uuid}/set_copies/",
method=actions.FrontActionMethod.POST
),
global_actions={
'confirm': actions.ConfirmAction(
path="/api/v1/extensions/{id}/"
'next': actions.NextAction(
name="创建订单",
path="/api/v1/tenant/{tenant_id}/arkstore/order/extensions/{uuid}/",
method=actions.FrontActionMethod.POST
),
}
)

order_page.create_actions(
payment_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/arkstore/order/extensions/{uuid}/',
method=actions.FrontActionMethod.GET,
path="/api/v1/tenant/{tenant_id}/arkstore/order/{order_no}/payment/",
method=actions.FrontActionMethod.GET
),
global_actions={
"payed": actions.DirectAction(
name='已支付',
path='/api/v1/tenant/{tenant_id}/arkstore/order/status/extensions/{uuid}/',
'next': actions.NextAction(
name="已支付",
path="/api/v1/tenant/{tenant_id}/arkstore/order/{order_no}/payment_status/",
method=actions.FrontActionMethod.GET
),
},
}
)

profile_page.create_actions(
Expand Down
37 changes: 36 additions & 1 deletion api/v1/pages/tenant_manage/child_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,40 @@
pages.register_front_pages(page)
pages.register_front_pages(edit_page)

select_user_page = pages.TablePage(select=True,name=_("选择用户"))

pages.register_front_pages(select_user_page)

select_user_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/users/',
method=actions.FrontActionMethod.GET
)
)


select_permission_page = pages.TablePage(select=True,name=_("选择权限"))

pages.register_front_pages(select_permission_page)

select_permission_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/childmanager_permissions',
method=actions.FrontActionMethod.GET
)
)

select_scope_page = pages.TablePage(select=True,name=_("选择范围"))

pages.register_front_pages(select_scope_page)

select_scope_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/childmanager_permissions?only_show_group=1',
method=actions.FrontActionMethod.GET
)
)


router = routers.FrontRouter(
path=tag,
Expand Down Expand Up @@ -47,7 +81,8 @@
),
global_actions={
'confirm': actions.ConfirmAction(
path="/api/v1/tenant/{tenant_id}/child_managers/{id}/"
path="/api/v1/tenant/{tenant_id}/child_managers/{id}/",
refresh=False
),
}
)
Expand Down
65 changes: 56 additions & 9 deletions api/v1/pages/tenant_manage/extension_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from platform import platform
from arkid.core import routers, pages, actions
from arkid.core.translation import gettext_default as _
from ..platform_admin.extension_admin import markdown_page

tag = 'tenant_extension_manage'
name = '插件管理'
Expand All @@ -10,11 +11,14 @@
page = pages.TabsPage(tag=tag, name=name)
platform_extension_page = pages.CardsPage(name=_('Platform Extensions', '插件租赁'))
tenant_extension_rented_page = pages.CardsPage(name=_('Rented Extensions', '已租赁'))
rent_page = pages.FormPage(name=_('Rent', '租赁'))
rent_page = pages.StepPage(name=_('Rent', '租赁'))
setting_page = pages.FormPage(name='插件租户配置')
config_page = pages.TablePage(name='插件运行时配置')
create_config_page = pages.FormPage(name='创建插件运行时配置')
update_config_page = pages.FormPage(name='更新插件运行时配置')
price_page = pages.CardsPage(name='选择价格')
copies_page = pages.FormPage(name='人天份数')
payment_page = pages.FormPage(name='支付')


pages.register_front_pages(page)
Expand All @@ -25,6 +29,9 @@
pages.register_front_pages(config_page)
pages.register_front_pages(create_config_page)
pages.register_front_pages(update_config_page)
pages.register_front_pages(price_page)
pages.register_front_pages(copies_page)
pages.register_front_pages(payment_page)


page.add_pages([
Expand All @@ -45,25 +52,61 @@
method=actions.FrontActionMethod.GET,
),
local_actions={
"markdown": actions.OpenAction(
name='文档',
page=markdown_page
),
"rent": actions.OpenAction(
name="租赁",
page=rent_page
)
},
)

rent_page.create_actions(
rent_page.add_pages([
price_page,
copies_page,
payment_page
])

price_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/arkstore/rent/extensions/{uuid}/',
method=actions.FrontActionMethod.GET,
path='/api/v1/tenant/{tenant_id}/arkstore/rent/extensions/{package}/',
method=actions.FrontActionMethod.GET
),
local_actions={
'next': actions.NextAction(
name="选择价格"
),
}
)

copies_page.create_actions(
init_action=actions.DirectAction(
path="/api/v1/tenant/{tenant_id}/arkstore/order/extensions/{uuid}/set_copies/",
method=actions.FrontActionMethod.POST
),
global_actions={
"payed": actions.DirectAction(
name='确定',
path='/api/v1/tenant/{tenant_id}/arkstore/rent/status/extensions/{uuid}/',
method=actions.FrontActionMethod.POST,
'next': actions.NextAction(
name="创建订单",
path="/api/v1/tenant/{tenant_id}/arkstore/rent/extensions/{package}/",
method=actions.FrontActionMethod.POST
),
},
}
)

payment_page.create_actions(
init_action=actions.DirectAction(
path="/api/v1/tenant/{tenant_id}/arkstore/order/{order_no}/payment/",
method=actions.FrontActionMethod.GET
),
global_actions={
'next': actions.NextAction(
name="已支付",
path="/api/v1/tenant/{tenant_id}/arkstore/order/{order_no}/payment_status/",
method=actions.FrontActionMethod.GET
),
}
)

tenant_extension_rented_page.create_actions(
Expand All @@ -76,6 +119,10 @@
path='/api/v1/tenant/{tenant_id}/tenant/extensions/{id}/active/',
method=actions.FrontActionMethod.POST,
),
"markdown": actions.OpenAction(
name='文档',
page=markdown_page
),
"setting": actions.OpenAction(
name='租户配置',
page=setting_page
Expand Down
5 changes: 5 additions & 0 deletions api/v1/schema/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ class ConfigOpenApiVersionSchemaOut(Schema):
openapi_uris: str = Field(title=_('openapi uris', '接口文档地址'), default='')


class ConfigOpenApiVersionDataSchemaOut(ResponseSchema):

data: ConfigOpenApiVersionSchemaOut


AppProtocolConfigIn = AppProtocolExtension.create_composite_config_schema(
'AppProtocolConfigIn',
exclude=["name", "type", "logo", "url", 'description', 'entry_permission'],
Expand Down
Loading

0 comments on commit 3194606

Please sign in to comment.