feat: timezone and recording
This commit is contained in:
@@ -91,15 +91,21 @@ def update_course(class_name, course, value):
|
|||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def create_live_class(class_name, title, duration, date, time, description=None):
|
def create_live_class(
|
||||||
|
class_name, title, duration, date, time, timezone, auto_recording, description=None
|
||||||
|
):
|
||||||
date = format_date(date, "yyyy-mm-dd", True)
|
date = format_date(date, "yyyy-mm-dd", True)
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
"topic": title,
|
"topic": title,
|
||||||
"start_time": format_datetime(f"{date} {time}", "yyyy-MM-ddTHH:mm:ssZ"),
|
"start_time": format_datetime(f"{date} {time}", "yyyy-MM-ddTHH:mm:ssZ"),
|
||||||
"duration": duration,
|
"duration": duration,
|
||||||
"timezone": "IN",
|
|
||||||
"agenda": description,
|
"agenda": description,
|
||||||
"private_meeting": True,
|
"private_meeting": True,
|
||||||
|
"auto_recording": "none"
|
||||||
|
if auto_recording == "No Recording"
|
||||||
|
else auto_recording.lower(),
|
||||||
|
"timezone": timezone,
|
||||||
}
|
}
|
||||||
headers = {
|
headers = {
|
||||||
"Authorization": "Bearer " + authenticate(),
|
"Authorization": "Bearer " + authenticate(),
|
||||||
@@ -123,6 +129,7 @@ def create_live_class(class_name, title, duration, date, time, description=None)
|
|||||||
"class_name": class_name,
|
"class_name": class_name,
|
||||||
"password": data.get("password"),
|
"password": data.get("password"),
|
||||||
"description": description,
|
"description": description,
|
||||||
|
"auto_recording": auto_recording,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
class_details = frappe.get_doc(payload)
|
class_details = frappe.get_doc(payload)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"host",
|
"host",
|
||||||
"class_name",
|
"class_name",
|
||||||
"password",
|
"password",
|
||||||
|
"auto_recording",
|
||||||
"column_break_astv",
|
"column_break_astv",
|
||||||
"description",
|
"description",
|
||||||
"section_break_glxh",
|
"section_break_glxh",
|
||||||
@@ -114,11 +115,18 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Class",
|
"label": "Class",
|
||||||
"options": "LMS Class"
|
"options": "LMS Class"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "No Recording",
|
||||||
|
"fieldname": "auto_recording",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"label": "Auto Recording",
|
||||||
|
"options": "No Recording\nLocal\nCloud"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-03-06 16:59:28.565587",
|
"modified": "2023-03-14 18:44:48.813102",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Live Class",
|
"name": "LMS Live Class",
|
||||||
|
|||||||
@@ -27,10 +27,6 @@ frappe.ready(() => {
|
|||||||
$("#create-live-class").click((e) => {
|
$("#create-live-class").click((e) => {
|
||||||
create_live_class(e);
|
create_live_class(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
console.log(locals.Doctype);
|
|
||||||
}, 10000);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const submit_student = (e) => {
|
const submit_student = (e) => {
|
||||||
@@ -102,6 +98,10 @@ const create_live_class = (e) => {
|
|||||||
duration: $("input[data-fieldname='meeting_duration']").val(),
|
duration: $("input[data-fieldname='meeting_duration']").val(),
|
||||||
date: $("input[data-fieldname='meeting_date']").val(),
|
date: $("input[data-fieldname='meeting_date']").val(),
|
||||||
time: $("input[data-fieldname='meeting_time']").val(),
|
time: $("input[data-fieldname='meeting_time']").val(),
|
||||||
|
timezone: $('select[data-fieldname="meeting_timezone"]').val(),
|
||||||
|
auto_recording: $(
|
||||||
|
'select[data-fieldname="meeting_recording"]'
|
||||||
|
).val(),
|
||||||
description: $(
|
description: $(
|
||||||
"textarea[data-fieldname='meeting_description']"
|
"textarea[data-fieldname='meeting_description']"
|
||||||
).val(),
|
).val(),
|
||||||
@@ -139,6 +139,13 @@ const make_live_class_form = (e) => {
|
|||||||
label: "Time",
|
label: "Time",
|
||||||
reqd: 1,
|
reqd: 1,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
fieldname: "meeting_timezone",
|
||||||
|
label: __("Time Zone"),
|
||||||
|
fieldtype: "Select",
|
||||||
|
options: get_timezones().join("\n"),
|
||||||
|
reqd: 1,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fieldname: "meeting_col",
|
fieldname: "meeting_col",
|
||||||
fieldtype: "Column Break",
|
fieldtype: "Column Break",
|
||||||
@@ -158,6 +165,13 @@ const make_live_class_form = (e) => {
|
|||||||
label: "Duration (in Minutes)",
|
label: "Duration (in Minutes)",
|
||||||
reqd: 1,
|
reqd: 1,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
fieldname: "meeting_recording",
|
||||||
|
fieldtype: "Select",
|
||||||
|
options: "No Recording\nLocal\nCloud",
|
||||||
|
label: "Auto Recording",
|
||||||
|
default: "No Recording",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fieldname: "meeting_sec",
|
fieldname: "meeting_sec",
|
||||||
fieldtype: "Section Break",
|
fieldtype: "Section Break",
|
||||||
@@ -174,11 +188,152 @@ const make_live_class_form = (e) => {
|
|||||||
],
|
],
|
||||||
body: $("#live-class-form").get(0),
|
body: $("#live-class-form").get(0),
|
||||||
});
|
});
|
||||||
|
|
||||||
this.field_group.make();
|
this.field_group.make();
|
||||||
$("#live-class-form .form-section:last").removeClass("empty-section");
|
$("#live-class-form .form-section:last").removeClass("empty-section");
|
||||||
$("#live-class-form .frappe-control").removeClass("hide-control");
|
$("#live-class-form .frappe-control").removeClass("hide-control");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const get_timezones = () => {
|
||||||
|
return [
|
||||||
|
"Pacific/Midway",
|
||||||
|
"Pacific/Pago_Pago",
|
||||||
|
"Pacific/Honolulu",
|
||||||
|
"America/Anchorage",
|
||||||
|
"America/Vancouver",
|
||||||
|
"America/Los_Angeles",
|
||||||
|
"America/Tijuana",
|
||||||
|
"America/Edmonton",
|
||||||
|
"America/Denver",
|
||||||
|
"America/Phoenix",
|
||||||
|
"America/Mazatlan",
|
||||||
|
"America/Winnipeg",
|
||||||
|
"America/Regina",
|
||||||
|
"America/Chicago",
|
||||||
|
"America/Mexico_City",
|
||||||
|
"America/Guatemala",
|
||||||
|
"America/El_Salvador",
|
||||||
|
"America/Managua",
|
||||||
|
"America/Costa_Rica",
|
||||||
|
"America/Montreal",
|
||||||
|
"America/New_York",
|
||||||
|
"America/Indianapolis",
|
||||||
|
"America/Panama",
|
||||||
|
"America/Bogota",
|
||||||
|
"America/Lima",
|
||||||
|
"America/Halifax",
|
||||||
|
"America/Puerto_Rico",
|
||||||
|
"America/Caracas",
|
||||||
|
"America/Santiago",
|
||||||
|
"America/St_Johns",
|
||||||
|
"America/Montevideo",
|
||||||
|
"America/Araguaina",
|
||||||
|
"America/Argentina/Buenos_Aires",
|
||||||
|
"America/Godthab",
|
||||||
|
"America/Sao_Paulo",
|
||||||
|
"Atlantic/Azores",
|
||||||
|
"Canada/Atlantic",
|
||||||
|
"Atlantic/Cape_Verde",
|
||||||
|
"UTC",
|
||||||
|
"Etc/Greenwich",
|
||||||
|
"Europe/Belgrade",
|
||||||
|
"CET",
|
||||||
|
"Atlantic/Reykjavik",
|
||||||
|
"Europe/Dublin",
|
||||||
|
"Europe/London",
|
||||||
|
"Europe/Lisbon",
|
||||||
|
"Africa/Casablanca",
|
||||||
|
"Africa/Nouakchott",
|
||||||
|
"Europe/Oslo",
|
||||||
|
"Europe/Copenhagen",
|
||||||
|
"Europe/Brussels",
|
||||||
|
"Europe/Berlin",
|
||||||
|
"Europe/Helsinki",
|
||||||
|
"Europe/Amsterdam",
|
||||||
|
"Europe/Rome",
|
||||||
|
"Europe/Stockholm",
|
||||||
|
"Europe/Vienna",
|
||||||
|
"Europe/Luxembourg",
|
||||||
|
"Europe/Paris",
|
||||||
|
"Europe/Zurich",
|
||||||
|
"Europe/Madrid",
|
||||||
|
"Africa/Bangui",
|
||||||
|
"Africa/Algiers",
|
||||||
|
"Africa/Tunis",
|
||||||
|
"Africa/Harare",
|
||||||
|
"Africa/Nairobi",
|
||||||
|
"Europe/Warsaw",
|
||||||
|
"Europe/Prague",
|
||||||
|
"Europe/Budapest",
|
||||||
|
"Europe/Sofia",
|
||||||
|
"Europe/Istanbul",
|
||||||
|
"Europe/Athens",
|
||||||
|
"Europe/Bucharest",
|
||||||
|
"Asia/Nicosia",
|
||||||
|
"Asia/Beirut",
|
||||||
|
"Asia/Damascus",
|
||||||
|
"Asia/Jerusalem",
|
||||||
|
"Asia/Amman",
|
||||||
|
"Africa/Tripoli",
|
||||||
|
"Africa/Cairo",
|
||||||
|
"Africa/Johannesburg",
|
||||||
|
"Europe/Moscow",
|
||||||
|
"Asia/Baghdad",
|
||||||
|
"Asia/Kuwait",
|
||||||
|
"Asia/Riyadh",
|
||||||
|
"Asia/Bahrain",
|
||||||
|
"Asia/Qatar",
|
||||||
|
"Asia/Aden",
|
||||||
|
"Asia/Tehran",
|
||||||
|
"Africa/Khartoum",
|
||||||
|
"Africa/Djibouti",
|
||||||
|
"Africa/Mogadishu",
|
||||||
|
"Asia/Dubai",
|
||||||
|
"Asia/Muscat",
|
||||||
|
"Asia/Baku",
|
||||||
|
"Asia/Kabul",
|
||||||
|
"Asia/Yekaterinburg",
|
||||||
|
"Asia/Tashkent",
|
||||||
|
"Asia/Calcutta",
|
||||||
|
"Asia/Kathmandu",
|
||||||
|
"Asia/Novosibirsk",
|
||||||
|
"Asia/Almaty",
|
||||||
|
"Asia/Dacca",
|
||||||
|
"Asia/Krasnoyarsk",
|
||||||
|
"Asia/Dhaka",
|
||||||
|
"Asia/Bangkok",
|
||||||
|
"Asia/Saigon",
|
||||||
|
"Asia/Jakarta",
|
||||||
|
"Asia/Irkutsk",
|
||||||
|
"Asia/Shanghai",
|
||||||
|
"Asia/Hong_Kong",
|
||||||
|
"Asia/Taipei",
|
||||||
|
"Asia/Kuala_Lumpur",
|
||||||
|
"Asia/Singapore",
|
||||||
|
"Australia/Perth",
|
||||||
|
"Asia/Yakutsk",
|
||||||
|
"Asia/Seoul",
|
||||||
|
"Asia/Tokyo",
|
||||||
|
"Australia/Darwin",
|
||||||
|
"Australia/Adelaide",
|
||||||
|
"Asia/Vladivostok",
|
||||||
|
"Pacific/Port_Moresby",
|
||||||
|
"Australia/Brisbane",
|
||||||
|
"Australia/Sydney",
|
||||||
|
"Australia/Hobart",
|
||||||
|
"Asia/Magadan",
|
||||||
|
"SST",
|
||||||
|
"Pacific/Noumea",
|
||||||
|
"Asia/Kamchatka",
|
||||||
|
"Pacific/Fiji",
|
||||||
|
"Pacific/Auckland",
|
||||||
|
"Asia/Kolkata",
|
||||||
|
"Europe/Kiev",
|
||||||
|
"America/Tegucigalpa",
|
||||||
|
"Pacific/Apia",
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
const make_add_students_section = () => {
|
const make_add_students_section = () => {
|
||||||
this.field_group = new frappe.ui.FieldGroup({
|
this.field_group = new frappe.ui.FieldGroup({
|
||||||
fields: [
|
fields: [
|
||||||
|
|||||||
Reference in New Issue
Block a user