@@ -38,6 +38,17 @@ public function details(Request $request, $server)
3838 return sprintf ('%s=%s ' , $ item ->variable ->env_variable , $ item ->variable_value );
3939 });
4040
41+ $ mergeInto = [
42+ 'STARTUP= ' . $ server ->startup ,
43+ 'SERVER_MEMORY= ' . $ server ->memory ,
44+ 'SERVER_IP= ' . $ server ->allocation ->ip ,
45+ 'SERVER_PORT= ' . $ server ->allocation ->port ,
46+ ];
47+
48+ if ($ environment ->count () === 0 ) {
49+ $ environment = collect ($ mergeInto );
50+ }
51+
4152 return response ()->json ([
4253 'scripts ' => [
4354 'install ' => (! $ server ->option ->copy_script_install ) ? null : str_replace (["\r\n" , "\n" , "\r" ], "\n" , $ server ->option ->copy_script_install ),
@@ -47,12 +58,7 @@ public function details(Request $request, $server)
4758 'container ' => $ server ->option ->copy_script_container ,
4859 'entry ' => $ server ->option ->copy_script_entry ,
4960 ],
50- 'env ' => $ environment ->merge ([
51- 'STARTUP= ' . $ server ->startup ,
52- 'SERVER_MEMORY= ' . $ server ->memory ,
53- 'SERVER_IP= ' . $ server ->allocation ->ip ,
54- 'SERVER_PORT= ' . $ server ->allocation ->port ,
55- ])->toArray (),
61+ 'env ' => $ environment ->toArray (),
5662 ]);
5763 }
5864}
0 commit comments