diff --git a/app/modules/common/common.py b/app/modules/common/common.py
index c0b74c0f..8049db66 100644
--- a/app/modules/common/common.py
+++ b/app/modules/common/common.py
@@ -40,6 +40,8 @@ def get_time_zoned_date(date: datetime, fmt: str = '%Y-%m-%d %H:%M:%S') -> str:
:rtype: str
"""
date_format = '%Y-%m-%d %H:%M:%S'
+ if not fmt:
+ fmt = date_format
if not isinstance(date, datetime):
date = datetime.strptime(date, date_format)
native = _convert_to_time_zone(date)
diff --git a/inc/add.js b/app/static/js/add.js
similarity index 100%
rename from inc/add.js
rename to app/static/js/add.js
diff --git a/inc/add_nginx.js b/app/static/js/add_nginx.js
similarity index 100%
rename from inc/add_nginx.js
rename to app/static/js/add_nginx.js
diff --git a/inc/admin_settings.js b/app/static/js/admin_settings.js
similarity index 100%
rename from inc/admin_settings.js
rename to app/static/js/admin_settings.js
diff --git a/inc/configshow.js b/app/static/js/configshow.js
similarity index 100%
rename from inc/configshow.js
rename to app/static/js/configshow.js
diff --git a/inc/hotkeys.js b/app/static/js/hotkeys.js
similarity index 100%
rename from inc/hotkeys.js
rename to app/static/js/hotkeys.js
diff --git a/inc/metrics.js b/app/static/js/metrics.js
similarity index 100%
rename from inc/metrics.js
rename to app/static/js/metrics.js
diff --git a/inc/nprogress.js b/app/static/js/nprogress.js
similarity index 100%
rename from inc/nprogress.js
rename to app/static/js/nprogress.js
diff --git a/inc/overview.js b/app/static/js/overview.js
similarity index 96%
rename from inc/overview.js
rename to app/static/js/overview.js
index 646dbef8..75b870a3 100644
--- a/inc/overview.js
+++ b/app/static/js/overview.js
@@ -10,7 +10,7 @@ function showHapserversCallBack(serv, hostnamea, service) {
$.ajax( {
url: "/app/service/" + service + "/" + serv + "/last-edit",
beforeSend: function() {
- $("#edit_date_"+hostnamea).html('');
+ $("#edit_date_"+hostnamea).html('
');
},
type: "GET",
success: function( data ) {
@@ -32,7 +32,7 @@ function overviewHapserverBackends(serv, hostnamea, service) {
$.ajax( {
url: "/app/service/" + service + "/backends/" + serv[0],
beforeSend: function() {
- $("#top-"+hostnamea).html('
');
+ $("#top-"+hostnamea).html('
');
},
success: function( data ) {
if (data.indexOf('error:') != '-1') {
@@ -59,7 +59,7 @@ function showOverviewCallBack(serv, hostnamea) {
$.ajax( {
url: "/app/overview/server/"+serv,
beforeSend: function() {
- $("#"+hostnamea).html('
');
+ $("#"+hostnamea).html('
');
},
type: "GET",
success: function( data ) {
@@ -77,7 +77,7 @@ function showServicesOverview() {
$.ajax( {
url: "/app/overview/services",
beforeSend: function() {
- $("#services_ovw").html('
');
+ $("#services_ovw").html('
');
},
type: "GET",
@@ -321,8 +321,8 @@ function showBytes(serv) {
},
type: "POST",
beforeSend: function() {
- $("#show_bin_bout").html('
');
- $("#sessions").html('
');
+ $("#show_bin_bout").html('
');
+ $("#sessions").html('
');
},
success: function( data ) {
data = data.replace(/\s+/g,' ');
@@ -343,7 +343,7 @@ function showNginxConnections(serv) {
},
type: "POST",
beforeSend: function() {
- $("#sessions").html('
');
+ $("#sessions").html('
');
},
success: function( data ) {
data = data.replace(/\s+/g,' ');
@@ -364,7 +364,7 @@ function showApachekBytes(serv) {
},
type: "POST",
beforeSend: function() {
- $("#sessions").html('
');
+ $("#sessions").html('
');
},
success: function( data ) {
data = data.replace(/\s+/g,' ');
@@ -385,7 +385,7 @@ function keepalivedBecameMaster(serv) {
},
type: "POST",
beforeSend: function() {
- $("#bin_bout").html('
');
+ $("#bin_bout").html('
');
},
success: function( data ) {
data = data.replace(/\s+/g,' ');
@@ -407,7 +407,7 @@ function showUsersOverview() {
// },
type: "GET",
beforeSend: function() {
- $("#users-table").html('
');
+ $("#users-table").html('
');
},
success: function( data ) {
data = data.replace(/\s+/g,' ');
@@ -428,7 +428,7 @@ function showSubOverview() {
// },
type: "GET",
beforeSend: function() {
- $("#sub-table").html('
');
+ $("#sub-table").html('
');
},
success: function( data ) {
data = data.replace(/\s+/g,' ');
@@ -576,13 +576,13 @@ function ShowOverviewLogs() {
url: "/app/overview/logs",
type: "GET",
beforeSend: function() {
- $("#overview-logs").html('
');
+ $("#overview-logs").html('
');
},
success: function( data ) {
data = data.replace(/\s+/g,' ');
$("#overview-logs").html(data);
$.getScript("/inc/fontawesome.min.js")
- $.getScript("/inc/overview.js")
+ $.getScript("/app/static/js/overview.js")
}
} );
}
diff --git a/inc/runtimeapi.js b/app/static/js/runtimeapi.js
similarity index 100%
rename from inc/runtimeapi.js
rename to app/static/js/runtimeapi.js
diff --git a/inc/select2.js b/app/static/js/select2.js
similarity index 100%
rename from inc/select2.js
rename to app/static/js/select2.js
diff --git a/inc/smon.js b/app/static/js/smon.js
similarity index 100%
rename from inc/smon.js
rename to app/static/js/smon.js
diff --git a/app/static/js/waf.js b/app/static/js/waf.js
index 34f024d4..6a0efa78 100644
--- a/app/static/js/waf.js
+++ b/app/static/js/waf.js
@@ -1,6 +1,6 @@
var awesome = "/inc/fontawesome.min.js"
var waf = "/app/static/js/waf.js"
-var overview = "/inc/overview.js"
+var overview = "/app/static/js/overview.js"
function showOverviewWaf(serv, hostnamea) {
var service = cur_url[1];
if (service == 'haproxy') {
diff --git a/app/templates/add.html b/app/templates/add.html
index b72a58dd..d12c7a4b 100644
--- a/app/templates/add.html
+++ b/app/templates/add.html
@@ -20,7 +20,7 @@
{% set header_params = {'add-header': 'add-header', 'set-header': 'set-header', 'del-header': 'del-header'} %}
{% set if_values = {'1':'Host name starts with','2':'Host name ends with','3':'Path starts with','4':'Path ends with', '6': 'Src ip'} %}
-
+