Skip to content

Commit e85ed7c

Browse files
authored
Fix Next Run (#69)
* Fix web page tab title * Make nextRun respect the browsers time zone * Make nextRun value re-evaluate on hover * Add push on pull request
1 parent 6111999 commit e85ed7c

7 files changed

Lines changed: 36 additions & 44 deletions

File tree

.github/workflows/dockerimage.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on:
44
release:
55
types: [published, edited]
66
push:
7-
branches: master
8-
pull_request:
9-
branches: master
7+
# branches: master
8+
# pull requests are broken when pushing to ghcr
9+
# pull_request:
10+
# branches: master
1011
jobs:
1112
buildx:
1213
runs-on: ubuntu-latest

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,20 @@ RUN apk update && apk upgrade && \
1515
# ---- Dependencies ----
1616
FROM tools AS dependencies
1717
# install node packages
18-
RUN cd /tilloo && npm ci --only=production && cd /tilloo/web/client && npm ci --only=production
18+
RUN cd /tilloo && \
19+
npm ci --only=production --ignore-scripts && \
20+
cd /tilloo/web/client && \
21+
npm ci --only=production --ignore-scripts
1922

2023
#
2124
# ---- Build ----
2225
FROM tools AS build
2326
# build vue app
27+
RUN cd /tilloo/web/client && \
28+
npm ci --ignore-scripts
29+
2430
COPY web/client /tilloo/web/client
2531
RUN cd /tilloo/web/client && \
26-
npm ci && \
2732
DOCKER_BUILD=true npm run build
2833

2934
#

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,4 @@ The author is [Chris Kinsman](https://github.com/chriskinsman)
214214
[github-build-image]: https://img.shields.io/github/workflow/status/chriskinsman/tilloo/tilloo
215215
[github-build-url]: https://github.com/chriskinsman/tilloo/actions?query=workflow%3Atilloo
216216

217-
t
217+

web/client/README.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,4 @@
1-
# client
2-
3-
## Project setup
4-
```
5-
npm install
6-
```
7-
8-
### Compiles and hot-reloads for development
9-
```
10-
npm run serve
11-
```
12-
13-
### Compiles and minifies for production
14-
```
15-
npm run build
16-
```
17-
18-
### Lints and fixes files
19-
```
20-
npm run lint
21-
```
22-
23-
### Customize configuration
24-
See [Configuration Reference](https://cli.vuejs.org/config/).
25-
26-
A test of cache
1+
# tilloo-web-client
272

283
## Updating packages
294

web/client/src/views/Jobs.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@
4747
<template v-slot:item.schedule="{ item }">
4848
<v-tooltip top>
4949
<template v-slot:activator="{ on, attrs }">
50-
<span v-bind="attrs" v-on="on">{{ item.schedule }} </span>
50+
<span v-bind="attrs" v-on="on" @mouseover="calculateNextRun(item)"
51+
>{{ item.schedule }}
52+
</span>
5153
</template>
5254
<span
5355
>Runs: {{ friendlyCron(item.schedule) }}<br />Next run:
54-
{{ nextRun(item.schedule, item.lastRanAt) | formatDate }}</span
56+
{{ item.nextRun | formatDate }}</span
5557
>
5658
</v-tooltip>
5759
</template>
@@ -168,18 +170,19 @@ export default {
168170
friendlyCron(schedule) {
169171
return cronstrue.toString(schedule);
170172
},
171-
nextRun(schedule, lastRanAt) {
173+
calculateNextRun(item) {
172174
const job = new CronJob(
173-
schedule,
175+
item.schedule,
174176
() => {
175177
// used so that this invalidates and updates each time lastRanAt changes
176-
this.lastRanAt = lastRanAt;
178+
this.lastRanAt = item.lastRanAt;
177179
return;
178180
},
179181
null,
180182
true
181183
);
182-
return job.nextDates(1)[0];
184+
185+
this.$set(item, "nextRun", job.nextDates(1)[0]?.local());
183186
},
184187
},
185188
sockets: {

web/client/src/views/Run.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<template>
22
<v-container :fluid="true">
3-
<v-icon :disabled="stopDisabled" @click="jobStop()" title="Stop Job">
3+
<v-icon :disabled="stopDisabled" title="Stop Job" @click="jobStop()">
44
mdi-stop
55
</v-icon>
66
<v-icon
77
:disabled="downloadDisabled"
8-
@click="downloadLog()"
98
title="Download Log"
9+
@click="downloadLog()"
1010
>
1111
mdi-download
1212
</v-icon>

web/client/vue.config.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Hack to allow container build without server pieces
22
const configureAPI = process.env.DOCKER_BUILD
33
? {
4-
before: () => {
5-
return;
6-
},
7-
}
4+
before: () => {
5+
return;
6+
},
7+
}
88
: require("../server/configure");
99

1010
module.exports = {
@@ -19,5 +19,13 @@ module.exports = {
1919
},
2020
},
2121
},
22+
chainWebpack: config => {
23+
config
24+
.plugin('html')
25+
.tap(args => {
26+
args[0].title = "Tilloo";
27+
return args;
28+
})
29+
},
2230
transpileDependencies: ["vuetify"],
2331
};

0 commit comments

Comments
 (0)