Kaynağa Gözat

fix: rename `auto-reload` to `live-reload`

version-14
Pruthvi Patel 3 yıl önce
ebeveyn
işleme
d99403393a
3 değiştirilmiş dosya ile 12 ekleme ve 8 silme
  1. +2
    -2
      esbuild/esbuild.js
  2. +6
    -2
      frappe/build.py
  3. +4
    -4
      frappe/public/js/frappe/build_events/BuildSuccess.vue

+ 2
- 2
esbuild/esbuild.js Dosyayı Görüntüle

@@ -44,7 +44,7 @@ let argv = yargs
type: "boolean", type: "boolean",
description: "Run in watch mode and rebuild on file changes" description: "Run in watch mode and rebuild on file changes"
}) })
.option("auto-reload", {
.option("live-reload", {
type: "boolean", type: "boolean",
description: `Automatically reload webpages when assets are rebuilt. description: `Automatically reload webpages when assets are rebuilt.
Can only be used with the --watch flag.` Can only be used with the --watch flag.`
@@ -481,7 +481,7 @@ async function notify_redis({ error, success }) {
if (success) { if (success) {
payload = { payload = {
success: true, success: true,
autoreload: argv["auto-reload"]
live_reload: argv["live-reload"]
}; };
} }




+ 6
- 2
frappe/build.py Dosyayı Görüntüle

@@ -235,8 +235,12 @@ def watch(apps=None):
if apps: if apps:
command += " --apps {apps}".format(apps=apps) command += " --apps {apps}".format(apps=apps)


if frappe.conf.autoreload_on_build:
command += " --auto-reload"
live_reload = frappe.conf.live_reload
if "LIVE_RELOAD" in os.environ:
live_reload = os.environ["LIVE_RELOAD"]

if live_reload:
command += " --live-reload"


check_node_executable() check_node_executable()
frappe_app_path = frappe.get_app_path("frappe", "..") frappe_app_path = frappe.get_app_path("frappe", "..")


+ 4
- 4
frappe/public/js/frappe/build_events/BuildSuccess.vue Dosyayı Görüntüle

@@ -5,7 +5,7 @@
> >
Compiled successfully Compiled successfully
<a <a
v-if="!autoreload"
v-if="!live_reload"
class="ml-4 text-white underline" href="/" @click.prevent="reload" class="ml-4 text-white underline" href="/" @click.prevent="reload"
> >
Refresh Refresh
@@ -18,13 +18,13 @@ export default {
data() { data() {
return { return {
is_shown: false, is_shown: false,
autoreload: false,
live_reload: false,
}; };
}, },
methods: { methods: {
show(data) { show(data) {
if (data.autoreload) {
this.autoreload = true;
if (data.live_reload) {
this.live_reload = true;
this.reload(); this.reload();
} }




Yükleniyor…
İptal
Kaydet