Skip to content

Commit efddce1

Browse files
authored
Add License details to license config page when available (#3029)
1 parent cc7175c commit efddce1

3 files changed

Lines changed: 51 additions & 2 deletions

File tree

src/Frontend/src/components/configuration/PlatformLicense.vue

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { useConfigurationStore } from "@/stores/ConfigurationStore";
99
import { storeToRefs } from "pinia";
1010
import { useLicenseStore } from "@/stores/LicenseStore";
1111
import LoadingSpinner from "../LoadingSpinner.vue";
12+
import ColumnHeader from "../ColumnHeader.vue";
13+
import DataView from "../DataView.vue";
1214
1315
const configurationStore = useConfigurationStore();
1416
const { configuration } = storeToRefs(configurationStore);
@@ -23,6 +25,7 @@ const { licenseStatus, license } = licenseStore;
2325
<section>
2426
<LoadingSpinner v-if="loading" />
2527
<template v-else>
28+
<h3 class="mt-2">License Details</h3>
2629
<div class="box">
2730
<div class="row">
2831
<div class="license-info">
@@ -100,7 +103,6 @@ const { licenseStatus, license } = licenseStore;
100103
<a href="https://docs.particular.net/servicecontrol/license" target="_blank">Install or update a ServiceControl license</a>
101104
</li>
102105
</ul>
103-
104106
<div class="need-help">
105107
Need help?
106108
<a href="https://particular.net/contactus">Contact us <FAIcon :icon="faExternalLink" /></a>
@@ -109,6 +111,30 @@ const { licenseStatus, license } = licenseStore;
109111
</div>
110112
</div>
111113
</template>
114+
115+
<template v-if="license.products?.length">
116+
<h3 class="mt-4">Licensed Endpoints</h3>
117+
<div class="licensed-endpoints col-4">
118+
<div role="row" aria-label="column-headers" class="row table-head-row" :style="{ borderTop: 0 }">
119+
<ColumnHeader name="Size" label="Size (Average Messages/Month)" class="col-6" />
120+
<ColumnHeader name="Quantity" label="Quantity" class="col-6" />
121+
</div>
122+
<DataView :data="license.products">
123+
<template #data="{ pageData }">
124+
<div role="rowgroup" aria-label="endpoints">
125+
<div role="row" class="row grid-row" v-for="endpoint in pageData" :key="endpoint.name">
126+
<span class="col-6">
127+
{{ endpoint.name }}
128+
</span>
129+
<span class="col-6">
130+
{{ endpoint.quantity }}
131+
</span>
132+
</div>
133+
</div>
134+
</template>
135+
</DataView>
136+
</div>
137+
</template>
112138
</section>
113139
</ServiceControlAvailable>
114140
</section>
@@ -117,7 +143,6 @@ const { licenseStatus, license } = licenseStore;
117143
<style scoped>
118144
.license-info {
119145
font-size: 16px;
120-
padding: 2em;
121146
line-height: 3em;
122147
}
123148
@@ -130,4 +155,20 @@ const { licenseStatus, license } = licenseStore;
130155
padding-top: 20px;
131156
border-top: 2px solid #f2f2f2;
132157
}
158+
159+
.licensed-endpoints {
160+
padding: 20px;
161+
}
162+
163+
.licensed-endpoints .grid-row {
164+
border-top: 1px solid #eee;
165+
border-right: 1px solid #fff;
166+
border-bottom: 1px solid #eee;
167+
border-left: 1px solid #fff;
168+
background-color: #fff;
169+
}
170+
171+
.licensed-endpoints span {
172+
padding: 10px;
173+
}
133174
</style>

src/Frontend/src/resources/LicenseInfo.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import type Configuration from "./Configuration";
22

3+
export interface LicensedProduct {
4+
name: string;
5+
quantity: number;
6+
}
7+
38
export default interface LicenseInfo {
49
registered_to: string;
510
edition: string;
@@ -11,6 +16,7 @@ export default interface LicenseInfo {
1116
license_status: LicenseStatus;
1217
license_extension_url?: string;
1318
status: string;
19+
products: LicensedProduct[];
1420
}
1521

1622
export function typeText(license: LicenseInfo, configuration: Configuration | null) {

src/Frontend/src/stores/LicenseStore.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const useLicenseStore = defineStore("LicenseStore", () => {
1818
status: "",
1919
license_status: LicenseStatus.Unavailable,
2020
license_extension_url: "",
21+
products: [],
2122
});
2223

2324
const licenseStatus = reactive({
@@ -72,6 +73,7 @@ export const useLicenseStore = defineStore("LicenseStore", () => {
7273
license.instance_name = lic.instance_name;
7374
license.registered_to = lic.registered_to;
7475
license.status = lic.status;
76+
license.products = lic.products;
7577
license.license_extension_url = lic.license_extension_url ?? "https://particular.net/extend-your-trial?p=servicepulse";
7678
license.upgrade_protection_expiration = lic.upgrade_protection_expiration;
7779

0 commit comments

Comments
 (0)