-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
27 changed files
with
775 additions
and
221 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
from .settings import * | ||
|
||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.sqlite3', | ||
'NAME': 'database', | ||
if os.environ.get("GITHUB_WORKFLOW"): | ||
DATABASES = { | ||
"default": { | ||
"ENGINE": "django.db.backends.postgresql", | ||
"NAME": "github_actions", | ||
"USER": "postgres", | ||
"PASSWORD": "postgres", | ||
"HOST": "127.0.0.1", | ||
"PORT": "5432", | ||
} | ||
} | ||
else: | ||
DATABASES = { | ||
"default": { | ||
"ENGINE": "django.db.backends.postgresql", | ||
"NAME": "postgres-local", | ||
"USER": "postgres", | ||
"PASSWORD": "postgres", | ||
"PORT": "5432" | ||
# 'HOST': 'localhost' | ||
} | ||
} | ||
} | ||
|
||
DYNAMIC_PREFERENCES = { | ||
'ENABLE_CACHE': False, | ||
"ENABLE_CACHE": False, | ||
} | ||
|
||
EMAIL_BACKEND = 'django.core.mail.backends.locmem.EmailBackend' | ||
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend" |
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
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
25 changes: 25 additions & 0 deletions
25
remotescripts/management/commands/clear_scripts_running_status.py
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,25 @@ | ||
from django.core.management.base import BaseCommand, CommandError | ||
from remotescripts.models import ScriptConfigurationBase | ||
|
||
|
||
class Command(BaseCommand): | ||
help = ( | ||
"Clears the running status of all remotescripts. To be used on server restart" | ||
) | ||
|
||
def handle(self, *args, **options): | ||
scripts = ScriptConfigurationBase.objects.all() | ||
count = 0 | ||
for script in scripts: | ||
if script.is_running: | ||
script.is_running = False | ||
script.save() | ||
count += 1 | ||
if count: | ||
self.stdout.write( | ||
self.style.SUCCESS("Cleared 'running' status of %s scripts" % count) | ||
) | ||
else: | ||
self.stdout.write( | ||
self.style.SUCCESS("No scripts with status 'running' were found") | ||
) |
17 changes: 17 additions & 0 deletions
17
remotescripts/migrations/0008_alter_scriptconfigurationbase_options.py
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,17 @@ | ||
# Generated by Django 4.0.6 on 2022-08-23 10:55 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('remotescripts', '0007_scriptconfigurationbase_is_running'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='scriptconfigurationbase', | ||
options={'ordering': ['id']}, | ||
), | ||
] |
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
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 |
---|---|---|
@@ -1,28 +1,21 @@ | ||
{% if queryset.run_numbers %} | ||
<div style="max-width: 700px;"> | ||
<h4>{{ caption }}</h4> | ||
<table class="table table-hover"> | ||
<thead> | ||
<div style="max-width: 700px;"> | ||
<h4>{{ caption }}</h4> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th class="col-sm-3">Fill Number</th> | ||
{% comment %} | ||
<th>Ini Lumi (1033 cm2/s)</th> | ||
<th>End Lumi (1033 cm2/s)</th> | ||
<th>N Bunches</th> | ||
<th>N Colliding Bunches</th> | ||
<th>Peak PU</th> | ||
{% endcomment %} | ||
<th class="col-sm-9">Certified Runs</th> | ||
<th class="col-sm-3" scope="col">Fill Number</th> | ||
<th class="col-sm-9" scope="col">Certified Runs</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
</thead> | ||
<tbody> | ||
{% for fill in queryset.fills %} | ||
<tr> | ||
<td class="col-sm-3">{{ fill.fill_number}}</td> | ||
<td class="col-sm-9">{{ fill.run_number|join:", " }}</td> | ||
</tr> | ||
<tr> | ||
<td scope="row" class="col-sm-3">{{ fill.fill.fill_number}}</td> | ||
<td class="col-sm-9">{{ fill.run_number|join:", " }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
{% endif %} | ||
</tbody> | ||
</table> | ||
</div> | ||
{% endif %} |
Oops, something went wrong.