Refactor method names to use camel case

This commit is contained in:
Andras Bacsai 2024-03-04 11:01:14 +01:00
parent b4908cfcb4
commit c20aa0b256
31 changed files with 71 additions and 49 deletions

View File

@ -71,7 +71,7 @@ public function handle(StandaloneMariadb $database)
if (!is_null($this->database->limits_cpuset)) {
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
}
if ($this->database->destination->server->is_log_drain_enabled() && $this->database->is_log_drain_enabled()) {
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [

View File

@ -78,7 +78,7 @@ public function handle(StandaloneMongodb $database)
if (!is_null($this->database->limits_cpuset)) {
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
}
if ($this->database->destination->server->is_log_drain_enabled() && $this->database->is_log_drain_enabled()) {
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [

View File

@ -71,7 +71,7 @@ public function handle(StandaloneMysql $database)
if (!is_null($this->database->limits_cpuset)) {
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
}
if ($this->database->destination->server->is_log_drain_enabled() && $this->database->is_log_drain_enabled()) {
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [

View File

@ -77,7 +77,7 @@ public function handle(StandalonePostgresql $database)
if (!is_null($this->database->limits_cpuset)) {
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
}
if ($this->database->destination->server->is_log_drain_enabled() && $this->database->is_log_drain_enabled()) {
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
ray('Log Drain Enabled');
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',

View File

@ -81,7 +81,7 @@ public function handle(StandaloneRedis $database)
if (!is_null($this->database->limits_cpuset)) {
data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset);
}
if ($this->database->destination->server->is_log_drain_enabled() && $this->database->is_log_drain_enabled()) {
if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [

View File

@ -77,7 +77,7 @@ private function check_resources($schedule)
// ray('dispatching container status job in ' . $randomSeconds . ' seconds');
// dispatch($job);
// })->name('container-status-' . $server->id)->everyMinute()->onOneServer();
if ($server->is_log_drain_enabled()) {
if ($server->isLogDrainEnabled()) {
$schedule->job(new CheckLogDrainContainerJob($server))->everyMinute()->onOneServer();
// $schedule
// ->call(function () use ($server) {

View File

@ -1185,7 +1185,7 @@ private function generate_compose_file()
} else {
$docker_compose['services'][$this->container_name]['labels'] = $labels;
}
if ($this->server->is_log_drain_enabled() && $this->application->is_log_drain_enabled()) {
if ($this->server->isLogDrainEnabled() && $this->application->isLogDrainEnabled()) {
$docker_compose['services'][$this->container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [

View File

@ -29,14 +29,14 @@ class Advanced extends Component
'application.settings.gpu_options' => 'string|required',
];
public function mount() {
$this->is_force_https_enabled = $this->application->settings->is_force_https_enabled;
$this->is_gzip_enabled = $this->application->settings->is_gzip_enabled;
$this->is_stripprefix_enabled = $this->application->settings->is_stripprefix_enabled;
$this->is_force_https_enabled = $this->application->isForceHttpsEnabled();
$this->is_gzip_enabled = $this->application->isGzipEnabled();
$this->is_stripprefix_enabled = $this->application->isStripprefixEnabled();
}
public function instantSave()
{
if ($this->application->is_log_drain_enabled()) {
if (!$this->application->destination->server->is_log_drain_enabled()) {
if ($this->application->isLogDrainEnabled()) {
if (!$this->application->destination->server->isLogDrainEnabled()) {
$this->application->settings->is_log_drain_enabled = false;
$this->dispatch('error', 'Log drain is not enabled on this server.');
return;

View File

@ -53,7 +53,7 @@ public function mount()
}
public function instantSaveAdvanced() {
try {
if (!$this->database->destination->server->is_log_drain_enabled()) {
if (!$this->database->destination->server->isLogDrainEnabled()) {
$this->database->is_log_drain_enabled = false;
$this->dispatch('error', 'Log drain is not enabled on the server. Please enable it first.');
return;

View File

@ -52,7 +52,7 @@ public function mount()
public function instantSaveAdvanced()
{
try {
if (!$this->database->destination->server->is_log_drain_enabled()) {
if (!$this->database->destination->server->isLogDrainEnabled()) {
$this->database->is_log_drain_enabled = false;
$this->dispatch('error', 'Log drain is not enabled on the server. Please enable it first.');
return;

View File

@ -54,7 +54,7 @@ public function mount()
public function instantSaveAdvanced()
{
try {
if (!$this->database->destination->server->is_log_drain_enabled()) {
if (!$this->database->destination->server->isLogDrainEnabled()) {
$this->database->is_log_drain_enabled = false;
$this->dispatch('error', 'Log drain is not enabled on the server. Please enable it first.');
return;

View File

@ -60,7 +60,7 @@ public function mount()
}
public function instantSaveAdvanced() {
try {
if (!$this->database->destination->server->is_log_drain_enabled()) {
if (!$this->database->destination->server->isLogDrainEnabled()) {
$this->database->is_log_drain_enabled = false;
$this->dispatch('error', 'Log drain is not enabled on the server. Please enable it first.');
return;

View File

@ -46,7 +46,7 @@ public function mount()
}
public function instantSaveAdvanced() {
try {
if (!$this->database->destination->server->is_log_drain_enabled()) {
if (!$this->database->destination->server->isLogDrainEnabled()) {
$this->database->is_log_drain_enabled = false;
$this->dispatch('error', 'Log drain is not enabled on the server. Please enable it first.');
return;

View File

@ -36,7 +36,7 @@ public function mount()
}
public function instantSaveAdvanced()
{
if (!$this->database->service->destination->server->is_log_drain_enabled()) {
if (!$this->database->service->destination->server->isLogDrainEnabled()) {
$this->database->is_log_drain_enabled = false;
$this->dispatch('error', 'Log drain is not enabled on the server. Please enable it first.');
return;

View File

@ -30,7 +30,7 @@ public function instantSave()
}
public function instantSaveAdvanced()
{
if (!$this->application->service->destination->server->is_log_drain_enabled()) {
if (!$this->application->service->destination->server->isLogDrainEnabled()) {
$this->application->is_log_drain_enabled = false;
$this->dispatch('error', 'Log drain is not enabled on the server. Please enable it first.');
return;

View File

@ -54,7 +54,7 @@ public function configureLogDrain()
{
try {
InstallLogDrain::run($this->server);
if (!$this->server->is_log_drain_enabled()) {
if (!$this->server->isLogDrainEnabled()) {
$this->dispatch('serverRefresh');
$this->dispatch('success', 'Log drain service stopped.');
return;

View File

@ -80,15 +80,15 @@ public function is_github_based(): bool
}
return false;
}
public function is_force_https_enabled()
public function isForceHttpsEnabled()
{
return data_get($this, 'settings.is_force_https_enabled', false);
}
public function is_stripprefix_enabled()
public function isStripprefixEnabled()
{
return data_get($this, 'settings.is_stripprefix_enabled', true);
}
public function is_gzip_enabled()
public function isGzipEnabled()
{
return data_get($this, 'settings.is_gzip_enabled', true);
}
@ -493,7 +493,7 @@ public function workdir()
{
return application_configuration_dir() . "/{$this->uuid}";
}
public function is_log_drain_enabled()
public function isLogDrainEnabled()
{
return data_get($this, 'settings.is_log_drain_enabled', false);
}

View File

@ -405,7 +405,7 @@ public function isFunctional()
{
return $this->settings->is_reachable && $this->settings->is_usable && !$this->settings->force_disabled;
}
public function is_log_drain_enabled()
public function isLogDrainEnabled()
{
return $this->settings->is_logdrain_newrelic_enabled || $this->settings->is_logdrain_highlight_enabled || $this->settings->is_logdrain_axiom_enabled || $this->settings->is_logdrain_custom_enabled;
}

View File

@ -19,15 +19,15 @@ protected static function booted()
$service->fileStorages()->delete();
});
}
public function is_log_drain_enabled()
public function isLogDrainEnabled()
{
return data_get($this, 'is_log_drain_enabled', false);
}
public function is_stripprefix_enabled()
public function isStripprefixEnabled()
{
return data_get($this, 'is_stripprefix_enabled', true);
}
public function is_gzip_enabled()
public function isGzipEnabled()
{
return data_get($this, 'is_gzip_enabled', true);
}

View File

@ -17,13 +17,17 @@ protected static function booted()
$service->fileStorages()->delete();
});
}
public function is_log_drain_enabled()
public function isLogDrainEnabled()
{
return data_get($this, 'is_log_drain_enabled', false);
}
public function is_gzip_enabled()
public function isStripprefixEnabled()
{
return true;
return data_get($this, 'is_stripprefix_enabled', true);
}
public function isGzipEnabled()
{
return data_get($this, 'is_gzip_enabled', true);
}
public function type()
{

View File

@ -100,7 +100,7 @@ public function link()
}
return null;
}
public function is_log_drain_enabled()
public function isLogDrainEnabled()
{
return data_get($this, 'is_log_drain_enabled', false);
}

View File

@ -92,7 +92,7 @@ public function team()
{
return data_get($this, 'environment.project.team');
}
public function is_log_drain_enabled()
public function isLogDrainEnabled()
{
return data_get($this, 'is_log_drain_enabled', false);
}

View File

@ -105,7 +105,7 @@ public function type(): string
return 'standalone-mysql';
}
public function is_log_drain_enabled()
public function isLogDrainEnabled()
{
return data_get($this, 'is_log_drain_enabled', false);
}

View File

@ -97,7 +97,7 @@ public function link()
}
return null;
}
public function is_log_drain_enabled()
public function isLogDrainEnabled()
{
return data_get($this, 'is_log_drain_enabled', false);
}

View File

@ -96,7 +96,7 @@ public function link()
}
return null;
}
public function is_log_drain_enabled()
public function isLogDrainEnabled()
{
return data_get($this, 'is_log_drain_enabled', false);
}

View File

@ -400,9 +400,9 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview
uuid: $appUuid,
domains: $domains,
onlyPort: $onlyPort,
is_force_https_enabled: $application->is_force_https_enabled(),
is_gzip_enabled: $application->is_gzip_enabled(),
is_stripprefix_enabled: $application->is_stripprefix_enabled()
is_force_https_enabled: $application->isForceHttpsEnabled(),
is_gzip_enabled: $application->isGzipEnabled(),
is_stripprefix_enabled: $application->isStripprefixEnabled()
));
}
return $labels->all();

View File

@ -1052,12 +1052,13 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
domains: $fqdns,
is_force_https_enabled: true,
serviceLabels: $serviceLabels,
is_gzip_enabled: $savedService->is_gzip_enabled(),
is_stripprefix_enabled: $savedService->is_stripprefix_enabled(),
is_gzip_enabled: $savedService->isGzipEnabled(),
is_stripprefix_enabled: $savedService->isStripprefixEnabled(),
service_name: $serviceName));
}
}
if ($resource->server->is_log_drain_enabled() && $savedService->is_log_drain_enabled()) {
if ($resource->server->isLogDrainEnabled() && $savedService->isLogDrainEnabled()) {
data_set($service, 'logging', [
'driver' => 'fluentd',
'options' => [
@ -1501,7 +1502,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
$defaultLabels = defaultLabels($resource->id, $containerName, $pull_request_id, type: 'application');
$serviceLabels = $serviceLabels->merge($defaultLabels);
if ($server->is_log_drain_enabled() && $resource->is_log_drain_enabled()) {
if ($server->isLogDrainEnabled() && $resource->isLogDrainEnabled()) {
data_set($service, 'logging', [
'driver' => 'fluentd',
'options' => [

View File

@ -18,6 +18,10 @@ public function up(): void
Schema::table('service_applications', function (Blueprint $table) {
$table->boolean('is_stripprefix_enabled')->default(true);
});
Schema::table('service_databases', function (Blueprint $table) {
$table->boolean('is_gzip_enabled')->default(true);
$table->boolean('is_stripprefix_enabled')->default(true);
});
}
/**
@ -32,5 +36,9 @@ public function down(): void
Schema::table('service_applications', function (Blueprint $table) {
$table->dropColumn('is_stripprefix_enabled');
});
Schema::table('service_databases', function (Blueprint $table) {
$table->dropColumn('is_gzip_enabled');
$table->dropColumn('is_stripprefix_enabled');
});
}
};

View File

@ -12,7 +12,7 @@
</div>
<div class="flex flex-col gap-4">
<div class="flex flex-col w-full gap-2 xl:flex-row">
@if ($server->is_log_drain_enabled())
@if ($server->isLogDrainEnabled())
<x-forms.input disabled type="password" required
id="server.settings.logdrain_newrelic_license_key" label="License Key" />
<x-forms.input disabled required id="server.settings.logdrain_newrelic_base_uri"
@ -44,7 +44,7 @@
<form wire:submit='submit("axiom")' class="flex flex-col">
<div class="flex flex-col gap-4">
<div class="flex flex-col w-full gap-2 xl:flex-row">
@if ($server->is_log_drain_enabled())
@if ($server->isLogDrainEnabled())
<x-forms.input disabled type="password" required id="server.settings.logdrain_axiom_api_key"
label="API Key" />
<x-forms.input disabled required id="server.settings.logdrain_axiom_dataset_name"
@ -88,7 +88,7 @@
</div>
<form wire:submit='submit("custom")' class="flex flex-col">
<div class="flex flex-col gap-4">
@if ($server->is_log_drain_enabled())
@if ($server->isLogDrainEnabled())
<x-forms.textarea disabled rows="6" required id="server.settings.logdrain_custom_config"
label="Custom FluentBit Configuration" />
<x-forms.textarea disabled id="server.settings.logdrain_custom_config_parser"

View File

@ -5,8 +5,6 @@
services:
changedetection:
image: ghcr.io/dgtlmoon/changedetection.io
container_name: changedetection
hostname: changedetection
volumes:
- changedetection-data:/datastore
environment:
@ -21,7 +19,6 @@ services:
playwright-chrome:
condition: service_started
playwright-chrome:
hostname: playwright-chrome
image: dgtlmoon/sockpuppetbrowser:latest
# cap_add:
# - SYS_ADMIN

View File

@ -51,6 +51,18 @@
"logo": "svgs\/unknown.svg",
"minversion": "0.0.0"
},
"changedetection": {
"documentation": "https:\/\/github.com\/dgtlmoon\/changedetection.io\/",
"slogan": "Website change detection monitor and notifications",
"compose": "c2VydmljZXM6CiAgY2hhbmdlZGV0ZWN0aW9uOgogICAgaW1hZ2U6IGdoY3IuaW8vZGd0bG1vb24vY2hhbmdlZGV0ZWN0aW9uLmlvCiAgICB2b2x1bWVzOgogICAgICAtICdjaGFuZ2VkZXRlY3Rpb24tZGF0YTovZGF0YXN0b3JlJwogICAgZW52aXJvbm1lbnQ6CiAgICAgIC0gU0VSVklDRV9GUUROX0NIQU5HRURFVEVDVElPTgogICAgICAtIFBVSUQ9MTAwMAogICAgICAtIFBHSUQ9MTAwMAogICAgICAtIEJBU0VfVVJMPSRTRVJWSUNFX0ZRRE5fQ0hBTkdFREVURUNUSU9OCiAgICAgIC0gJ1BMQVlXUklHSFRfRFJJVkVSX1VSTD13czovL3BsYXl3cmlnaHQtY2hyb21lOjMwMDAvP3N0ZWFsdGg9MSYtLWRpc2FibGUtd2ViLXNlY3VyaXR5PXRydWUnCiAgICAgIC0gSElERV9SRUZFUkVSPXRydWUKICAgIGRlcGVuZHNfb246CiAgICAgIHBsYXl3cmlnaHQtY2hyb21lOgogICAgICAgIGNvbmRpdGlvbjogc2VydmljZV9zdGFydGVkCiAgcGxheXdyaWdodC1jaHJvbWU6CiAgICBpbWFnZTogJ2RndGxtb29uL3NvY2twdXBwZXRicm93c2VyOmxhdGVzdCcKICAgIHJlc3RhcnQ6IHVubGVzcy1zdG9wcGVkCiAgICBlbnZpcm9ubWVudDoKICAgICAgLSBTQ1JFRU5fV0lEVEg9MTkyMAogICAgICAtIFNDUkVFTl9IRUlHSFQ9MTAyNAogICAgICAtIFNDUkVFTl9ERVBUSD0xNgogICAgICAtIE1BWF9DT05DVVJSRU5UX0NIUk9NRV9QUk9DRVNTRVM9MTAK",
"tags": [
"web",
"alert",
"monitor"
],
"logo": "svgs\/unknown.svg",
"minversion": "0.0.0"
},
"code-server": {
"documentation": "https:\/\/coder.com\/docs\/code-server\/latest",
"slogan": "Code-Server is a web-based code editor that enables remote coding and collaboration from any device, anywhere.",