@steedos/service-bull-dashboard 2.7.1-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Steedos Licensing
2
+
3
+ SOFTWARE LICENSING
4
+
5
+ To determine under which license you may use a file from the Steedos source code,
6
+ please resort to the header of that file.
7
+
8
+ If the file has no header, the following rules apply
9
+ 1. enterprise features are licensed under Steedos Enterprise Terms, see License.enterprise.txt
10
+ 2. source code that is neither (1) is licensed under MIT, see https://opensource.org/licenses/MIT
11
+
12
+ On request, licenses under different terms are available.
13
+
14
+ Source code of enterprise features are files that
15
+ * are in folders named "ee" or start with "ee_", or in subfolders of such folders.
16
+ * contain the strings "ee_" in its filename name.
17
+ The files can be found by running the command `find . -iname ee -or -iname "*_ee*" -or -iname "*ee_*"`
18
+
19
+ STEEDOS TRADEMARK GUIDELINES
20
+
21
+ Your use of the mark Steedos is subject to Steedos, Inc's prior written approval. For trademark approval or any questions
22
+ you have about using these trademarks, please email zhuangjianguo@steedos.com
@@ -0,0 +1,2 @@
1
+ UI: `/bull-jobs/dashboard`
2
+ 权限: 超级管理员权限
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@steedos/service-bull-dashboard",
3
+ "version": "2.7.1-beta.3",
4
+ "description": "",
5
+ "main": "package.service.js",
6
+ "license": "MIT",
7
+ "private": false,
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "dependencies": {
12
+ "@bull-board/express": "^4.6.4",
13
+ "@steedos/auth": "2.7.1-beta.3",
14
+ "@steedos/router": "2.7.1-beta.3",
15
+ "@steedos/service-package-loader": "2.7.1-beta.3",
16
+ "bullmq": "5.7.4"
17
+ },
18
+ "gitHead": "f154c292cacb12408aa6383e8667a3f6dcd38fb6"
19
+ }
@@ -0,0 +1,100 @@
1
+ /*
2
+ * @Author: baozhoutao@steedos.com
3
+ * @Date: 2022-11-24 10:08:34
4
+ * @LastEditors: baozhoutao@steedos.com
5
+ * @LastEditTime: 2024-04-26 10:10:09
6
+ * @Description:
7
+ */
8
+ "use strict";
9
+ const project = require('./package.json');
10
+ const packageName = project.name;
11
+ const packageLoader = require('@steedos/service-package-loader');
12
+ const SteedosRouter = require('@steedos/router');
13
+ const router = SteedosRouter.staticRouter();
14
+ const { Queue: QueueMQ } = require('bullmq');
15
+ const { createBullBoard } = require('@bull-board/api')
16
+ const { BullMQAdapter } = require('@bull-board/api/bullMQAdapter');
17
+ const { ExpressAdapter } = require('@bull-board/express')
18
+ const { superAdminAuthentication } = require('@steedos/auth');
19
+
20
+ const basePath = '/bull-jobs/dashboard';
21
+
22
+
23
+ /**
24
+ * @typedef {import('moleculer').Context} Context Moleculer's Context
25
+ * 软件包服务启动后也需要抛出事件。
26
+ */
27
+ module.exports = {
28
+ name: packageName,
29
+ namespace: "steedos",
30
+ mixins: [packageLoader],
31
+ /**
32
+ * Settings
33
+ */
34
+ settings: {
35
+ packageInfo: {
36
+ path: __dirname,
37
+ name: packageName
38
+ }
39
+ },
40
+
41
+ /**
42
+ * Dependencies
43
+ */
44
+ dependencies: [],
45
+
46
+ /**
47
+ * Actions
48
+ */
49
+ actions: {
50
+
51
+ },
52
+
53
+ /**
54
+ * Events
55
+ */
56
+ events: {
57
+
58
+ },
59
+
60
+ /**
61
+ * Methods
62
+ */
63
+ methods: {
64
+
65
+ },
66
+
67
+ /**
68
+ * Service created lifecycle event handler
69
+ */
70
+ async created() {
71
+
72
+ },
73
+
74
+ /**
75
+ * Service started lifecycle event handler
76
+ */
77
+ async started() {
78
+ if(process.env.NODE_ENV != 'production'){
79
+ const queueMQ = new QueueMQ('object_webhooks', {connection: process.env.QUEUE_BACKEND});
80
+ const serverAdapter = new ExpressAdapter();
81
+ serverAdapter.setBasePath(basePath)
82
+
83
+ createBullBoard({
84
+ queues: [
85
+ new BullMQAdapter(queueMQ, {readOnlyMode: false}),
86
+ ],
87
+ serverAdapter
88
+ })
89
+ // ... express server configuration
90
+ router.use(basePath, superAdminAuthentication, serverAdapter.getRouter());
91
+ }
92
+ },
93
+
94
+ /**
95
+ * Service stopped lifecycle event handler
96
+ */
97
+ async stopped() {
98
+
99
+ }
100
+ };