feat(server-actions): remove inline job-log; link → job-log-modal trigger
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6656588b8f
commit
e2b6f39828
2 changed files with 37 additions and 4 deletions
|
|
@ -24,13 +24,11 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if latest_job %}
|
{% if latest_job %}
|
||||||
<p class="last-job">
|
<p class="last-job">
|
||||||
<a href="/jobs/{{ latest_job.id }}">{{ latest_job_phrase }}</a>
|
<button type="button" class="link-button" data-inline-modal-open="job-log-modal">{{ latest_job_phrase }}</button>
|
||||||
{% if latest_job_is_running %}since{% endif %}
|
{% if latest_job_is_running %}since{% endif %}
|
||||||
{{ latest_job_at | timeago }}
|
{{ latest_job_at | timeago }}
|
||||||
(<a href="/servers/{{ server.id }}/jobs">show all</a>)
|
(<a href="/servers/{{ server.id }}/jobs">show all</a>)
|
||||||
</p>
|
</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if latest_job_is_running %}
|
|
||||||
<pre class="log-stream job-log" data-sse-url="/jobs/{{ latest_job.id }}/stream"></pre>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -685,6 +685,41 @@ def test_rename_preserves_hostname(user_client_with_blueprints) -> None:
|
||||||
assert server.hostname == "My Cool Server", "rename must not wipe hostname"
|
assert server.hostname == "My Cool Server", "rename must not wipe hostname"
|
||||||
|
|
||||||
|
|
||||||
|
def test_server_detail_no_inline_job_log_pre(user_client_with_blueprints) -> None:
|
||||||
|
from sqlalchemy import select
|
||||||
|
|
||||||
|
from l4d2web.models import Job, Server
|
||||||
|
|
||||||
|
client, data = user_client_with_blueprints
|
||||||
|
|
||||||
|
with session_scope() as db:
|
||||||
|
server = Server(
|
||||||
|
user_id=data["user_id"],
|
||||||
|
blueprint_id=data["blueprint_id"],
|
||||||
|
name="jobserver",
|
||||||
|
port=27099,
|
||||||
|
rcon_password="x",
|
||||||
|
actual_state="running",
|
||||||
|
)
|
||||||
|
db.add(server)
|
||||||
|
db.flush()
|
||||||
|
job = Job(
|
||||||
|
user_id=data["user_id"],
|
||||||
|
server_id=server.id,
|
||||||
|
operation="start",
|
||||||
|
state="running",
|
||||||
|
)
|
||||||
|
db.add(job)
|
||||||
|
db.flush()
|
||||||
|
server_id = server.id
|
||||||
|
|
||||||
|
res = client.get(f"/servers/{server_id}")
|
||||||
|
assert res.status_code == 200
|
||||||
|
html = res.get_data(as_text=True)
|
||||||
|
assert 'class="log-stream job-log"' not in html
|
||||||
|
assert 'data-inline-modal-open="job-log-modal"' in html
|
||||||
|
|
||||||
|
|
||||||
def test_update_server_clears_hostname(user_client_with_blueprints) -> None:
|
def test_update_server_clears_hostname(user_client_with_blueprints) -> None:
|
||||||
from sqlalchemy import select
|
from sqlalchemy import select
|
||||||
from l4d2web.models import Server
|
from l4d2web.models import Server
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue