@things-factory/operato-fleet 8.0.0-beta.9 → 8.0.0

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.
@@ -0,0 +1,52 @@
1
+ module.exports = {
2
+ SECRET: '0xD58F835B69D207A76CC5F84a70a1D0d4C79dAC95', // should be changed
3
+ email: {
4
+ host: 'smtp.office365.com', // your sender-email smtp host
5
+ port: 587, // smtp server port
6
+ secure: false, // true for 465, false for other ports
7
+ auth: {
8
+ user: 'your sender-email',
9
+ pass: 'your sender-email password' // generated ethereal password
10
+ },
11
+ secureConnection: false,
12
+ tls: {
13
+ ciphers: 'SSLv3'
14
+ }
15
+ },
16
+ logger: {
17
+ file: {
18
+ filename: 'logs/application-%DATE%.log',
19
+ datePattern: 'YYYY-MM-DD-HH',
20
+ zippedArchive: false,
21
+ maxSize: '20m',
22
+ maxFiles: '2d',
23
+ level: 'info'
24
+ },
25
+ console: {
26
+ level: 'silly'
27
+ }
28
+ },
29
+ ormconfig: {
30
+ name: 'default',
31
+ type: 'postgres',
32
+ host: 'postgres',
33
+ port: 5432,
34
+ database: 'postgres',
35
+ username: 'postgres',
36
+ password: 'abcd1234',
37
+ synchronize: true,
38
+ logging: true
39
+ },
40
+ scheduler: {
41
+ /* Name to be used for setting client's "application" properties when registering a schedule */
42
+ application: 'operato-ecs',
43
+ /* Base endpoint to be used for setting "callback" properties when registering a schedule */
44
+ callbackBase: 'http://app:3000',
45
+ /*
46
+ Scheduler service endpoint
47
+ caution) endpoint for "localhost" has some problem.
48
+ https://github.com/node-fetch/node-fetch/issues/1624
49
+ */
50
+ endpoint: 'http://scheduler:9902'
51
+ }
52
+ }
@@ -0,0 +1,55 @@
1
+ version: '3'
2
+ services:
3
+ nginx:
4
+ image: hatiolab/operato-nginx:latest
5
+ ports:
6
+ - ${HostPort}:80
7
+ depends_on:
8
+ - app
9
+ app:
10
+ build: .
11
+ container_name: operato-fleet
12
+ image: hatiolab/operato-fleet:latest
13
+ privileged: true
14
+ volumes:
15
+ - ./logs:/app/logs
16
+ - ./config.production.js:/app/config.production.js
17
+ ports:
18
+ - 4000:3000
19
+ depends_on:
20
+ - postgres
21
+ - mosquitto
22
+ - scheduler
23
+ logging:
24
+ driver: 'json-file'
25
+ options:
26
+ max-size: '100m'
27
+ max-file: '3'
28
+ postgres:
29
+ image: postgres:13.2
30
+ container_name: db-operato-fleet
31
+ environment:
32
+ POSTGRES_PASSWORD: abcd1234
33
+ POSTGRES_USER: postgres
34
+ PGDATA: /var/lib/postgresql/data/pgdata
35
+ volumes:
36
+ - ./postgres_data:/var/lib/postgresql/data/pgdata
37
+ ports:
38
+ - '55432:5432'
39
+ mosquitto:
40
+ image: eclipse-mosquitto:1.6.12
41
+ ports:
42
+ - 1883:1883
43
+ - 9001:9001
44
+ scheduler:
45
+ image: hatiolab/schevt-mgr:latest
46
+ container_name: scheduler
47
+ volumes:
48
+ - ./config.yaml:/app/config.yaml
49
+ ports:
50
+ - '9902:9902'
51
+ logging:
52
+ driver: 'json-file'
53
+ options:
54
+ max-size: '100m'
55
+ max-file: '3'
@@ -0,0 +1,54 @@
1
+ if [ -f "config.production.js" ] ; then
2
+ echo "config.production.js exist"
3
+ else
4
+ echo "config.production.js create"
5
+ curl -O https://raw.githubusercontent.com/things-factory/things-factory/master/packages/operato-fleet/installer/config.production.js
6
+ fi
7
+
8
+ if [ -f "start.sh" ] ; then
9
+ echo "start.sh exist"
10
+ else
11
+ echo "start.sh create"
12
+ curl -O https://raw.githubusercontent.com/things-factory/things-factory/master/packages/operato-fleet/installer/start.sh
13
+ fi
14
+
15
+ if [ -f "stop.sh" ] ; then
16
+ echo "stop.sh exist"
17
+ else
18
+ echo "stop.sh create"
19
+ curl -O https://raw.githubusercontent.com/things-factory/things-factory/master/packages/operato-fleet/installer/stop.sh
20
+ fi
21
+
22
+ if [ -f "upgrade.sh" ] ; then
23
+ echo "upgrade.sh exist"
24
+ else
25
+ echo "upgrade.sh create"
26
+ curl -O https://raw.githubusercontent.com/things-factory/things-factory/master/packages/operato-fleet/installer/upgrade.sh
27
+ fi
28
+
29
+ if [ -f "migrate.sh" ] ; then
30
+ echo "migrate.sh exist"
31
+ else
32
+ echo "migrate.sh create"
33
+ curl -O https://raw.githubusercontent.com/things-factory/things-factory/master/packages/operato-fleet/installer/migrate.sh
34
+ fi
35
+
36
+ if [ -f "docker-compose.yml" ] ; then
37
+ echo "docker-compose.yml exist"
38
+ else
39
+ echo "docker-compose.yml create"
40
+ curl -O https://raw.githubusercontent.com/things-factory/things-factory/master/packages/operato-fleet/installer/docker-compose.yml
41
+ fi
42
+
43
+ chmod u+x start.sh
44
+ chmod u+x stop.sh
45
+ chmod u+x upgrade.sh
46
+ chmod u+x migrate.sh
47
+
48
+ echo "HostPort=3000" > .env
49
+
50
+ docker pull hatiolab/operato-fleet:latest
51
+
52
+ docker pull hatiolab/operato-nginx:latest
53
+
54
+ docker-compose create
@@ -0,0 +1 @@
1
+ docker exec -it operato-fleet npm run migration -- --mode=production
@@ -0,0 +1,18 @@
1
+ HOST_PORT=3000
2
+
3
+ if [ $# -eq 0 ] ; then
4
+ echo "Warning: default port 3000"
5
+ else
6
+ HOST_PORT=$1
7
+ fi
8
+
9
+
10
+ echo "HOST_PORT : ${HOST_PORT}"
11
+
12
+ echo "HostPort="$HOST_PORT > .env
13
+
14
+ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
15
+ xhost +"local:docker@"
16
+ fi
17
+
18
+ docker-compose up -d
@@ -0,0 +1 @@
1
+ docker-compose stop
@@ -0,0 +1 @@
1
+ curl -fsSL https://raw.githubusercontent.com/things-factory/things-factory/master/packages/operato-fleet/installer/install.sh | bash -s
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/operato-fleet",
3
- "version": "8.0.0-beta.9",
3
+ "version": "8.0.0",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "client/index.js",
6
6
  "things-factory": true,
@@ -39,67 +39,67 @@
39
39
  "@material/mwc-formfield": "^0.27.0",
40
40
  "@material/mwc-linear-progress": "^0.27.0",
41
41
  "@material/mwc-radio": "^0.27.0",
42
- "@operato/board": "^8.0.0-beta",
43
- "@operato/data-grist": "^8.0.0-beta",
44
- "@operato/help": "^8.0.0-beta",
45
- "@operato/oops": "^8.0.0-beta",
46
- "@operato/scene-chartjs": "^8.0.0-beta",
47
- "@operato/scene-clock": "^8.0.0-beta",
48
- "@operato/scene-clone": "^8.0.0-beta",
49
- "@operato/scene-compass": "^8.0.0-beta",
50
- "@operato/scene-data-transform": "^8.0.0-beta",
51
- "@operato/scene-excel": "^8.0.0-beta",
52
- "@operato/scene-form": "^8.0.0-beta",
53
- "@operato/scene-gantt": "^8.0.0-beta",
54
- "@operato/scene-gauge": "^8.0.0-beta",
55
- "@operato/scene-google-map": "^8.0.0-beta",
56
- "@operato/scene-graphql": "^8.0.0-beta",
57
- "@operato/scene-grist": "^8.0.0-beta",
58
- "@operato/scene-half-roundrect": "^8.0.0-beta",
59
- "@operato/scene-image-slider": "^8.0.0-beta",
60
- "@operato/scene-indoor-map": "^8.0.0-beta",
61
- "@operato/scene-integration": "^8.0.0-beta",
62
- "@operato/scene-label": "^8.0.0-beta",
63
- "@operato/scene-legend": "^8.0.0-beta",
64
- "@operato/scene-marker": "^8.0.0-beta",
65
- "@operato/scene-news-ticker": "^8.0.0-beta",
66
- "@operato/scene-progressbar": "^8.0.0-beta",
67
- "@operato/scene-random": "^8.0.0-beta",
68
- "@operato/scene-restful": "^8.0.0-beta",
69
- "@operato/scene-switch": "^8.0.0-beta",
70
- "@operato/scene-tab": "^8.0.0-beta",
71
- "@operato/scene-table": "^8.0.0-beta",
72
- "@operato/scene-timer": "^8.0.0-beta",
73
- "@operato/scene-visualizer": "^8.0.0-beta",
74
- "@operato/scene-wheel-sorter": "^8.0.0-beta",
75
- "@things-factory/apptool-ui": "^8.0.0-beta.9",
76
- "@things-factory/attachment-base": "^8.0.0-beta.9",
77
- "@things-factory/auth-ui": "^8.0.0-beta.9",
78
- "@things-factory/biz-base": "^8.0.0-beta.9",
79
- "@things-factory/board-service": "^8.0.0-beta.9",
80
- "@things-factory/board-ui": "^8.0.0-beta.9",
81
- "@things-factory/code-ui": "^8.0.0-beta.9",
82
- "@things-factory/context-ui": "^8.0.0-beta.9",
83
- "@things-factory/dashboard": "^8.0.0-beta.9",
84
- "@things-factory/evaluation": "^8.0.0-beta.9",
85
- "@things-factory/export-ui": "^8.0.0-beta.9",
86
- "@things-factory/export-ui-csv": "^8.0.0-beta.9",
87
- "@things-factory/export-ui-excel": "^8.0.0-beta.9",
88
- "@things-factory/help": "^8.0.0-beta.9",
89
- "@things-factory/i18n-base": "^8.0.0-beta.9",
90
- "@things-factory/integration-fulfillment": "^8.0.0-beta.9",
91
- "@things-factory/integration-marketplace": "^8.0.0-beta.9",
92
- "@things-factory/more-ui": "^8.0.0-beta.9",
93
- "@things-factory/notification": "^8.0.0-beta.9",
94
- "@things-factory/oauth2-client": "^8.0.0-beta.9",
95
- "@things-factory/pdf": "^8.0.0-beta.9",
96
- "@things-factory/resource-ui": "^8.0.0-beta.9",
97
- "@things-factory/setting-ui": "^8.0.0-beta.9",
98
- "@things-factory/system": "^8.0.0-beta.9",
42
+ "@operato/board": "^8.0.0",
43
+ "@operato/data-grist": "^8.0.0",
44
+ "@operato/help": "^8.0.0",
45
+ "@operato/oops": "^8.0.0",
46
+ "@operato/scene-chartjs": "^8.0.0",
47
+ "@operato/scene-clock": "^8.0.0",
48
+ "@operato/scene-clone": "^8.0.0",
49
+ "@operato/scene-compass": "^8.0.0",
50
+ "@operato/scene-data-transform": "^8.0.0",
51
+ "@operato/scene-excel": "^8.0.0",
52
+ "@operato/scene-form": "^8.0.0",
53
+ "@operato/scene-gantt": "^8.0.0",
54
+ "@operato/scene-gauge": "^8.0.0",
55
+ "@operato/scene-google-map": "^8.0.0",
56
+ "@operato/scene-graphql": "^8.0.0",
57
+ "@operato/scene-grist": "^8.0.0",
58
+ "@operato/scene-half-roundrect": "^8.0.0",
59
+ "@operato/scene-image-slider": "^8.0.0",
60
+ "@operato/scene-indoor-map": "^8.0.0",
61
+ "@operato/scene-integration": "^8.0.0",
62
+ "@operato/scene-label": "^8.0.0",
63
+ "@operato/scene-legend": "^8.0.0",
64
+ "@operato/scene-marker": "^8.0.0",
65
+ "@operato/scene-news-ticker": "^8.0.0",
66
+ "@operato/scene-progressbar": "^8.0.0",
67
+ "@operato/scene-random": "^8.0.0",
68
+ "@operato/scene-restful": "^8.0.0",
69
+ "@operato/scene-switch": "^8.0.0",
70
+ "@operato/scene-tab": "^8.0.0",
71
+ "@operato/scene-table": "^8.0.0",
72
+ "@operato/scene-timer": "^8.0.0",
73
+ "@operato/scene-visualizer": "^8.0.0",
74
+ "@operato/scene-wheel-sorter": "^8.0.0",
75
+ "@things-factory/apptool-ui": "^8.0.0",
76
+ "@things-factory/attachment-base": "^8.0.0",
77
+ "@things-factory/auth-ui": "^8.0.0",
78
+ "@things-factory/biz-base": "^8.0.0",
79
+ "@things-factory/board-service": "^8.0.0",
80
+ "@things-factory/board-ui": "^8.0.0",
81
+ "@things-factory/code-ui": "^8.0.0",
82
+ "@things-factory/context-ui": "^8.0.0",
83
+ "@things-factory/dashboard": "^8.0.0",
84
+ "@things-factory/evaluation": "^8.0.0",
85
+ "@things-factory/export-ui": "^8.0.0",
86
+ "@things-factory/export-ui-csv": "^8.0.0",
87
+ "@things-factory/export-ui-excel": "^8.0.0",
88
+ "@things-factory/help": "^8.0.0",
89
+ "@things-factory/i18n-base": "^8.0.0",
90
+ "@things-factory/integration-fulfillment": "^8.0.0",
91
+ "@things-factory/integration-marketplace": "^8.0.0",
92
+ "@things-factory/more-ui": "^8.0.0",
93
+ "@things-factory/notification": "^8.0.0",
94
+ "@things-factory/oauth2-client": "^8.0.0",
95
+ "@things-factory/pdf": "^8.0.0",
96
+ "@things-factory/resource-ui": "^8.0.0",
97
+ "@things-factory/setting-ui": "^8.0.0",
98
+ "@things-factory/system": "^8.0.0",
99
99
  "chance": "^1.1.11"
100
100
  },
