Commit Graph

503 Commits

Author SHA1 Message Date
KernelDeimos
8e083d20d2 tweak(ui): allow size changing on spinner 2024-05-30 15:59:05 -04:00
Eric Dubé
d57980c6cb
Merge pull request #421 from AtkinsSJ/exit-status
Add exit status codes to `puter.exit()`, and an `exit` builtin to Phoenix
2024-05-30 12:28:36 -04:00
KernelDeimos
d047abf31c Update eslint 2024-05-28 19:06:00 -04:00
KernelDeimos
e050506a05 Add class registry (second pass)
ExportService gets removed and instead a global class registry is added.
The `init.js` file is split into `init_sync.js` and `init_async.js`
so that synchronous code that isn't dependent on imports is guarenteed
to run before initgui.js. The globalThis scope and service-script API
now expose `def`, a function for registering class definitions, and
`use`, a function for obtaining registered classes.
2024-05-28 19:06:00 -04:00
KernelDeimos
51bac4486f Add class registry (first pass)
In the first pass I add a `register` method and update `defineComponent`
so it calls `register` as well. This made it possible to create a
proof-of-concept for registered classes. Additionally ExportService was
added to expose registered classes to service scripts. This first pass
works, but it would be better if all types of classes (components or
otherwise) were registered via the same method.
2024-05-27 21:16:50 -04:00
KernelDeimos
06f41659f5 Add function to import UIWindow from service scripts 2024-05-25 17:20:22 -04:00
KernelDeimos
cbfad2ef7a refactor(gui): add service scripts 2024-05-24 19:29:07 -04:00
KernelDeimos
4508bfac73 Fix cookie issue 2024-05-23 13:30:02 -04:00
Sam Atkins
7674da4cd2 feat: Add exit status code to apps
`puter.exit()` now takes a status code, similar to the exit status on
desktop OSes. This is passed to the appClosed event, so that eg a
parent app can know whether its child app ran successfully.
2024-05-23 12:54:06 +01:00
Eric Dubé
8786024559
Merge pull request #404 from secondtruth/patch-1
Update de.js
2024-05-17 15:42:02 -04:00
Eric Dubé
bbb43f53d0
Merge pull request #403 from Zac0511/patch-3
Update fr.js
2024-05-17 15:39:06 -04:00
KernelDeimos
e4543c5f35 Fix 8688ggu00 (2) 2024-05-17 12:32:16 -04:00
Zac0511
340b9202c0
Update fr.js 2024-05-17 14:36:54 +02:00
Zac0511
99ca8755f3
Update fr.js 2024-05-17 14:22:22 +02:00
Zac0511
eaf1e96fa2
Update fr.js 2024-05-17 14:19:19 +02:00
Zac0511
f9b5353058
Update fr.js 2024-05-17 14:15:49 +02:00
Zac0511
e0af914c90
Update fr.js 2024-05-17 14:00:43 +02:00
Zac0511
8f19f4dc5b
Update fr.js
Complete rework of the file, completly remade from en.js
2024-05-17 13:58:33 +02:00
Zac0511
5f47e7f0fa
Update fr.js
Bug repairing... again
2024-05-17 09:55:25 +02:00
Zac0511
9c39b0453d
Update fr.js
Little update for some bugs
2024-05-17 09:16:12 +02:00
Zac0511
545fc103b8
Update fr.js
Complete rework of the file for the latest updates
2024-05-17 09:10:55 +02:00
KernelDeimos
49b257ecff fix(security): Move token for socket.io to request body
Currently this commit breaks websocket events and needs to
be updated.
2024-05-16 17:58:44 -04:00
KernelDeimos
f042b095f1 Fix 8688gxkuj 2024-05-16 17:25:41 -04:00
Christian Neff
43d0936533
Update de.js
Translated:
- 2FA strings
- Task Manager strings
- 2 other scattered strings
2024-05-16 19:51:42 +02:00
KernelDeimos
b68873c5f4 Fix 8688grpf1 2024-05-16 12:48:57 -04:00
Zac0511
e1ae9241af
Update fr.js 2024-05-16 18:27:12 +02:00
Zac0511
b6ea37c517
Update fr.js
Since there was a lot of text and menus added, and they were not translated, so i just translated them.
2024-05-16 18:06:21 +02:00
KernelDeimos
bee0e19eaf Fix 8688ggu00 2024-05-15 20:59:20 -04:00
KernelDeimos
800aef1942 Implement anti-CSRF for logout 2024-05-13 20:40:27 -04:00
KernelDeimos
c2f1694107 Require password entry to disable 2FA 2024-05-13 16:00:07 -04:00
KernelDeimos
23215bd6f7 Move change_email/start to password-protected endpoint 2024-05-13 16:00:07 -04:00
KernelDeimos
9076fddc0d Add new password change endpoint 2024-05-13 16:00:07 -04:00
Eric Dubé
89ac491120
Merge pull request #391 from AtkinsSJ/truncate-filename
refactor: Put truncate_filename() helper in its own file
2024-05-10 12:54:46 -04:00
Sam Atkins
e53bfe6b62 refactor: Put truncate_filename() helper in its own file
Every user previously set the max_length as window.TRUNCATE_LENGTH, so
I've moved that constant into the truncate_filename file and set it as
the default if max_length is not specified.
2024-05-10 17:46:09 +01:00
Sam Atkins
9bb4570126 Re-use existing Task Manager rows if possible instead of recreating them
Most of the time, we'll already have a TaskManagerRow for the given
process, so we can just update its properties.

