ceph dashboard二次开发(14.2.22)

开发环境搭建

前端

yum install npm
npm config set registry https://registry.npmmirror.com
npm install -g n
# 查看npm与nodejs的版本,确保匹配。
# 在环境上编译安装ceph
# 切换到如下目录
/usr/share/ceph/mgr/dashboard/frontend
npm install

生成配置文件,启动

root@sims53[/usr/share/ceph/mgr/dashboard/frontend]# nvm use 14
Now using node v14.21.3 (npm v6.14.18)
root@sims53[/usr/share/ceph/mgr/dashboard/frontend]# cat proxy.conf.json  # 里面的地址和端口是mgr dashboard服务的地址端口
{
  "/api/": {
    "target": "http://10.10.136.91:8080",
    "secure": false,
    "logLevel": "debug"
  },
  "/ui-api/": {
    "target": "http://10.10.136.91:8080",
    "secure": false,
    "logLevel": "debug"
  }
}
root@sims53[/usr/share/ceph/mgr/dashboard/frontend]# npm start

> ceph-dashboard@0.0.0 start /usr/share/ceph/mgr/dashboard/frontend
> npm run env_build && ng serve --host 0.0.0.0 --ssl


> ceph-dashboard@0.0.0 env_build /usr/share/ceph/mgr/dashboard/frontend
> cp src/environments/environment.tpl.ts src/environments/environment.prod.ts && cp src/environments/environment.tpl.ts src/environments/environment.ts  && node ./environment.build.js

Environment variables have been set
WARNING: This is a simple server for use in testing or debugging Angular applications
locally. It hasn't been reviewed for security issues.

Binding this server to an open connection can result in compromising your application or
computer. Using a different host than the one passed to the "--host" flag might result in
websocket connection issues. You might need to use "--disableHostCheck" if that's the
case.
** Angular Live Development Server is listening on 0.0.0.0:4200, open your browser on https://localhost:4200/ **
 10% building 3/3 modules 0 active[HPM] Proxy created: /api/  ->  http://10.10.136.91:8080
[HPM] Subscribed to http-proxy events:  [ 'error', 'close' ]
[HPM] Proxy created: /ui-api/  ->  http://10.10.136.91:8080
[HPM] Subscribed to http-proxy events:  [ 'error', 'close' ]
 11% building 12/12 modules 0 activeBrowserslist: caniuse-lite is outdated. Please run next command `npm update`
                                                          
Date: 2024-04-26T05:50:21.615Z
Hash: 9c183f7dc657d47885bc
Time: 38282ms
chunk {ceph-block-block-module-ngfactory} ceph-block-block-module-ngfactory.js, ceph-block-block-module-ngfactory.js.map (ceph-block-block-module-ngfactory) 513 kB  [rendered]
chunk {ceph-pool-pool-module-ngfactory} ceph-pool-pool-module-ngfactory.js, ceph-pool-pool-module-ngfactory.js.map (ceph-pool-pool-module-ngfactory) 460 kB  [rendered]
chunk {ceph-rgw-rgw-module-ngfactory} ceph-rgw-rgw-module-ngfactory.js, ceph-rgw-rgw-module-ngfactory.js.map (ceph-rgw-rgw-module-ngfactory) 717 kB  [rendered]
chunk {core-auth-auth-module-ngfactory} core-auth-auth-module-ngfactory.js, core-auth-auth-module-ngfactory.js.map (core-auth-auth-module-ngfactory) 197 kB  [rendered]
chunk {default~ceph-block-block-module-ngfactory~ceph-pool-pool-module-ngfactory} default~ceph-block-block-module-ngfactory~ceph-pool-pool-module-ngfactory.js, default~ceph-block-block-module-ngfactory~ceph-pool-pool-module-ngfactory.js.map (default~ceph-block-block-module-ngfactory~ceph-pool-pool-module-ngfactory) 765 kB  [rendered]
chunk {default~ceph-pool-pool-module-ngfactory~core-auth-auth-module-ngfactory} default~ceph-pool-pool-module-ngfactory~core-auth-auth-module-ngfactory.js, default~ceph-pool-pool-module-ngfactory~core-auth-auth-module-ngfactory.js.map (default~ceph-pool-pool-module-ngfactory~core-auth-auth-module-ngfactory) 20.6 kB  [rendered]
chunk {main} main.js, main.js.map (main) 5.23 MB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 416 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 9.3 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 537 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 1.22 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 7.62 MB [initial] [rendered]
ℹ 「wdm」: Compiled successfully.

