-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alt Import method #1
Comments
You want to run what on your Android device? The reason I use drag and drop is that web applications can only access files that the user "actively provides". Usually this happens by dragging them into the web browser. The only alternative is an HTML file form element, which will open a system dialog that allows the user to select a file. However, the issue is that this UI element looks different on every platform and cannot be styled by CSS, so I really don't want to have it visible in the application. There might be a workaround of using a hidden HTML file form element and triggering events on it via JavaScript, but I'd have to look into how easy / difficult this would be to implement in this context. |
Running my services on a headless raspberry pi and access them over my phone. |
This is already possible, effectively, by uploading the file via "curl" when the server is running. The only problem is that you need a session token and that's difficult to obtain without using the UI, since you have to complete a challenge-response based authentication to obtain it. Script to upload would look like this.
With "command line option" you mean an import as a "one-off operation" when the server is not running? (Like we have it for setting up user accounts, etc.) So you'd first create all your users, then do all your imports and then run the server? |
So basically, we have two possibilities to implement this, if we actually want to integrate it into location-visualizer. location-visualizer has "offline" operations, so to say, which can be performed from the command line when the actual server does not run. These are the ones for user account management (creating, deleting accounts, setting credentials, giving / revoking permissions, etc.). EDIT: Well and importing and exporting tiles are also "offline operations". And it has "online" operations, such as uploading geo data, which can be performed from the web interface when the actual server runs. Now uploading geo data is already available as an "online" operation (meaning there has to be a running server already). But you can effectively only do it from within the web interface. You could do it via Now what we could do is implement a command line option where you run I'm just brainstorming how to implement this with the least technical hassle and the least confusion to the user possible. I think providing a "CLI client" that can upload files is the right way to go (better than the "offline" / "one-off" option), since we already have the import as an "online" (= with server process running) operation and that CLI client would make use of it. But yeah, it is somewhat a change in scope. And it would not be that easy to script since two processes (server and client) would be running in parallel. But if you keep the server running all the time and then do a second SSH session and there run the client to perform the import, that would probably be the right way to do it. Just brainstorming, so far. What are your thoughts on it? |
The script method looks fine . Can't see any hint in the ui. What I meant by command line option is similar to what you described with the curl script . e.g. |
Yes, I understand. But I'd like to go into detail once more about what I meant. Currently, However, these "one-off" operations shall only be performed when the server does not run. The reason is that they will, of course, run another process (independant of the server process - if there is one), do its thing, and shut down. So if the server were running while we also execute one of these commands, we'd have two processes (the server process and the one executing the "one-off" command) running in parallel, accessing the same database files (geographical database, user database, tile database) - each with their own file handles and "database drivers" - which is not what's supposed to happen and may lead to undefined behaviour, like the other process not getting notified of changes (as is the case for changes to user accounts, since these are only loaded once at startup), or even file corruption (which might happen, for example, when tiles are imported while the server is running - since the server will also have the tile database open and access it - and now another process, that the server is not aware of - comes along and changes the file "under the hood" - not good - will lead to desaster, in this case database corruption). So the question is, do you want to import geo data before you start the server, or do you want to import geo data while the server is running. I assume the latter. It also fits better to what the UI is currently doing and we may use the same API, which means it will be "cleaner" to code. Therefore, the import has to be a remote operation. You understand the difference? My assumption is that the The difference is important in certain scenarios, for example when scripting things. For example, if the import were a "one-off" operation (server not running) how you would script things would be to import first and then, after the import is done, run the server. However, I think this is not a good idea. You probably want to keep the server running in the background at all times and then occasionally do imports. Then it has to be a remote operation, because we must not have two processes having the database open at the same time. This will take some time to implement, but I agree that this would be cool to have. But please confirm again that this is actually the thing you envision. So your assumption when you do the import is that the server always runs, right? It's not an "offline" (no server running) import that you want to do. Cause these would be fundamentally different to implement. But my assumption is that "online" (server running) import is the better way to do it. |
Personally I don't mind stopping the server and do the one-off import or run a second instance for the purpose . Most users might use the app on a desktop environment so this solution is for edge cases like remote phone clients as.my self. If you are interested to add an alternative import to this project I'll be happy to whatever is easier to maintain and makes sense for you the developer . Thanks for the detailed explanation of how the import mechanism might work . Thanks for this software . And Merry Christmas :-) |
Would like to browse to run the re mm ote server on my android device .
Can drag and drop obviously using an android device.
An upload button is needed in this case
The text was updated successfully, but these errors were encountered: