mirror of
https://github.com/frappe/lms.git
synced 2026-05-04 22:49:31 +03:00
fix: LiveCodeSession reference error and UI loading state (#2218)
* fix: LiveCodeSession reference error and UI loading state * fix: remove trailing slash from livecode_url in LMS Settings and add patch to update existing records * fix: remove reload function in patch file and update live_code_url default value by administrator --------- Co-authored-by: Jannat Patel <31363128+pateljannat@users.noreply.github.com>
This commit is contained in:
@@ -49,11 +49,14 @@
|
||||
"
|
||||
variant="solid"
|
||||
@click="submitCode"
|
||||
:loading="running"
|
||||
:disabled="running"
|
||||
class="text-ink-gray-9"
|
||||
>
|
||||
<template #prefix>
|
||||
<Play class="size-3" />
|
||||
</template>
|
||||
{{ __('Run') }}
|
||||
{{ running ? __('Running') : __('Run') }}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -172,8 +175,9 @@ const { brand } = sessionStore()
|
||||
const { settings } = useSettings()
|
||||
const router = useRouter()
|
||||
const fromLesson = ref(false)
|
||||
const falconURL = ref<string>('https://falcon.frappe.io/')
|
||||
const falconURL = ref<string>('https://falcon.frappe.io')
|
||||
const falconError = ref<string | null>(null)
|
||||
const running = ref<boolean>(false)
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -308,8 +312,10 @@ const loadFalcon = () => {
|
||||
}
|
||||
|
||||
const submitCode = async () => {
|
||||
running.value = true
|
||||
await runCode()
|
||||
createSubmission()
|
||||
running.value = false
|
||||
}
|
||||
|
||||
const runCode = async () => {
|
||||
@@ -406,6 +412,7 @@ const execute = (stdin = ''): Promise<string> => {
|
||||
|
||||
setTimeout(() => {
|
||||
if (!hasExited) {
|
||||
running.value = false
|
||||
error.value = true
|
||||
errorMessage.value = 'Execution timed out.'
|
||||
reject('Execution timed out.')
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"default": "https://falcon.frappe.io/",
|
||||
"default": "https://falcon.frappe.io",
|
||||
"fieldname": "livecode_url",
|
||||
"fieldtype": "Data",
|
||||
"label": "LiveCode URL"
|
||||
@@ -512,8 +512,8 @@
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2026-03-18 15:32:56.259783",
|
||||
"modified_by": "sayali@frappe.io",
|
||||
"modified": "2026-03-19 11:31:14.951880",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Settings",
|
||||
"owner": "Administrator",
|
||||
@@ -544,4 +544,4 @@
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -122,4 +122,5 @@ lms.patches.v2_0.rename_badge_assignment_event
|
||||
lms.patches.v2_0.enable_allow_job_posting
|
||||
lms.patches.v2_0.set_conferencing_provider_for_zoom
|
||||
lms.patches.v2_0.sync_evaluator_roles
|
||||
lms.patches.v2_0.give_event_permission #10-03-2026
|
||||
lms.patches.v2_0.fix_livecode_url_default
|
||||
lms.patches.v2_0.give_event_permission #10-03-2026
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
livecode_url = frappe.db.get_single_value("LMS Settings", "livecode_url")
|
||||
if livecode_url == "https://falcon.frappe.io/":
|
||||
frappe.db.set_single_value("LMS Settings", "livecode_url", "https://falcon.frappe.io")
|
||||
Reference in New Issue
Block a user