OnGetAsync()
{
+ if(bool.Parse(Configuration["MaintenanceMode"]))
+ {
+ return StatusCode(503);
+ }
LastError = "";
LoggedIn = !string.IsNullOrEmpty(Request.Cookies["Token"]);
CanEdit = Request.Cookies["CanEdit"] == "True";
@@ -519,7 +523,7 @@ namespace GanjooRazor.Pages
IsPoemPage = false;
IsHomePage = Request.Path == "/";
PinterestUrl = Request.Query["pinterest_url"];
- ViewData["GoogleAnalyticsCode"] = _configuration["GoogleAnalyticsCode"];
+ ViewData["GoogleAnalyticsCode"] = Configuration["GoogleAnalyticsCode"];
GoogleBreadCrumbList breadCrumbList = new GoogleBreadCrumbList();
Banner = null;
diff --git a/GanjooRazor/Pages/errors/503.cshtml b/GanjooRazor/Pages/errors/503.cshtml
new file mode 100644
index 00000000..7ddc9243
--- /dev/null
+++ b/GanjooRazor/Pages/errors/503.cshtml
@@ -0,0 +1,38 @@
+@page
+
+@{
+ Layout = null;
+ ViewData["Title"] = "در حال بهروز رسانی ...";
+}
+
+
+
+
+
+
+
+
+ @ViewData["Title"]
+
+
+
+
+
+
+
+
+
+
+

+
+
+ گنجور در حال به روزرسانی است
+
+
+
+ گنجور در حال بهروزرسانی است. لطفاً لحظاتی دیگر مجدداً تلاش کنید.
+
+
+
+
+
diff --git a/GanjooRazor/appsettings.json b/GanjooRazor/appsettings.json
index 367a6d76..1565f251 100644
--- a/GanjooRazor/appsettings.json
+++ b/GanjooRazor/appsettings.json
@@ -11,5 +11,6 @@
"APIRoot": "http://localhost:3439",
"GlobalAPIRoot": "http://localhost:3439",
"SiteUrl": "http://localhost:33081",
- "ReadOnlyMode": "False"
+ "ReadOnlyMode": "False",
+ "MaintenanceMode": "False"
}