101
101
  "devDependencies": {
102
- "@things-factory/builder": "^8.0.0-beta.4"
102
+ "@things-factory/builder": "^8.0.0"
103
103
  },
104
- "gitHead": "86b1dfa26292926a2d5447fdc23bfa5a9e983245"
104
+ "gitHead": "07ef27d272dd9a067a9648ac7013748510556a18"
105
105
  }
@@ -1,130 +0,0 @@
1
- import { html, css } from 'lit'
2
- import { connect } from 'pwa-helpers/connect-mixin.js'
3
- import '@material/mwc-button'
4
- import '@material/mwc-textfield'
5
- import { store, PageView } from '@operato/shell'
6
- import '@operato/data-grist'
7
- import { i18next, localize } from '@operato/i18n'
8
- import { isMobileDevice } from '@operato/utils'
9
- import { ScrollbarStyles, CommonButtonStyles } from '@things-factory/styles'
10
- import { FMSPageStyles } from '../fleet-page-style'
11
-
12
- import { fetchClients } from '../../commons/fetch-client'
13
-
14
- class FMSClient extends connect(store)(localize(i18next)(PageView)) {
15
- static get properties() {
16
- return {}
17
- }
18
-
19
- static get styles() {
20
- return [ScrollbarStyles, FMSPageStyles]
21
- }
22
-
23
- get context() {
24
- return {
25
- title: i18next.t('title.client'),
26
- exportable: {
27
- accept: ['json'],
28
- name: 'client',
29
- data: () => {
30
- return []
31
- }
32
- },
33
- actions: [
34
- {
35
- title: i18next.t('button.register'),
36
- action: this.register.bind(this),
37
- ...CommonButtonStyles.register
38
- }
39
- ]
40
- }
41
- }
42
-
43
- render() {
44
- return html`
45
- <form search>
46
- <mwc-textfield label="device" icon="router"></mwc-textfield>
47
- <mwc-textfield label="client" icon="domain"></mwc-textfield>
48
- <mwc-textfield label="delivery" icon="local_shipping"></mwc-textfield>
49
- <mwc-textfield label="from date" icon="event" type="date"></mwc-textfield>
50
- <mwc-textfield label="to date" icon="event" type="date"></mwc-textfield>
51
- <mwc-button label="search" icon="search" raised></mwc-button>
52
- </form>
53
-
54
- <ox-grist
55
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
56
- .config=${this.config}
57
- .fetchHandler=${this.fetchHandler.bind(this)}
58
- >
59
- </ox-grist>
60
- `
61
- }
62
-
63
- connectedCallback() {
64
- super.connectedCallback()
65
-
66
- this.config = {
67
- list: { fields: ['client', 'delivery', 'device', 'status', 'battery'] },
68
- pagination: { infinite: false },
69
- rows: { selectable: false, appendable: false },
70
- columns: [
71
- { type: 'gutter', gutterName: 'sequence' },
72
- {
73
- type: 'string',
74
- name: 'client',
75
- header: i18next.t('field.client'),
76
- record: { editable: false, align: 'left' },
77
- imex: { header: i18next.t('field.client'), key: 'client', width: 50, type: 'string' },
78
- sortable: true,
79
- width: 150
80
- },
81
- {
82
- type: 'string',
83
- name: 'delivery',
84
- header: i18next.t('field.delivery'),
85
- record: { editable: false, align: 'left' },
86
- imex: { header: i18next.t('field.delivery'), key: 'delivery', width: 50, type: 'string' },
87
- sortable: true,
88
- width: 150
89
- },
90
- {
91
- type: 'string',
92
- name: 'device',
93
- header: i18next.t('field.device'),
94
- record: { editable: false, align: 'left' },
95
- imex: { header: i18next.t('field.device'), key: 'device', width: 50, type: 'string' },
96
- sortable: true,
97
- width: 150
98
- },
99
- {
100
- type: 'datetime',
101
- name: 'registration',
102
- header: i18next.t('field.registration'),
103
- record: { editable: false, align: 'left' },
104
- imex: { header: i18next.t('field.registration'), key: 'registration', width: 50, type: 'string' },
105
- sortable: true,
106
- width: 180
107
- }
108
- ]
109
- }
110
- }
111
-
112
- async firstUpdated() {
113
- await this.updateComplete
114
- this.renderRoot.querySelector('ox-grist').fetch({ limit: 50 })
115
- }
116
-
117
- pageUpdated(changes, lifecycle) {
118
- if (this.active) {
119
- } else {
120
- }
121
- }
122
-
123
- async fetchHandler({ page, limit, sorters = [] }) {
124
- return await fetchClients({ page, limit, sorters })
125
- }
126
-
127
- register() {}
128
- }
129
-
130
- window.customElements.define('fleet-client', FMSClient)