Iterating the results from #iter_tasks means we also insert the rows in
the correct order, regardless of their previous order.
2024-05-10 17:41:13 +01:00
Sam Atkins
5b43358219 fix: Only run Component initialization functions once
If the Component gets removed from the DOM and then re-added, it already
has contents, and we don't need to create them again. It also has
already had on_ready called, so that doesn't need to happen again
either.

This fix stops Components duplicating their content elements and
listener callbacks whenever they're moved around the document.
2024-05-10 17:41:01 +01:00
Sam Atkins
cf605c8a38 refactor: Convert Task Manager to use Components
This currently behaves the same as it did before: It still recreates the
table contents every half a second. It should also look identical,
though it's possible I missed some small differences.

The component structure is:

TaskManagerTable
- Table
  - TaskManagerRow
  - TaskManagerRow
  - TaskManagerRow
  - ...

TaskManagerRow is implemented so that we can later move to modifying
them in place as the process tree changes, instead of having to replace
them all.

Otherwise, most of the code is just moved around, and not changed much.
2024-05-10 17:41:01 +01:00
Sam Atkins
e304f6fc3a Add ability to look up a process by its uuid 2024-05-10 17:38:00 +01:00
Sam Atkins
09cee986f2 Add a Table component, based on the TaskManager table
For now, this is quite basic. The main feature is the sticky header.
2024-05-10 17:38:00 +01:00
Eric Dubé
3992fe1a45
Merge pull request #384 from AtkinsSJ/progress-dialogs
refactor: Replace several existing progress dialogs with one configurable one
2024-05-10 12:25:32 -04:00
Eric Dubé
17e08cafce
Merge pull request #380 from AtkinsSJ/eslint-ci
Run ESLint on CI
2024-05-10 12:24:31 -04:00
ghostxbh
5800350b25
fix: Eliminates duplicate translation keys 2024-05-10 10:41:21 +08:00
KernelDeimos
cd2daa1910 Require email verification for contact form 2024-05-09 19:40:34 -04:00
Sam Atkins
edebbee9e7 feat: Display upload errors in UIWindowProgress dialog
The object returned from UIWindowProgress() now has a `show_error()`
method, taking a title and message. Calling it will replace the content
of the window with those messages.

I've made use of this for file uploads. The only other place we
currently have errors we could show is for zipping and downloading
files, but we do not always have a progress dialog in that case, so I'll
leave that for now.

I think ideally, we would always create a progress dialog, and it would
then support being invisible initially, but appearing after a delay.
Then we'd always have an object to call `show_error()` on, and it could
then immediately show the dialog. But I'll get to that another day. :^)
2024-05-09 19:00:55 +01:00
Sam Atkins
c2c87bf0ba refactor: Replace UIWindowDownloadDirProg with UIWindowProgress 2024-05-09 18:28:39 +01:00
Sam Atkins
e525747002 refactor: Replace UIWindowCopyProgress with UIWindowProgress 2024-05-09 18:28:39 +01:00
Sam Atkins
6d8c709de8 Delete unused UIWindowDownloadProgress.js 2024-05-09 18:28:39 +01:00
Sam Atkins
f07c13a50c feat: Show "Deleting /foo" in progress window when deleting files
Previously we showed "Moving /foo" which was confusing.

