@things-factory/operato-fleet 8.0.6 → 9.0.0-beta.10
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/.dockerignore +24 -6
- package/client/pages/client/client.js +130 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +60 -60
- package/installer/config.production.js +0 -52
- package/installer/docker-compose.yml +0 -55
- package/installer/install.sh +0 -54
- package/installer/migrate.sh +0 -1
- package/installer/start.sh +0 -18
- package/installer/stop.sh +0 -1
- package/installer/upgrade.sh +0 -1
package/.dockerignore
CHANGED
|
@@ -1,13 +1,31 @@
|
|
|
1
|
-
node_modules
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
node_modules/
|
|
2
|
+
client/
|
|
3
|
+
server/
|
|
4
|
+
dist-client/
|
|
5
|
+
installer/
|
|
6
|
+
attachments/
|
|
7
|
+
cache/
|
|
8
|
+
logs/
|
|
9
|
+
Dockerfile*
|
|
5
10
|
docker-compose.yml
|
|
6
11
|
db.sqlite
|
|
7
12
|
db*.sqlite
|
|
8
13
|
license.json
|
|
9
|
-
attachments
|
|
10
14
|
config.development.js
|
|
11
15
|
config.production.js
|
|
12
16
|
!config/config.development.js
|
|
13
|
-
!config/config.production.js
|
|
17
|
+
!config/config.production.js
|
|
18
|
+
\_index.html
|
|
19
|
+
|
|
20
|
+
npm-debug.log
|
|
21
|
+
yarn-error.log
|
|
22
|
+
|
|
23
|
+
.env
|
|
24
|
+
.env.local
|
|
25
|
+
.env.production
|
|
26
|
+
.git/
|
|
27
|
+
.gitignore
|
|
28
|
+
.dockerignore
|
|
29
|
+
.vscode/
|
|
30
|
+
.idea/
|
|
31
|
+
.DS_Store
|
|
@@ -0,0 +1,130 @@
|
|
|
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)
|