Skip to content

Commit

Permalink
merge master and fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
zhen0 committed Sep 25, 2020
2 parents 3cf2b14 + 4f1103d commit 4cbe5c8
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 26 deletions.
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
VUE_APP_AUTH0_DOMAIN=login.prefect.io
VUE_APP_AUTH0_PUBLIC_CLIENT_ID=z8iBknuNYsEHh61it7ihD5EVvMsG9920
VUE_APP_BASE_URL=http://localhost:8080
VUE_APP_SERVER_URL=http://localhost:4200/graphql
VUE_APP_CLOUD_URL=https://api.prefect.io/graphql
VUE_APP_STRIPE_PUBLIC_TOKEN=pk_live_Yiko9dHXtDNGaxJuEQ2ftaga000VDDoS1v
Expand Down
26 changes: 17 additions & 9 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,29 @@
### Features and Improvements

- Add Vuex user store unit tests and add circleci job to run unit tests on PR [#245](https://github.com/PrefectHQ/ui/pull/245)

### Bugfixes

- None

## 2020-09-24

### Bugfixes

- Fix `delete_agent` mutation `agentId` type [#253](https://github.com/PrefectHQ/ui/pull/253)
- Add 24 hour clock to the logs row [#247](https://github.com/PrefectHQ/ui/pull/247)

## 2020-09-23

### Features and Improvements

- Show version group id on the flow details tile[#236](https://github.com/PrefectHQ/ui/pull/236)
- Add a check for flow and agent label alignment and alert if mis-matched [#217](https://github.com/PrefectHQ/ui/pull/217)
- Add unit tests for tenant store [#195](https://github.com/PrefectHQ/ui/pull/195)
- Improves error handling related to garbage collection - [#232](https://github.com/PrefectHQ/ui/pull/232)
- Improves component teardown by accounting for elements whose destroyed method had been called but that hadn't been removed from the DOM due to transitions - [#232](https://github.com/PrefectHQ/ui/pull/232)
- Improve navigation experience when going forward/backward in the browser history - [#232](https://github.com/PrefectHQ/ui/pull/232)
- None

### Bugfixes

- None
- Improve the usability of apollo endpoint setting - [#241](https://github.com/PrefectHQ/ui/pull/241)

## 2020-09-17

Expand Down Expand Up @@ -161,10 +173,6 @@

- Update connection icon if Cloud is in maintenance mode - [#155](https://github.com/PrefectHQ/ui/pull/155)

### Bugfixes

- None

## 2020-08-25

### Features and Improvements
Expand Down
4 changes: 1 addition & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@
<script>
;(async () => {
try {
window.prefect_ui_settings = await fetch(
`${process.env.VUE_APP_BASE_URL}/settings.json`
)
window.prefect_ui_settings = await fetch('/settings.json')
.then(response => response.json())
.then(data => data)
} catch {
Expand Down
6 changes: 4 additions & 2 deletions src/components/LogsCard/LogRow.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<script>
import { formatTime } from '@/mixins/formatTimeMixin'
export default {
mixins: [formatTime],
props: {
index: {
type: Number,
Expand Down Expand Up @@ -109,10 +111,10 @@ export default {
<v-tooltip top>
<template v-slot:activator="{ on }">
<div class="log-datetime grey--text text--darken-1" v-on="on">
{{ log.time }}
{{ logTime(log.timestamp) }}
</div>
</template>
<span>{{ log.date }} at {{ log.time }}</span>
<span>{{ logDate(log.timestamp) }}</span>
</v-tooltip>
<div class="log-level d-flex align-center justify-start">
<v-icon :color="logLevelColor(log.level)" x-small>lens</v-icon>
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/Agent/delete-agent.gql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mutation DeleteAgent($agentId: String!) {
mutation DeleteAgent($agentId: UUID!) {
delete_agent(input: { agent_id: $agentId }) {
success
}
Expand Down
25 changes: 25 additions & 0 deletions src/mixins/formatTimeMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,31 @@ export const formatTime = {
: moment(timestamp).format('D MMM YYYY h:mma')
}`
},
formTime(timestamp) {
if (!timestamp) return
let timeObj = moment(timestamp).tz(this.timezone)
return `${
timeObj ? timeObj.format('hh:mma') : moment(timestamp).format('hh:mma')
}`
},
logTime(timestamp) {
if (!timestamp) return
let timeObj = moment(timestamp).tz(this.timezone)
return `${
timeObj
? timeObj.format('HH:mm:ss')
: moment(timestamp).format('HH:mm:ss')
}`
},
logDate(timestamp) {
if (!timestamp) return
let timeObj = moment(timestamp).tz(this.timezone)
return `${
timeObj
? timeObj.format('D MMMM YYYY h:mma')
: moment(timestamp).format('D MMMM YYYY h:mma')
}`
},
formatTime(timestamp) {
if (!timestamp) return
let timeObj = moment(timestamp).tz(this.timezone)
Expand Down
60 changes: 51 additions & 9 deletions src/pages/Home/StartPrefectServer-Section.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export default {
},
data() {
return {
defaultUrl:
window.prefect_ui_settings?.server_url ||
process.env.VUE_APP_SERVER_URL,
error: false,
loading: false,
success: false,
Expand All @@ -26,6 +29,17 @@ export default {
this.error = false
this.loading = false
},
async _resetUrl() {
localStorage.removeItem('server_url')
this.urlInput = this.defaultUrl
this.error = false
this.success = false
this.connected = false
this.setServerUrl(this.defaultUrl)
},
async _testUrl() {
this.success = false
this.error = false
Expand Down Expand Up @@ -114,18 +128,39 @@ export default {
@keyup="_handleKeyup"
>
<template v-slot:append>
<v-fade-transition mode="out-in">
<v-icon v-if="success" key="success" color="green">
check
</v-icon>
<v-icon v-else-if="error" key="error" color="error">
error
</v-icon>
</v-fade-transition>
<v-tooltip top>
<template v-slot:activator="{ on }">
<div class="mb-2">
<v-fade-transition mode="out-in">
<v-icon v-if="success" key="success" color="green">
check
</v-icon>
<v-icon v-else-if="error" key="error" color="error">
error
</v-icon>
</v-fade-transition>

<v-btn
color="blue-grey lighten-1"
icon
small
@click="_resetUrl"
v-on="on"
>
<v-icon key="reset" color="grey">
settings_backup_restore
</v-icon>
</v-btn>
</div>
</template>
<span>
Reset stored GraphQL endpoint
</span>
</v-tooltip>
</template>

<template v-slot:append-outer>
<div class="mt-n1">
<div>
<v-btn
color="primary"
dark
Expand Down Expand Up @@ -165,3 +200,10 @@ export default {
</ol>
</div>
</template>

<style lang="scss" scoped>
/* stylelint-disable-next-line */
.v-input__append-inner {
margin-top: 0 !important;
}
</style>
2 changes: 1 addition & 1 deletion src/store/auth0/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ const actions = {
auth0Client = await createAuth0Client({
domain: process.env.VUE_APP_AUTH0_DOMAIN,
client_id: process.env.VUE_APP_AUTH0_PUBLIC_CLIENT_ID,
redirect_uri: process.env.VUE_APP_BASE_URL,
redirect_uri: process.env.VUE_APP_BASE_URL || window.location.origin,
scope: 'openid email'
})
},
Expand Down

0 comments on commit 4cbe5c8

Please sign in to comment.