-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa0da3e
commit 130c547
Showing
30 changed files
with
559 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
@tool extends Node | ||
|
||
@onready var _start = %Start | ||
@onready var _stop = %Stop | ||
@onready var _restart = %Restart | ||
@onready var _open_logs = %OpenLogs | ||
|
||
@onready var _proc_manager: ProcessManager = %ProcessManager | ||
@onready var _proc_logs: ProcessLogs = %ProcessLogs | ||
|
||
func _ready(): | ||
_proc_manager.get_process_command = _get_process_command | ||
|
||
func _get_process_command(): | ||
var cli = RivetPluginBridge.get_plugin().cli | ||
return [cli.get_cli_path(), "sidekick", "backend-dev", "--no-color"] | ||
|
||
func _on_process_manager_process_status_changed(status, _pid): | ||
_start.visible = status == ProcessManager.ProcessStatus.STOPPED | ||
_stop.visible = status == ProcessManager.ProcessStatus.RUNNING | ||
_restart.visible = status == ProcessManager.ProcessStatus.RUNNING | ||
_open_logs.visible = _proc_manager.logs_path != null | ||
|
||
func _on_start_pressed(): | ||
_proc_manager.start_process() | ||
|
||
func _on_stop_pressed(): | ||
_proc_manager.stop_process() | ||
|
||
func _on_restart_pressed(): | ||
_proc_manager.start_process() | ||
|
||
func _on_clear_logs_pressed(): | ||
_proc_logs.clear_logs() | ||
|
||
func _on_open_logs_pressed(): | ||
_proc_manager.open_logs_in_file_manager() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
[gd_scene load_steps=4 format=3 uid="uid://c4c4p87eotulc"] | ||
|
||
[ext_resource type="Script" path="res://addons/rivet/devtools/backend/panel.gd" id="1_ydecy"] | ||
[ext_resource type="Script" path="res://addons/rivet/devtools/elements/process_manager.gd" id="2_dolt5"] | ||
[ext_resource type="PackedScene" uid="uid://v3rf8tpycjfv" path="res://addons/rivet/devtools/elements/process_logs.tscn" id="3_lqccm"] | ||
|
||
[node name="Panel" type="HBoxContainer"] | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
script = ExtResource("1_ydecy") | ||
|
||
[node name="ProcessManager" type="Node" parent="." node_paths=PackedStringArray("logs")] | ||
unique_name_in_owner = true | ||
script = ExtResource("2_dolt5") | ||
logs = NodePath("../ProcessLogs") | ||
|
||
[node name="ProcessLogs" parent="." instance=ExtResource("3_lqccm")] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
init_message = "Press start to start backend server." | ||
|
||
[node name="VBoxContainer" type="VBoxContainer" parent="."] | ||
custom_minimum_size = Vector2(100, 2.08165e-12) | ||
layout_mode = 2 | ||
|
||
[node name="Start" type="Button" parent="VBoxContainer"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
text = "Start" | ||
|
||
[node name="Stop" type="Button" parent="VBoxContainer"] | ||
unique_name_in_owner = true | ||
visible = false | ||
layout_mode = 2 | ||
text = "Stop" | ||
|
||
[node name="Restart" type="Button" parent="VBoxContainer"] | ||
unique_name_in_owner = true | ||
visible = false | ||
layout_mode = 2 | ||
text = "Restart" | ||
|
||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"] | ||
layout_mode = 2 | ||
|
||
[node name="ClearLogs" type="Button" parent="VBoxContainer"] | ||
layout_mode = 2 | ||
text = "Clear" | ||
|
||
[node name="OpenLogs" type="Button" parent="VBoxContainer"] | ||
unique_name_in_owner = true | ||
visible = false | ||
layout_mode = 2 | ||
text = "Open in File Manager" | ||
|
||
[connection signal="process_status_changed" from="ProcessManager" to="." method="_on_process_manager_process_status_changed"] | ||
[connection signal="pressed" from="VBoxContainer/Start" to="." method="_on_start_pressed"] | ||
[connection signal="pressed" from="VBoxContainer/Stop" to="." method="_on_stop_pressed"] | ||
[connection signal="pressed" from="VBoxContainer/Restart" to="." method="_on_restart_pressed"] | ||
[connection signal="pressed" from="VBoxContainer/ClearLogs" to="." method="_on_clear_logs_pressed"] | ||
[connection signal="pressed" from="VBoxContainer/OpenLogs" to="." method="_on_open_logs_pressed"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.