浏览器访问 https://IP:4200

在这里插入图片描述

版本释出

npm run-script build

后端

修改/usr/share/ceph/mgr/dashboard下的代码

项目目录结构如下:

root@sims53[/usr/share/ceph/mgr/dashboard]# tree -L 3 -I "node_modules|*.pyc|*.pyo" 
.
|-- HACKING.rst
|-- README.rst
|-- __init__.py
|-- awsauth.py
|-- cherrypy_backports.py
|-- ci
|   `-- check_grafana_uids.py
|-- constraints.txt
|-- controllers
|   |-- __init__.py
|   |-- auth.py
|   |-- cephfs.py
|   |-- cluster_configuration.py
|   |-- docs.py
|   |-- erasure_code_profile.py
|   |-- grafana.py
|   |-- health.py
|   |-- home.py
|   |-- host.py
|   |-- iscsi.py
|   |-- logging.py
|   |-- logs.py
|   |-- mgr_modules.py
|   |-- monitor.py
|   |-- nfsganesha.py
|   |-- osd.py
|   |-- perf_counters.py
|   |-- pool.py
|   |-- prometheus.py
|   |-- rbd.py
|   |-- rbd_mirroring.py
|   |-- rgw.py
|   |-- role.py
|   |-- saml2.py
|   |-- settings.py
|   |-- summary.py
|   |-- task.py
|   `-- user.py
|-- exceptions.py
|-- frontend
|   |-- angular.json
|   |-- dist
|   |   `-- en-US
|   |-- e2e
|   |   |-- block
|   |   |-- cluster
|   |   |-- filesystems
|   |   |-- helper.po.ts
|   |   |-- nfs
|   |   |-- pools
|   |   `-- tsconfig.e2e.json
|   |-- environment.build.js
|   |-- html-linter.config.json
|   |-- i18n.config.json
|   |-- package-lock.json
|   |-- package.json
|   |-- protractor.conf.js
|   |-- proxy.conf.json
|   |-- src
|   |   |-- app
|   |   |-- assets
|   |   |-- defaults.scss
|   |   |-- environments
|   |   |-- favicon.ico
|   |   |-- index.html
|   |   |-- jestGlobalMocks.ts
|   |   |-- locale
|   |   |-- main.ts
|   |   |-- polyfills.ts
|   |   |-- setupJest.ts
|   |   |-- styles
|   |   |-- styles.scss
|   |   |-- testing
|   |   |-- tsconfig.app.json
|   |   |-- tsconfig.spec.json
|   |   |-- typings.d.ts
|   |   |-- unit-test-configuration.ts.sample
|   |   |-- vendor.overrides.scss
|   |   `-- vendor.variables.scss
|   |-- tsconfig.json
|   `-- tslint.json
|-- grafana.py
|-- module.py
|-- plugins
|   |-- __init__.py
|   |-- debug.py
|   |-- feature_toggles.py
|   |-- interfaces.py
|   |-- lru_cache.py
|   |-- pluggy.py
|   |-- plugin.py
|   `-- ttl_cache.py
|-- requirements-py27.txt
|-- requirements-py3.txt
|-- requirements.txt
|-- rest_client.py
|-- run-backend-api-request.sh
|-- run-backend-api-tests.sh
|-- run-backend-rook-api-request.sh
|-- run-frontend-e2e-tests.sh
|-- run-frontend-unittests.sh
|-- run-tox.sh
|-- security.py
|-- services
|   |-- __init__.py
|   |-- access_control.py
|   |-- auth.py
|   |-- ceph_service.py
|   |-- cephfs.py
|   |-- cephx.py
|   |-- exception.py
|   |-- ganesha.py
|   |-- iscsi_cli.py
|   |-- iscsi_client.py
|   |-- iscsi_config.py
|   |-- orchestrator.py
|   |-- rbd.py
|   |-- rgw_client.py
|   |-- sso.py
|   `-- tcmu_service.py
|-- settings.py
|-- tests
|   |-- __init__.py
|   |-- helper.py
|   |-- test_access_control.py
|   |-- test_api_auditing.py
|   |-- test_auth.py
|   |-- test_ceph_service.py
|   |-- test_cephfs.py
|   |-- test_controllers.py
|   |-- test_docs.py
|   |-- test_erasure_code_profile.py
|   |-- test_exceptions.py
|   |-- test_feature_toggles.py
|   |-- test_ganesha.py
|   |-- test_grafana.py
|   |-- test_home.py
|   |-- test_iscsi.py
|   |-- test_notification.py
|   |-- test_osd.py
|   |-- test_plugin_debug.py
|   |-- test_pool.py
|   |-- test_prometheus.py
|   |-- test_rbd.py
|   |-- test_rbd_mirroring.py
|   |-- test_rbd_service.py
|   |-- test_rest_client.py
|   |-- test_rest_tasks.py
|   |-- test_rgw.py
|   |-- test_rgw_client.py
|   |-- test_settings.py
|   |-- test_sso.py
|   |-- test_task.py
|   `-- test_tools.py
|-- tools.py
`-- tox.ini

