<commit_before>frappe.listview_settings["RQ Job"] = {
	hide_name_column: true,

	onload(listview) {
		if (!has_common(frappe.user_roles, ["Administrator", "System Manager"])) return;

		listview.page.add_inner_button(__("Remove Failed Jobs"), () => {
			frappe.confirm(__("Are you sure you want to remove all failed jobs?"), () => {
				frappe.xcall("frappe.core.doctype.rq_job.rq_job.remove_failed_jobs");
			});
		});

		if (listview.list_view_settings) {
			listview.list_view_settings.disable_count = 1;
			listview.list_view_settings.disable_sidebar_stats = 1;
		}

		frappe.xcall("frappe.utils.scheduler.get_scheduler_status").then(({ status }) => {
			if (status === "active") {
				listview.page.set_indicator(__("Scheduler: Active"), "green");
			} else {
				listview.page.set_indicator(__("Scheduler: Inactive"), "red");
			}
		});
	},
};
<commit_msg>feat: auto refresh RQ job page<commit_after>frappe.listview_settings["RQ Job"] = {
	hide_name_column: true,

	onload(listview) {
		if (!has_common(frappe.user_roles, ["Administrator", "System Manager"])) return;

		listview.page.add_inner_button(__("Remove Failed Jobs"), () => {
			frappe.confirm(__("Are you sure you want to remove all failed jobs?"), () => {
				frappe.xcall("frappe.core.doctype.rq_job.rq_job.remove_failed_jobs");
			});
		});

		if (listview.list_view_settings) {
			listview.list_view_settings.disable_count = 1;
			listview.list_view_settings.disable_sidebar_stats = 1;
		}

		frappe.xcall("frappe.utils.scheduler.get_scheduler_status").then(({ status }) => {
			if (status === "active") {
				listview.page.set_indicator(__("Scheduler: Active"), "green");
			} else {
				listview.page.set_indicator(__("Scheduler: Inactive"), "red");
			}
		});

		setInterval(() => {
			if (!listview.list_view_settings.disable_auto_refresh) {
				listview.refresh();
			}
		}, 5000);
	},
};

{'fraction_non_alphanumeric': 0.16943699731903486, 'fraction_numerical': 0.004289544235924933, 'mean_word_length': 4.654545454545454, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4029803', 'n_tokens_mistral': 748, 'n_tokens_neox': 663, 'n_words': 96}