Skip to content

Commit

Permalink
chore: tidy up login (#8)
Browse files Browse the repository at this point in the history
Tidy up the login message so it fits more nicely on the screen

Fix the link to the linux binary
  • Loading branch information
Owen authored Jul 1, 2024
1 parent 6f2a086 commit 43b3f04
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

## [Unreleased]

## [1.0.2] - 2024-07-01
### Fixed
- Update linux binaries path
- Make the "connect to Infracost" link more simple

## [1.0.1] - 2024-07-01
### Fixed
- Updates to readme
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pluginGroup = io.infracost.plugins
pluginName = Infracost
pluginRepositoryUrl = https://github.com/infracost/jetbrains-infracost
pluginVersion = 1.0.1
pluginVersion = 1.0.2

pluginSinceBuild = 232
pluginUntilBuild = 242.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ abstract class InfracostTask(project: Project, taskTitle: String, cancellable: B
} else if (osName.contains("mac")) {
resourcePath = "/binaries/macos/${arch}/infracost"
} else if (osName.contains("nix") || osName.contains("nux") || osName.contains("aix")) {
resourcePath = "/linux/${arch}/infracost"
resourcePath = "/binaries/linux/${arch}/infracost"
}

if (resourcePath != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import com.intellij.openapi.fileEditor.OpenFileDescriptor
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.SimpleToolWindowPanel
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.ui.JBColor
import com.intellij.ui.components.JBLabel
import com.intellij.ui.components.JBScrollPane
import com.intellij.ui.treeStructure.Tree
import io.infracost.plugins.infracost.actions.CheckAuthAction
import io.infracost.plugins.infracost.actions.ResultProcessor
import io.infracost.plugins.infracost.actions.RunAuthAction
import io.infracost.plugins.infracost.model.Resource
import java.awt.Cursor
import java.awt.event.MouseAdapter
import java.awt.event.MouseEvent
import java.nio.file.Paths
Expand All @@ -34,6 +37,7 @@ class InfracostWindow(private val project: Project) : SimpleToolWindowPanel(fals
fun updatePanel(isAuthenticated: Boolean) {
if (isAuthenticated) {
this.authenticated = true
this.removeAll()
configureToolbar()
} else {
this.authenticated = false
Expand All @@ -42,14 +46,20 @@ class InfracostWindow(private val project: Project) : SimpleToolWindowPanel(fals
}

private fun showLoginButton() {
val label = "You are not connected to Infracost. Click the button below to connect."
val button = JButton("Connect to Infracost")
button.addActionListener { RunAuthAction.runAuth(project) }
val label = "First we need to"
val hyperlink = JBLabel("connect to Infracost")
hyperlink.foreground = JBColor.BLUE
hyperlink.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR))
hyperlink.addMouseListener(object : MouseAdapter() {
override fun mouseClicked(e: MouseEvent) {
RunAuthAction.runAuth(project)
}
})

val panel = JPanel()
panel.border = BorderFactory.createEmptyBorder(20,10,0,10)
panel.add(JLabel(label))
panel.add(button)

panel.add(hyperlink)
this.add(JBScrollPane(panel))
}

Expand Down

0 comments on commit 43b3f04

Please sign in to comment.