diff --git a/storage_dashboard/README.rst b/storage_dashboard/README.rst new file mode 100644 index 000000000..c451dbea2 --- /dev/null +++ b/storage_dashboard/README.rst @@ -0,0 +1,49 @@ +.. 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 18 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: (V18) Adarsh K, + (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..f8f4d3252 --- /dev/null +++ b/storage_dashboard/__manifest__.py @@ -0,0 +1,49 @@ +# -*- 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': '18.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/cybro-icon.png b/storage_dashboard/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/storage_dashboard/static/description/assets/cybro-icon.png differ diff --git a/storage_dashboard/static/description/assets/cybro-odoo.png b/storage_dashboard/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/storage_dashboard/static/description/assets/cybro-odoo.png differ diff --git a/storage_dashboard/static/description/assets/h2.png b/storage_dashboard/static/description/assets/h2.png new file mode 100644 index 000000000..0bfc4707d Binary files /dev/null and b/storage_dashboard/static/description/assets/h2.png differ diff --git a/storage_dashboard/static/description/assets/icons/arrows-repeat.svg b/storage_dashboard/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/icons/banner-1.png b/storage_dashboard/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/banner-1.png differ diff --git a/storage_dashboard/static/description/assets/icons/banner-2.svg b/storage_dashboard/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/icons/banner-bg.png b/storage_dashboard/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/banner-bg.png differ diff --git a/storage_dashboard/static/description/assets/icons/banner-bg.svg b/storage_dashboard/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/icons/banner-call.svg b/storage_dashboard/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/storage_dashboard/static/description/assets/icons/banner-mail.svg b/storage_dashboard/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/storage_dashboard/static/description/assets/icons/banner-pattern.svg b/storage_dashboard/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/icons/banner-promo.svg b/storage_dashboard/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/icons/brand-pair.svg b/storage_dashboard/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/close-icon.svg b/storage_dashboard/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + 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/collabarate-icon.svg b/storage_dashboard/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + 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/cybro-logo.png b/storage_dashboard/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/cybro-logo.png differ diff --git a/storage_dashboard/static/description/assets/icons/down.svg b/storage_dashboard/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file 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/faq.png b/storage_dashboard/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/faq.png differ diff --git a/storage_dashboard/static/description/assets/icons/feature-icon.svg b/storage_dashboard/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/icons/feature.png b/storage_dashboard/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/feature.png differ diff --git a/storage_dashboard/static/description/assets/icons/gear.svg b/storage_dashboard/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/icons/hero.gif b/storage_dashboard/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..71ecef8be Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/hero.gif differ diff --git a/storage_dashboard/static/description/assets/icons/hire-odoo.svg b/storage_dashboard/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + 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/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/life-ring-icon.svg b/storage_dashboard/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + 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/mail.svg b/storage_dashboard/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + 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/notes.png b/storage_dashboard/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/notes.png differ diff --git a/storage_dashboard/static/description/assets/icons/notification icon.svg b/storage_dashboard/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/icons/odoo-consultancy.svg b/storage_dashboard/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/storage_dashboard/static/description/assets/icons/odoo-licencing.svg b/storage_dashboard/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/storage_dashboard/static/description/assets/icons/odoo-logo.png b/storage_dashboard/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/odoo-logo.png differ diff --git a/storage_dashboard/static/description/assets/icons/patter.svg b/storage_dashboard/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/icons/pattern1.png b/storage_dashboard/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/pattern1.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-piece-icon.svg b/storage_dashboard/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/replace-icon.svg b/storage_dashboard/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/screenshot-main.png b/storage_dashboard/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/screenshot-main.png differ diff --git a/storage_dashboard/static/description/assets/icons/screenshot.png b/storage_dashboard/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/screenshot.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/skype-fill.svg b/storage_dashboard/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/icons/skype.png b/storage_dashboard/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/skype.png differ diff --git a/storage_dashboard/static/description/assets/icons/skype.svg b/storage_dashboard/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/storage_dashboard/static/description/assets/icons/star-1.svg b/storage_dashboard/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/icons/star-2.svg b/storage_dashboard/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/storage_dashboard/static/description/assets/icons/support.png b/storage_dashboard/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/support.png differ diff --git a/storage_dashboard/static/description/assets/icons/test-1 - Copy.png b/storage_dashboard/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/test-1 - Copy.png differ diff --git a/storage_dashboard/static/description/assets/icons/test-1.png b/storage_dashboard/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/test-1.png differ diff --git a/storage_dashboard/static/description/assets/icons/test-2.png b/storage_dashboard/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/test-2.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/translate.svg b/storage_dashboard/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/video.png b/storage_dashboard/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/video.png differ diff --git a/storage_dashboard/static/description/assets/icons/whatsapp.png b/storage_dashboard/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/storage_dashboard/static/description/assets/icons/whatsapp.png differ diff --git a/storage_dashboard/static/description/assets/icons/wrench-icon.svg b/storage_dashboard/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/storage_dashboard/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/modules/1.gif b/storage_dashboard/static/description/assets/modules/1.gif new file mode 100644 index 000000000..ae3a880a2 Binary files /dev/null and b/storage_dashboard/static/description/assets/modules/1.gif differ diff --git a/storage_dashboard/static/description/assets/modules/2.gif b/storage_dashboard/static/description/assets/modules/2.gif new file mode 100644 index 000000000..d19e2b352 Binary files /dev/null and b/storage_dashboard/static/description/assets/modules/2.gif 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..3bedf7981 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..0e311ca87 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.jpg b/storage_dashboard/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/storage_dashboard/static/description/assets/modules/6.jpg differ diff --git a/storage_dashboard/static/description/assets/screenshots/ss1.png b/storage_dashboard/static/description/assets/screenshots/ss1.png new file mode 100644 index 000000000..39590f823 Binary files /dev/null and b/storage_dashboard/static/description/assets/screenshots/ss1.png differ diff --git a/storage_dashboard/static/description/assets/screenshots/ss2.png b/storage_dashboard/static/description/assets/screenshots/ss2.png new file mode 100644 index 000000000..4dec8ca0b Binary files /dev/null and b/storage_dashboard/static/description/assets/screenshots/ss2.png differ diff --git a/storage_dashboard/static/description/assets/screenshots/ss3.png b/storage_dashboard/static/description/assets/screenshots/ss3.png new file mode 100644 index 000000000..f3bf2b8ce Binary files /dev/null and b/storage_dashboard/static/description/assets/screenshots/ss3.png differ diff --git a/storage_dashboard/static/description/assets/y18.jpg b/storage_dashboard/static/description/assets/y18.jpg new file mode 100644 index 000000000..eea1714f2 Binary files /dev/null and b/storage_dashboard/static/description/assets/y18.jpg differ diff --git a/storage_dashboard/static/description/banner.jpg b/storage_dashboard/static/description/banner.jpg new file mode 100644 index 000000000..4bd9278e3 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..dd0d70f0b 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..92ed2f468 --- /dev/null +++ b/storage_dashboard/static/description/index.html @@ -0,0 +1,959 @@ + + + + + + Storage Dashboard + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+ + + + +
+
+ +
+
+
+
+

+ Dashboard for Storage Usage of Different Models. +

+

Storage Dashboard +

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

Key + Highlights

+
+
+
+
+ +
+
+ Easy to understand storage consumption +
+
+
+
+
+
+ +
+
+ Shows database details +
+
+
+
+
+
+ +
+
+ Shows total storage used by database +
+
+
+
+
+
+ +
+
+ Shows model wise storage usage +
+
+
+
+
+ +
+
+
+ Storage Dashboard +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ 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.

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

+ Yes, the module allows you to see model-wise storage usage. You can view how much space each model or table within your database is consuming, which helps in identifying resource-heavy models. +

+
+
+ +
+ +
+

+ You can view the total storage used by your database on the Database Details section of the dashboard. This section provides the key information about the database. +

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

+ Latest Release 18.0.1.0.0 +

+ + 30th September, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + + + + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + 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 + + + +