Skip to content

Commit

Permalink
Merge pull request #1040 from longguikeji/release-2.5.1-beta
Browse files Browse the repository at this point in the history
Release 2.5.1 beta
  • Loading branch information
notevery authored Jul 15, 2022
2 parents e05e46b + 7407983 commit 8c1f002
Show file tree
Hide file tree
Showing 117 changed files with 3,425 additions and 1,066 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: release

on:
workflow_dispatch:
inputs:
prod_version:
description: 'the tag of the charts to release, like `2.5.1`'
default: ''
required: true
push:
tags:
- '2.*.*'
Expand All @@ -10,13 +16,21 @@ jobs:
tag2image:
runs-on: ubuntu-latest
steps:
- id: set-version
run: |
PRODVERSIONIN=${{ github.event.inputs.prod_version }}
PRODVERSION=${PRODVERSIONIN:-"${{ github.ref_name}}"}
echo "PRODVERSION=$PRODVERSION" >> $GITHUB_ENV
- id: get-versions
run: |
echo "::set-output name=PRODVERSION::${PRODVERSION}"
- name: Checkout
uses: actions/checkout@v3
with:
ref: "${{ github.ref_name}}"
ref: '${{steps.get-versions.outputs.PRODVERSION}}'
- id: get-versions
run: |
sversion="${{ github.ref_name}}"
sversion="${{steps.get-versions.outputs.PRODVERSION}}"
echo "::set-output name=sversion::${sversion: 0 :3}"
- name: Login harbor
uses: docker/login-action@v1
Expand All @@ -40,19 +54,17 @@ jobs:
PIP="https://pypi.python.org/simple"
push: true
tags: |
"docker.io/longguikeji/arkid:${{ github.ref_name}}"
"docker.io/longguikeji/arkid:${{steps.get-versions.outputs.PRODVERSION}}"
"docker.io/longguikeji/arkid:${{steps.get-versions.outputs.sversion}}"
"docker.io/longguikeji/arkid:2"
"${{ secrets.ARK_RLS }}/arkid:${{ github.ref_name}}"
"${{ secrets.ARK_RLS }}/arkid:${{steps.get-versions.outputs.PRODVERSION}}"
"${{ secrets.ARK_RLS }}/arkid:${{steps.get-versions.outputs.sversion}}"
"${{ secrets.ARK_RLS }}/arkid:2"
- name: Feishu 报忧
if: ${{ failure() }}
uses: wangsijie/feishu-bot@v1
with:
uuid: ${{ secrets.FEISHU_UUID }}
data: |
{"msg_type":"post","content":{"post":{"zh_cn":{"title":"${{ github.event.repository.name }} 镜像版本 ${{ github.ref_name}} 发布失败",
{"msg_type":"post","content":{"post":{"zh_cn":{"title":"${{ github.event.repository.name }} 镜像版本 ${{steps.get-versions.outputs.PRODVERSION}} 发布失败",
"content":[[{"tag":"text","text":""},
{"tag":"a","text":"点击查看具体日志","href":"https://github.com/${{ github.repository }}/actions/workflows/release.yml"}]]}}}}
- name: Feishu 报喜
Expand All @@ -61,6 +73,6 @@ jobs:
with:
uuid: ${{ secrets.FEISHU_UUID }}
data: |
{"msg_type":"post","content":{"post":{"zh_cn":{"title": "${{ github.event.repository.name }} 镜像版本 ${{ github.ref_name}} 发布成功",
{"msg_type":"post","content":{"post":{"zh_cn":{"title": "${{ github.event.repository.name }} 镜像版本 ${{steps.get-versions.outputs.PRODVERSION}} 发布成功",
"content":[[{"tag":"text","text":""},
{"tag":"a","text":"","href":"https://hub.docker.com/r/longguikeji/arkid/tags"}]]}}}}
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ RUN set -eux; \
gettext xmlsec1 supervisor \
freetds-dev freetds-bin \
python-dev python-pip \
python-dev default-libmysqlclient-dev tini gosu; \
default-libmysqlclient-dev tini gosu; \
# verify that the binary works
gosu nobody true; \
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 requirements.txt ./
RUN sed -i "s@https://mirrors.aliyun.com/pypi/simple@$PIP@g" requirements.txt;
RUN pip install --no-cache-dir -r requirements.txt

ADD . .
Expand Down
36 changes: 16 additions & 20 deletions api/v1/pages/mine/grant_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@
name = _("授权管理")


page = pages.TablePage(
page = pages.TreePage(
name=name,
tag=tag
)
permission_page = pages.TablePage(
name=_("申请权限"),
select=True,
)
app_permission_page = pages.TablePage(name=_("该应用权限"))
# permission_page = pages.TablePage(
# name=_("申请权限"),
# select=True,
# )


pages.register_front_pages(page)
pages.register_front_pages(permission_page)
pages.register_front_pages(app_permission_page)
# pages.register_front_pages(permission_page)

router = routers.FrontRouter(
path=tag,
Expand All @@ -29,25 +31,19 @@

page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/mine/tenant/{tenant_id}/permissions/',
path='/api/v1/tenant/{tenant_id}/all_apps_in_arkid/',
method=actions.FrontActionMethod.GET,
),
global_actions={
'open': actions.OpenAction(
name=("申请权限"),
page=permission_page
node_actions=[
actions.CascadeAction(
page=app_permission_page
)
}
]
)

permission_page.create_actions(
app_permission_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/mine/tenant/{tenant_id}/all_permissions/',
method=actions.FrontActionMethod.GET,
path='/api/v1/mine/tenant/{tenant_id}/permissions/?app_id={app_id}',
method=actions.FrontActionMethod.GET
),
global_actions={
'confirm': actions.ConfirmAction(
path="/api/v1/mine/tenant/{tenant_id}/permissions/"
),
}
)
2 changes: 1 addition & 1 deletion api/v1/pages/mine/logout.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
path=tag,
name=name,
icon='logout',
url='/api/v1/mine/logout/'
url='/api/v1/tenant/{tenant_id}/mine/logout/'
)
16 changes: 8 additions & 8 deletions api/v1/pages/permission_manage/permission_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
path='/api/v1/tenant/{tenant_id}/permission_groups/{permission_group_id}/permissions/',
method=actions.FrontActionMethod.GET
),
# global_actions={
# "update":actions.OpenAction(
# name=_("添加权限"),
# page=edit_permissions_page,
# )
# },
global_actions={
"update":actions.OpenAction(
name=_("添加权限"),
page=edit_permissions_page,
)
},
local_actions={
"delete": actions.DeleteAction(
path="/api/v1/tenant/{tenant_id}/permission_groups/{permission_group_id}/permissions/{id}/",
Expand All @@ -82,7 +82,7 @@
select=True,
global_actions={
'confirm': actions.ConfirmAction(
path="/tenant/{tenant_id}/permission_groups/{permission_group_id}/permissions/"
path="/api/v1/tenant/{tenant_id}/permission_groups/{permission_group_id}/permissions/"
),
}
)
Expand All @@ -107,7 +107,7 @@

select_app_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/apps/',
path='/api/v1/tenant/{tenant_id}/all_apps_in_arkid/',
method=actions.FrontActionMethod.GET
)
)
Expand Down
61 changes: 47 additions & 14 deletions api/v1/pages/platform_admin/extension_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

store_page = pages.CardsPage(name='插件商店')
installed_page = pages.CardsPage(name='已安装')
arkstore_markdown_page = pages.FormPage(name=_("文档"))
order_page = pages.StepPage(name=_('Order', '购买'))
trial_page = pages.FormPage(name=_('Trial', '试用'))
bind_agent_page = pages.FormPage(name=_('Bind Agent', '绑定代理商'))
purchased_page = pages.CardsPage(name='已购买')
markdown_page = pages.FormPage(name=_("文档"))
Expand All @@ -22,7 +24,9 @@
pages.register_front_pages(page)
pages.register_front_pages(installed_page)
pages.register_front_pages(store_page)
pages.register_front_pages(arkstore_markdown_page)
pages.register_front_pages(order_page)
pages.register_front_pages(trial_page)
pages.register_front_pages(bind_agent_page)
pages.register_front_pages(purchased_page)
pages.register_front_pages(markdown_page)
Expand Down Expand Up @@ -57,12 +61,7 @@
),
"update": actions.DirectAction(
name='更新',
path='/api/v1/tenant/{tenant_id}/arkstore/install/{uuid}/',
method=actions.FrontActionMethod.POST,
),
"active": actions.DirectAction(
name='切换启用状态',
path='/api/v1/extensions/{id}/active/',
path='/api/v1/tenant/{tenant_id}/arkstore/update/{package}/',
method=actions.FrontActionMethod.POST,
),
"profile": actions.OpenAction(
Expand All @@ -84,9 +83,17 @@
),
},
local_actions={
"markdown": actions.OpenAction(
name='文档',
page=arkstore_markdown_page
),
"order": actions.OpenAction(
name='购买',
page=order_page
),
"trial": actions.OpenAction(
name='试用',
page=trial_page
)
},
)
Expand All @@ -97,6 +104,10 @@
method=actions.FrontActionMethod.GET,
),
local_actions={
"markdown": actions.OpenAction(
name='文档',
page=arkstore_markdown_page
),
"install": actions.DirectAction(
name='安装',
path='/api/v1/tenant/{tenant_id}/arkstore/install/{uuid}/',
Expand All @@ -112,6 +123,13 @@
)
)

arkstore_markdown_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/arkstore/extensions/{uuid}/markdown/',
method=actions.FrontActionMethod.GET
)
)

