cockpit-project / cockpit-files Goto Github PK
View Code? Open in Web Editor NEWA Featureful File Browser for Cockpit (Modernized and tested version of https://github.com/45Drives/cockpit-navigator)
License: GNU Lesser General Public License v2.1
A Featureful File Browser for Cockpit (Modernized and tested version of https://github.com/45Drives/cockpit-navigator)
License: GNU Lesser General Public License v2.1
Instead of using flex, we may want to implement the grid using CSS grid, so we can have equidistant spacing and have items wrap as expected. (Using flex would mean that all items would have equidistant spacing if we changed the spacing model.) Additionally, we should be using gap, not margin, to space out items. We could also have no gap/margin, but there's probably some value in having some gutter space to deselect an item (and perhaps add canvas-style selection later on).
For example, something like this would change the spacing to rely on a grid. (We'd want to refactor it to adapt to this kind of layout, not override the PF React "Flex" as this would do. Note: PatternFly's "Grid" layout is not CSS grid; it's mainly a 12-cell design grid like Bootstrap uses, not a CSS grid as I'm suggesting here. That said, the PF Grid layout for "smart (reponsive)" may work as a basis for this... but it does a bunch of nonsense things that might also get in the way).
#folder-view {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
justify-items: baseline;
}
.file-item,
.directory-item {
margin: 0;
}
They UI support < and > buttons. These are supposed to be navigation in history. See gnome file navigation App for understanding the expected functionality.
Introduce a file viewer for code files (like plaintext, but with syntax highlighting)
Bonus item: (can be split into new issue if hard) edit text files?
Use https://www.patternfly.org/v4/components/code-editor
I wonder if this should be more explicit and be renamed to Create symlink
. Create link
makes me think it generates a link to that directory/file which I could share although share link
is more logical.
This is from the old implementation:
This is the suggested new mockup https://photos.app.goo.gl/cwoFBp4fh5HYsCTcA
By using the watch API any changes on the filesystem contents will trigger events, which we can use to refresh the file list.
Introduce a 'Delete' action on the top right corner of the 'Directory'file details' panel.
Let's say we have the following structure:
[kkoukiou@sequioa test]$ tree
.
└── codeforces
└── codeforces
2 directories, 1 file
The outer one is obviously directory and the inner one is file.
When navigating from the parent folder into the outer 'codeforces' directory, the sidebar shows the file info instead.
In smaller screens (~1300px) the sidebar jumps quite a bit and shifts the files grid. Sometimes changing from 4 columns to 3 columns while clicking on a file/folder. I've accidentally opened the wrong directory many times because of folders jumping around.
Modals that have one input element only, should have this focused on oppening and Enter should submit the modal.
Whenever I click on some files, the UI crashes. I'm not sure what is in common with the files yet.
I've seen it happen with JSON files, txt files, JPGs, etc.
I have two users aside from root on my machine, test and kkoukiou.
[kkoukiou@sequioa cockpit-navigator-new]$ sudo ls -l /home/
total 28
drwx--x--x+ 76 kkoukiou kkoukiou 4096 Jul 7 08:04 kkoukiou
drwx------. 2 root root 16384 Nov 1 2016 lost+found
drwx------. 9 1002 1006 4096 Jan 12 18:20 test
[kkoukiou@sequioa cockpit-navigator-new]$ sudo ls -l /home/test
total 4
drwxr-xr-x. 21 1002 1006 4096 Jan 12 17:57 cockpit
When clicking on 'test' it does not navigate inside the directory we get in the following state:
TO be discussed if this going to be hidden when connected from localhost.
NODE_ENV= ./build.js
13:27:54: Build finished in 3924 ms
One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.
babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.
And we should allow some file operations like 'Delete' on the selection.
control-click to toggle the item as part of the selection; shift-click to make a range between last clicked and current item being shift-clicked; rubber banding, which might be difficult
Here's some example SCSS which adds in a selected state (based on a selected
class; which needs to be added could be called something else) and retools the hover state to be similar to the selected state, using CSS custom properties ("variables"). To not interrupt flow, it uses not just background, but a box shadow and an outline (with an offset) to make the selected look expand outside of its bounding box a bit.
.file-item,
.directory-item {
&.selected,
&:hover {
background: var(--item-background, transparent);
border-radius: 1px;
box-shadow: 0 0 0 10px var(--item-background, transparent);
outline-offset: 10px;
outline: 1px solid var(--item-outline, transparent);
}
&.selected {
--item-background: var(--pf-global--palette--blue-50);
--item-outline: var(--pf-global--palette--blue-50);
}
&:hover {
--item-background: var(--pf-global--BackgroundColor--200);
--item-outline: var(--pf-global--BackgroundColor--200);
}
}
Mockups on what it should approximately look like (these are not pixel or color perfect; the code above should be similar, but not exactly like this):
Selected:
Hover:
Thiis should be available through the kebab actions menu and also the context menu.
Get inspiration from Nautilus for that.
We need to either speed up the initial directory listing, or show a spinner.
SImiliar to gnome's filenavigator. Grid or list view.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.