From d8646f8e7c4a2eacb8810abdfa54471458762160 Mon Sep 17 00:00:00 2001 From: wang-liang0615 Date: Tue, 5 Sep 2023 15:22:08 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=85=B3=E8=81=94=20?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=8F=8D=E5=90=91=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cmdb/views/ci_types/relationTable.vue | 73 +++++++++++++++++-- 1 file changed, 66 insertions(+), 7 deletions(-) diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/relationTable.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/relationTable.vue index b655bc6..c2016be 100644 --- a/cmdb-ui/src/modules/cmdb/views/ci_types/relationTable.vue +++ b/cmdb-ui/src/modules/cmdb/views/ci_types/relationTable.vue @@ -18,18 +18,30 @@ keep-source :max-height="windowHeight - 180" class="ops-stripe-table" + :row-class-name="rowClass" > - + + + + - + From 9e5c926bfd46c2f5dcb03d92db8d31ef195e4b33 Mon Sep 17 00:00:00 2001 From: ashing Date: Tue, 5 Sep 2023 15:26:50 +0800 Subject: [PATCH 2/7] feat: support docker deploy mysql and redis Signed-off-by: ashing --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index aa01399..5e562dd 100644 --- a/Makefile +++ b/Makefile @@ -15,10 +15,18 @@ env: npm install yarn && \ make deps +docker-mysql: + @docker run --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest + +docker-redis: + @docker run --name some-redis -p 6379:6379 -d redis:latest + deps: + cd cmdb-api && \ pipenv install --dev && \ pipenv run flask db-setup && \ pipenv run flask cmdb-init-cache && \ + cd .. && \ cd cmdb-ui && yarn install && cd .. api: From 00fbe15a19a47b0e8a13036dc4d8ab262640eab3 Mon Sep 17 00:00:00 2001 From: ivonGwy Date: Tue, 5 Sep 2023 15:40:31 +0800 Subject: [PATCH 3/7] add document link --- README.md | 2 +- docs/README_en.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index efd1874..c224e51 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![API](https://img.shields.io/badge/API-Flask-brightgreen)](https://github.com/pallets/flask) [English](docs/README_en.md) / [中文](README.md) - +- 产品文档:https://veops.cn/docs/ - 在线体验: CMDB - username: demo 或者 admin - password: 123456 diff --git a/docs/README_en.md b/docs/README_en.md index 8be3fe1..9e84d85 100644 --- a/docs/README_en.md +++ b/docs/README_en.md @@ -7,7 +7,7 @@ [English](README_en.md) / [中文](../README.md) ## DEMO ONLINE - +- Product document:https://veops.cn/docs/ - Preview online: CMDB - username: demo - password: 123456 From b826de4195deb148a54fd1e72bbbfc079120fcf4 Mon Sep 17 00:00:00 2001 From: ashing Date: Tue, 5 Sep 2023 20:06:31 +0800 Subject: [PATCH 4/7] optimize: makefile help Signed-off-by: ashing --- Makefile | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 5e562dd..801359c 100644 --- a/Makefile +++ b/Makefile @@ -1,45 +1,48 @@ -.PHONY: env clean api ui worker +default: help +help: ## Display this help + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) +.PHONY: help -help: - @echo " env create a development environment using pipenv" - @echo " deps install dependencies using pip" - @echo " clean remove unwanted files like .pyc's" - @echo " lint check style with flake8" - @echo " api start api server" - @echo " ui start ui server" - @echo " worker start async tasks worker" - -env: +env: ## Create a development environment using pipenv sudo easy_install pip && \ pip install pipenv -i https://pypi.douban.com/simple && \ npm install yarn && \ make deps +.PHONY: env -docker-mysql: +docker-mysql: ## deploy MySQL use docker @docker run --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest +.PHONY: docker-mysql -docker-redis: +docker-redis: ## deploy Redis use docker @docker run --name some-redis -p 6379:6379 -d redis:latest +.PHONY: docker-redis -deps: +deps: ## install dependencies using pip cd cmdb-api && \ pipenv install --dev && \ pipenv run flask db-setup && \ pipenv run flask cmdb-init-cache && \ cd .. && \ cd cmdb-ui && yarn install && cd .. +.PHONY: deps -api: +api: ## start api server cd cmdb-api && pipenv run flask run -h 0.0.0.0 +.PHONY: api -worker: +worker: ## start async tasks worker cd cmdb-api && pipenv run celery -A celery_worker.celery worker -E -Q one_cmdb_async --concurrency=1 -D && pipenv run celery -A celery_worker.celery worker -E -Q acl_async --concurrency=1 -D +.PHONY: worker -ui: +ui: ## start ui server cd cmdb-ui && yarn run serve +.PHONY: ui -clean: +clean: ## remove unwanted files like .pyc's pipenv run flask clean +.PHONY: clean -lint: +lint: ## check style with flake8 flake8 --exclude=env . +.PHONY: lint From eb9c20a2958ee3e101c34fb24026c6ac1a8f4a92 Mon Sep 17 00:00:00 2001 From: ashing Date: Tue, 5 Sep 2023 20:21:10 +0800 Subject: [PATCH 5/7] fix: review Signed-off-by: ashing --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 801359c..56048b1 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +MYSQL_ROOT_PASSWORD ?= root + default: help help: ## Display this help @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) @@ -11,11 +13,11 @@ env: ## Create a development environment using pipenv .PHONY: env docker-mysql: ## deploy MySQL use docker - @docker run --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest + @docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} -d mysql:latest .PHONY: docker-mysql docker-redis: ## deploy Redis use docker - @docker run --name some-redis -p 6379:6379 -d redis:latest + @docker run --name redis -p 6379:6379 -d redis:latest .PHONY: docker-redis deps: ## install dependencies using pip From 32227d375a71d59ff4791f7977862e1a74cdd5ab Mon Sep 17 00:00:00 2001 From: ashing Date: Tue, 5 Sep 2023 20:29:29 +0800 Subject: [PATCH 6/7] fix: review Signed-off-by: ashing --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 56048b1..4979a52 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ MYSQL_ROOT_PASSWORD ?= root default: help -help: ## Display this help +help: ## display this help @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) .PHONY: help -env: ## Create a development environment using pipenv +env: ## create a development environment using pipenv sudo easy_install pip && \ pip install pipenv -i https://pypi.douban.com/simple && \ npm install yarn && \ From c0c05bca86321db38305c9d99c8d0b95723d6ad8 Mon Sep 17 00:00:00 2001 From: ashing Date: Tue, 5 Sep 2023 20:33:07 +0800 Subject: [PATCH 7/7] fix: review Signed-off-by: ashing --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4979a52..fb91082 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ MYSQL_ROOT_PASSWORD ?= root +MYSQL_PORT ?= 3306 +REDIS_PORT ?= 6379 default: help help: ## display this help @@ -13,11 +15,11 @@ env: ## create a development environment using pipenv .PHONY: env docker-mysql: ## deploy MySQL use docker - @docker run --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} -d mysql:latest + @docker run --name mysql -p ${MYSQL_PORT}:3306 -e MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} -d mysql:latest .PHONY: docker-mysql docker-redis: ## deploy Redis use docker - @docker run --name redis -p 6379:6379 -d redis:latest + @docker run --name redis -p ${REDIS_PORT}:6379 -d redis:latest .PHONY: docker-redis deps: ## install dependencies using pip