Skip to content

Commit cafe1c5

Browse files
authored
refactor: adjust ui to adapt github-badge flag, refine makefile (#574)
## What type of PR is this? /kind refactor ## What this PR does / why we need it: Adjust ui to adapt github-badge flag and refine makefile.
1 parent cda3942 commit cafe1c5

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

Makefile

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ endif
3434

3535
.PHONY: gen-version
3636
gen-version: ## Generate version file
37-
# Update version
38-
-cd pkg/version/scripts && go run gen/gen.go
37+
@echo "🛠️ Updating the version file ..."
38+
@cd pkg/version/scripts && go run gen/gen.go
3939

4040
.PHONY: test
4141
test: ## Run the tests
@@ -89,9 +89,9 @@ build-all: build-darwin build-linux build-windows ## Build for all platforms
8989
# make build-darwin GOARCH=arm64
9090
# make build-darwin GOARCH=arm64 SKIP_UI_BUILD=true
9191
.PHONY: build-darwin
92-
build-darwin: $(BUILD_UI) ## Build for MacOS (Darwin)
93-
$(MAKE) gen-version
94-
-rm -rf ./_build/darwin
92+
build-darwin: gen-version $(BUILD_UI) ## Build for MacOS (Darwin)
93+
@rm -rf ./_build/darwin
94+
@echo "🚀 Building karpor-server for darwin platform ..."
9595
GOOS=darwin GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_ENABLED) \
9696
go build -o ./_build/darwin/$(APPROOT) \
9797
./cmd
@@ -105,9 +105,9 @@ build-darwin: $(BUILD_UI) ## Build for MacOS (Darwin)
105105
# make build-linux GOARCH=arm64
106106
# make build-linux GOARCH=arm64 SKIP_UI_BUILD=true
107107
.PHONY: build-linux
108-
build-linux: $(BUILD_UI) ## Build for Linux
109-
$(MAKE) gen-version
110-
-rm -rf ./_build/linux
108+
build-linux: gen-version $(BUILD_UI) ## Build for Linux
109+
@rm -rf ./_build/linux
110+
@echo "🚀 Building karpor-server for linux platform ..."
111111
GOOS=linux GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_ENABLED) \
112112
go build -o ./_build/linux/$(APPROOT) \
113113
./cmd
@@ -121,9 +121,9 @@ build-linux: $(BUILD_UI) ## Build for Linux
121121
# make build-windows GOARCH=arm64
122122
# make build-windows GOARCH=arm64 SKIP_UI_BUILD=true
123123
.PHONY: build-windows
124-
build-windows: $(BUILD_UI) ## Build for Windows
125-
$(MAKE) gen-version
126-
-rm -rf ./_build/windows
124+
build-windows: gen-version $(BUILD_UI) ## Build for Windows
125+
@rm -rf ./_build/windows
126+
@echo "🚀 Building karpor-server for windows platform ..."
127127
GOOS=windows GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_ENABLED) \
128128
go build -o ./_build/windows/$(APPROOT).exe \
129129
./cmd
@@ -132,9 +132,8 @@ build-windows: $(BUILD_UI) ## Build for Windows
132132
# Description: Builds the UI for the dashboard.
133133
# Usage: make build-ui
134134
.PHONY: build-ui
135-
build-ui: ## Build UI for the dashboard
136-
$(MAKE) gen-version
137-
@echo "Building UI for the dashboard ..."
135+
build-ui: gen-version ## Build UI for the dashboard
136+
@echo "🧀 Building UI for the dashboard ..."
138137
cd ui && npm install && npm run build && touch build/.gitkeep
139138

140139
.PHONY: check-license

ui/src/components/layout/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ const LayoutPage = () => {
212212
onClick={handleMenuClick}
213213
/>
214214
</div>
215-
<div className={styles.right} style={{ marginRight: 80 }}>
215+
<div
216+
className={styles.right}
217+
style={githubBadge ? { marginRight: 80 } : {}}
218+
>
216219
{isReadOnlyMode && (
217220
<div className={styles.read_only_mode}>
218221
<img className={styles.read_only_mode_img} src={showPng} />

0 commit comments

Comments
 (0)