@fdm-monster/client-next 0.0.1 → 0.0.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/.yarn/install-state.gz +0 -0
- package/RELEASE_NOTES.MD +28 -1
- package/dist/assets/MaterialIcons-Regular-BjXOXp5c.eot +0 -0
- package/dist/assets/MaterialIcons-Regular-DEUTIz1o.ttf +0 -0
- package/dist/assets/MaterialIcons-Regular-DOtZ65Va.woff2 +0 -0
- package/dist/assets/MaterialIcons-Regular-FsbMSDLx.woff +0 -0
- package/dist/assets/index-CHzfWKPO.css +5 -0
- package/dist/assets/index-WVqTlgq7.js +90 -0
- package/dist/assets/index-WVqTlgq7.js.map +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/img/DavidZwart.jpg +0 -0
- package/dist/img/OIG.JYDC2RaWdz7g9.jpg +0 -0
- package/dist/img/OIG.jpg +0 -0
- package/dist/img/icons/android-chrome-256x256.png +0 -0
- package/dist/img/icons/android-chrome-384x384.png +0 -0
- package/dist/img/icons/android-chrome-512x512.png +0 -0
- package/dist/img/icons/favicon.svg +1 -0
- package/dist/img/logo.png +0 -0
- package/dist/img/logo.svg +1 -0
- package/dist/img/manifest.webmanifest +33 -0
- package/dist/img/octoprint-tentacle.svg +144 -0
- package/dist/img/thumbail_unknown.jpg +0 -0
- package/dist/img/vbanner.jpg +0 -0
- package/dist/index.html +24 -0
- package/dist/robots.txt +2 -0
- package/package.json +1 -1
- package/.all-contributorsrc +0 -57
- package/.editorconfig +0 -5
- package/.eslintrc.js +0 -126
- package/.github/FUNDING.yml +0 -3
- package/.github/workflows/release-client.yml +0 -94
- package/.github/workflows/vue-publish.yml +0 -26
- package/.prettierignore +0 -15
- package/.whitesource +0 -12
- package/renovate.json +0 -30
- package/src/App.vue +0 -60
- package/src/AppLoader.vue +0 -383
- package/src/assets/adjectives.json +0 -1468
- package/src/assets/logo.svg +0 -6
- package/src/assets/nouns.json +0 -4309
- package/src/auto-imports.d.ts +0 -139
- package/src/backend/app.service.ts +0 -39
- package/src/backend/auth.service.ts +0 -56
- package/src/backend/base.service.ts +0 -57
- package/src/backend/batch.service.ts +0 -37
- package/src/backend/camera-stream.service.ts +0 -33
- package/src/backend/custom-gcode.service.ts +0 -11
- package/src/backend/dto/octoprint-settings.dto.ts +0 -168
- package/src/backend/first-time-setup.service.ts +0 -17
- package/src/backend/floor.service.ts +0 -84
- package/src/backend/index.ts +0 -4
- package/src/backend/print-completions.service.ts +0 -11
- package/src/backend/printer-file.service.ts +0 -91
- package/src/backend/printer-group.service.ts +0 -62
- package/src/backend/printer-job.service.ts +0 -20
- package/src/backend/printer-settings.service.ts +0 -28
- package/src/backend/printers.service.ts +0 -136
- package/src/backend/server-private.service.ts +0 -55
- package/src/backend/server.api.ts +0 -132
- package/src/backend/settings.service.ts +0 -85
- package/src/backend/user.service.ts +0 -51
- package/src/components/AboutHelp/AboutView.vue +0 -164
- package/src/components/CameraGrid/CameraGridView.vue +0 -111
- package/src/components/FirstTimeSetup/FirstTimeSetupView.vue +0 -354
- package/src/components/Generic/Actions/PrinterConnectionAction.vue +0 -56
- package/src/components/Generic/Actions/PrinterCreateAction.vue +0 -22
- package/src/components/Generic/Actions/PrinterDeleteAction.vue +0 -29
- package/src/components/Generic/Actions/PrinterQuickStopAction.vue +0 -35
- package/src/components/Generic/Actions/PrinterSettingsAction.vue +0 -35
- package/src/components/Generic/Actions/PrinterUrlAction.vue +0 -24
- package/src/components/Generic/Actions/RefreshFilesAction.vue +0 -50
- package/src/components/Generic/Actions/SyncPrinterNameAction.vue +0 -36
- package/src/components/Generic/Dialogs/AddOrUpdateCameraStreamDialog.vue +0 -131
- package/src/components/Generic/Dialogs/AddOrUpdateFloorDialog.vue +0 -141
- package/src/components/Generic/Dialogs/AddOrUpdatePrinterDialog.vue +0 -303
- package/src/components/Generic/Dialogs/BaseDialog.vue +0 -81
- package/src/components/Generic/Dialogs/BatchJsonCreateDialog.vue +0 -109
- package/src/components/Generic/Dialogs/BatchReprintDialog.vue +0 -190
- package/src/components/Generic/Dialogs/PrinterChecksPanel.vue +0 -37
- package/src/components/Generic/Dialogs/PrinterControlDialog.vue +0 -202
- package/src/components/Generic/Dialogs/PrinterMaintenanceDialog.vue +0 -130
- package/src/components/Generic/Dialogs/YamlImportExportDialog.vue +0 -186
- package/src/components/Generic/Dialogs/dialog.constants.ts +0 -19
- package/src/components/Generic/FileExplorerSideNav.vue +0 -734
- package/src/components/Generic/Loaders/GridLoader.vue +0 -68
- package/src/components/Generic/NavigationDrawer.vue +0 -69
- package/src/components/Generic/PrintJobsMenu.vue +0 -148
- package/src/components/Generic/Snackbars/AppErrorSnackbar.vue +0 -64
- package/src/components/Generic/Snackbars/AppInfoSnackbar.vue +0 -63
- package/src/components/Generic/Snackbars/AppProgressSnackbar.vue +0 -158
- package/src/components/Generic/Vuetify/TooltipButton.vue +0 -47
- package/src/components/HelpOverlay/HelpOverlay.vue +0 -57
- package/src/components/Login/LoginForm.vue +0 -206
- package/src/components/Login/LoginView.spec.ts +0 -64
- package/src/components/Login/LoginView.vue +0 -65
- package/src/components/Login/Logo.vue +0 -13
- package/src/components/Login/PermissionDenied.vue +0 -109
- package/src/components/Login/RegistrationForm.vue +0 -207
- package/src/components/Login/RegistrationView.vue +0 -17
- package/src/components/Login/__snapshots__/LoginView.spec.ts.snap +0 -1051
- package/src/components/NotFound/NotFoundView.vue +0 -39
- package/src/components/PrintStatistics/PrintStatistics.vue +0 -168
- package/src/components/PrintStatistics/PrintStatisticsView.vue +0 -15
- package/src/components/PrinterGrid/HomeToolbar.vue +0 -90
- package/src/components/PrinterGrid/PrinterGrid.vue +0 -164
- package/src/components/PrinterGrid/PrinterGridTile.vue +0 -438
- package/src/components/PrinterGrid/PrinterGridView.vue +0 -210
- package/src/components/PrinterList/FileControlList.vue +0 -40
- package/src/components/PrinterList/PrinterDetails.vue +0 -91
- package/src/components/PrinterList/PrintersView.vue +0 -492
- package/src/components/Settings/AccountSettings.vue +0 -163
- package/src/components/Settings/DiagnosticsSettings.vue +0 -137
- package/src/components/Settings/EmergencyCommands.vue +0 -265
- package/src/components/Settings/FloorSettings.vue +0 -276
- package/src/components/Settings/GridSettings.vue +0 -127
- package/src/components/Settings/OctoPrintSettings.vue +0 -188
- package/src/components/Settings/ServerProtectionSettings.vue +0 -370
- package/src/components/Settings/SettingsView.vue +0 -73
- package/src/components/Settings/SoftwareUpgradeSettings.vue +0 -297
- package/src/components/Settings/UserManagementSettings.vue +0 -257
- package/src/components/TopBar.vue +0 -147
- package/src/components.d.ts +0 -70
- package/src/directives/file-upload.directive.ts +0 -117
- package/src/directives/printer-drop-position.directive.ts +0 -92
- package/src/env.d.ts +0 -6
- package/src/main.ts +0 -76
- package/src/models/batch/reprint.dto.ts +0 -79
- package/src/models/batch.model.ts +0 -11
- package/src/models/camera-streams/camera-stream.ts +0 -19
- package/src/models/floors/floor.model.ts +0 -30
- package/src/models/octoprint/connection-options.model.ts +0 -8
- package/src/models/plugins/firmware-updates/prusa-firmware-release.model.ts +0 -57
- package/src/models/print-completions/print-completions.model.ts +0 -49
- package/src/models/printers/crud/create-printer.model.ts +0 -26
- package/src/models/printers/file-upload-commands.model.ts +0 -4
- package/src/models/printers/gcode/gcode-analysis.model.ts +0 -30
- package/src/models/printers/printer-current-job.model.ts +0 -90
- package/src/models/printers/printer-file.model.ts +0 -48
- package/src/models/printers/printer.model.ts +0 -18
- package/src/models/server/client-releases.model.ts +0 -27
- package/src/models/server/export-yaml.model.ts +0 -11
- package/src/models/server/features.model.ts +0 -37
- package/src/models/server/github-rate-limit.model.ts +0 -21
- package/src/models/server/version.model.ts +0 -14
- package/src/models/settings/printer-file-clean-settings.model.ts +0 -5
- package/src/models/settings/server-settings.dto.ts +0 -19
- package/src/models/settings/settings.model.ts +0 -57
- package/src/models/socketio-messages/socketio-message.model.ts +0 -53
- package/src/models/uploads/queued-upload.model.ts +0 -12
- package/src/models/user.model.ts +0 -15
- package/src/plugins/README.md +0 -3
- package/src/plugins/index.ts +0 -17
- package/src/plugins/vuetify.ts +0 -53
- package/src/router/index.ts +0 -192
- package/src/router/route-names.ts +0 -14
- package/src/router/utils.ts +0 -23
- package/src/shared/alert.events.ts +0 -14
- package/src/shared/app.constants.ts +0 -23
- package/src/shared/auth.constants.ts +0 -34
- package/src/shared/dialog.composable.ts +0 -41
- package/src/shared/drag.constants.ts +0 -19
- package/src/shared/experimental.constants.ts +0 -1
- package/src/shared/http-client.ts +0 -162
- package/src/shared/noun-adjectives.data.ts +0 -24
- package/src/shared/printer-grid.constants.ts +0 -5
- package/src/shared/printer-state.constants.ts +0 -194
- package/src/shared/snackbar.composable.ts +0 -66
- package/src/shared/socketio.service.ts +0 -104
- package/src/store/auth.store.ts +0 -255
- package/src/store/connection.store.ts +0 -66
- package/src/store/dialog.store.ts +0 -114
- package/src/store/features.store.ts +0 -57
- package/src/store/floor.store.ts +0 -173
- package/src/store/grid.store.ts +0 -10
- package/src/store/index.ts +0 -4
- package/src/store/printer-state.store.ts +0 -246
- package/src/store/printer.store.ts +0 -236
- package/src/store/profile.store.ts +0 -25
- package/src/store/settings.store.ts +0 -64
- package/src/store/test-printer.store.ts +0 -70
- package/src/store/uploads.store.ts +0 -75
- package/src/styles/README.md +0 -3
- package/src/styles/settings.scss +0 -10
- package/src/types/global.d.ts +0 -15
- package/src/utils/array.utils.ts +0 -15
- package/src/utils/date.utils.ts +0 -5
- package/src/utils/download-file.util.ts +0 -25
- package/src/utils/error.utils.ts +0 -3
- package/src/utils/file-size.util.ts +0 -11
- package/src/utils/id.type.ts +0 -1
- package/src/utils/sentry.util.ts +0 -8
- package/src/utils/test.util.ts +0 -30
- package/src/utils/time.utils.ts +0 -2
- package/src/utils/uploads-state.utils.ts +0 -58
- package/src/utils/validation.utils.ts +0 -14
- package/src/vite-env.d.ts +0 -7
- package/test/setup-axios-mock.ts +0 -15
- /package/{src/assets/logo.png → dist/assets/logo-CJVdjy51.png} +0 -0
- /package/{src/assets → dist/img/icons}/android-chrome-192x192.png +0 -0
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-card>
|
|
3
|
-
<v-toolbar color="primary">
|
|
4
|
-
<v-avatar>
|
|
5
|
-
<v-icon>settings</v-icon>
|
|
6
|
-
</v-avatar>
|
|
7
|
-
<v-toolbar-title> Server Protection Settings </v-toolbar-title>
|
|
8
|
-
</v-toolbar>
|
|
9
|
-
<v-list lines="three">
|
|
10
|
-
<v-list-item v-if="!whitelistSettingsHidden">
|
|
11
|
-
<v-list-item-title> IP Whitelist </v-list-item-title>
|
|
12
|
-
<v-list-item-subtitle>
|
|
13
|
-
<v-alert color="warning">
|
|
14
|
-
<v-icon>info</v-icon> Be cautious, setting the wrong
|
|
15
|
-
whitelist could make you lose access to the server!
|
|
16
|
-
</v-alert>
|
|
17
|
-
Only allow access from specific IP Adresses or subnets. Note:
|
|
18
|
-
127.0.0.1 will always be allowed access. Examples:
|
|
19
|
-
<br />
|
|
20
|
-
<v-chip size="small"> 192.168 </v-chip>
|
|
21
|
-
<v-chip size="small"> 192.168.1 </v-chip>
|
|
22
|
-
<v-chip size="small"> 192.168.1.1 </v-chip>
|
|
23
|
-
<br />
|
|
24
|
-
<v-row>
|
|
25
|
-
<v-col
|
|
26
|
-
cols="12"
|
|
27
|
-
md="2"
|
|
28
|
-
>
|
|
29
|
-
<v-checkbox
|
|
30
|
-
v-model="whitelistEnabled"
|
|
31
|
-
label="Enable IP Whitelist"
|
|
32
|
-
/>
|
|
33
|
-
</v-col>
|
|
34
|
-
</v-row>
|
|
35
|
-
<v-row class="mt-0">
|
|
36
|
-
<v-col
|
|
37
|
-
cols="12"
|
|
38
|
-
md="2"
|
|
39
|
-
>
|
|
40
|
-
<v-text-field
|
|
41
|
-
v-model="ipAddress"
|
|
42
|
-
:disabled="!whitelistEnabled"
|
|
43
|
-
:rules="[ipAddressRule, (val) => !!val]"
|
|
44
|
-
append-icon="add"
|
|
45
|
-
label="IP Address"
|
|
46
|
-
@click:append="appendIpAddress(ipAddress)"
|
|
47
|
-
/>
|
|
48
|
-
</v-col>
|
|
49
|
-
<v-col>
|
|
50
|
-
<v-chip-group>
|
|
51
|
-
<v-chip
|
|
52
|
-
v-for="ip in whitelistedIpAddresses"
|
|
53
|
-
:key="ip"
|
|
54
|
-
:disabled="!whitelistEnabled"
|
|
55
|
-
closable
|
|
56
|
-
@click:close="removeIpWhitelist(ip)"
|
|
57
|
-
>
|
|
58
|
-
{{ ip }}
|
|
59
|
-
</v-chip>
|
|
60
|
-
</v-chip-group>
|
|
61
|
-
</v-col>
|
|
62
|
-
</v-row>
|
|
63
|
-
<v-row>
|
|
64
|
-
<v-col>
|
|
65
|
-
<v-btn
|
|
66
|
-
color="default"
|
|
67
|
-
@click="resetWhitelistSettingsToDefault()"
|
|
68
|
-
>
|
|
69
|
-
reset to default
|
|
70
|
-
</v-btn>
|
|
71
|
-
<v-btn
|
|
72
|
-
color="primary"
|
|
73
|
-
@click="setWhitelistSettings()"
|
|
74
|
-
>
|
|
75
|
-
save whitelist settings
|
|
76
|
-
</v-btn>
|
|
77
|
-
</v-col>
|
|
78
|
-
</v-row>
|
|
79
|
-
</v-list-item-subtitle>
|
|
80
|
-
</v-list-item>
|
|
81
|
-
|
|
82
|
-
<v-list-item>
|
|
83
|
-
<v-list-item-title> Login Required </v-list-item-title>
|
|
84
|
-
|
|
85
|
-
<v-list-item-subtitle>
|
|
86
|
-
<v-row>
|
|
87
|
-
<v-col
|
|
88
|
-
cols="12"
|
|
89
|
-
md="2"
|
|
90
|
-
>
|
|
91
|
-
<v-checkbox
|
|
92
|
-
v-model="loginRequired"
|
|
93
|
-
label="Require Login"
|
|
94
|
-
/>
|
|
95
|
-
</v-col>
|
|
96
|
-
</v-row>
|
|
97
|
-
<v-row>
|
|
98
|
-
<v-col>
|
|
99
|
-
<v-btn
|
|
100
|
-
color="primary"
|
|
101
|
-
@click="setLoginRequired()"
|
|
102
|
-
>
|
|
103
|
-
save login required setting
|
|
104
|
-
</v-btn>
|
|
105
|
-
</v-col>
|
|
106
|
-
</v-row>
|
|
107
|
-
</v-list-item-subtitle>
|
|
108
|
-
</v-list-item>
|
|
109
|
-
|
|
110
|
-
<v-list-item>
|
|
111
|
-
<v-list-item-title> Registration Enabled </v-list-item-title>
|
|
112
|
-
<v-list-item-subtitle>
|
|
113
|
-
<v-row>
|
|
114
|
-
<v-col
|
|
115
|
-
cols="12"
|
|
116
|
-
md="2"
|
|
117
|
-
>
|
|
118
|
-
<v-checkbox
|
|
119
|
-
v-model="registrationEnabled"
|
|
120
|
-
label="Enable Registration"
|
|
121
|
-
/>
|
|
122
|
-
</v-col>
|
|
123
|
-
</v-row>
|
|
124
|
-
<v-row>
|
|
125
|
-
<v-col>
|
|
126
|
-
<v-btn
|
|
127
|
-
color="primary"
|
|
128
|
-
@click="setRegistrationEnabled()"
|
|
129
|
-
>
|
|
130
|
-
save registration enabled setting
|
|
131
|
-
</v-btn>
|
|
132
|
-
</v-col>
|
|
133
|
-
</v-row>
|
|
134
|
-
</v-list-item-subtitle>
|
|
135
|
-
</v-list-item>
|
|
136
|
-
|
|
137
|
-
<v-list-item>
|
|
138
|
-
<v-list-item-title>
|
|
139
|
-
Login Expiry Settings (advanced)
|
|
140
|
-
</v-list-item-title>
|
|
141
|
-
|
|
142
|
-
<v-list-item-subtitle>
|
|
143
|
-
<v-row>
|
|
144
|
-
<v-col
|
|
145
|
-
cols="12"
|
|
146
|
-
md="2"
|
|
147
|
-
>
|
|
148
|
-
<v-text-field
|
|
149
|
-
v-model="jwtExpiresIn"
|
|
150
|
-
:rules="[(val) => !!val && val >= 2 && val <= 120]"
|
|
151
|
-
label="JWT Expiry (minutes)"
|
|
152
|
-
/>
|
|
153
|
-
</v-col>
|
|
154
|
-
</v-row>
|
|
155
|
-
<v-row>
|
|
156
|
-
<v-col
|
|
157
|
-
cols="12"
|
|
158
|
-
md="2"
|
|
159
|
-
>
|
|
160
|
-
<v-checkbox
|
|
161
|
-
v-model="refreshTokenAttemptsEnabled"
|
|
162
|
-
label="Enable Refresh Token Attempts"
|
|
163
|
-
@update:model-value="onRefreshTokenEnabledChange()"
|
|
164
|
-
/>
|
|
165
|
-
</v-col>
|
|
166
|
-
</v-row>
|
|
167
|
-
<v-row>
|
|
168
|
-
<v-col
|
|
169
|
-
cols="12"
|
|
170
|
-
md="2"
|
|
171
|
-
>
|
|
172
|
-
<v-text-field
|
|
173
|
-
v-model="refreshTokenAttempts"
|
|
174
|
-
:disabled="!refreshTokenAttemptsEnabled"
|
|
175
|
-
:rules="[(val) => !!val && val >= 50]"
|
|
176
|
-
label="Refresh Token Attempts (disabled: -1)"
|
|
177
|
-
type="number"
|
|
178
|
-
/>
|
|
179
|
-
</v-col>
|
|
180
|
-
</v-row>
|
|
181
|
-
<v-row>
|
|
182
|
-
<v-col
|
|
183
|
-
cols="12"
|
|
184
|
-
md="2"
|
|
185
|
-
>
|
|
186
|
-
<v-text-field
|
|
187
|
-
v-model="refreshTokenExpiry"
|
|
188
|
-
:rules="[(val) => !!val && val >= 1 && val <= 30]"
|
|
189
|
-
label="Refresh Token Expiry (days)"
|
|
190
|
-
/>
|
|
191
|
-
</v-col>
|
|
192
|
-
</v-row>
|
|
193
|
-
|
|
194
|
-
<v-alert color="secondary">
|
|
195
|
-
<v-icon>info</v-icon> Be cautious, setting the wrong expiry
|
|
196
|
-
could make you lose access to the server or make your user
|
|
197
|
-
experience highly degraded!
|
|
198
|
-
</v-alert>
|
|
199
|
-
|
|
200
|
-
<v-row>
|
|
201
|
-
<v-col>
|
|
202
|
-
<v-btn
|
|
203
|
-
color="primary"
|
|
204
|
-
@click="saveLoginExpirySettings()"
|
|
205
|
-
>
|
|
206
|
-
save login expiry settings
|
|
207
|
-
</v-btn>
|
|
208
|
-
<v-btn
|
|
209
|
-
color="default"
|
|
210
|
-
@click="resetLoginExpirySettingsToDefault()"
|
|
211
|
-
>
|
|
212
|
-
reset to default
|
|
213
|
-
</v-btn>
|
|
214
|
-
</v-col>
|
|
215
|
-
</v-row>
|
|
216
|
-
</v-list-item-subtitle>
|
|
217
|
-
</v-list-item>
|
|
218
|
-
</v-list>
|
|
219
|
-
</v-card>
|
|
220
|
-
</template>
|
|
221
|
-
|
|
222
|
-
<script lang="ts" setup>
|
|
223
|
-
import { onMounted, ref } from 'vue'
|
|
224
|
-
import { whitelistSettingsHidden } from '@/shared/experimental.constants'
|
|
225
|
-
import { isValidIPOrMask } from '@/utils/validation.utils'
|
|
226
|
-
import { SettingsService } from '@/backend'
|
|
227
|
-
import { useSnackbar } from '@/shared/snackbar.composable'
|
|
228
|
-
import { useAuthStore } from '@/store/auth.store'
|
|
229
|
-
import { useRouter } from 'vue-router'
|
|
230
|
-
import { RouteNames } from '@/router/route-names'
|
|
231
|
-
|
|
232
|
-
const router = useRouter()
|
|
233
|
-
const snackbar = useSnackbar()
|
|
234
|
-
const authStore = useAuthStore()
|
|
235
|
-
|
|
236
|
-
const ipAddress = ref<string>('')
|
|
237
|
-
const whitelistEnabled = ref<boolean>(false)
|
|
238
|
-
const whitelistedIpAddresses = ref<string[]>([])
|
|
239
|
-
|
|
240
|
-
const loginRequired = ref<boolean>(false)
|
|
241
|
-
const registrationEnabled = ref<boolean>(false)
|
|
242
|
-
|
|
243
|
-
const jwtExpiresIn = ref<number>(3200)
|
|
244
|
-
const refreshTokenAttemptsEnabled = ref<boolean>(false)
|
|
245
|
-
const refreshTokenAttempts = ref<number>(-1)
|
|
246
|
-
const refreshTokenExpiry = ref<number>(14)
|
|
247
|
-
|
|
248
|
-
const ipAddressRule = (val: string) =>
|
|
249
|
-
isValidIPOrMask(val) ? true : 'Not a valid IP Address'
|
|
250
|
-
|
|
251
|
-
async function loadSettings() {
|
|
252
|
-
const settings = await SettingsService.getSettings()
|
|
253
|
-
loginRequired.value = settings.server.loginRequired
|
|
254
|
-
registrationEnabled.value = settings.server.registration
|
|
255
|
-
|
|
256
|
-
ipAddress.value = settings.connection?.clientIp ?? '127.0.0.1'
|
|
257
|
-
whitelistEnabled.value = settings.server.whitelistEnabled
|
|
258
|
-
whitelistedIpAddresses.value = settings.server.whitelistedIpAddresses
|
|
259
|
-
|
|
260
|
-
const sensitiveSettings = await SettingsService.getSettingsSensitive()
|
|
261
|
-
jwtExpiresIn.value = sensitiveSettings.credentials.jwtExpiresIn / 60
|
|
262
|
-
refreshTokenAttemptsEnabled.value =
|
|
263
|
-
sensitiveSettings.credentials.refreshTokenAttempts !== -1
|
|
264
|
-
refreshTokenAttempts.value =
|
|
265
|
-
sensitiveSettings.credentials.refreshTokenAttempts
|
|
266
|
-
refreshTokenExpiry.value =
|
|
267
|
-
sensitiveSettings.credentials.refreshTokenExpiry / 24 / 3600
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
onMounted(async () => {
|
|
271
|
-
await loadSettings()
|
|
272
|
-
})
|
|
273
|
-
|
|
274
|
-
function onRefreshTokenEnabledChange() {
|
|
275
|
-
if (!refreshTokenAttemptsEnabled.value) {
|
|
276
|
-
refreshTokenAttempts.value = -1
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
function removeIpWhitelist(removedIp: string) {
|
|
281
|
-
whitelistedIpAddresses.value = whitelistedIpAddresses.value.filter(
|
|
282
|
-
(ip) => ip.toLowerCase() !== removedIp.toLowerCase()
|
|
283
|
-
)
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
function appendIpAddress(ip: string) {
|
|
287
|
-
if (!isValidIPOrMask(ip)) return
|
|
288
|
-
whitelistedIpAddresses.value.push(ip.toLowerCase())
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
async function resetWhitelistSettingsToDefault() {
|
|
292
|
-
whitelistedIpAddresses.value = ['127.0.0.1', '::12']
|
|
293
|
-
whitelistEnabled.value = false
|
|
294
|
-
await setWhitelistSettings(false)
|
|
295
|
-
snackbar.info('Whitelist settings reset to default')
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
async function setWhitelistSettings(showSuccess = true) {
|
|
299
|
-
await SettingsService.setWhitelistSettings({
|
|
300
|
-
whitelistedIpAddresses: whitelistedIpAddresses.value,
|
|
301
|
-
whitelistEnabled: whitelistEnabled.value
|
|
302
|
-
})
|
|
303
|
-
if (showSuccess) {
|
|
304
|
-
snackbar.info('Whitelist settings updated')
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
await loadSettings()
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
async function setLoginRequired() {
|
|
311
|
-
const loginRequiredVal = loginRequired.value
|
|
312
|
-
if (
|
|
313
|
-
!loginRequiredVal &&
|
|
314
|
-
!confirm('Disabling login will expose your server. Continue?')
|
|
315
|
-
) {
|
|
316
|
-
return
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
await SettingsService.updateLoginRequiredSettings(loginRequiredVal)
|
|
320
|
-
|
|
321
|
-
await authStore.logout(true)
|
|
322
|
-
|
|
323
|
-
await authStore.checkAuthenticationRequirements()
|
|
324
|
-
if (!loginRequiredVal) {
|
|
325
|
-
await router.push({ name: RouteNames.Home })
|
|
326
|
-
} else {
|
|
327
|
-
await router.push({ name: RouteNames.Login })
|
|
328
|
-
}
|
|
329
|
-
snackbar.info('Login Required settings updated')
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
async function setRegistrationEnabled() {
|
|
333
|
-
await SettingsService.updateRegistrationEnabledSettings(
|
|
334
|
-
registrationEnabled.value
|
|
335
|
-
)
|
|
336
|
-
await authStore.checkAuthenticationRequirements()
|
|
337
|
-
snackbar.info('Registration settings updated')
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
async function resetLoginExpirySettingsToDefault() {
|
|
341
|
-
jwtExpiresIn.value = 120
|
|
342
|
-
refreshTokenAttemptsEnabled.value = false
|
|
343
|
-
refreshTokenAttempts.value = -1
|
|
344
|
-
refreshTokenExpiry.value = 14
|
|
345
|
-
await saveLoginExpirySettings()
|
|
346
|
-
snackbar.info('Login expiry settings reset to default')
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
async function saveLoginExpirySettings(showSnackbar = true) {
|
|
350
|
-
if (jwtExpiresIn.value < 2 || jwtExpiresIn.value > 120) {
|
|
351
|
-
throw new Error('JWT Expiry must be between 2 and 120 minutes')
|
|
352
|
-
}
|
|
353
|
-
if (
|
|
354
|
-
refreshTokenAttemptsEnabled.value &&
|
|
355
|
-
(refreshTokenAttempts.value < 50 || refreshTokenAttempts.value > 1000)
|
|
356
|
-
) {
|
|
357
|
-
throw new Error('Refresh Token Attempts must be between 50 and 1000')
|
|
358
|
-
}
|
|
359
|
-
if (refreshTokenExpiry.value < 1 || refreshTokenExpiry.value > 30) {
|
|
360
|
-
throw new Error('Refresh Token Expiry must be between 1 and 30 days')
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
await SettingsService.updateCredentialSettings(
|
|
364
|
-
jwtExpiresIn.value * 60,
|
|
365
|
-
refreshTokenAttempts.value,
|
|
366
|
-
refreshTokenExpiry.value * 24 * 3600
|
|
367
|
-
)
|
|
368
|
-
snackbar.info('Login expiry settings updated')
|
|
369
|
-
}
|
|
370
|
-
</script>
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-row no-gutters>
|
|
3
|
-
<div>
|
|
4
|
-
<v-navigation-drawer :permanent="true">
|
|
5
|
-
<v-list-item>
|
|
6
|
-
<v-list-item-title class="text-h6"> Settings </v-list-item-title>
|
|
7
|
-
<v-list-item-subtitle> Adjust your Fdm Monster </v-list-item-subtitle>
|
|
8
|
-
</v-list-item>
|
|
9
|
-
|
|
10
|
-
<v-divider />
|
|
11
|
-
|
|
12
|
-
<v-list
|
|
13
|
-
density="compact"
|
|
14
|
-
nav
|
|
15
|
-
>
|
|
16
|
-
<v-list-item
|
|
17
|
-
v-for="item in items"
|
|
18
|
-
:key="item.title"
|
|
19
|
-
:to="item.path"
|
|
20
|
-
link
|
|
21
|
-
:prepend-icon="item.icon"
|
|
22
|
-
:title="item.title"
|
|
23
|
-
router-link
|
|
24
|
-
/>
|
|
25
|
-
</v-list>
|
|
26
|
-
</v-navigation-drawer>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<router-view class="grow" />
|
|
30
|
-
</v-row>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
<script lang="ts" setup>
|
|
34
|
-
const items = ref([
|
|
35
|
-
{
|
|
36
|
-
title: 'Grid',
|
|
37
|
-
icon: 'grid_on',
|
|
38
|
-
path: '/settings/grid'
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
title: 'Floors',
|
|
42
|
-
icon: 'house_siding',
|
|
43
|
-
path: '/settings/floors'
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
title: 'User Management',
|
|
47
|
-
icon: 'group',
|
|
48
|
-
path: '/settings/user-management'
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
title: 'Account Settings',
|
|
52
|
-
icon: 'account_circle',
|
|
53
|
-
path: '/settings/account'
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
title: 'Server Protection',
|
|
57
|
-
icon: 'security',
|
|
58
|
-
path: '/settings/server-protection'
|
|
59
|
-
},
|
|
60
|
-
{ title: 'OctoPrint Settings', icon: 'image', path: '/settings/octoprint' },
|
|
61
|
-
{
|
|
62
|
-
title: 'Emergency Commands',
|
|
63
|
-
icon: 'warning',
|
|
64
|
-
path: '/settings/emergency-commands'
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
title: 'Software Upgrade',
|
|
68
|
-
icon: 'upgrade',
|
|
69
|
-
path: '/settings/software-upgrade'
|
|
70
|
-
},
|
|
71
|
-
{ title: 'Diagnostics', icon: 'bug_report', path: '/settings/diagnostics' }
|
|
72
|
-
])
|
|
73
|
-
</script>
|