From 308a73a04f2d6d7b7af9a164852b89fc6f9d7d75 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 8 Mar 2022 20:04:44 +0500 Subject: [PATCH] bug fix: issues --- .../baseTemplate/custom-js/system-status.js | 65 ++++++++++++++++--- 1 file changed, 56 insertions(+), 9 deletions(-) diff --git a/static/baseTemplate/custom-js/system-status.js b/static/baseTemplate/custom-js/system-status.js index b24357fb4..affffe87d 100644 --- a/static/baseTemplate/custom-js/system-status.js +++ b/static/baseTemplate/custom-js/system-status.js @@ -98,21 +98,21 @@ app.filter('getwebsitename', function () { }; }); -function getWebsiteName(domain){ +function getWebsiteName(domain) { if (domain !== undefined) { - domain = domain.replace(/-/g, ''); + domain = domain.replace(/-/g, ''); - var domainName = domain.split("."); + var domainName = domain.split("."); - var finalDomainName = domainName[0]; + var finalDomainName = domainName[0]; - if (finalDomainName.length > 5) { - finalDomainName = finalDomainName.substring(0, 4); - } - - return finalDomainName; + if (finalDomainName.length > 5) { + finalDomainName = finalDomainName.substring(0, 4); } + + return finalDomainName; + } } app.controller('systemStatusInfo', function ($scope, $http, $timeout) { @@ -655,3 +655,50 @@ app.controller('versionManagment', function ($scope, $http, $timeout) { }); + +app.controller('designtheme', function ($scope, $http, $timeout) { + + $scope.themeloading = true; + + + $scope.getthemedata = function () { + $scope.themeloading = false; + + url = "/base/getthemedata"; + + var data = { + package: "helo world", + Themename: $('#stheme').val(), + }; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(Listgetthemedata, cantgetthemedata); + + + function Listgetthemedata(response) { + $scope.themeloading = true; + + if (response.data.status === 1) { + document.getElementById('appendthemedata').innerHTML = ""; + $("#appendthemedata").val(response.data.csscontent) + } else { + alert(response.data.error_message) + } + } + + function cantgetthemedata(response) { + $scope.themeloading = true; + console.log(response); + } + + //$timeout(getStuff, 2000); + + }; +}); + +