order_page.add_pages([
price_page,
copies_page,
Expand Down Expand Up @@ -152,7 +170,7 @@
global_actions={
'next': actions.NextAction(
name="已支付",
path="/api/v1/tenant/{tenant_id}/arkstore/order/{order_no}/payment_status/",
path="/api/v1/tenant/{tenant_id}/arkstore/purchase/order/{order_no}/payment_status/",
method=actions.FrontActionMethod.GET
),
}
Expand All @@ -177,14 +195,29 @@
),
global_actions={
"confirm": actions.DirectAction(
name='修改',
path='/api/v1/tenant/{tenant_id}/arkstore/bind_agent/',
method=actions.FrontActionMethod.PUT
),
"delete": actions.DirectAction(
name='删除',
name='确定',
path='/api/v1/tenant/{tenant_id}/arkstore/bind_agent/',
method=actions.FrontActionMethod.DELETE
method=actions.FrontActionMethod.POST
),
# "delete": actions.DirectAction(
# name='删除',
# path='/api/v1/tenant/{tenant_id}/arkstore/bind_agent/',
# method=actions.FrontActionMethod.DELETE
# ),
},
)


trial_page.create_actions(
init_action=actions.DirectAction(
path='/api/v1/tenant/{tenant_id}/arkstore/trial/extensions/{uuid}/',
method=actions.FrontActionMethod.GET,
),
global_actions={
"confirm": actions.DirectAction(
name='试用',
path='/api/v1/tenant/{tenant_id}/arkstore/trial/extensions/{uuid}/',
method=actions.FrontActionMethod.POST
),
},
)
2 changes: 1 addition & 1 deletion api/v1/pages/tenant_manage/extension_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
global_actions={
'next': actions.NextAction(
name="已支付",
path="/api/v1/tenant/{tenant_id}/arkstore/order/{order_no}/payment_status/",
path="/api/v1/tenant/{tenant_id}/arkstore/rent/order/{order_no}/payment_status/extensions/{package}/",
method=actions.FrontActionMethod.GET
),
}
Expand Down
2 changes: 2 additions & 0 deletions api/v1/schema/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class AppListsOut(ResponseSchema):

