Skip to content

Commit

Permalink
Fix more formatting and schema issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gecage952 committed Mar 27, 2024
1 parent 791348a commit 87f5126
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 19 deletions.
2 changes: 1 addition & 1 deletion client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8071,7 +8071,7 @@ export interface components {
* Job State
* @description The current job's state
*/
state?: string;
state?: components["schemas"]["JobState"] | null;
/**
* STDERR
* @description Job STDERR text
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/JobInformation/JobInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ const props = defineProps({
includeTimes: {
type: Boolean,
default: false,
}
},
});
const stdout_length = ref(50000);
const stdout_text = ref("");
const stderr_length = ref(50000);
const stderr_text = ref("");
const stderr_text = ref("");
const stdout_position = computed(() => stdout_text.value.length);
const stderr_position = computed(() => stderr_text.value.length);
Expand Down Expand Up @@ -97,15 +97,15 @@ async function fetchInvocation(jobId) {

<template>
<div>
<JobDetailsProvider auto-refresh :job-id="props.job_id" @update:result="updateJob"/>
<JobDetailsProvider auto-refresh :job-id="props.job_id" @update:result="updateJob" />
<JobConsoleOutputProvider
auto-refresh
:job-id="props.job_id"
:stdout_position="stdout_position"
:stdout_length="stdout_length"
:stderr_position="stderr_position"
:stderr_length="stderr_length"
@update:result="updateConsoleOutputs"/>
@update:result="updateConsoleOutputs" />
<h2 class="h-md">Job Information</h2>
<table id="job-information" class="tabletip info_data_table">
<tbody>
Expand Down
16 changes: 11 additions & 5 deletions client/src/components/providers/JobProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { rethrowSimple } from "utils/simple-error";
import { cleanPaginationParameters, stateIsTerminal } from "./utils";

async function jobDetails({ jobId }) {
const url =
`${getAppRoot()}api/jobs/${jobId}?full=True`;
const url = `${getAppRoot()}api/jobs/${jobId}?full=True`;
try {
const { data } = await axios.get(url);
return data;
Expand All @@ -16,9 +15,16 @@ async function jobDetails({ jobId }) {
}
}

async function jobConsoleOutput({ jobId, stdout_position = 0, stdout_length = 0, stderr_position = 0, stderr_length = 0 }) {
const url = `${getAppRoot()}api/jobs/${jobId}/console_output?stdout_position=${stdout_position}&stdout_length=${stdout_length}` +
`&stderr_position=${stderr_position}&stderr_length=${stderr_length}`;
async function jobConsoleOutput({
jobId,
stdout_position = 0,
stdout_length = 0,
stderr_position = 0,
stderr_length = 0,
}) {
const url =
`${getAppRoot()}api/jobs/${jobId}/console_output?stdout_position=${stdout_position}&stdout_length=${stdout_length}` +
`&stderr_position=${stderr_position}&stderr_length=${stderr_length}`;
try {
const { data } = await axios.get(url);
return data;
Expand Down
4 changes: 3 additions & 1 deletion lib/galaxy/managers/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ def get_accessible_job(self, trans, decoded_job_id) -> Job:
trans.sa_session.refresh(job)
return job

def get_job_console_output(self, trans, job, stdout_position=-1, stdout_length=0, stderr_position=-1, stderr_length=0):
def get_job_console_output(
self, trans, job, stdout_position=-1, stdout_length=0, stderr_position=-1, stderr_length=0
):
if job is None:
raise ObjectNotFound()

Expand Down
14 changes: 7 additions & 7 deletions lib/galaxy/webapps/galaxy/api/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,13 @@ def outputs(
summary="Returns STDOUT and STDERR from job.",
)
def console_output(
self,
job_id: Annotated[DecodedDatabaseIdField, JobIdPathParam],
stdout_position: int,
stdout_length: int,
stderr_position: int,
stderr_length: int,
trans: ProvidesUserContext = DependsOnTrans,
self,
job_id: Annotated[DecodedDatabaseIdField, JobIdPathParam],
stdout_position: int,
stdout_length: int,
stderr_position: int,
stderr_length: int,
trans: ProvidesUserContext = DependsOnTrans,
) -> JobConsoleOutput:
"""
Get the stdout and/or stderr of a job. The position parameters are the index
Expand Down
5 changes: 4 additions & 1 deletion lib/galaxy/webapps/galaxy/services/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def show(
id: DecodedDatabaseIdField,
full: bool = False,
) -> Dict[str, Any]:
job = self.job_manager.get_accessible_job(trans, id,)
job = self.job_manager.get_accessible_job(
trans,
id,
)
return view_show_job(trans, job, bool(full))

def index(
Expand Down

0 comments on commit 87f5126

Please sign in to comment.