Skip to content

Commit 71549b0

Browse files
committed
Added helpers for Dockerfile.
1 parent bc1ffb4 commit 71549b0

4 files changed

Lines changed: 21 additions & 5 deletions

File tree

app.bundle

Lines changed: 3 additions & 2 deletions
Large diffs are not rendered by default.

public/js/ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5625,7 +5625,7 @@ COMPONENT('statusform', function(self, config) {
56255625
};
56265626

56275627
self.submit = function(){
5628-
EXEC(config.exec, input.parent().attrd('name'), input.val().toLowerCase().replace(/[^+a-z0-9./\-_]/gi, ''), formtype);
5628+
EXEC(config.exec, input.parent().attrd('name'), input.val().replace(/[^+a-z0-9./\-_]/gi, ''), formtype);
56295629
};
56305630

56315631
self.val = function(value, type, submit) {

public/parts/code.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,10 +929,13 @@
929929

930930
items.push({ name: '@(Toggle ruler)', icon: 'arrows-v', value: 'toggleruler' });
931931

932-
if ((/js|json|html|todo|api|txt|versions|sitemap/).test(code.current.ext)) {
932+
if ((/js|json|html|todo|api|txt|versions|sitemap/).test(code.current.ext) || code.current.name === 'Dockerfile') {
933933

934934
sub = [];
935-
if (code.current.path.substring(0, 9) === '/scripts/' && code.current.ext === 'js') {
935+
936+
if (code.current.name === 'Dockerfile') {
937+
sub.push({ name: '@(Dockerfile)', icon: 'docker', value: 'template', id: 'dockerfile' });
938+
} else if (code.current.path.substring(0, 9) === '/scripts/' && code.current.ext === 'js') {
936939
sub.push({ name: '@(Script)', icon: 'code', value: 'template', id: 'script' });
937940
} else if (code.current.ext === 'js') {
938941
sub.push({ name: '@(Controller)', icon: 'code', value: 'template', id: 'controller' });
@@ -3558,6 +3561,9 @@
35583561
if (!files.config)
35593562
opt.items.push({ name: '<strong>@(Create):</strong> /config', icon: '!ti ti-file', value: '/config' });
35603563

3564+
if (!files.config)
3565+
opt.items.push({ name: '<strong>@(Create):</strong> /Dockefile', icon: '!ti ti-file', value: '/Dockerfile' });
3566+
35613567
if (!files['index.js'])
35623568
opt.items.push({ name: '<strong>@(Create):</strong> /index.js', icon: '!ti ti-file', value: '/index.js' });
35633569

public/templates/dockerfile.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Targeted for Total.js Code Editor
2+
3+
FROM node:20-alpine
4+
RUN apk update && apk add bash && apk add zip && apk add unzip && apk add tar && apk add graphicsmagick
5+
6+
WORKDIR /www
7+
8+
EXPOSE 8000
9+
CMD [ "/bin/bash", "-c", "mkdir -p logs;npm i;npm start > logs/debug.log" ]

0 commit comments

Comments
 (0)