class AppItemOut(ModelSchema):

id: UUID = Field(readonly=True)

class Config:
model = App
model_fields = ['id', 'name', 'url', 'logo','description']
Expand Down
3 changes: 0 additions & 3 deletions api/v1/schema/approve_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ class ApproveActionSchema(Schema):
)


class ApproveActionListOut(ResponseSchema):
data: List[ApproveActionListItemOut]


class ApproveActionOut(ResponseSchema):
data: ApproveActionSchema
Expand Down
25 changes: 24 additions & 1 deletion api/v1/schema/mine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
from arkid.core.schema import ResponseSchema
from ninja import ModelSchema, Schema
from typing import List, Optional
from arkid.core.models import App, Tenant, User
from arkid.core.models import App, Tenant, User, Permission
from pydantic import Field
from arkid.core import pages,actions
from arkid.core.translation import gettext_default as _


Expand Down Expand Up @@ -36,6 +37,28 @@ class Config:
model = Tenant
model_fields = ["id", "name", "slug", "icon"]

class MinePermissionListSchemaOut(Schema):

id: UUID = Field(hidden=True)
name: str
# app_name: str = Field(default=None, alias="app.name", title=_("应用名称"))
category: str
sort_id: int = Field(hidden=True)
in_current: bool = Field(item_action={"path":"/api/v1/mine/tenant/{tenant_id}/permissions/{permission_id}/add_permisssion", "method":actions.FrontActionMethod.GET.value, "close": False})
# is_system: bool
# is_open: bool = Field(item_action={"path":"/api/v1/tenant/{tenant_id}/permission/{id}/toggle_open", "method":actions.FrontActionMethod.POST.value})

# class Config:
# model = Permission
# model_fields = ['id', 'name', 'category', 'is_system']


class MineTenantListOut(ResponseSchema):
data: List[MineTenantListItemOut]


class MineLogoutOut(ResponseSchema):

refresh:bool = Field(
title=_("是否刷新页面")
)
1 change: 1 addition & 0 deletions api/v1/schema/permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
class PermissionListSchemaOut(ModelSchema):

app_name: str = Field(default=None, alias="app.name", title=_("应用名称"))
sort_id: int = Field(hidden=True)
is_open: bool = Field(item_action={"path":"/api/v1/tenant/{tenant_id}/permission/{id}/toggle_open", "method":actions.FrontActionMethod.POST.value})

class Config:
Expand Down
Loading

0 comments on commit 8c1f002

Please sign in to comment.