Skip to content

Commit

Permalink
Docker support and IISH specific updates and changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kerim1 committed Mar 20, 2024
1 parent 5b5a457 commit 9e42851
Show file tree
Hide file tree
Showing 21 changed files with 1,028 additions and 154 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ typings
#################

.idea
*.iml

#################
## Node
Expand Down Expand Up @@ -49,7 +50,6 @@ node_modules
!jest.setup.js
src/extensions/*/lib/*.js
!src/extensions/*/lib/*.proxy.js
!src/extensions/*/config.js

#################
## Misc
Expand Down
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:lts-alpine AS builder

# Install tooling
RUN apk --no-cache add git python3 make build-base

# Copy the application
RUN mkdir -p /app
COPY . /app
WORKDIR /app

# Install the application dependencies and build the application
RUN npm install
RUN npm run build

# Create the actual image
FROM nginx:stable-alpine

# Copy the build
COPY --from=builder /app/entrypoint.sh /opt/entrypoint.sh
COPY --from=builder /app/dist /usr/share/nginx/html
WORKDIR /usr/share/nginx/html

# Run web server
ENTRYPOINT ["/opt/entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
9 changes: 9 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

mv /usr/share/nginx/html/default.html /usr/share/nginx/html/index.html

case "$UV_PROFILE" in
"iish") mv /usr/share/nginx/html/iish.css /usr/share/nginx/html/default.css ;;
esac

exec "/docker-entrypoint.sh" "$@"
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions src/content-handlers/iiif/IIIFContentHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,16 @@ export default class IIIFContentHandler extends BaseContentHandler<IIIFData>
}
}

// if using uv-av-extension and there is no structure, fall back to uv-mediaelement-extension
const hasRanges: boolean = helper.getRanges().length > 0;

if (extension!.type === Extension.AV && !hasRanges) {
extension = await that._getExtensionByType(
Extension.MEDIAELEMENT,
format
);
}
// TODO: No fallback to the mediaelement extension
// if using uv-av-extension and there is no structure, fall back to uv-mediaelement-extension
// const hasRanges: boolean = helper.getRanges().length > 0;
//
// if (extension!.type === Extension.AV && !hasRanges) {
// extension = await that._getExtensionByType(
// Extension.MEDIAELEMENT,
// format
// );
// }

// if there still isn't a matching extension, use the default extension.
if (!extension) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { MoreInfoRightPanel } from "../../modules/uv-moreinforightpanel-module/M
import { SettingsDialogue } from "./SettingsDialogue";
import { ShareDialogue } from "./ShareDialogue";
import { IIIFResourceType } from "@iiif/vocabulary/dist-commonjs/";
import { Bools, Strings } from "@edsilv/utils";
import { Strings} from "@edsilv/utils";
import { Thumb, TreeNode, Range } from "manifesto.js";
import "./theme/theme.less";
import defaultConfig from "./config/config.json";
Expand Down Expand Up @@ -142,7 +142,14 @@ export default class Extension extends BaseExtension<Config>
}

isLeftPanelEnabled(): boolean {
return Bools.getBool(this.data.config!.options.leftPanelEnabled, true);
let isEnabled: boolean = super.isLeftPanelEnabled();
const tree: TreeNode | null = this.helper.getTree();

if (tree && tree.nodes.length) {
isEnabled = true;
}

return isEnabled;
}

render(): void {
Expand Down
Loading

0 comments on commit 9e42851

Please sign in to comment.