diff --git a/storage_dashboard/README.rst b/storage_dashboard/README.rst new file mode 100644 index 000000000..2a94dd492 --- /dev/null +++ b/storage_dashboard/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Storage Dashboard +================= +Storage Dashboard Module for Odoo 17 Provides Memory Usage Statistics for +Various Models in the Current Database. + +configuration +============ +* No Additional Configuration Needed. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developers: (V17) Ashwin A, + (V16) Vishnuraj P +* Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/storage_dashboard/__init__.py b/storage_dashboard/__init__.py new file mode 100755 index 000000000..097bdb395 --- /dev/null +++ b/storage_dashboard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/storage_dashboard/__manifest__.py b/storage_dashboard/__manifest__.py new file mode 100755 index 000000000..fd75b0091 --- /dev/null +++ b/storage_dashboard/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Storage Dashboard', + 'version': '17.0.1.0.0', + 'category': 'Extra Tools', + 'summary': 'Dashboard for Storage Usage of Different Models.', + 'description': "Storage Dashboard Provides Memory Usage Statistics for " + "Various Models in the Current Database.", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'data': [ + 'views/storage_dashboard_menu.xml', + ], + 'assets': { + 'web.assets_backend': [ + 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.0/chart.umd.min.js', + 'storage_dashboard/static/src/js/storage_dashboard.js', + 'storage_dashboard/static/src/xml/storage_dashboard_templates.xml', + ] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/storage_dashboard/doc/RELEASE_NOTES.md b/storage_dashboard/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..a75f71751 --- /dev/null +++ b/storage_dashboard/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 22.03.2024 +#### Version 17.0.1.0.0 +#### ADD + +- Initial commit for Storage Dashboard diff --git a/storage_dashboard/models/__init__.py b/storage_dashboard/models/__init__.py new file mode 100755 index 000000000..c83bdc21a --- /dev/null +++ b/storage_dashboard/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import storage_usage diff --git a/storage_dashboard/models/storage_usage.py b/storage_dashboard/models/storage_usage.py new file mode 100755 index 000000000..dbf7e8eea --- /dev/null +++ b/storage_dashboard/models/storage_usage.py @@ -0,0 +1,205 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import os +import platform +import psycopg2 +import psutil +from odoo import api, models +from odoo.exceptions import AccessError +from odoo.tools import config + + +def get_model_storage(db_name, model_name): + """ Method to get storage usage of a model it returns storage of + specific model passed to this method """ + sql_model_name = model_name.replace(".", "_") + db_host = config['db_host'] + db_port = config['db_port'] + db_user = config['db_user'] + db_password = config['db_password'] + try: + connection = psycopg2.connect( + dbname=db_name, + user=db_user, + password=db_password, + host=db_host, + port=db_port, + ) + cursor = connection.cursor() + cursor.execute(f""" + SELECT sum(pg_column_size(x)) + FROM (SELECT * FROM {sql_model_name}) AS x; + """) + total_storage = cursor.fetchone()[0] + cursor.close() + connection.close() + except psycopg2.Error as e: + if 'relation does not exist' in str(e).lower(): + # Return zero as storage when the relation doesn't exist + return '0 bytes' + else: + return None + return total_storage + + +def get_index_data(db_name, model_name): + sql_model_name = model_name.replace(".", "_") + db_host = config['db_host'] + db_port = config['db_port'] + db_user = config['db_user'] + db_password = config['db_password'] + try: + connection = psycopg2.connect( + dbname=db_name, + user=db_user, + password=db_password, + host=db_host, + port=db_port, + ) + cursor = connection.cursor() + cursor.execute(f"""SELECT + pg_indexes_size('{sql_model_name}'); + """) + index_size = cursor.fetchone()[0] + cursor.close() + connection.close() + except psycopg2.Error as e: + if 'relation does not exist' in str(e).lower(): + # Return zero as storage when the relation doesn't exist + return '0 bytes' + else: + return None + return index_size + + +class StorageUsage(models.Model): + """ Model for Compute Storage usage of each models """ + _name = 'storage.usage' + _description = "Storage Usage" + + @api.model + def get_data(self): + """ Method for get all existing models and return model with its + storage with the help of get_model_storage_method """ + user_group_ids = self.env.user.groups_id.ids + accessible_model_ids = self.env['ir.model.access'].search([ + ('group_id', 'in', user_group_ids) + ]).mapped('model_id').ids + model_names = [record.model for record in self.env['ir.model'].browse( + accessible_model_ids)] + chart_x = [] + chart_y = [] + for name in model_names: + size = get_model_storage(self.env.cr.dbname, name) if get_model_storage(self.env.cr.dbname, name) else 0 + if size > 100000: + size = round(size / (1024 * 1024), 2) + if size != 0: + chart_x.append(name) + chart_y.append(size) + return {'x_data': chart_x, + 'y_data': chart_y} + + @api.model + def get_info(self): + """ + Method for get database information and returns it as a dictionary + """ + db_host = config['db_host'] + db_port = config['db_port'] + db_user = config['db_user'] + db_password = config['db_password'] + try: + connection = psycopg2.connect( + dbname=self.env.cr.dbname, + user=db_user, + password=db_password, + host=db_host, + port=db_port + ) + # Establishing connection + cursor = connection.cursor() + # Fetching version od DB + cursor.execute("SELECT version();") + db_version = cursor.fetchone()[0] + # Fetching total size of DB + cursor.execute(""" + SELECT sum(pg_total_relation_size(schemaname || '.' || + tablename)) FROM pg_tables + WHERE schemaname NOT IN ('pg_catalog', 'information_schema'); + """) + db_size = cursor.fetchone()[0] / (1024 * 1024) + # Fetching count of tables in DB + cursor.execute(""" + SELECT count(*) FROM information_schema.tables WHERE + table_schema='public'; + """) + db_tables = cursor.fetchone()[0] + # Closing the connection + cursor.close() + connection.close() + # Getting system monitor datas + system_datas = dict(psutil.virtual_memory()._asdict()) + total_memory = system_datas['total'] / (1024 * 1024 * 1024) + used_memory = system_datas['used'] / (1024 * 1024 * 1024) + available_memory = system_datas['available'] / (1024 * 1024 * 1024) + cpu_usage = psutil.cpu_percent(interval=None) + operating_system = platform.system() + os_ver = platform.release() + soft_limit = config.get('limit_memory_soft') / (1024 * 1024 * 1024) + hard_limit = config.get('limit_memory_hard') / (1024 * 1024 * 1024) + transient_age_limit = config.get('transient_age_limit') + limit_time_cpu = config.get('limit_time_cpu') + limit_request = config.get('limit_request') + limit_time_real = config.get('limit_time_real') + http_port = config.get('http_port') + db_user = config.get('db_user') + # Odoo ram usage + process = psutil.Process(os.getpid()) + memory_info = process.memory_info() + ram_usage = memory_info.rss / (1024 * 1024) + + db_date = self.env['ir.config_parameter'].sudo().get_param( + 'database.create_date') + except psycopg2.Error as e: + raise AccessError( + f"Error while fetching database information via query: {e}") + return { + 'db_name': self.env.cr.dbname, + 'db_version': db_version, + 'db_date': db_date, + 'db_size': f"{round(db_size, 2)} MB", + 'db_tables': db_tables, + 'total_memory': f"{round(total_memory, 2)} GB", + 'used_memory': f"{round(used_memory, 2)} GB", + 'available_memory': f"{round(available_memory, 2)} GB", + 'cpu_usage': f"{cpu_usage} %", + 'ram_usage': f"{round(ram_usage, 2)} MB", + 'os': f"{operating_system +' ' + os_ver}", + 'db_user': db_user, + 'soft_limit': f"{soft_limit} GB", + 'hard_limit': f"{hard_limit} GB", + 'transient_age_limit': f"{transient_age_limit} GB", + 'limit_time_cpu': f"{limit_time_cpu} s", + 'limit_request': limit_request, + 'limit_time_real': limit_time_real, + 'http_port': http_port, + } diff --git a/storage_dashboard/static/description/assets/icons/capture (1).png b/storage_dashboard/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/capture (1).png differ diff --git a/storage_dashboard/static/description/assets/icons/check.png b/storage_dashboard/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/check.png differ diff --git a/storage_dashboard/static/description/assets/icons/chevron.png b/storage_dashboard/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/chevron.png differ diff --git a/storage_dashboard/static/description/assets/icons/cogs.png b/storage_dashboard/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/cogs.png differ diff --git a/storage_dashboard/static/description/assets/icons/consultation.png b/storage_dashboard/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/consultation.png differ diff --git a/storage_dashboard/static/description/assets/icons/ecom-black.png b/storage_dashboard/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/ecom-black.png differ diff --git a/storage_dashboard/static/description/assets/icons/education-black.png b/storage_dashboard/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/education-black.png differ diff --git a/storage_dashboard/static/description/assets/icons/hotel-black.png b/storage_dashboard/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/hotel-black.png differ diff --git a/storage_dashboard/static/description/assets/icons/img.png b/storage_dashboard/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/img.png differ diff --git a/storage_dashboard/static/description/assets/icons/license.png b/storage_dashboard/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/license.png differ diff --git a/storage_dashboard/static/description/assets/icons/lifebuoy.png b/storage_dashboard/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/lifebuoy.png differ diff --git a/storage_dashboard/static/description/assets/icons/manufacturing-black.png b/storage_dashboard/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/manufacturing-black.png differ diff --git a/storage_dashboard/static/description/assets/icons/photo-capture.png b/storage_dashboard/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/photo-capture.png differ diff --git a/storage_dashboard/static/description/assets/icons/pos-black.png b/storage_dashboard/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/pos-black.png differ diff --git a/storage_dashboard/static/description/assets/icons/puzzle.png b/storage_dashboard/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/puzzle.png differ diff --git a/storage_dashboard/static/description/assets/icons/restaurant-black.png b/storage_dashboard/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/restaurant-black.png differ diff --git a/storage_dashboard/static/description/assets/icons/service-black.png b/storage_dashboard/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/service-black.png differ diff --git a/storage_dashboard/static/description/assets/icons/trading-black.png b/storage_dashboard/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/trading-black.png differ diff --git a/storage_dashboard/static/description/assets/icons/training.png b/storage_dashboard/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/training.png differ diff --git a/storage_dashboard/static/description/assets/icons/update.png b/storage_dashboard/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/update.png differ diff --git a/storage_dashboard/static/description/assets/icons/user.png b/storage_dashboard/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/user.png differ diff --git a/storage_dashboard/static/description/assets/icons/wrench.png b/storage_dashboard/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/wrench.png differ diff --git a/storage_dashboard/static/description/assets/misc/Cybrosys R.png b/storage_dashboard/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/Cybrosys R.png differ diff --git a/storage_dashboard/static/description/assets/misc/categories.png b/storage_dashboard/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/categories.png differ diff --git a/storage_dashboard/static/description/assets/misc/check-box.png b/storage_dashboard/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/check-box.png differ diff --git a/storage_dashboard/static/description/assets/misc/compass.png b/storage_dashboard/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/compass.png differ diff --git a/storage_dashboard/static/description/assets/misc/corporate.png b/storage_dashboard/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/corporate.png differ diff --git a/storage_dashboard/static/description/assets/misc/customer-support.png b/storage_dashboard/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/customer-support.png differ diff --git a/storage_dashboard/static/description/assets/misc/cybrosys-logo.png b/storage_dashboard/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/cybrosys-logo.png differ diff --git a/storage_dashboard/static/description/assets/misc/email.svg b/storage_dashboard/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/storage_dashboard/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/misc/features.png b/storage_dashboard/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/features.png differ diff --git a/storage_dashboard/static/description/assets/misc/logo.png b/storage_dashboard/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/logo.png differ diff --git a/storage_dashboard/static/description/assets/misc/phone.svg b/storage_dashboard/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/storage_dashboard/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/storage_dashboard/static/description/assets/misc/pictures.png b/storage_dashboard/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/pictures.png differ diff --git a/storage_dashboard/static/description/assets/misc/pie-chart.png b/storage_dashboard/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/pie-chart.png differ diff --git a/storage_dashboard/static/description/assets/misc/right-arrow.png b/storage_dashboard/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/right-arrow.png differ diff --git a/storage_dashboard/static/description/assets/misc/star (1) 2.svg b/storage_dashboard/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/storage_dashboard/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/misc/star.png b/storage_dashboard/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/star.png differ diff --git a/storage_dashboard/static/description/assets/misc/support (1) 1.svg b/storage_dashboard/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/storage_dashboard/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/misc/support-email.svg b/storage_dashboard/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/storage_dashboard/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/storage_dashboard/static/description/assets/misc/support.png b/storage_dashboard/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/support.png differ diff --git a/storage_dashboard/static/description/assets/misc/tick-mark.svg b/storage_dashboard/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/storage_dashboard/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/misc/whatsapp 1.svg b/storage_dashboard/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/storage_dashboard/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/misc/whatsapp.png b/storage_dashboard/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/storage_dashboard/static/description/assets/misc/whatsapp.png differ diff --git a/storage_dashboard/static/description/assets/misc/whatsapp.svg b/storage_dashboard/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/storage_dashboard/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/modules/1.png b/storage_dashboard/static/description/assets/modules/1.png new file mode 100644 index 000000000..ae3a880a2 Binary files /dev/null and b/storage_dashboard/static/description/assets/modules/1.png differ diff --git a/storage_dashboard/static/description/assets/modules/2.png b/storage_dashboard/static/description/assets/modules/2.png new file mode 100644 index 000000000..d6b1fe049 Binary files /dev/null and b/storage_dashboard/static/description/assets/modules/2.png differ diff --git a/storage_dashboard/static/description/assets/modules/3.png b/storage_dashboard/static/description/assets/modules/3.png new file mode 100644 index 000000000..8513873ea Binary files /dev/null and b/storage_dashboard/static/description/assets/modules/3.png differ diff --git a/storage_dashboard/static/description/assets/modules/4.png b/storage_dashboard/static/description/assets/modules/4.png new file mode 100644 index 000000000..5141a7802 Binary files /dev/null and b/storage_dashboard/static/description/assets/modules/4.png differ diff --git a/storage_dashboard/static/description/assets/modules/5.png b/storage_dashboard/static/description/assets/modules/5.png new file mode 100644 index 000000000..469963f22 Binary files /dev/null and b/storage_dashboard/static/description/assets/modules/5.png differ diff --git a/storage_dashboard/static/description/assets/modules/6.png b/storage_dashboard/static/description/assets/modules/6.png new file mode 100644 index 000000000..7cdd530f0 Binary files /dev/null and b/storage_dashboard/static/description/assets/modules/6.png differ diff --git a/storage_dashboard/static/description/assets/screenshots/1.png b/storage_dashboard/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..6a979cb19 Binary files /dev/null and b/storage_dashboard/static/description/assets/screenshots/1.png differ diff --git a/storage_dashboard/static/description/assets/screenshots/2.png b/storage_dashboard/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..1ad16f17c Binary files /dev/null and b/storage_dashboard/static/description/assets/screenshots/2.png differ diff --git a/storage_dashboard/static/description/assets/screenshots/3.png b/storage_dashboard/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..9454953bb Binary files /dev/null and b/storage_dashboard/static/description/assets/screenshots/3.png differ diff --git a/storage_dashboard/static/description/assets/screenshots/hero.png b/storage_dashboard/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..be7e77a5c Binary files /dev/null and b/storage_dashboard/static/description/assets/screenshots/hero.png differ diff --git a/storage_dashboard/static/description/banner.jpg b/storage_dashboard/static/description/banner.jpg new file mode 100644 index 000000000..a61fffb06 Binary files /dev/null and b/storage_dashboard/static/description/banner.jpg differ diff --git a/storage_dashboard/static/description/icon.png b/storage_dashboard/static/description/icon.png new file mode 100644 index 000000000..5af66135e Binary files /dev/null and b/storage_dashboard/static/description/icon.png differ diff --git a/storage_dashboard/static/description/index.html b/storage_dashboard/static/description/index.html new file mode 100644 index 000000000..5adee9d57 --- /dev/null +++ b/storage_dashboard/static/description/index.html @@ -0,0 +1,699 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+
+
+
+
+

