diff --git a/backend/app/api/v1/docker.go b/backend/app/api/v1/docker.go index bdcc6fd52..8160f4b3c 100644 --- a/backend/app/api/v1/docker.go +++ b/backend/app/api/v1/docker.go @@ -1,6 +1,9 @@ package v1 import ( + "io/ioutil" + "os" + "github.com/1Panel-dev/1Panel/backend/app/api/v1/helper" "github.com/1Panel-dev/1Panel/backend/app/dto" "github.com/1Panel-dev/1Panel/backend/constant" @@ -20,6 +23,26 @@ func (b *BaseApi) LoadDockerStatus(c *gin.Context) { helper.SuccessWithData(c, status) } +// @Tags Container Docker +// @Summary Load docker daemon.json +// @Description 获取 docker 配置信息(表单) +// @Produce json +// @Success 200 {object} string +// @Security ApiKeyAuth +// @Router /containers/daemonjson/file [get] +func (b *BaseApi) LoadDaemonJsonFile(c *gin.Context) { + if _, err := os.Stat(constant.DaemonJsonPath); err != nil { + helper.SuccessWithData(c, "daemon.json is not find in path") + return + } + content, err := ioutil.ReadFile(constant.DaemonJsonPath) + if err != nil { + helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) + return + } + helper.SuccessWithData(c, string(content)) +} + // @Tags Container Docker // @Summary Load docker daemon.json // @Description 获取 docker 配置信息 diff --git a/backend/router/ro_container.go b/backend/router/ro_container.go index 3c53a3526..be353aacf 100644 --- a/backend/router/ro_container.go +++ b/backend/router/ro_container.go @@ -60,6 +60,7 @@ func (s *ContainerRouter) InitContainerRouter(Router *gin.RouterGroup) { baRouter.POST("/volume", baseApi.CreateVolume) baRouter.GET("/daemonjson", baseApi.LoadDaemonJson) + baRouter.GET("/daemonjson/file", baseApi.LoadDaemonJsonFile) baRouter.GET("/docker/status", baseApi.LoadDockerStatus) baRouter.POST("/docker/operate", baseApi.OperateDocker) baRouter.POST("/daemonjson/update", baseApi.UpdateDaemonJson) diff --git a/cmd/server/docs/docs.go b/cmd/server/docs/docs.go index 80e36411c..dae0d9d84 100644 --- a/cmd/server/docs/docs.go +++ b/cmd/server/docs/docs.go @@ -881,17 +881,14 @@ var doc = `{ }, "/auth/status": { "get": { - "description": "获取系统安全登录状态", + "description": "判断是否为首次登录", "tags": [ "Auth" ], - "summary": "Load safety status", + "summary": "Check is First login", "responses": { "200": { "description": "" - }, - "402": { - "description": "" } } } @@ -1637,6 +1634,31 @@ var doc = `{ } } }, + "/containers/daemonjson/file": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 docker 配置信息(表单)", + "produces": [ + "application/json" + ], + "tags": [ + "Container Docker" + ], + "summary": "Load docker daemon.json", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, "/containers/daemonjson/update": { "post": { "security": [ @@ -6230,6 +6252,25 @@ var doc = `{ } } }, + "/settings/search/available": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取系统可用状态", + "tags": [ + "System Setting" + ], + "summary": "Load system available status", + "responses": { + "200": { + "description": "" + } + } + } + }, "/settings/snapshot": { "post": { "security": [ @@ -10553,15 +10594,18 @@ var doc = `{ "model.App": { "type": "object", "properties": { - "author": { - "type": "string" - }, "createdAt": { "type": "string" }, "crossVersionUpdate": { "type": "boolean" }, + "document": { + "type": "string" + }, + "github": { + "type": "string" + }, "icon": { "type": "string" }, @@ -10583,9 +10627,6 @@ var doc = `{ "shortDesc": { "type": "string" }, - "source": { - "type": "string" - }, "status": { "type": "string" }, @@ -10594,6 +10635,9 @@ var doc = `{ }, "updatedAt": { "type": "string" + }, + "website": { + "type": "string" } } }, @@ -10981,8 +11025,20 @@ var doc = `{ "pageSize": { "type": "integer" }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, "type": { "type": "string" + }, + "unused": { + "type": "boolean" + }, + "update": { + "type": "boolean" } } }, @@ -11852,15 +11908,18 @@ var doc = `{ "response.AppDTO": { "type": "object", "properties": { - "author": { - "type": "string" - }, "createdAt": { "type": "string" }, "crossVersionUpdate": { "type": "boolean" }, + "document": { + "type": "string" + }, + "github": { + "type": "string" + }, "icon": { "type": "string" }, @@ -11882,9 +11941,6 @@ var doc = `{ "shortDesc": { "type": "string" }, - "source": { - "type": "string" - }, "status": { "type": "string" }, @@ -11905,6 +11961,9 @@ var doc = `{ "items": { "type": "string" } + }, + "website": { + "type": "string" } } }, diff --git a/cmd/server/docs/swagger.json b/cmd/server/docs/swagger.json index ea71b4d93..be4e7f103 100644 --- a/cmd/server/docs/swagger.json +++ b/cmd/server/docs/swagger.json @@ -867,17 +867,14 @@ }, "/auth/status": { "get": { - "description": "获取系统安全登录状态", + "description": "判断是否为首次登录", "tags": [ "Auth" ], - "summary": "Load safety status", + "summary": "Check is First login", "responses": { "200": { "description": "" - }, - "402": { - "description": "" } } } @@ -1623,6 +1620,31 @@ } } }, + "/containers/daemonjson/file": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取 docker 配置信息(表单)", + "produces": [ + "application/json" + ], + "tags": [ + "Container Docker" + ], + "summary": "Load docker daemon.json", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "string" + } + } + } + } + }, "/containers/daemonjson/update": { "post": { "security": [ @@ -6216,6 +6238,25 @@ } } }, + "/settings/search/available": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "获取系统可用状态", + "tags": [ + "System Setting" + ], + "summary": "Load system available status", + "responses": { + "200": { + "description": "" + } + } + } + }, "/settings/snapshot": { "post": { "security": [ @@ -10539,15 +10580,18 @@ "model.App": { "type": "object", "properties": { - "author": { - "type": "string" - }, "createdAt": { "type": "string" }, "crossVersionUpdate": { "type": "boolean" }, + "document": { + "type": "string" + }, + "github": { + "type": "string" + }, "icon": { "type": "string" }, @@ -10569,9 +10613,6 @@ "shortDesc": { "type": "string" }, - "source": { - "type": "string" - }, "status": { "type": "string" }, @@ -10580,6 +10621,9 @@ }, "updatedAt": { "type": "string" + }, + "website": { + "type": "string" } } }, @@ -10967,8 +11011,20 @@ "pageSize": { "type": "integer" }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, "type": { "type": "string" + }, + "unused": { + "type": "boolean" + }, + "update": { + "type": "boolean" } } }, @@ -11838,15 +11894,18 @@ "response.AppDTO": { "type": "object", "properties": { - "author": { - "type": "string" - }, "createdAt": { "type": "string" }, "crossVersionUpdate": { "type": "boolean" }, + "document": { + "type": "string" + }, + "github": { + "type": "string" + }, "icon": { "type": "string" }, @@ -11868,9 +11927,6 @@ "shortDesc": { "type": "string" }, - "source": { - "type": "string" - }, "status": { "type": "string" }, @@ -11891,6 +11947,9 @@ "items": { "type": "string" } + }, + "website": { + "type": "string" } } }, diff --git a/cmd/server/docs/swagger.yaml b/cmd/server/docs/swagger.yaml index d6db04d59..efb4e241f 100644 --- a/cmd/server/docs/swagger.yaml +++ b/cmd/server/docs/swagger.yaml @@ -1447,12 +1447,14 @@ definitions: type: object model.App: properties: - author: - type: string createdAt: type: string crossVersionUpdate: type: boolean + document: + type: string + github: + type: string icon: type: string id: @@ -1467,14 +1469,14 @@ definitions: type: string shortDesc: type: string - source: - type: string status: type: string type: type: string updatedAt: type: string + website: + type: string type: object model.AppInstall: properties: @@ -1727,8 +1729,16 @@ definitions: type: integer pageSize: type: integer + tags: + items: + type: string + type: array type: type: string + unused: + type: boolean + update: + type: boolean required: - page - pageSize @@ -2314,12 +2324,14 @@ definitions: type: object response.AppDTO: properties: - author: - type: string createdAt: type: string crossVersionUpdate: type: boolean + document: + type: string + github: + type: string icon: type: string id: @@ -2334,8 +2346,6 @@ definitions: type: string shortDesc: type: string - source: - type: string status: type: string tags: @@ -2350,6 +2360,8 @@ definitions: items: type: string type: array + website: + type: string type: object response.AppDetailDTO: properties: @@ -3125,13 +3137,11 @@ paths: - Auth /auth/status: get: - description: 获取系统安全登录状态 + description: 判断是否为首次登录 responses: "200": description: "" - "402": - description: "" - summary: Load safety status + summary: Check is First login tags: - Auth /backups: @@ -3605,6 +3615,21 @@ paths: summary: Load docker daemon.json tags: - Container Docker + /containers/daemonjson/file: + get: + description: 获取 docker 配置信息(表单) + produces: + - application/json + responses: + "200": + description: OK + schema: + type: string + security: + - ApiKeyAuth: [] + summary: Load docker daemon.json + tags: + - Container Docker /containers/daemonjson/update: post: consumes: @@ -6529,6 +6554,17 @@ paths: summary: Load system setting info tags: - System Setting + /settings/search/available: + get: + description: 获取系统可用状态 + responses: + "200": + description: "" + security: + - ApiKeyAuth: [] + summary: Load system available status + tags: + - System Setting /settings/snapshot: post: consumes: diff --git a/frontend/src/api/modules/container.ts b/frontend/src/api/modules/container.ts index 7a9a378ab..981a579d7 100644 --- a/frontend/src/api/modules/container.ts +++ b/frontend/src/api/modules/container.ts @@ -130,6 +130,9 @@ export const dockerOperate = (params: Container.DockerOperate) => { export const loadDaemonJson = () => { return http.get(`/containers/daemonjson`); }; +export const loadDaemonJsonFile = () => { + return http.get(`/containers/daemonjson/file`); +}; export const loadDockerStatus = () => { return http.get(`/containers/docker/status`); }; diff --git a/frontend/src/components/container-log/index.vue b/frontend/src/components/container-log/index.vue index 38c086f9b..9fda66682 100644 --- a/frontend/src/components/container-log/index.vue +++ b/frontend/src/components/container-log/index.vue @@ -17,7 +17,7 @@ placeholder="None data" :indent-with-tab="true" :tabSize="4" - style="margin-top: 10px; height: calc(100vh - 350px)" + style="margin-top: 10px; height: calc(100vh - 375px)" :lineWrapping="true" :matchBrackets="true" theme="cobalt" diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 277c74d4a..4c8294384 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -3,12 +3,12 @@ export default { true: 'true', false: 'false', button: { - create: 'Create', - add: 'Add', - save: 'Save', + create: 'Create ', + add: 'Add ', + save: 'Save ', set: 'Reset', - sync: 'Sync', - delete: 'Delete', + sync: 'Sync ', + delete: 'Delete ', edit: 'Edit', enable: 'Enable', disable: 'Disable', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index b6e40fe56..2f740dc58 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -79,7 +79,7 @@ export default { infoTitle: '提示', notRecords: '当前任务未产生执行记录', sureLogOut: '您是否确认退出登录?', - createSuccess: '新建成功', + createSuccess: '创建成功', updateSuccess: '更新成功', uploadSuccess: '上传成功', operate: '操作', @@ -245,7 +245,7 @@ export default { database: { delete: '删除操作无法回滚,请输入 "', deleteHelper: '" 删除此数据库', - create: '新建数据库', + create: '创建数据库', noMysql: '当前未检测到 {0} 数据库,请进入应用商店点击安装!', mysqlBadStatus: '当前 mysql 应用状态异常,请在', adjust: '中查看原因或修改配置', @@ -269,7 +269,6 @@ export default { portSetting: '端口', portHelper: '该端口为容器对外暴露端口,修改需要单独保存并且重启容器!', - baseSetting: '基础设置', confChange: '配置修改', unSupportType: '不支持当前文件类型!', @@ -746,7 +745,7 @@ export default { snapshot: '快照', recoverDetail: '恢复详情', - createSnapshot: '新建快照', + createSnapshot: '创建快照', recover: '恢复', noRecoverRecord: '暂无恢复记录', lastRecoverAt: '上次恢复时间', @@ -890,7 +889,7 @@ export default { remark: '备注', group: '分组', groupSetting: '分组管理', - createGroup: '新建分组', + createGroup: '创建分组', app: '应用', appNew: '新装应用', appInstalled: '已装应用', @@ -923,7 +922,7 @@ export default { check: '查看', acmeAccountManage: 'Acme 账户', email: '邮箱', - addAccount: '新建账户', + addAccount: '创建账户', acmeAccount: 'Acme 账户', provider: '验证方式', dnsCommon: '手动解析', @@ -1052,7 +1051,7 @@ export default { saveAndReload: '保存并重载', }, ssl: { - create: '新建证书', + create: '创建证书', provider: '类型', manualCreate: '手动创建', acmeAccount: 'Acme 账号', @@ -1072,7 +1071,7 @@ export default { autoRenewHelper: '距离到期时间7天自动续签', renewSuccess: '续签成功', renewWebsite: '该证书已经和以下网站关联,续签会同步应用到这些网站', - createAcme: '新建账户', + createAcme: '创建账户', }, firewall: { ccDeny: 'CC 防护', diff --git a/frontend/src/layout/layout-content.vue b/frontend/src/layout/layout-content.vue index 867b36d1a..a38330d60 100644 --- a/frontend/src/layout/layout-content.vue +++ b/frontend/src/layout/layout-content.vue @@ -100,7 +100,7 @@ const showBack = computed(() => { } .content-container__toolbar { - margin-top: 30px; + margin-top: 20px; } .content-container_form { diff --git a/frontend/src/views/container/compose/detail/index.vue b/frontend/src/views/container/compose/detail/index.vue index 286cf13ee..26ffa32c9 100644 --- a/frontend/src/views/container/compose/detail/index.vue +++ b/frontend/src/views/container/compose/detail/index.vue @@ -35,7 +35,7 @@ - + diff --git a/frontend/src/views/container/image/pull/index.vue b/frontend/src/views/container/image/pull/index.vue index 2584d7945..1e5ec947e 100644 --- a/frontend/src/views/container/image/pull/index.vue +++ b/frontend/src/views/container/image/pull/index.vue @@ -7,7 +7,7 @@ size="50%" > @@ -106,13 +106,8 @@ const acceptParams = async (params: DialogProps): Promise => { buttonDisabled.value = false; logInfo.value = ''; }; - const emit = defineEmits<{ (e: 'search'): void }>(); -const handleClose = () => { - drawerVisiable.value = false; -}; - type FormInstance = InstanceType; const formRef = ref(); @@ -150,6 +145,7 @@ const onCloseLog = async () => { emit('search'); clearInterval(Number(timer)); timer = null; + drawerVisiable.value = false; }; function loadDetailInfo(id: number) { diff --git a/frontend/src/views/container/image/push/index.vue b/frontend/src/views/container/image/push/index.vue index 0e70b5abf..99978628c 100644 --- a/frontend/src/views/container/image/push/index.vue +++ b/frontend/src/views/container/image/push/index.vue @@ -1,13 +1,13 @@ diff --git a/frontend/src/views/container/repo/index.vue b/frontend/src/views/container/repo/index.vue index b7b15e93c..a7955fc17 100644 --- a/frontend/src/views/container/repo/index.vue +++ b/frontend/src/views/container/repo/index.vue @@ -13,7 +13,7 @@ {{ $t('container.createRepo') }} - + {{ $t('commons.button.delete') }} diff --git a/frontend/src/views/container/setting/index.vue b/frontend/src/views/container/setting/index.vue index 5da9ba98b..e56c1c548 100644 --- a/frontend/src/views/container/setting/index.vue +++ b/frontend/src/views/container/setting/index.vue @@ -1,6 +1,6 @@ diff --git a/frontend/src/views/cronjob/index.vue b/frontend/src/views/cronjob/index.vue index 127e33653..16d772c30 100644 --- a/frontend/src/views/cronjob/index.vue +++ b/frontend/src/views/cronjob/index.vue @@ -13,7 +13,7 @@ {{ $t('commons.button.create') }}{{ $t('cronjob.cronTask') }} - + {{ $t('commons.button.delete') }} diff --git a/frontend/src/views/cronjob/operate/index.vue b/frontend/src/views/cronjob/operate/index.vue index d5f5490fc..acf0b0cde 100644 --- a/frontend/src/views/cronjob/operate/index.vue +++ b/frontend/src/views/cronjob/operate/index.vue @@ -3,130 +3,148 @@ - - - - - - - - - - + + + + + + + + + + + + - - - + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - -
- - - - - -
- - - - - - - -
- - - + - - - - - {{ $t('cronjob.saveLocal') }} - - - - - -
+ - - - + + + + + - - - +
+ + + + + +
+ + + + + + + +
+ + + + + + + + {{ $t('cronjob.saveLocal') }} + + + + + +
+ + + + + + + + +
+