Skip to content

Commit

Permalink
feat: sync plugin directly from table
Browse files Browse the repository at this point in the history
  • Loading branch information
henrychoy committed Feb 13, 2025
1 parent e169227 commit 0800ef7
Showing 1 changed file with 39 additions and 13 deletions.
52 changes: 39 additions & 13 deletions src/frontend/src/views/EntryPointsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,39 @@
<CodeEditor v-model="row.taskGraph" language="yaml" :readOnly="true" />
</template>
<template #body-cell-plugins="props">
<q-chip
<span
v-for="(plugin, i) in props.row.plugins"
:key="i"
color="secondary"
text-color="white"
clickable
@click.stop="editEntrypoint = props.row; showAssignPluginsDialog = true"
>
{{ plugin.name }}
<q-badge
v-if="!plugin.latestSnapshot"
<q-chip
color="secondary"
text-color="white"
clickable
@click.stop="editEntrypoint = props.row; showAssignPluginsDialog = true"
>
{{ plugin.name }}
<q-badge
v-if="!plugin.latestSnapshot"
color="red"
label="outdated"
rounded
class="q-ml-xs"
/>
</q-chip>
<q-btn
v-if="!plugin.latestSnapshot"
round
color="red"
label="outdated"
rounded
class="q-ml-xs"
/>
</q-chip>
icon="sync"
size="sm"
@click.stop="syncPlugin(props.row.id, plugin.id, plugin.name)"
class="q-mr-md"
>
<q-tooltip>
Sync to latest version of plugin
</q-tooltip>
</q-btn>
</span>
<q-btn
round
size="sm"
Expand Down Expand Up @@ -150,4 +166,14 @@
const editObjTags = ref({})
const showTagsDialog = ref(false)
async function syncPlugin(entrypointId, pluginId, pluginName) {
try {
await api.addPluginsToEntrypoint(entrypointId, [pluginId])
tableRef.value.refreshTable()
notify.success(`Successfully updated plugin '${pluginName}' to latest version`)
} catch(err) {
console.warn(err)
}
}
</script>

0 comments on commit 0800ef7

Please sign in to comment.