Skip to content

Commit

Permalink
refactor: adjust ui to adapt github-badge flag, refine makefile (#574)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
elliotxx authored Aug 3, 2024
1 parent cda3942 commit cafe1c5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
27 changes: 13 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ endif

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

.PHONY: test
test: ## Run the tests
Expand Down Expand Up @@ -89,9 +89,9 @@ build-all: build-darwin build-linux build-windows ## Build for all platforms
# make build-darwin GOARCH=arm64
# make build-darwin GOARCH=arm64 SKIP_UI_BUILD=true
.PHONY: build-darwin
build-darwin: $(BUILD_UI) ## Build for MacOS (Darwin)
$(MAKE) gen-version
-rm -rf ./_build/darwin
build-darwin: gen-version $(BUILD_UI) ## Build for MacOS (Darwin)
@rm -rf ./_build/darwin
@echo "🚀 Building karpor-server for darwin platform ..."
GOOS=darwin GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_ENABLED) \
go build -o ./_build/darwin/$(APPROOT) \
./cmd
Expand All @@ -105,9 +105,9 @@ build-darwin: $(BUILD_UI) ## Build for MacOS (Darwin)
# make build-linux GOARCH=arm64
# make build-linux GOARCH=arm64 SKIP_UI_BUILD=true
.PHONY: build-linux
build-linux: $(BUILD_UI) ## Build for Linux
$(MAKE) gen-version
-rm -rf ./_build/linux
build-linux: gen-version $(BUILD_UI) ## Build for Linux
@rm -rf ./_build/linux
@echo "🚀 Building karpor-server for linux platform ..."
GOOS=linux GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_ENABLED) \
go build -o ./_build/linux/$(APPROOT) \
./cmd
Expand All @@ -121,9 +121,9 @@ build-linux: $(BUILD_UI) ## Build for Linux
# make build-windows GOARCH=arm64
# make build-windows GOARCH=arm64 SKIP_UI_BUILD=true
.PHONY: build-windows
build-windows: $(BUILD_UI) ## Build for Windows
$(MAKE) gen-version
-rm -rf ./_build/windows
build-windows: gen-version $(BUILD_UI) ## Build for Windows
@rm -rf ./_build/windows
@echo "🚀 Building karpor-server for windows platform ..."
GOOS=windows GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_ENABLED) \
go build -o ./_build/windows/$(APPROOT).exe \
./cmd
Expand All @@ -132,9 +132,8 @@ build-windows: $(BUILD_UI) ## Build for Windows
# Description: Builds the UI for the dashboard.
# Usage: make build-ui
.PHONY: build-ui
build-ui: ## Build UI for the dashboard
$(MAKE) gen-version
@echo "Building UI for the dashboard ..."
build-ui: gen-version ## Build UI for the dashboard
@echo "🧀 Building UI for the dashboard ..."
cd ui && npm install && npm run build && touch build/.gitkeep

.PHONY: check-license
Expand Down
5 changes: 4 additions & 1 deletion ui/src/components/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,10 @@ const LayoutPage = () => {
onClick={handleMenuClick}
/>
</div>
<div className={styles.right} style={{ marginRight: 80 }}>
<div
className={styles.right}
style={githubBadge ? { marginRight: 80 } : {}}
>
{isReadOnlyMode && (
<div className={styles.read_only_mode}>
<img className={styles.read_only_mode_img} src={showPng} />
Expand Down

0 comments on commit cafe1c5

Please sign in to comment.