diff --git a/src/pages/ProductDetails.vue b/src/pages/ProductDetails.vue
index 287fdf45..a6030c27 100644
--- a/src/pages/ProductDetails.vue
+++ b/src/pages/ProductDetails.vue
@@ -2,8 +2,8 @@
-
-
+
+
@@ -26,16 +26,18 @@
-
-
Supported platforms:
-
- {{ platform.name }}
-
-
-
Team:
-
- {{ product.team.name }}
-
+
+
+
Supported platforms:
+
+ {{ platform.name }}
+
+
+ Team:
+
+ {{ product.team.name }}
+
+
@@ -97,6 +99,36 @@
+
+
+
+
+
+ {{ props.row.keyid }}
+ {{ props.row.name }}
+
+ {{ createdAt(props.row.inserted) }}
+
+
+ {{ props.row.public_url }}
+
+
+
+
+
+
+
+
+
@@ -131,7 +163,21 @@
-
+
+
+
+
+ Add sign key
+
+
+
@@ -142,13 +188,27 @@
+
+
+
+ Warning
+
+
+ Are you sure you want to create a new sign key for the product ?
+
+
+
+
+
+
+
Warning
- Are you sure you want to delete the product ?
+ Are you sure you want to delete the product ?
@@ -183,9 +243,17 @@ export default defineComponent({
return {
product: null,
confirm: false,
+ confirm_key: false,
doc: false,
loadingPage: false,
loading: false,
+ loadingKey: false,
+ keyRows: [
+ { name: 'keyid', required: true, align: 'left', label: 'ID', field: 'keyid' },
+ { name: 'name', required: true, align: 'left', label: 'Name', field: 'name' },
+ { name: 'inserted', required: true, align: 'center', label: 'Created at', field: 'inserted' },
+ { name: 'public_url', required: true, align: 'left', label: 'URL', field: 'public_url' }
+ ],
// mockPackages: [
// { name: 'alsa-sof-firmware', version: '#1.9.3-4.el8_6'},
// { name: 'cheese', version: '#3.28.0-4.el8_6'},
@@ -209,6 +277,9 @@ export default defineComponent({
installationString () {
return `dnf copr --hub ${window.location.host} enable ${this.product.owner.username}/${this.product.name}`
},
+ createdAt (date) {
+ return new Date(date).toLocaleString()
+ },
loadProduct (productId) {
this.loadingPage = true
this.$api.get(`/products/${productId}/`)
@@ -245,6 +316,43 @@ export default defineComponent({
]
})
})
+ },
+ addSignKey () {
+ this.loadingKey = true
+ this.$api.post(`products/${this.productId}/create-sign-key/`)
+ .then(response => {
+ if (response.error) {
+ Notify.create({
+ message: response.error,
+ type: 'negative',
+ actions: [
+ { label: 'Dismiss', color: 'white', handler: () => {} }
+ ]
+ })
+ }
+ this.loadingKey = false
+ this.confirm_key = false
+ this.loadProduct(this.productId)
+ })
+ .catch(error => {
+ console.log(error)
+ this.loadingKey = false
+ this.confirm_key = false
+ if (+String(error.response.status)[0] === 4 ){
+ Notify.create({
+ message: error.response.data.detail, type: 'negative',
+ actions: [{ label: 'Dismiss', color: 'white', handler: () => {} }]
+ })
+ } else {
+ Notify.create({
+ message: `${error.response.status}: ${error.response.statusText}`,
+ type: 'negative',
+ actions: [
+ { label: 'Dismiss', color: 'white', handler: () => {} }
+ ]
+ })
+ }
+ })
}
}
})