测试修改主机列表内容
在这里插入图片描述

修改后
在这里插入图片描述

  • 11
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
C语言是一种广泛使用的编程语言,它具有高效、灵活、可移植性强等特点,被广泛应用于操作系统、嵌入式系统、数据库、编译器等领域的开发。C语言的基本语法包括变量、数据类型、运算符、控制结构(如if语句、循环语句等)、函数、指针等。在编写C程序时,需要注意变量的声明和定义、指针的使用、内存的分配与释放等问题。C语言中常用的数据结构包括: 1. 数组:一种存储同类型数据的结构,可以进行索引访问和修改。 2. 链表:一种存储不同类型数据的结构,每个节点包含数据和指向下一个节点的指针。 3. 栈:一种后进先出(LIFO)的数据结构,可以通过压入(push)和弹出(pop)操作进行数据的存储和取出。 4. 队列:一种先进先出(FIFO)的数据结构,可以通过入队(enqueue)和出队(dequeue)操作进行数据的存储和取出。 5. 树:一种存储具有父子关系的数据结构,可以通过中序遍历、前序遍历和后序遍历等方式进行数据的访问和修改。 6. 图:一种存储具有节点和边关系的数据结构,可以通过广度优先搜索、深度优先搜索等方式进行数据的访问和修改。 这些数据结构在C语言中都有相应的实现方式,可以应用于各种不同的场景。C语言中的各种数据结构都有其优缺点,下面列举一些常见的数据结构的优缺点: 数组: 优点:访问和修改元素的速度非常快,适用于需要频繁读取和修改数据的场合。 缺点:数组的长度是固定的,不适合存储大小不固定的动态数据,另外数组在内存中是连续分配的,当数组较大时可能会导致内存碎片化。 链表: 优点:可以方便地插入和删除元素,适用于需要频繁插入和删除数据的场合。 缺点:访问和修改元素的速度相对较慢,因为需要遍历链表找到指定的节点。 栈: 优点:后进先出(LIFO)的特性使得栈在处理递归和括号匹配等问题时非常方便。 缺点:栈的空间有限,当数据量较大时可能会导致栈溢出。 队列: 优点:先进先出(FIFO)的特性使得

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值