Also, make use of i18n replacements instead of gluing strings together,
because other languages might put the words in a different order. For
now, I've modified all the translations so that the "Moving foo" text
will appear as it did before, but these will require someone who
actually knows the different languages to check and correct them.
2024-05-09 18:19:05 +01:00
Sam Atkins
c12312cbd3 refactor: Replace UIWindowMoveProgress with UIWindowProgress 2024-05-09 18:18:27 +01:00
Sam Atkins
cb6c098f95 refactor: Replace UIWindowProgressEmptyTrash with UIWindowProgress
I noticed during this that emptying the trash from inside the Trash
window uses a different code path without a progress dialog, so I've
added a TODO to merge that in. I tried just using it directly but the
behaviour is a bit different. (The Trash one makes all the items fade
out.)
2024-05-09 18:17:15 +01:00
Sam Atkins
09ca82e1d8 refactor: Replace UIWindowNewFolderProgress with UIWindowProgress
This previously had code for the cancel button, but that cancel button
didn't exist. I've left the previous on-cancel code commented out with
a TODO.
2024-05-09 15:51:45 +01:00
Sam Atkins
5b565a69d7 refactor: Replace UIWindowUploadProgress with UIWindowProgress 2024-05-09 15:51:45 +01:00
Sam Atkins
52ddfc8801 Introduce a general-purpose progress window
We have 7 of these, which all have very similar code. Let's deduplicate
them! :^)
2024-05-09 15:51:45 +01:00
Sam Atkins
df3f7e9a6e Allow Button component to not have button-block class
This needs a better solution for configuring the button's CSS classes,
but this works for now.
2024-05-09 12:38:29 +01:00
Sam Atkins
05aaa5b667 chore: Remove dead code from 2FA development
No `.qr-code-checkbox input`s now exist. Also, `.code-confirm-btn` is
only used by CodeEntryView, which doesn't use this Button component.
2024-05-09 12:12:33 +01:00
Sam Atkins
1b2608d6ee refactor: Replace component definition boilerplate with a function
Also, we can ask the CustomElementRegistry if it has an entry with a
given name, instead of polluting the window object.
2024-05-08 14:46:58 +01:00
Sam Atkins
9267b50666 Convert UIWindowThemeDialog to components
This also fixes the "Reset Colors" button not adjusting the sliders.
2024-05-08 14:46:58 +01:00
Sam Atkins
2604dae83c Resolve eslint issues in new 2FA code
/puter/src/UI/Settings/UITabSecurity.js
  13:13  error  'user' is not defined        no-undef
  31:13  error  'user' is not defined        no-undef
  32:70  error  'user' is not defined        no-undef
  36:30  error  'user' is not defined        no-undef
  40:82  error  'user' is not defined        no-undef
  41:83  error  'user' is not defined        no-undef
  87:41  error  'api_origin' is not defined  no-undef

/puter/src/UI/UIWindow2FASetup.js
  39:33  error  'api_origin' is not defined  no-undef
  51:37  error  'api_origin' is not defined  no-undef
  69:37  error  'api_origin' is not defined  no-undef

/puter/src/UI/UIWindowLogin.js
  202:73  error  'api_origin' is not defined  no-undef
  271:73  error  'api_origin' is not defined  no-undef
2024-05-08 09:49:58 +01:00
Sam Atkins
6778aa4343 Resolve eslint issues in Russian translation
/puter/src/i18n/translations/ru.js
  180:34  error  Irregular whitespace not allowed    no-irregular-whitespace
  257:9   error  Duplicate key 'storage_puter_used'  no-dupe-keys
