Skip to content

Commit

Permalink
Fix Next Run (#69)
Browse files Browse the repository at this point in the history
* Fix web page tab title
* Make nextRun respect the browsers time zone
* Make nextRun value re-evaluate on hover
* Add push on pull request
  • Loading branch information
chriskinsman authored Feb 8, 2022
1 parent 6111999 commit e85ed7c
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 44 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
release:
types: [published, edited]
push:
branches: master
pull_request:
branches: master
# branches: master
# pull requests are broken when pushing to ghcr
# pull_request:
# branches: master
jobs:
buildx:
runs-on: ubuntu-latest
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ RUN apk update && apk upgrade && \
# ---- Dependencies ----
FROM tools AS dependencies
# install node packages
RUN cd /tilloo && npm ci --only=production && cd /tilloo/web/client && npm ci --only=production
RUN cd /tilloo && \
npm ci --only=production --ignore-scripts && \
cd /tilloo/web/client && \
npm ci --only=production --ignore-scripts

#
# ---- Build ----
FROM tools AS build
# build vue app
RUN cd /tilloo/web/client && \
npm ci --ignore-scripts

COPY web/client /tilloo/web/client
RUN cd /tilloo/web/client && \
npm ci && \
DOCKER_BUILD=true npm run build

#
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,4 @@ The author is [Chris Kinsman](https://github.com/chriskinsman)
[github-build-image]: https://img.shields.io/github/workflow/status/chriskinsman/tilloo/tilloo
[github-build-url]: https://github.com/chriskinsman/tilloo/actions?query=workflow%3Atilloo

t

27 changes: 1 addition & 26 deletions web/client/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
# client

## Project setup
```
npm install
```

### Compiles and hot-reloads for development
```
npm run serve
```

### Compiles and minifies for production
```
npm run build
```

### Lints and fixes files
```
npm run lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

A test of cache
# tilloo-web-client

## Updating packages

Expand Down
15 changes: 9 additions & 6 deletions web/client/src/views/Jobs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@
<template v-slot:item.schedule="{ item }">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<span v-bind="attrs" v-on="on">{{ item.schedule }} </span>
<span v-bind="attrs" v-on="on" @mouseover="calculateNextRun(item)"
>{{ item.schedule }}
</span>
</template>
<span
>Runs: {{ friendlyCron(item.schedule) }}<br />Next run:
{{ nextRun(item.schedule, item.lastRanAt) | formatDate }}</span
{{ item.nextRun | formatDate }}</span
>
</v-tooltip>
</template>
Expand Down Expand Up @@ -168,18 +170,19 @@ export default {
friendlyCron(schedule) {
return cronstrue.toString(schedule);
},
nextRun(schedule, lastRanAt) {
calculateNextRun(item) {
const job = new CronJob(
schedule,
item.schedule,
() => {
// used so that this invalidates and updates each time lastRanAt changes
this.lastRanAt = lastRanAt;
this.lastRanAt = item.lastRanAt;
return;
},
null,
true
);
return job.nextDates(1)[0];
this.$set(item, "nextRun", job.nextDates(1)[0]?.local());
},
},
sockets: {
Expand Down
4 changes: 2 additions & 2 deletions web/client/src/views/Run.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<template>
<v-container :fluid="true">
<v-icon :disabled="stopDisabled" @click="jobStop()" title="Stop Job">
<v-icon :disabled="stopDisabled" title="Stop Job" @click="jobStop()">
mdi-stop
</v-icon>
<v-icon
:disabled="downloadDisabled"
@click="downloadLog()"
title="Download Log"
@click="downloadLog()"
>
mdi-download
</v-icon>
Expand Down
16 changes: 12 additions & 4 deletions web/client/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Hack to allow container build without server pieces
const configureAPI = process.env.DOCKER_BUILD
? {
before: () => {
return;
},
}
before: () => {
return;
},
}
: require("../server/configure");

module.exports = {
Expand All @@ -19,5 +19,13 @@ module.exports = {
},
},
},
chainWebpack: config => {
config
.plugin('html')
.tap(args => {
args[0].title = "Tilloo";
return args;
})
},
transpileDependencies: ["vuetify"],
};

0 comments on commit e85ed7c

Please sign in to comment.