@budibase/server 1.0.123 → 1.0.125
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/builder/assets/index.3d890df7.js +1299 -0
- package/builder/assets/index.89795487.css +6 -0
- package/builder/assets/{vendor.8e34a169.js → vendor.5240f480.js} +1 -1
- package/builder/index.html +3 -3
- package/coverage/clover.xml +695 -1678
- package/coverage/coverage-final.json +28 -43
- package/coverage/lcov-report/api/controllers/analytics.js.html +8 -3
- package/coverage/lcov-report/api/controllers/apikeys.js.html +9 -4
- package/coverage/lcov-report/api/controllers/auth.js.html +8 -3
- package/coverage/lcov-report/api/controllers/automation.js.html +8 -3
- package/coverage/lcov-report/api/controllers/backup.js.html +8 -3
- package/coverage/lcov-report/api/controllers/cloud.js.html +8 -3
- package/coverage/lcov-report/api/controllers/component.js.html +8 -3
- package/coverage/lcov-report/api/controllers/datasource.js.html +11 -6
- package/coverage/lcov-report/api/controllers/dev.js.html +8 -3
- package/coverage/lcov-report/api/controllers/index.html +16 -26
- package/coverage/lcov-report/api/controllers/integration.js.html +8 -3
- package/coverage/lcov-report/api/controllers/layout.js.html +8 -3
- package/coverage/lcov-report/api/controllers/metadata.js.html +8 -3
- package/coverage/lcov-report/api/controllers/migrations.js.html +8 -3
- package/coverage/lcov-report/api/controllers/permission.js.html +8 -3
- package/coverage/lcov-report/api/controllers/query/index.html +16 -26
- package/coverage/lcov-report/api/controllers/query/validation.js.html +8 -3
- package/coverage/lcov-report/api/controllers/role.js.html +10 -5
- package/coverage/lcov-report/api/controllers/routing.js.html +9 -4
- package/coverage/lcov-report/api/controllers/row/external.js.html +8 -3
- package/coverage/lcov-report/api/controllers/row/index.html +25 -35
- package/coverage/lcov-report/api/controllers/row/internal.js.html +32 -24
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +21 -16
- package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +24 -19
- package/coverage/lcov-report/api/controllers/row/utils.js.html +33 -19
- package/coverage/lcov-report/api/controllers/screen.js.html +9 -4
- package/coverage/lcov-report/api/controllers/script.js.html +8 -3
- package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +55 -50
- package/coverage/lcov-report/api/controllers/table/external.js.html +8 -3
- package/coverage/lcov-report/api/controllers/table/index.html +19 -44
- package/coverage/lcov-report/api/controllers/table/index.js.html +20 -15
- package/coverage/lcov-report/api/controllers/templates.js.html +8 -3
- package/coverage/lcov-report/api/controllers/user.js.html +8 -3
- package/coverage/lcov-report/api/controllers/view/exporters.js.html +8 -3
- package/coverage/lcov-report/api/controllers/view/index.html +8 -3
- package/coverage/lcov-report/api/controllers/view/index.js.html +10 -5
- package/coverage/lcov-report/api/controllers/view/utils.js.html +8 -3
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +8 -3
- package/coverage/lcov-report/api/controllers/webhook.js.html +10 -5
- package/coverage/lcov-report/api/index.html +18 -13
- package/coverage/lcov-report/api/index.js.html +28 -8
- package/coverage/lcov-report/api/routes/analytics.js.html +8 -3
- package/coverage/lcov-report/api/routes/apikeys.js.html +8 -3
- package/coverage/lcov-report/api/routes/auth.js.html +8 -3
- package/coverage/lcov-report/api/routes/automation.js.html +8 -3
- package/coverage/lcov-report/api/routes/backup.js.html +8 -3
- package/coverage/lcov-report/api/routes/cloud.js.html +8 -3
- package/coverage/lcov-report/api/routes/component.js.html +8 -3
- package/coverage/lcov-report/api/routes/datasource.js.html +8 -3
- package/coverage/lcov-report/api/routes/deploy.js.html +8 -3
- package/coverage/lcov-report/api/routes/dev.js.html +9 -4
- package/coverage/lcov-report/api/routes/index.html +13 -68
- package/coverage/lcov-report/api/routes/integration.js.html +8 -3
- package/coverage/lcov-report/api/routes/layout.js.html +8 -3
- package/coverage/lcov-report/api/routes/metadata.js.html +8 -3
- package/coverage/lcov-report/api/routes/migrations.js.html +8 -3
- package/coverage/lcov-report/api/routes/permission.js.html +8 -3
- package/coverage/lcov-report/api/routes/query.js.html +8 -3
- package/coverage/lcov-report/api/routes/role.js.html +8 -3
- package/coverage/lcov-report/api/routes/routing.js.html +8 -3
- package/coverage/lcov-report/api/routes/screen.js.html +8 -3
- package/coverage/lcov-report/api/routes/script.js.html +8 -3
- package/coverage/lcov-report/api/routes/table.js.html +8 -3
- package/coverage/lcov-report/api/routes/templates.js.html +8 -3
- package/coverage/lcov-report/api/routes/user.js.html +8 -3
- package/coverage/lcov-report/api/routes/utils/index.html +8 -3
- package/coverage/lcov-report/api/routes/utils/validators.js.html +8 -3
- package/coverage/lcov-report/api/routes/view.js.html +8 -3
- package/coverage/lcov-report/api/routes/webhook.js.html +8 -3
- package/coverage/lcov-report/automations/actions.js.html +21 -7
- package/coverage/lcov-report/automations/automationUtils.js.html +64 -23
- package/coverage/lcov-report/automations/bullboard.js.html +8 -3
- package/coverage/lcov-report/automations/index.html +27 -37
- package/coverage/lcov-report/automations/index.js.html +8 -3
- package/coverage/lcov-report/automations/steps/bash.js.html +8 -3
- package/coverage/lcov-report/automations/steps/delay.js.html +8 -3
- package/coverage/lcov-report/automations/steps/discord.js.html +8 -3
- package/coverage/lcov-report/automations/steps/executeQuery.js.html +8 -3
- package/coverage/lcov-report/automations/steps/executeScript.js.html +8 -3
- package/coverage/lcov-report/automations/steps/filter.js.html +8 -3
- package/coverage/lcov-report/automations/steps/index.html +31 -41
- package/coverage/lcov-report/automations/steps/integromat.js.html +8 -3
- package/coverage/lcov-report/{api/routes/static.js.html → automations/steps/loop.js.html} +70 -80
- package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +9 -4
- package/coverage/lcov-report/automations/steps/queryRows.js.html +9 -4
- package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +8 -3
- package/coverage/lcov-report/automations/steps/serverLog.js.html +8 -3
- package/coverage/lcov-report/automations/steps/slack.js.html +8 -3
- package/coverage/lcov-report/automations/steps/updateRow.js.html +8 -3
- package/coverage/lcov-report/automations/steps/utils.js.html +14 -9
- package/coverage/lcov-report/automations/steps/zapier.js.html +8 -3
- package/coverage/lcov-report/automations/triggerInfo/app.js.html +8 -3
- package/coverage/lcov-report/automations/triggerInfo/cron.js.html +8 -3
- package/coverage/lcov-report/automations/triggerInfo/index.html +8 -3
- package/coverage/lcov-report/automations/triggerInfo/index.js.html +8 -3
- package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +8 -3
- package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +8 -3
- package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +8 -3
- package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +8 -3
- package/coverage/lcov-report/automations/triggers.js.html +16 -11
- package/coverage/lcov-report/block-navigation.js +8 -0
- package/coverage/lcov-report/constants/index.html +12 -7
- package/coverage/lcov-report/constants/index.js.html +55 -32
- package/coverage/lcov-report/constants/layouts.js.html +8 -3
- package/coverage/lcov-report/constants/screens.js.html +8 -3
- package/coverage/lcov-report/db/inMemoryView.js.html +8 -3
- package/coverage/lcov-report/db/index.html +8 -3
- package/coverage/lcov-report/db/index.js.html +9 -4
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +20 -15
- package/coverage/lcov-report/db/linkedRows/index.html +8 -3
- package/coverage/lcov-report/db/linkedRows/index.js.html +22 -17
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +12 -7
- package/coverage/lcov-report/db/newid.js.html +11 -6
- package/coverage/lcov-report/db/utils.js.html +84 -79
- package/coverage/lcov-report/events/AutomationEmitter.js.html +14 -9
- package/coverage/lcov-report/events/index.html +8 -3
- package/coverage/lcov-report/events/index.js.html +9 -4
- package/coverage/lcov-report/events/utils.js.html +18 -13
- package/coverage/lcov-report/index.html +125 -120
- package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +8 -3
- package/coverage/lcov-report/integrations/tests/index.html +8 -3
- package/coverage/lcov-report/middleware/appInfo.js.html +8 -3
- package/coverage/lcov-report/middleware/builder.js.html +8 -3
- package/coverage/lcov-report/middleware/currentapp.js.html +65 -15
- package/coverage/lcov-report/middleware/index.html +25 -50
- package/coverage/lcov-report/middleware/joi-validator.js.html +9 -4
- package/coverage/lcov-report/middleware/publicApi.js.html +8 -3
- package/coverage/lcov-report/middleware/resourceId.js.html +8 -3
- package/coverage/lcov-report/middleware/selfhost.js.html +9 -4
- package/coverage/lcov-report/middleware/utils.js.html +8 -3
- package/coverage/lcov-report/sorter.js +26 -0
- package/coverage/lcov-report/threads/automation.js.html +581 -90
- package/coverage/lcov-report/threads/index.html +30 -40
- package/coverage/lcov-report/threads/query.js.html +9 -4
- package/coverage/lcov-report/threads/utils.js.html +17 -9
- package/coverage/lcov-report/utilities/bcrypt.js.html +8 -3
- package/coverage/lcov-report/utilities/budibaseDir.js.html +8 -3
- package/coverage/lcov-report/utilities/centralPath.js.html +8 -3
- package/coverage/lcov-report/utilities/csvParser.js.html +10 -5
- package/coverage/lcov-report/utilities/global.js.html +9 -4
- package/coverage/lcov-report/utilities/index.html +8 -3
- package/coverage/lcov-report/utilities/index.js.html +11 -6
- package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +32 -9
- package/coverage/lcov-report/utilities/queue/index.html +12 -7
- package/coverage/lcov-report/utilities/routing/index.html +8 -3
- package/coverage/lcov-report/utilities/routing/index.js.html +8 -3
- package/coverage/lcov-report/utilities/rowProcessor/index.html +8 -3
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +48 -43
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +18 -13
- package/coverage/lcov-report/utilities/scriptRunner.js.html +8 -3
- package/coverage/lcov-report/utilities/security.js.html +9 -4
- package/coverage/lcov-report/utilities/statusCodes.js.html +8 -3
- package/coverage/lcov-report/utilities/usageQuota/index.html +24 -34
- package/coverage/lcov-report/utilities/usageQuota/rows.js.html +44 -39
- package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +8 -3
- package/coverage/lcov-report/utilities/users.js.html +8 -3
- package/coverage/lcov-report/utilities/workerRequests.js.html +9 -4
- package/coverage/lcov.info +1144 -2875
- package/dist/api/controllers/application.js +145 -73
- package/dist/api/controllers/deploy/index.js +68 -36
- package/dist/api/controllers/public/applications.js +29 -9
- package/dist/api/controllers/public/queries.js +27 -7
- package/dist/api/controllers/public/rows.js +32 -12
- package/dist/api/controllers/public/tables.js +2 -2
- package/dist/api/controllers/public/users.js +8 -8
- package/dist/api/controllers/public/utils.js +1 -1
- package/dist/api/controllers/query/import/index.js +3 -3
- package/dist/api/controllers/query/index.js +57 -44
- package/dist/api/controllers/row/ExternalRequest.js +27 -27
- package/dist/api/controllers/row/index.js +83 -60
- package/dist/api/controllers/row/internal.js +2 -1
- package/dist/api/controllers/row/utils.js +2 -1
- package/dist/api/controllers/static/templates/BudibaseApp.svelte +3 -0
- package/dist/api/controllers/table/bulkFormula.js +2 -1
- package/dist/api/controllers/table/internal.js +41 -35
- package/dist/api/controllers/table/utils.js +271 -229
- package/dist/api/index.js +5 -0
- package/dist/api/routes/application.js +39 -13
- package/dist/api/routes/index.js +61 -56
- package/dist/api/routes/public/index.js +6 -9
- package/dist/api/routes/public/queries.js +1 -1
- package/dist/api/routes/public/rows.js +1 -1
- package/dist/api/routes/public/tables.js +3 -3
- package/dist/api/routes/public/users.js +1 -1
- package/dist/api/routes/row.js +43 -17
- package/dist/api/routes/static.js +40 -13
- package/dist/api/routes/tests/utilities/TestFunctions.js +75 -33
- package/dist/app.js +8 -4
- package/dist/automations/actions.js +3 -0
- package/dist/automations/automationUtils.js +10 -0
- package/dist/automations/steps/createRow.js +12 -12
- package/dist/automations/steps/deleteRow.js +13 -16
- package/dist/automations/steps/loop.js +51 -0
- package/dist/automations/tests/utilities/index.js +13 -11
- package/dist/automations/utils.js +187 -133
- package/dist/constants/index.js +5 -0
- package/dist/definitions/datasource.js +1 -0
- package/dist/environment.js +2 -3
- package/dist/index.js +4 -0
- package/dist/integrations/base/sql.js +2 -2
- package/dist/integrations/base/sqlTable.js +2 -2
- package/dist/integrations/googlesheets.js +1 -1
- package/dist/integrations/index.js +4 -0
- package/dist/integrations/microsoftSqlServer.js +8 -8
- package/dist/integrations/mysql.js +9 -9
- package/dist/integrations/oracle.js +7 -7
- package/dist/integrations/postgres.js +7 -7
- package/dist/integrations/queries/sql.js +2 -2
- package/dist/integrations/redis.js +158 -0
- package/dist/integrations/rest.js +1 -1
- package/dist/middleware/authorized.js +51 -51
- package/dist/middleware/currentapp.js +15 -1
- package/dist/migrations/functions/appUrls.js +1 -1
- package/dist/migrations/functions/developerQuota.js +49 -0
- package/dist/migrations/functions/publishedAppsQuota.js +47 -0
- package/dist/migrations/functions/quotas1.js +6 -2
- package/dist/migrations/functions/usageQuotas/index.js +0 -4
- package/dist/migrations/functions/usageQuotas/syncApps.js +4 -7
- package/dist/migrations/functions/usageQuotas/syncDevelopers.js +24 -0
- package/dist/migrations/functions/usageQuotas/syncPublishedApps.js +26 -0
- package/dist/migrations/functions/usageQuotas/syncRows.js +5 -8
- package/dist/migrations/index.js +17 -1
- package/dist/package.json +14 -8
- package/dist/threads/automation.js +149 -27
- package/dist/threads/index.js +36 -10
- package/dist/threads/utils.js +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/utilities/queue/inMemoryQueue.js +6 -1
- package/nodemon.json +1 -1
- package/package.json +15 -9
- package/scripts/dev/manage.js +2 -0
- package/src/api/controllers/{application.js → application.ts} +118 -51
- package/src/api/controllers/deploy/{index.js → index.ts} +53 -29
- package/src/api/controllers/public/applications.ts +2 -2
- package/src/api/controllers/public/queries.ts +1 -1
- package/src/api/controllers/public/rows.ts +1 -1
- package/src/api/controllers/query/{index.js → index.ts} +51 -48
- package/src/api/controllers/row/ExternalRequest.ts +1 -1
- package/src/api/controllers/row/{index.js → index.ts} +24 -17
- package/src/api/controllers/row/internal.js +2 -1
- package/src/api/controllers/row/utils.js +4 -1
- package/src/api/controllers/static/templates/BudibaseApp.svelte +3 -0
- package/src/api/controllers/table/bulkFormula.js +1 -1
- package/src/api/controllers/table/{internal.js → internal.ts} +30 -26
- package/src/api/controllers/table/{utils.js → utils.ts} +86 -69
- package/src/api/index.js +5 -0
- package/src/api/routes/{application.js → application.ts} +8 -14
- package/src/api/routes/index.ts +60 -0
- package/src/api/routes/public/index.ts +1 -4
- package/src/api/routes/{row.js → row.ts} +7 -15
- package/src/api/routes/{static.js → static.ts} +11 -11
- package/src/api/routes/tests/misc.spec.js +39 -37
- package/src/api/routes/tests/utilities/{TestFunctions.js → TestFunctions.ts} +57 -33
- package/src/app.ts +1 -2
- package/src/automations/actions.js +3 -0
- package/src/automations/automationUtils.js +12 -0
- package/src/automations/steps/{createRow.js → createRow.ts} +9 -15
- package/src/automations/steps/{deleteRow.js → deleteRow.ts} +10 -16
- package/src/automations/steps/loop.js +50 -0
- package/src/automations/tests/automation.spec.js +0 -1
- package/src/automations/tests/{createRow.spec.js → createRow.spec.ts} +4 -15
- package/src/automations/tests/{deleteRow.spec.js → deleteRow.spec.ts} +3 -5
- package/src/automations/tests/utilities/index.js +12 -10
- package/src/automations/{utils.js → utils.ts} +39 -28
- package/src/constants/index.js +6 -0
- package/src/definitions/common.ts +1 -0
- package/src/definitions/datasource.ts +1 -0
- package/src/environment.js +2 -3
- package/src/index.ts +3 -0
- package/src/integrations/index.ts +4 -0
- package/src/integrations/redis.ts +152 -0
- package/src/integrations/tests/redis.spec.js +60 -0
- package/src/middleware/{authorized.js → authorized.ts} +20 -14
- package/src/middleware/currentapp.js +16 -1
- package/src/middleware/tests/currentapp.spec.js +8 -4
- package/src/migrations/functions/developerQuota.ts +15 -0
- package/src/migrations/functions/publishedAppsQuota.ts +13 -0
- package/src/migrations/functions/tests/quotas1.spec.js +0 -2
- package/src/migrations/functions/usageQuotas/index.ts +0 -5
- package/src/migrations/functions/usageQuotas/syncApps.ts +3 -6
- package/src/migrations/functions/usageQuotas/syncDevelopers.ts +19 -0
- package/src/migrations/functions/usageQuotas/syncPublishedApps.ts +21 -0
- package/src/migrations/functions/usageQuotas/syncRows.ts +3 -6
- package/src/migrations/functions/usageQuotas/tests/syncApps.spec.ts +34 -0
- package/src/migrations/functions/usageQuotas/tests/syncRows.spec.ts +40 -0
- package/src/migrations/index.ts +13 -1
- package/src/threads/automation.js +196 -34
- package/src/threads/{index.js → index.ts} +18 -14
- package/src/threads/utils.js +1 -0
- package/src/utilities/queue/inMemoryQueue.js +7 -1
- package/tsconfig.build.json +10 -0
- package/tsconfig.json +2 -2
- package/builder/assets/index.68a7f4e3.css +0 -6
- package/builder/assets/index.8d4a5b33.js +0 -1291
- package/coverage/lcov-report/api/controllers/application.js.html +0 -1436
- package/coverage/lcov-report/api/controllers/query/index.js.html +0 -713
- package/coverage/lcov-report/api/controllers/row/index.js.html +0 -524
- package/coverage/lcov-report/api/controllers/table/internal.js.html +0 -620
- package/coverage/lcov-report/api/controllers/table/utils.js.html +0 -1331
- package/coverage/lcov-report/api/routes/application.js.html +0 -179
- package/coverage/lcov-report/api/routes/index.js.html +0 -266
- package/coverage/lcov-report/api/routes/row.js.html +0 -908
- package/coverage/lcov-report/automations/steps/createRow.js.html +0 -380
- package/coverage/lcov-report/automations/steps/deleteRow.js.html +0 -347
- package/coverage/lcov-report/automations/utils.js.html +0 -665
- package/coverage/lcov-report/middleware/authorized.js.html +0 -458
- package/coverage/lcov-report/middleware/usageQuota.js.html +0 -572
- package/coverage/lcov-report/threads/index.js.html +0 -296
- package/coverage/lcov-report/utilities/usageQuota/index.js.html +0 -359
- package/dist/middleware/usageQuota.js +0 -154
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/utilities/usageQuota/index.js +0 -86
- package/src/api/routes/index.js +0 -62
- package/src/middleware/tests/usageQuota.spec.js +0 -120
- package/src/middleware/usageQuota.js +0 -164
- package/src/migrations/functions/usageQuotas/tests/syncApps.spec.js +0 -41
- package/src/migrations/functions/usageQuotas/tests/syncRows.spec.js +0 -45
- package/src/utilities/tests/usageQuota/usageQuota.spec.js +0 -72
- package/src/utilities/usageQuota/index.js +0 -93
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">79.36% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>50/63</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">80% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>44/55</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">79.36% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>50/63</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -54,8 +54,14 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line medium'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
60
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
61
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -173,7 +179,22 @@
|
|
|
173
179
|
<a name='L114'></a><a href='#L114'>114</a>
|
|
174
180
|
<a name='L115'></a><a href='#L115'>115</a>
|
|
175
181
|
<a name='L116'></a><a href='#L116'>116</a>
|
|
176
|
-
<a name='L117'></a><a href='#L117'>117</a
|
|
182
|
+
<a name='L117'></a><a href='#L117'>117</a>
|
|
183
|
+
<a name='L118'></a><a href='#L118'>118</a>
|
|
184
|
+
<a name='L119'></a><a href='#L119'>119</a>
|
|
185
|
+
<a name='L120'></a><a href='#L120'>120</a>
|
|
186
|
+
<a name='L121'></a><a href='#L121'>121</a>
|
|
187
|
+
<a name='L122'></a><a href='#L122'>122</a>
|
|
188
|
+
<a name='L123'></a><a href='#L123'>123</a>
|
|
189
|
+
<a name='L124'></a><a href='#L124'>124</a>
|
|
190
|
+
<a name='L125'></a><a href='#L125'>125</a>
|
|
191
|
+
<a name='L126'></a><a href='#L126'>126</a>
|
|
192
|
+
<a name='L127'></a><a href='#L127'>127</a>
|
|
193
|
+
<a name='L128'></a><a href='#L128'>128</a>
|
|
194
|
+
<a name='L129'></a><a href='#L129'>129</a>
|
|
195
|
+
<a name='L130'></a><a href='#L130'>130</a>
|
|
196
|
+
<a name='L131'></a><a href='#L131'>131</a>
|
|
197
|
+
<a name='L132'></a><a href='#L132'>132</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
177
198
|
<span class="cline-any cline-neutral"> </span>
|
|
178
199
|
<span class="cline-any cline-neutral"> </span>
|
|
179
200
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -241,6 +262,21 @@
|
|
|
241
262
|
<span class="cline-any cline-neutral"> </span>
|
|
242
263
|
<span class="cline-any cline-neutral"> </span>
|
|
243
264
|
<span class="cline-any cline-neutral"> </span>
|
|
265
|
+
<span class="cline-any cline-yes">185x</span>
|
|
266
|
+
<span class="cline-any cline-yes">185x</span>
|
|
267
|
+
<span class="cline-any cline-yes">185x</span>
|
|
268
|
+
<span class="cline-any cline-yes">185x</span>
|
|
269
|
+
<span class="cline-any cline-neutral"> </span>
|
|
270
|
+
<span class="cline-any cline-no"> </span>
|
|
271
|
+
<span class="cline-any cline-no"> </span>
|
|
272
|
+
<span class="cline-any cline-no"> </span>
|
|
273
|
+
<span class="cline-any cline-neutral"> </span>
|
|
274
|
+
<span class="cline-any cline-neutral"> </span>
|
|
275
|
+
<span class="cline-any cline-neutral"> </span>
|
|
276
|
+
<span class="cline-any cline-neutral"> </span>
|
|
277
|
+
<span class="cline-any cline-neutral"> </span>
|
|
278
|
+
<span class="cline-any cline-neutral"> </span>
|
|
279
|
+
<span class="cline-any cline-neutral"> </span>
|
|
244
280
|
<span class="cline-any cline-yes">190x</span>
|
|
245
281
|
<span class="cline-any cline-no"> </span>
|
|
246
282
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -295,7 +331,7 @@
|
|
|
295
331
|
getCookie,
|
|
296
332
|
clearCookie,
|
|
297
333
|
} = require("@budibase/backend-core/utils")
|
|
298
|
-
const { Cookies } = require("@budibase/backend-core/constants")
|
|
334
|
+
const { Cookies, Headers } = require("@budibase/backend-core/constants")
|
|
299
335
|
const { getRole } = require("@budibase/backend-core/roles")
|
|
300
336
|
const { BUILTIN_ROLE_IDS } = require("@budibase/backend-core/roles")
|
|
301
337
|
const { generateUserMetadataID, isDevAppID } = require("../db/utils")
|
|
@@ -333,7 +369,7 @@ module.exports = async (ctx, next) => {
|
|
|
333
369
|
|
|
334
370
|
// deny access to application preview
|
|
335
371
|
if (!env.isTest()) {
|
|
336
|
-
if (
|
|
372
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (
|
|
337
373
|
isDevAppID(requestAppId) &&
|
|
338
374
|
!isWebhookEndpoint(ctx) &&
|
|
339
375
|
(!ctx.user || !ctx.user.builder || !ctx.user.builder.global)
|
|
@@ -348,12 +384,27 @@ module.exports = async (ctx, next) => {
|
|
|
348
384
|
if (!ctx.user) {
|
|
349
385
|
// not logged in, try to set a cookie for public apps
|
|
350
386
|
appId = requestAppId
|
|
351
|
-
} else if (requestAppId != null) {
|
|
387
|
+
} else <span class="missing-if-branch" title="else path not taken" >E</span>if (requestAppId != null) {
|
|
352
388
|
// Different App ID means cookie needs reset, or if the same public user has logged in
|
|
353
389
|
const globalUser = await getCachedSelf(ctx, requestAppId)
|
|
354
390
|
appId = requestAppId
|
|
355
391
|
// retrieving global user gets the right role
|
|
356
392
|
roleId = globalUser.roleId || roleId
|
|
393
|
+
|
|
394
|
+
// Allow builders to specify their role via a header
|
|
395
|
+
const isBuilder =
|
|
396
|
+
globalUser && globalUser.builder && globalUser.builder.global
|
|
397
|
+
const isDevApp = appId && isDevAppID(appId)
|
|
398
|
+
const roleHeader = ctx.request && ctx.request.headers[Headers.PREVIEW_ROLE]
|
|
399
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (isBuilder && isDevApp && roleHeader) {
|
|
400
|
+
// Ensure the role is valid by ensuring a definition exists
|
|
401
|
+
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
402
|
+
<span class="cstat-no" title="statement not covered" > await getRole(roleHeader)</span>
|
|
403
|
+
<span class="cstat-no" title="statement not covered" > roleId = roleHeader</span>
|
|
404
|
+
} catch (error) {
|
|
405
|
+
// Swallow error and do nothing
|
|
406
|
+
}
|
|
407
|
+
}
|
|
357
408
|
}
|
|
358
409
|
|
|
359
410
|
// nothing more to do
|
|
@@ -381,7 +432,7 @@ module.exports = async (ctx, next) => {
|
|
|
381
432
|
}
|
|
382
433
|
|
|
383
434
|
ctx.appId = appId
|
|
384
|
-
if (roleId) {
|
|
435
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (roleId) {
|
|
385
436
|
ctx.roleId = roleId
|
|
386
437
|
const userId = ctx.user ? generateUserMetadataID(ctx.user._id) : null
|
|
387
438
|
ctx.user = {
|
|
@@ -411,10 +462,9 @@ module.exports = async (ctx, next) => {
|
|
|
411
462
|
</div><!-- /wrapper -->
|
|
412
463
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
413
464
|
Code coverage generated by
|
|
414
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
415
|
-
at
|
|
465
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
466
|
+
at Wed Apr 27 2022 09:28:42 GMT+0000 (Coordinated Universal Time)
|
|
416
467
|
</div>
|
|
417
|
-
</div>
|
|
418
468
|
<script src="../prettify.js"></script>
|
|
419
469
|
<script>
|
|
420
470
|
window.onload = function () {
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">85.63% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>149/174</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">76.06% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>89/117</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">100% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>25/25</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">85.63% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>149/174</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line high'></div>
|
|
59
65
|
<div class="pad1">
|
|
@@ -87,21 +93,6 @@
|
|
|
87
93
|
<td data-value="10" class="abs high">8/10</td>
|
|
88
94
|
</tr>
|
|
89
95
|
|
|
90
|
-
<tr>
|
|
91
|
-
<td class="file high" data-value="authorized.js"><a href="authorized.js.html">authorized.js</a></td>
|
|
92
|
-
<td data-value="88" class="pic high">
|
|
93
|
-
<div class="chart"><div class="cover-fill" style="width: 88%"></div><div class="cover-empty" style="width: 12%"></div></div>
|
|
94
|
-
</td>
|
|
95
|
-
<td data-value="88" class="pct high">88%</td>
|
|
96
|
-
<td data-value="50" class="abs high">44/50</td>
|
|
97
|
-
<td data-value="82.97" class="pct high">82.97%</td>
|
|
98
|
-
<td data-value="47" class="abs high">39/47</td>
|
|
99
|
-
<td data-value="83.33" class="pct high">83.33%</td>
|
|
100
|
-
<td data-value="6" class="abs high">5/6</td>
|
|
101
|
-
<td data-value="89.79" class="pct high">89.79%</td>
|
|
102
|
-
<td data-value="49" class="abs high">44/49</td>
|
|
103
|
-
</tr>
|
|
104
|
-
|
|
105
96
|
<tr>
|
|
106
97
|
<td class="file high" data-value="builder.js"><a href="builder.js.html">builder.js</a></td>
|
|
107
98
|
<td data-value="88.88" class="pic high">
|
|
@@ -118,18 +109,18 @@
|
|
|
118
109
|
</tr>
|
|
119
110
|
|
|
120
111
|
<tr>
|
|
121
|
-
<td class="file
|
|
122
|
-
<td data-value="
|
|
123
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
112
|
+
<td class="file medium" data-value="currentapp.js"><a href="currentapp.js.html">currentapp.js</a></td>
|
|
113
|
+
<td data-value="79.36" class="pic medium">
|
|
114
|
+
<div class="chart"><div class="cover-fill" style="width: 79%"></div><div class="cover-empty" style="width: 21%"></div></div>
|
|
124
115
|
</td>
|
|
125
|
-
<td data-value="
|
|
126
|
-
<td data-value="
|
|
127
|
-
<td data-value="
|
|
128
|
-
<td data-value="
|
|
116
|
+
<td data-value="79.36" class="pct medium">79.36%</td>
|
|
117
|
+
<td data-value="63" class="abs medium">50/63</td>
|
|
118
|
+
<td data-value="80" class="pct high">80%</td>
|
|
119
|
+
<td data-value="55" class="abs high">44/55</td>
|
|
129
120
|
<td data-value="100" class="pct high">100%</td>
|
|
130
121
|
<td data-value="2" class="abs high">2/2</td>
|
|
131
|
-
<td data-value="
|
|
132
|
-
<td data-value="
|
|
122
|
+
<td data-value="79.36" class="pct medium">79.36%</td>
|
|
123
|
+
<td data-value="63" class="abs medium">50/63</td>
|
|
133
124
|
</tr>
|
|
134
125
|
|
|
135
126
|
<tr>
|
|
@@ -192,21 +183,6 @@
|
|
|
192
183
|
<td data-value="6" class="abs high">5/6</td>
|
|
193
184
|
</tr>
|
|
194
185
|
|
|
195
|
-
<tr>
|
|
196
|
-
<td class="file medium" data-value="usageQuota.js"><a href="usageQuota.js.html">usageQuota.js</a></td>
|
|
197
|
-
<td data-value="63.38" class="pic medium">
|
|
198
|
-
<div class="chart"><div class="cover-fill" style="width: 63%"></div><div class="cover-empty" style="width: 37%"></div></div>
|
|
199
|
-
</td>
|
|
200
|
-
<td data-value="63.38" class="pct medium">63.38%</td>
|
|
201
|
-
<td data-value="71" class="abs medium">45/71</td>
|
|
202
|
-
<td data-value="50.98" class="pct medium">50.98%</td>
|
|
203
|
-
<td data-value="51" class="abs medium">26/51</td>
|
|
204
|
-
<td data-value="50" class="pct medium">50%</td>
|
|
205
|
-
<td data-value="8" class="abs medium">4/8</td>
|
|
206
|
-
<td data-value="65.21" class="pct medium">65.21%</td>
|
|
207
|
-
<td data-value="69" class="abs medium">45/69</td>
|
|
208
|
-
</tr>
|
|
209
|
-
|
|
210
186
|
<tr>
|
|
211
187
|
<td class="file high" data-value="utils.js"><a href="utils.js.html">utils.js</a></td>
|
|
212
188
|
<td data-value="100" class="pic high">
|
|
@@ -229,10 +205,9 @@
|
|
|
229
205
|
</div><!-- /wrapper -->
|
|
230
206
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
231
207
|
Code coverage generated by
|
|
232
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
233
|
-
at
|
|
208
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
209
|
+
at Wed Apr 27 2022 09:28:42 GMT+0000 (Coordinated Universal Time)
|
|
234
210
|
</div>
|
|
235
|
-
</div>
|
|
236
211
|
<script src="../prettify.js"></script>
|
|
237
212
|
<script>
|
|
238
213
|
window.onload = function () {
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line high'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -122,7 +128,7 @@
|
|
|
122
128
|
let params = null
|
|
123
129
|
if (ctx[property] != null) {
|
|
124
130
|
params = ctx[property]
|
|
125
|
-
} else if (ctx.request[property] != null) {
|
|
131
|
+
} else <span class="missing-if-branch" title="else path not taken" >E</span>if (ctx.request[property] != null) {
|
|
126
132
|
params = ctx.request[property]
|
|
127
133
|
}
|
|
128
134
|
const { error } = schema.validate(params)
|
|
@@ -147,10 +153,9 @@ module.exports.params = schema => {
|
|
|
147
153
|
</div><!-- /wrapper -->
|
|
148
154
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
149
155
|
Code coverage generated by
|
|
150
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
151
|
-
at
|
|
156
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
157
|
+
at Wed Apr 27 2022 09:28:42 GMT+0000 (Coordinated Universal Time)
|
|
152
158
|
</div>
|
|
153
|
-
</div>
|
|
154
159
|
<script src="../prettify.js"></script>
|
|
155
160
|
<script>
|
|
156
161
|
window.onload = function () {
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line high'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -126,10 +132,9 @@ module.exports = function ({ requiresAppId } = <span class="branch-0 cbranch-no"
|
|
|
126
132
|
</div><!-- /wrapper -->
|
|
127
133
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
128
134
|
Code coverage generated by
|
|
129
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
130
|
-
at
|
|
135
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
136
|
+
at Wed Apr 27 2022 09:28:42 GMT+0000 (Coordinated Universal Time)
|
|
131
137
|
</div>
|
|
132
|
-
</div>
|
|
133
138
|
<script src="../prettify.js"></script>
|
|
134
139
|
<script>
|
|
135
140
|
window.onload = function () {
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line high'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -246,10 +252,9 @@ module.exports.bodySubResource = (main, sub) => {
|
|
|
246
252
|
</div><!-- /wrapper -->
|
|
247
253
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
248
254
|
Code coverage generated by
|
|
249
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
250
|
-
at
|
|
255
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
256
|
+
at Wed Apr 27 2022 09:28:42 GMT+0000 (Coordinated Universal Time)
|
|
251
257
|
</div>
|
|
252
|
-
</div>
|
|
253
258
|
<script src="../prettify.js"></script>
|
|
254
259
|
<script>
|
|
255
260
|
window.onload = function () {
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line high'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -81,7 +87,7 @@
|
|
|
81
87
|
// if added as a middleware will stop requests unless builder is in self host mode
|
|
82
88
|
// or cloud is in self host
|
|
83
89
|
module.exports = async (ctx, next) => {
|
|
84
|
-
if (env.SELF_HOSTED) {
|
|
90
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (env.SELF_HOSTED) {
|
|
85
91
|
await next()
|
|
86
92
|
return
|
|
87
93
|
}
|
|
@@ -93,10 +99,9 @@ module.exports = async (ctx, next) => {
|
|
|
93
99
|
</div><!-- /wrapper -->
|
|
94
100
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
95
101
|
Code coverage generated by
|
|
96
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
97
|
-
at
|
|
102
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
103
|
+
at Wed Apr 27 2022 09:28:42 GMT+0000 (Coordinated Universal Time)
|
|
98
104
|
</div>
|
|
99
|
-
</div>
|
|
100
105
|
<script src="../prettify.js"></script>
|
|
101
106
|
<script>
|
|
102
107
|
window.onload = function () {
|
|
@@ -54,6 +54,12 @@
|
|
|
54
54
|
<p class="quiet">
|
|
55
55
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
56
|
</p>
|
|
57
|
+
<template id="filterTemplate">
|
|
58
|
+
<div class="quiet">
|
|
59
|
+
Filter:
|
|
60
|
+
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
57
63
|
</div>
|
|
58
64
|
<div class='status-line high'></div>
|
|
59
65
|
<pre><table class="coverage">
|
|
@@ -84,10 +90,9 @@ exports.isWebhookEndpoint = ctx => {
|
|
|
84
90
|
</div><!-- /wrapper -->
|
|
85
91
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
86
92
|
Code coverage generated by
|
|
87
|
-
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
|
|
88
|
-
at
|
|
93
|
+
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
94
|
+
at Wed Apr 27 2022 09:28:42 GMT+0000 (Coordinated Universal Time)
|
|
89
95
|
</div>
|
|
90
|
-
</div>
|
|
91
96
|
<script src="../prettify.js"></script>
|
|
92
97
|
<script>
|
|
93
98
|
window.onload = function () {
|
|
@@ -24,6 +24,31 @@ var addSorting = (function() {
|
|
|
24
24
|
return getTableHeader().querySelectorAll('th')[n];
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
function onFilterInput() {
|
|
28
|
+
const searchValue = document.getElementById('fileSearch').value;
|
|
29
|
+
const rows = document.getElementsByTagName('tbody')[0].children;
|
|
30
|
+
for (let i = 0; i < rows.length; i++) {
|
|
31
|
+
const row = rows[i];
|
|
32
|
+
if (
|
|
33
|
+
row.textContent
|
|
34
|
+
.toLowerCase()
|
|
35
|
+
.includes(searchValue.toLowerCase())
|
|
36
|
+
) {
|
|
37
|
+
row.style.display = '';
|
|
38
|
+
} else {
|
|
39
|
+
row.style.display = 'none';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// loads the search box
|
|
45
|
+
function addSearchBox() {
|
|
46
|
+
var template = document.getElementById('filterTemplate');
|
|
47
|
+
var templateClone = template.content.cloneNode(true);
|
|
48
|
+
templateClone.getElementById('fileSearch').oninput = onFilterInput;
|
|
49
|
+
template.parentElement.appendChild(templateClone);
|
|
50
|
+
}
|
|
51
|
+
|
|
27
52
|
// loads all columns
|
|
28
53
|
function loadColumns() {
|
|
29
54
|
var colNodes = getTableHeader().querySelectorAll('th'),
|
|
@@ -162,6 +187,7 @@ var addSorting = (function() {
|
|
|
162
187
|
}
|
|
163
188
|
cols = loadColumns();
|
|
164
189
|
loadData();
|
|
190
|
+
addSearchBox();
|
|
165
191
|
addSortIndicators();
|
|
166
192
|
enableUI();
|
|
167
193
|
};
|