2024-05-08 09:44:31 +01:00
KernelDeimos
d58aa33d2b Remove taskbar items from localstorage 2024-05-07 20:01:05 -04:00
KernelDeimos
f62617a8bf Remove auth_token from /down call 2024-05-07 14:29:09 -04:00
Nariman Jelveh
5409547bba Make the 2fa disable prompt a child of the Settings window 2024-05-06 16:16:57 -07:00
KernelDeimos
db8e2c3bf2 Address next batch of UX issues 2024-05-06 19:09:28 -04:00
KernelDeimos
4c53ec6dd3 Address UX issues 2024-05-06 18:53:43 -04:00
KernelDeimos
b2d678ca95 Cleanup dead code 2024-05-06 16:45:03 -04:00
KernelDeimos
adbefb4622 Cleanup log messages 2024-05-06 16:44:23 -04:00
KernelDeimos
429b7033a4 Improve error handling for 2FA rate limit 2024-05-06 16:35:35 -04:00
KernelDeimos
57d9c246c0 Fix css in firefox 2024-05-06 15:47:09 -04:00
KernelDeimos
abbbf0d030 Add confirmation for disabling 2FA 2024-05-06 15:36:38 -04:00
KernelDeimos
1592bc44fc Fix spinner getting stuck 2024-05-06 01:30:32 -04:00
KernelDeimos
77fedee58a Remove artifact 2024-05-06 00:13:24 -04:00
KernelDeimos
63e72a22e0 Fix settings card update 2024-05-06 00:02:46 -04:00
KernelDeimos
00c8ece07e Finish recovery codes 2024-05-06 00:02:46 -04:00
KernelDeimos
60a561c84c Re-use CodeEntryView for login 2024-05-06 00:02:46 -04:00
KernelDeimos
4ad50b14d6 Fix the duplicate loading issue 2024-05-06 00:02:46 -04:00
KernelDeimos
df88373519 Remove test window open 2024-05-06 00:02:46 -04:00
KernelDeimos
099699198c Tweak QR code sizes 2024-05-06 00:02:46 -04:00
Nariman Jelveh
75bd1bc4c8 Update UIWindow2FASetup.js 2024-05-06 00:02:46 -04:00
Nariman Jelveh
12c883b6fd Remove the confirmation prompt when closing the 2FA setup winow
When exiting a window there should be a confirmation if exiting that window will irreversibly destroy work. For example, when you're working on a document and if you exit unsaved changes will be lost.
This doesn't seem to be the case. What work will be irreversibly lost?
2024-05-06 00:02:46 -04:00
Nariman Jelveh
144d647540 Improve styling 2024-05-06 00:02:46 -04:00
Nariman Jelveh
c8a6d109ce Add icon for Security tab and warning/success styling for 2fa card 2024-05-06 00:02:46 -04:00
KernelDeimos
5fa3c6511f Fix padding and enable code 2024-05-06 00:02:46 -04:00
KernelDeimos
d72d83d0f3 Add i18n entries for 2FA setup 2024-05-06 00:02:46 -04:00
KernelDeimos
c91c0afa71 Complete the 2FA setup flow 2024-05-06 00:02:46 -04:00
KernelDeimos
a95fcc96be Add text components and styling 2024-05-06 00:02:46 -04:00
KernelDeimos
f9c5a688b1 Fix code entry focus on init 2024-05-06 00:02:46 -04:00
KernelDeimos
e9b8c452b9 Temporarily disable real check for testing 2024-05-06 00:02:46 -04:00
KernelDeimos
3e380ba844 Add otp test endpoint and next wizard step 2024-05-06 00:02:46 -04:00
KernelDeimos
22234ad1c1 Add the wizardy behaviour 2024-05-06 00:02:46 -04:00
KernelDeimos
662fd13548 Add code entry to 2FA wizard 2024-05-06 00:02:46 -04:00
KernelDeimos
a672b8a58c Add UIWindow2FASetup 2024-05-06 00:02:46 -04:00
KernelDeimos
6e0cdb8a6b Document 2FA wizard structure 2024-05-06 00:02:46 -04:00
KernelDeimos
0baa678c8b Add Flexer 2024-05-06 00:02:46 -04:00
KernelDeimos
c99747d7f2 Make using web components easier 2024-05-06 00:02:46 -04:00
KernelDeimos
3bf7737790 Add recovery codes 2024-05-06 00:02:46 -04:00
KernelDeimos
455d3946d6 Add checkboxes and cancel action for 2FA setup 2024-05-06 00:02:46 -04:00
KernelDeimos
2dfecb5287 Add 2fa setting and complete login flow 2024-05-06 00:02:46 -04:00
KernelDeimos
abc12bd407 Add otp input at login 2024-05-06 00:02:46 -04:00
Efendi
467aabe5ee
Update translations.js
Added ru
2024-05-05 00:09:52 +03:00
Efendi
4f73641f46
Add files via upload 2024-05-05 00:07:07 +03:00