mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Fixing stl file mimetype.
This commit is contained in:
parent
54709c268c
commit
977f42529f
4 changed files with 21 additions and 17 deletions
|
|
@ -18,7 +18,7 @@ function timeoutPromise(ms, promise) {
|
|||
})
|
||||
}
|
||||
|
||||
async function apiCall(url, method, body, ms = 20000) {
|
||||
async function apiCall(url, method, body, ms = 60_000) {
|
||||
let init = {method};
|
||||
if (body !== undefined) {
|
||||
init.body = JSON.stringify(body);
|
||||
|
|
|
|||
|
|
@ -639,6 +639,8 @@ export function FileIcon({file, disabled = true, size = 'huge', ...props}) {
|
|||
props['name'] = 'book';
|
||||
} else if (mimetype.startsWith('text/vtt') || mimetype.startsWith('text/srt')) {
|
||||
props['name'] = 'closed captioning';
|
||||
} else if (mimetype.startsWith('application/x-openscad') || mimetype.startsWith('model/stl')) {
|
||||
props['name'] = 'cube';
|
||||
} else if (mimetype.startsWith('application/x-dosexec') || mimetype.startsWith('application/x-msi')) {
|
||||
props['name'] = 'microsoft';
|
||||
} else if (mimetype.startsWith('application/octet-stream')) {
|
||||
|
|
|
|||
|
|
@ -5,15 +5,19 @@ import {Media, StatusContext, ThemeContext} from "../contexts/contexts";
|
|||
import Icon from "semantic-ui-react/dist/commonjs/elements/Icon";
|
||||
import {DarkModeToggle, HotspotStatusIcon, NAME} from "./Common";
|
||||
|
||||
const links = [{text: 'Videos', to: '/videos', key: 'videos'}, {
|
||||
text: 'Archive', to: '/archive', key: 'archive'
|
||||
}, {text: 'Map', to: '/map', key: 'map'}, {text: 'Files', to: '/files', key: 'files'}, {
|
||||
text: 'Inventory', to: '/inventory', key: 'inventory'
|
||||
}, {
|
||||
key: 'more', text: 'More', links: [{to: '/more/otp', text: 'One Time Pad', end: true}, {
|
||||
to: '/more/statistics', text: 'Statistics', end: true
|
||||
},]
|
||||
},];
|
||||
const links = [
|
||||
{text: 'Videos', to: '/videos', key: 'videos'},
|
||||
{text: 'Archive', to: '/archive', key: 'archive'},
|
||||
{text: 'Map', to: '/map', key: 'map'},
|
||||
{text: 'Files', to: '/files', key: 'files'},
|
||||
{text: 'Inventory', to: '/inventory', key: 'inventory'},
|
||||
{text: 'More', key: 'more',
|
||||
links: [
|
||||
{to: '/more/otp', text: 'One Time Pad', end: true},
|
||||
{to: '/more/statistics', text: 'Statistics', end: true},
|
||||
]
|
||||
},
|
||||
];
|
||||
const admin = {to: '/admin', text: 'Admin', key: 'admin'};
|
||||
const rightLinks = [admin,];
|
||||
|
||||
|
|
@ -29,19 +33,17 @@ function DropdownLinks({link}) {
|
|||
|
||||
function MenuLink({link}) {
|
||||
// Wrapper around NavLink to handle Navlink/Dropdown change.
|
||||
let classes = 'item';
|
||||
|
||||
if (!link.links) {
|
||||
if (link.links) {
|
||||
return <DropdownLinks link={link}/>
|
||||
} else {
|
||||
const end = link.end ? {end: true} : {end: undefined};
|
||||
return <NavLink
|
||||
className={classes}
|
||||
className='item'
|
||||
to={link.to}
|
||||
{...end}
|
||||
>
|
||||
{link.text}
|
||||
</NavLink>
|
||||
} else {
|
||||
return <DropdownLinks link={link}/>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ def _mimetype_suffix_map(path: Path, mimetype: str):
|
|||
if suffix.endswith('.html') or suffix.endswith('.htm'):
|
||||
return 'text/html'
|
||||
if suffix.endswith('.stl'):
|
||||
return 'application/sta'
|
||||
return 'model/stl'
|
||||
if suffix.endswith('.scad'):
|
||||
return 'application/x-openscad'
|
||||
if suffix.endswith('.js'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue