-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Improve admin webui #112
Improve admin webui #112
Conversation
- add formatters to remove milliseconds on dates - add column labels to be used with filters - add new filters for version and build views
@hgy59, I was inspired by the work you did on #111 and had submitted some improvements for the admin screens. This mostly treats with labels on columns and filters, addition of new filters and fixing of date formatting. I had a thought to fix the screenshot management as well but I couldn't make heads or tails of the code. Essentially, I think that the edit function is redundant since you can only really delete the file there. This is problematic since it throws an SQL exception as follows:
After the file is deleted you are left with a blank screenshot like this (second entry): From there you can just delete the row. If you delete the row independently, the file isn't deleted. As such, I am proposing that we remove the edit screen altogether and add the delete function to the row deletion code. EDIT: I found a simple solution in the Flask-Admin docs and the example code for image uploader was useful. |
- remove edit function - fix file removal with row deletion
@publicarray @hgy59, this PR should be good to merge. Let me know if there are any improvements you would recommend. |
bbe6210
to
bb2e8c5
Compare
- add service view to admin interface - add service check on package upload
bb2e8c5
to
ec69e1e
Compare
@Diaoul, I was looking at the backend code as well as the database and saw that there is a field in the database I do however see that is is created as part of the test suite: spkrepo/spkrepo/tests/common.py Lines 281 to 286 in ec69e1e
Should code similar to the above be incorporated into the EDIT: I've included a proposed solution in 688bcfd, let me know what you think. |
Good catch! It's been like that forever 😅 |
I've tested the upload and it writes a hash value to the database which I've verified to be correct. I was trying to check the sign and unsign functions but I don't think I have my environment setup correctly. From the base EDIT: So I ran all the verification tests again and I got this error:
So then I changed it to
So, I'm not sure where to go next. Is the default value no longer valid: |
This should be a GNUPGHOME directory, not Any directory would work but please create a new one. Maybe you need to create a private/public key pair I don't remember. I'd need to check the configuration on the server 🙇 |
- add a functions to get md5 hash in build model and spk - use function in build model when uploading build - use function in spk when signing/unsigning spk
688bcfd
to
bd613dc
Compare
Thanks for that. I eventually used the default folder at
While creating a private/public key pair was a useful step, this was not the root cause of the issue. The
Once those steps were completed I was able to sign and unsign packages successfully. Through this, I fixed an error with updating the md5 hash for the sign/unsign and the commit was updated. Testing looks good so far. |
Probably a bit out of topic but out of curiosity, using this, are you able to unsign an official Synology package as well, thus allowing to untar afterwards? |
Alas, no. The official packages are likely encoded or encrypted in some way to prevent simple untar operations. If I am curious about a package (to learn from its wizard files for example), the most I would do is to install it and then look at the package files installed in |
9c56f77
to
2349b5d
Compare
- TODOs in `spkrepo/views/admin.py` addressed in #112
aa4ea03
to
b81d71b
Compare
@mreid-tt what is the reason to enlarge the version field?
I guess you are about to implement the feature to avoid delivering DSM 6 packages for DSM 7 requests? |
Currently the field was of length 3 characters. I expect that this will cause a problem after Synology moves from version 9.9 to version 10.0.
Yes, I've made a basic implementation in e2b7f29 which works as follows:
@hgy59, @publicarray, let me know your thoughts on this solution to #63. EDIT: It's a bit clunky because if you choose to set a minimum version, you'll need to set it for every firmware with the same version number but it works! |
b81d71b
to
3fcd731
Compare
- Add type column to Firmware table - Increase length of version column - Filter by type for closest firmware when getting catalog - Update populate_db with firmware type
94ddfed
to
ad1cf17
Compare
good idea, |
I've implemented the idea, let me know your thoughts.
I do still think we need a type which is clearer for the administrator to understand. What I can do as a creature comfort would be to tweak the admin interface to make that a dropdown selector rather than typing it in. EDIT: Changed my mind on that last bit. Seems overly complex to implement and maintain. EDIT: Added some input validation with regex to help keep our database clean. |
@Diaoul, @publicarray, could you please take a moment to review and approve this? I'm excited to move forward and get these into production. Your feedback is greatly appreciated. |
@Diaoul, @publicarray, could either of you find a moment to review and approve this? There have been increasing reports on Discord regarding users encountering difficulties downloading incorrect packages from the catalog. |
@Diaoul, @publicarray, I've noticed an increase in support requests on Discord due to the backend displaying the wrong package for download. Could you please prioritise the review and merging of this PR? It's urgent. |
Thanks I hope to have some time this weekend to look into deploying this pr |
Really appreciate it! If you have time it would be great if you can include a review and merge of #111 as this also includes a number of important fixes. |
Nice work! Running
I'll have a look what happened here. |
'NoneType' object has no attribute 'strftime' BaseModelView.index_view() got an unexpected keyword argument 'cls' Flask-SQLAlchemy uses a custom formatter to handle date formatting when displaying data in the templates. It dosn't support overriding the value.
At first, I got this So I imported datetime until I realised, you would get this error when modifying the confirmed_at value as it's not a string but a custom object from Flask-SQLAlchemy:
|
@publicarray, I'm thinking that the
|
Thanks @mreid-tt that fixed it! |
@publicarray, I've re-committed the change. Let me know if there is anything else I can assist with to get this PR merged. |
I've tried uploading a package freshly compiled from spkrepo am I missing something?
|
Hmm, I don't think I modified any of the conflict testing code. Could this be an actual conflict and there is really a |
I tried again with 7.2 and that worked. Yea it probably already existed, sorry |
I think it's all good :) |
@mreid-tt It's live I did notice this in the logfile when I login. Doesn't seem important but maybe there is an update for passlib?
|
Thanks @publicarray, this is great!
Looking into this it seems that |
As a follow-up, I have worked with @publicarray and we have removed the following firmware entries from the database:
These were removed as they did not align with the published versions of DSM (https://www.synology.com/en-global/releaseNote/DSM) or SRM (https://www.synology.com/en-global/releaseNote/SRM). |
Some admin web ui improvements
fix date formatting as well as labels for columns and filters
fix screenshot management
fix architecture management
Other admin improvements
fix app configuration (leftover from refactor #102)
fix handling of new service dependencies (fixes #39)
fix maintenance of md5 hashes
add major_version check (fixes #63)
other/environment fixes