Skip to content

Commit

Permalink
Notify user on how many days they have on their operator license. (#242)
Browse files Browse the repository at this point in the history
* Display trial progress notification in intellij.

* changelog
  • Loading branch information
meowjesty authored Mar 1, 2024
1 parent 3bc5e5b commit 6b0c5f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/382.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Notify user on license validity.
12 changes: 11 additions & 1 deletion modules/core/src/main/kotlin/com/metalbear/mirrord/MirrordApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ import java.util.concurrent.*

const val GITHUB_URL = "https://github.com/metalbear-co/mirrord"

/**
* The message types we get from mirrord-cli.
*
* See `mirrord/progress/src/lib.rs` `ProgressMessage`.
*/
enum class MessageType {
NewTask, FinishedTask, Warning
NewTask, FinishedTask, Warning, Info
}

// I don't know how to do tags like Rust so this format is for parsing both kind of messages ;_;
Expand Down Expand Up @@ -120,6 +125,11 @@ class MirrordApi(private val service: MirrordProjectService, private val project
}
}

message.type == MessageType.Info -> {
val service = project.service<MirrordProjectService>()
message.message?.let { service.notifier.notifySimple(it, NotificationType.INFORMATION) }
}

message.type == MessageType.Warning -> {
message.message?.let { warningHandler.handle(it) }
}
Expand Down

0 comments on commit 6b0c5f5

Please sign in to comment.