mirror of
https://github.com/Gouryella/drip.git
synced 2026-02-28 07:11:40 +00:00
feat: Add HTTP streaming, compression support, and Docker deployment
enhancements - Add adaptive HTTP response handling with automatic streaming for large responses (>1MB) - Implement zero-copy streaming using buffer pools for better performance - Add compression module for reduced bandwidth usage - Add GitHub Container Registry workflow for automated Docker builds - Add production-optimized Dockerfile and docker-compose configuration - Simplify background mode with -d flag and improved daemon management - Update documentation with new command syntax and deployment guides - Clean up unused code and improve error handling - Fix lipgloss style usage (remove unnecessary .Copy() calls)
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
// RenderConfigInit renders config initialization UI
|
||||
func RenderConfigInit() string {
|
||||
title := "Drip Configuration Setup"
|
||||
box := boxStyle.Copy().Width(50)
|
||||
box := boxStyle.Width(50)
|
||||
return "\n" + box.Render(titleStyle.Render(title)) + "\n"
|
||||
}
|
||||
|
||||
|
||||
@@ -6,19 +6,12 @@ import (
|
||||
|
||||
var (
|
||||
// Colors inspired by Vercel CLI
|
||||
primaryColor = lipgloss.Color("#0070F3")
|
||||
successColor = lipgloss.Color("#0070F3")
|
||||
warningColor = lipgloss.Color("#F5A623")
|
||||
errorColor = lipgloss.Color("#E00")
|
||||
mutedColor = lipgloss.Color("#888")
|
||||
highlightColor = lipgloss.Color("#0070F3")
|
||||
cyanColor = lipgloss.Color("#50E3C2")
|
||||
purpleColor = lipgloss.Color("#7928CA")
|
||||
|
||||
// Base styles
|
||||
baseStyle = lipgloss.NewStyle().
|
||||
PaddingLeft(1).
|
||||
PaddingRight(1)
|
||||
|
||||
// Box styles - Vercel-like clean box
|
||||
boxStyle = lipgloss.NewStyle().
|
||||
@@ -27,14 +20,11 @@ var (
|
||||
MarginTop(1).
|
||||
MarginBottom(1)
|
||||
|
||||
successBoxStyle = boxStyle.Copy().
|
||||
BorderForeground(successColor)
|
||||
successBoxStyle = boxStyle.BorderForeground(successColor)
|
||||
|
||||
warningBoxStyle = boxStyle.Copy().
|
||||
BorderForeground(warningColor)
|
||||
warningBoxStyle = boxStyle.BorderForeground(warningColor)
|
||||
|
||||
errorBoxStyle = boxStyle.Copy().
|
||||
BorderForeground(errorColor)
|
||||
errorBoxStyle = boxStyle.BorderForeground(errorColor)
|
||||
|
||||
// Text styles
|
||||
titleStyle = lipgloss.NewStyle().
|
||||
@@ -85,10 +75,6 @@ var (
|
||||
|
||||
tableCellStyle = lipgloss.NewStyle().
|
||||
PaddingRight(2)
|
||||
|
||||
tableRowHighlight = lipgloss.NewStyle().
|
||||
Foreground(highlightColor).
|
||||
Bold(true)
|
||||
)
|
||||
|
||||
// Success returns a styled success message
|
||||
|
||||
@@ -68,7 +68,7 @@ func (t *Table) Render() string {
|
||||
// Header
|
||||
headerParts := make([]string, len(t.headers))
|
||||
for i, header := range t.headers {
|
||||
style := tableHeaderStyle.Copy().Width(colWidths[i])
|
||||
style := tableHeaderStyle.Width(colWidths[i])
|
||||
headerParts[i] = style.Render(header)
|
||||
}
|
||||
output.WriteString(strings.Join(headerParts, " "))
|
||||
@@ -87,7 +87,7 @@ func (t *Table) Render() string {
|
||||
rowParts := make([]string, len(t.headers))
|
||||
for i, cell := range row {
|
||||
if i < len(colWidths) {
|
||||
style := tableCellStyle.Copy().Width(colWidths[i])
|
||||
style := tableCellStyle.Width(colWidths[i])
|
||||
rowParts[i] = style.Render(cell)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ func RenderTunnelConnected(status *TunnelStatus) string {
|
||||
|
||||
urlLine := lipgloss.JoinHorizontal(
|
||||
lipgloss.Left,
|
||||
urlStyle.Copy().Foreground(accent).Render(status.URL),
|
||||
urlStyle.Foreground(accent).Render(status.URL),
|
||||
lipgloss.NewStyle().MarginLeft(1).Foreground(mutedColor).Render("(forwarded address)"),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user