+ Storage Dashboard

+

+ Dashboard for Storage Usage of Different Models. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Easy to understand storage consumption

+
+
+
+
+
+
+ +
+
+

+ Shows database details

+
+
+
+
+
+
+ +
+
+

+ Shows total storage used by database

+
+
+
+
+
+
+ +
+
+

+ Shows model wise storage usage

+
+
+
+
+
+
+ +
+
+
+
+
+

+ Activate Storage Dashboard Module

+

+ After installing the module, the settings will have a new menu called "Memory Usage". +

+
+
+ +
+
+
+
+
+
+

+ Storage Dashboard view

+

+ Details about the System Monitor, Database, and a chart showing how much storage is used by various models are all shown on the dashboard. +

+
+
+ +
+
+ +
+
+
+ +
+
+
+
    +
  • + Easy to understand storage consumption +
  • +
  • + Shows database details +
  • +
  • + Shows total storage used by database +
  • +
  • + Shows model wise storage usage +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on: 22nd March 2024 +
+

+ Initial Commit for Storage Dashboard.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & + Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/storage_dashboard/static/src/js/storage_dashboard.js b/storage_dashboard/static/src/js/storage_dashboard.js new file mode 100755 index 000000000..6f85eb4f6 --- /dev/null +++ b/storage_dashboard/static/src/js/storage_dashboard.js @@ -0,0 +1,55 @@ +/** @odoo-module */ +import { registry } from "@web/core/registry"; +import { useService } from "@web/core/utils/hooks" +const { Component, onMounted, onWillStart, useRef, useState } = owl + +export class StorageDashboard extends Component { +/* Extending component and creating class StorageDashboard */ + setup(){ + this.state = useState({ + data:{}, + chart_data:{}, + }) + this.orm = useService("orm"); + this.StorageChart = useRef("StorageChart"); + onWillStart(async () => { + await this.FetchData() + }); + onMounted(async() => { + this.RenderChart() + }); + + } + async FetchData(){ + /* Fetch datas for chart and table */ + this.state.data = await this.orm.call('storage.usage', 'get_info', []) + this.state.chart_data = await this.orm.call('storage.usage', 'get_data', []) + } + async RenderChart(){ + /* Function for rendering the chart with fetched datas */ + this.charts(this.StorageChart.el,'bar',this.state.chart_data.x_data,'Size Used In MB',this.state.chart_data.y_data) + } + + charts(canvas,type,labels,label,data){ + new Chart( + canvas, + { + type:type, + data: { + labels: labels, + datasets: [ + { + label: label, + data: data, + borderRadius: 10, + backgroundColor: 'rgba(39, 232, 232, 0.5)', + borderColor: 'rgba(39, 232, 232, 1)', + } + ] + }, + } + ) + } +} +StorageDashboard.template = "DashboardDashboard" +registry.category("actions").add('storage_dashboard_tag', StorageDashboard) diff --git a/storage_dashboard/static/src/xml/storage_dashboard_templates.xml b/storage_dashboard/static/src/xml/storage_dashboard_templates.xml new file mode 100755 index 000000000..cf563f839 --- /dev/null +++ b/storage_dashboard/static/src/xml/storage_dashboard_templates.xml @@ -0,0 +1,145 @@ + + + + +
+
+
+
+
+

System Monitor

+
+
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Total Memory
Used Memory
Available Memory
CPU Usage
Odoo RAM Usage
Operating System
Database User
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Soft Memory Limit
Hard Memory Limit
Transient Age Limit
CPU Limit Time
Limit Request
Real Limit Time
Http Port
+
+
+
+
+
+
+ +
+
+
+
+

Database Details

+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
Database Name
Database Version
Database Created on
Database Size
Total Tables
+
+
+
+
+ +
+
+
+
+

Model Size Chart

+
+
+
+
+ +
+
+
+
+
+
diff --git a/storage_dashboard/views/storage_dashboard_menu.xml b/storage_dashboard/views/storage_dashboard_menu.xml new file mode 100755 index 000000000..717ccfa3f --- /dev/null +++ b/storage_dashboard/views/storage_dashboard_menu.xml @@ -0,0 +1,16 @@ + + + + + Memory Usage + storage_dashboard_tag + + + +