From 71998130ebbfb3a63c247c11bd0a7b6e2cf55cd5 Mon Sep 17 00:00:00 2001 From: constient-altrova Date: Fri, 7 Jun 2024 09:47:20 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'internal/'=20w?= =?UTF-8?q?ith=20remote=20'internal/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/prompter/tea_onboarding_form.go | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/internal/prompter/tea_onboarding_form.go b/internal/prompter/tea_onboarding_form.go index a77c41d..70f2f8f 100644 --- a/internal/prompter/tea_onboarding_form.go +++ b/internal/prompter/tea_onboarding_form.go @@ -276,6 +276,8 @@ var step = "signup" var subStep = "email" func waitForLog(m *model) { + time.Sleep(1100 * time.Millisecond) + go grpcutil.GetLog(m.config, m.config.Get().Token, m.config.Get().EndPoint, m.config.Get().TeamId, m.config.Get().AccountId, m.sourceId, m.sourceToken, stop) err := <-stop if err != nil { @@ -612,9 +614,34 @@ func (m model) View() string { return renderWelcome() + renderSection("Signup", true) + m.renderEmail() + m.renderToken() + renderSection("Account setup", true) + m.renderAccountSetup() + renderSection("Create a Team", true) + m.renderTeamName() + renderSection("Send logs", true) + m.renderSource() + m.renderCurlCommand() + awesomeLogReceived + renderSection("Config source", false) + m.renderConfig() + finishMessage case "complete": + currentTime := time.Now() + formattedTime := currentTime.Format("2006-01-02 15:04:05") fmt.Println("Thank you for signing up") + fmt.Printf( + ` +%s +%s %s %s \ +%s %s \ +%s %s \ +%s %s + +%s +`, + continueStyle.Render("******************************************************************************************"), + colorThree.Render(`curl`), + colorThree.Render(`--location`), + colorThree.Render(`'https://in.logfire.ai'`), + colorThree.Render(`--header`), + colorThree.Render(`'Content-Type: application/json'`), + colorThree.Render(`--header`), + colorThree.Render(`'Authorization: Bearer `+m.sourceToken+`'`), + colorThree.Render(`--data`), + colorThree.Render(`'[{"dt":"`+formattedTime+`","message":"Hello from Logfire!"}]'`), + colorTwo.Render("\nOpen Web app or run `logfire stream` to start streaming logs, You can test the ingestion by copying the command and pasting it in any terminal"), + ) + os.Exit(0) return "Completed!"