@eclipse-slm/ui 1.5.0-snapshot.1 → 1.5.0-snapshot.1024
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/package.json +9 -7
- package/src/api/ansible-service/ansible-service-client.ts +15 -0
- package/src/api/ansible-service/ansible-service-sse.ts +124 -0
- package/src/api/notification-service/notificationServiceWebsocketClient.js +5 -5
- package/src/api/platform-management/platform-management-client.ts +2 -2
- package/src/api/resource-management/resource-management-client.ts +0 -2
- package/src/app/appInstance.ts +8 -0
- package/src/app/navigation.ts +21 -0
- package/src/app/routes.ts +23 -0
- package/src/components/admin/ansible/AnsibleAdminImages.vue +113 -0
- package/src/components/admin/ansible/AnsibleAdminJobs.vue +179 -0
- package/src/components/admin/ansible/AnsibleAdminOperations.vue +124 -0
- package/src/components/base/ConfirmDialog.vue +39 -25
- package/src/components/base/CustomDialog.vue +31 -3
- package/src/components/base/IconPickerDialog.vue +155 -0
- package/src/components/capabilities/CapabilitiesTable.vue +209 -0
- package/src/components/capabilities/CapabilityActionCard.vue +77 -0
- package/src/components/capabilities/CapabilityCreateDialog.vue +86 -0
- package/src/components/capabilities/CapabilityCreateForm.vue +306 -0
- package/src/components/capabilities/CapabilityImportDialog.vue +108 -0
- package/src/components/capabilities/capabilityForm.ts +244 -0
- package/src/components/core/AppBar.vue +1 -1
- package/src/components/core/Drawer.vue +12 -2
- package/src/components/jobs/JobDetail.vue +413 -0
- package/src/components/jobs/JobStatusChip.vue +16 -0
- package/src/components/jobs/JobsOverview.vue +59 -72
- package/src/components/profilers/ProfilerDialog.vue +95 -0
- package/src/components/profilers/ProfilerForm.vue +102 -0
- package/src/components/profilers/ProfilersTable.vue +98 -0
- package/src/components/profilers/profilerForm.ts +61 -0
- package/src/components/resources/deviceinfo/DeviceInfoView.vue +9 -1
- package/src/components/resources/dialogs/AddItemChooserDialog.vue +68 -0
- package/src/components/service_offerings/ServiceOfferingCardGrid.vue +1 -1
- package/src/components/service_offerings/wizard_service_offering_version/ServiceOfferingVersionWizardStep2DeploymentDefinitionDockerCompose.vue +1 -2
- package/src/components/service_offerings/wizard_service_offering_version/ServiceOfferingVersionWizardStep2DeploymentDefinitionKubernetes.vue +1 -2
- package/src/components/service_vendors/ServiceVendorDevelopersTable.vue +1 -1
- package/src/docker/entrypoint.sh +2 -2
- package/src/localisation/en.json +93 -0
- package/src/main.ts +3 -6
- package/src/pages/AdminAnsibleServicePage.vue +111 -0
- package/src/pages/AdminCapabilitiesPage.vue +60 -0
- package/src/pages/AdminProfilersPage.vue +73 -0
- package/src/pages/DashboardPage.vue +28 -56
- package/src/pages/JobDetailPage.vue +7 -0
- package/src/pages/ResourceInstancesPage.vue +71 -0
- package/src/pages/ServiceOfferingCreateOrEditPage.vue +2 -2
- package/src/stores/ansibleAdminStore.ts +206 -0
- package/src/stores/capabilitiesStore.ts +45 -2
- package/src/stores/environmentStore.ts +3 -3
- package/src/stores/jobsStore.ts +39 -39
- package/src/stores/notificationStore.ts +15 -1
- package/src/stores/profilersStore.ts +80 -0
- package/src/stores/resourceDevicesStore.ts +2 -2
- package/src/stores/serviceInstancesStore.ts +0 -1
- package/src/stores/serviceOfferingsStore.ts +1 -1
- package/src/stores/userStore.ts +1 -1
- package/src/utils/i18n.ts +4 -2
- package/src/utils/imageUtil.js +1 -1
- package/src/utils/jobStatus.ts +76 -0
- package/src/utils/mdiIcons.ts +49 -0
- package/src/utils/notificationTextGenerator.ts +27 -1
- package/src/utils/tokenInterceptor.js +1 -1
- package/src/utils/updateToken.js +1 -1
- package/vite/dist/apiClients.d.ts +1 -1
- package/vite/dist/apiClients.js +1 -0
- package/vite/dist/index.js +25 -4
|
@@ -180,11 +180,10 @@ import DockerContainerEnvironmentVariables
|
|
|
180
180
|
from '@/components/service_offerings/wizard_service_offering_version/Docker/DockerEnvironmentVariables'
|
|
181
181
|
import 'vue-json-pretty/lib/styles.css'
|
|
182
182
|
import { parseDocument, parse as parseYaml } from 'yaml'
|
|
183
|
+
import { parse } from 'dot-properties'
|
|
183
184
|
import ServiceRepositorySelect
|
|
184
185
|
from '@/components/service_offerings/wizard_service_offering_version/ServiceRepositorySelect'
|
|
185
186
|
|
|
186
|
-
const { parse } = require('dot-properties')
|
|
187
|
-
|
|
188
187
|
export default {
|
|
189
188
|
name: 'ServiceOfferingVersionWizardStep2DeploymentDefinitionDockerCompose',
|
|
190
189
|
components: {
|
|
@@ -103,13 +103,12 @@
|
|
|
103
103
|
<script>
|
|
104
104
|
import 'vue-json-pretty/lib/styles.css'
|
|
105
105
|
import YAML from 'yaml'
|
|
106
|
+
import { parse } from 'dot-properties'
|
|
106
107
|
import DockerContainerEnvironmentVariables
|
|
107
108
|
from '@/components/service_offerings/wizard_service_offering_version/Docker/DockerEnvironmentVariables'
|
|
108
109
|
import ServiceRepositorySelect
|
|
109
110
|
from "@/components/service_offerings/wizard_service_offering_version/ServiceRepositorySelect.vue";
|
|
110
111
|
|
|
111
|
-
const { parse } = require('dot-properties')
|
|
112
|
-
|
|
113
112
|
export default {
|
|
114
113
|
name: 'ServiceOfferingVersionWizardStep2DeploymentDefinitionKubernetes',
|
|
115
114
|
components: {ServiceRepositorySelect, DockerContainerEnvironmentVariables},
|
|
@@ -94,7 +94,7 @@ import {storeToRefs} from "pinia";
|
|
|
94
94
|
import ServiceManagementClient from "@/api/service-management/service-management-client";
|
|
95
95
|
import logRequestError from "@/api/restApiHelper";
|
|
96
96
|
import updateToken from "@/utils/updateToken";
|
|
97
|
-
import {globals} from "@/
|
|
97
|
+
import {globals} from "@/app/appInstance";
|
|
98
98
|
|
|
99
99
|
export default {
|
|
100
100
|
name: 'ServiceVendorDevelopersTable',
|
package/src/docker/entrypoint.sh
CHANGED
|
@@ -27,11 +27,11 @@ printf "%-38s %s\n" "NOTIFICATION_SERVICE_URL:" "$NOTIFICATION_SERVICE_URL"
|
|
|
27
27
|
printf "%-38s %s\n" "PLATFORM_MANAGEMENT_URL:" "$PLATFORM_MANAGEMENT_URL"
|
|
28
28
|
printf "%-38s %s\n" "RESOURCE_MANAGEMENT_URL:" "$RESOURCE_MANAGEMENT_URL"
|
|
29
29
|
printf "%-38s %s\n" "SERVICE_MANAGEMENT_URL:" "$SERVICE_MANAGEMENT_URL"
|
|
30
|
+
printf "%-38s %s\n" "ANSIBLE_SERVICE_URL:" "$ANSIBLE_SERVICE_URL"
|
|
30
31
|
printf "%-38s %s\n" "CATALOG_SERVICE_URL:" "$CATALOG_SERVICE_URL"
|
|
31
32
|
printf "%-38s %s\n" "KEYCLOAK_URL:" "$KEYCLOAK_URL"
|
|
32
33
|
printf "%-38s %s\n" "KEYCLOAK_REALM:" "$KEYCLOAK_REALM"
|
|
33
34
|
printf "%-38s %s\n" "KEYCLOAK_CLIENT_ID:" "$KEYCLOAK_CLIENT_ID"
|
|
34
|
-
printf "%-38s %s\n" "AWX_URL:" "$AWX_URL"
|
|
35
35
|
printf "%-38s %s\n" "BASYX_AAS_GUI_URL:" "$BASYX_AAS_GUI_URL"
|
|
36
36
|
|
|
37
37
|
# Replace the placeholders in all relevant files (.js, .html, .css)
|
|
@@ -43,11 +43,11 @@ find /usr/share/nginx/html -type f \( -name '*.js' -o -name '*.html' -o -name '*
|
|
|
43
43
|
-e "s|/__ENV_PLATFORM_MANAGEMENT_URL__PLACEHOLDER__/|$PLATFORM_MANAGEMENT_URL|g" \
|
|
44
44
|
-e "s|/__ENV_RESOURCE_MANAGEMENT_URL__PLACEHOLDER__/|$RESOURCE_MANAGEMENT_URL|g" \
|
|
45
45
|
-e "s|/__ENV_SERVICE_MANAGEMENT_URL__PLACEHOLDER__/|$SERVICE_MANAGEMENT_URL|g" \
|
|
46
|
+
-e "s|/__ENV_ANSIBLE_SERVICE_URL__PLACEHOLDER__/|$ANSIBLE_SERVICE_URL|g" \
|
|
46
47
|
-e "s|/__ENV_CATALOG_SERVICE_URL__PLACEHOLDER__/|$CATALOG_SERVICE_URL|g" \
|
|
47
48
|
-e "s|/__ENV_KEYCLOAK_URL__PLACEHOLDER__/|$KEYCLOAK_URL|g" \
|
|
48
49
|
-e "s|/__ENV_KEYCLOAK_REALM__PLACEHOLDER__/|$KEYCLOAK_REALM|g" \
|
|
49
50
|
-e "s|/__ENV_KEYCLOAK_CLIENT_ID__PLACEHOLDER__/|$KEYCLOAK_CLIENT_ID|g" \
|
|
50
|
-
-e "s|/__ENV_AWX_URL__PLACEHOLDER__/|$AWX_URL|g" \
|
|
51
51
|
-e "s|/__ENV_BASYX_AAS_GUI_URL__PLACEHOLDER__/|$BASYX_AAS_GUI_URL|g" \
|
|
52
52
|
{} \;
|
|
53
53
|
|
package/src/localisation/en.json
CHANGED
|
@@ -57,6 +57,99 @@
|
|
|
57
57
|
},
|
|
58
58
|
"service-vendors":{
|
|
59
59
|
"title": "Service Vendors"
|
|
60
|
+
},
|
|
61
|
+
"capabilities":{
|
|
62
|
+
"title": "Capabilities"
|
|
63
|
+
},
|
|
64
|
+
"profilers":{
|
|
65
|
+
"title": "Profilers"
|
|
66
|
+
},
|
|
67
|
+
"ansible-service":{
|
|
68
|
+
"title": "Ansible Service",
|
|
69
|
+
"tabs": {
|
|
70
|
+
"jobs": "Jobs",
|
|
71
|
+
"operations": "Operations",
|
|
72
|
+
"images": "Execution environments"
|
|
73
|
+
},
|
|
74
|
+
"jobs": {
|
|
75
|
+
"filter": {
|
|
76
|
+
"status": "Status",
|
|
77
|
+
"resourceId": "Resource ID",
|
|
78
|
+
"resourceIdInvalid": "Not a valid UUID",
|
|
79
|
+
"user": "User",
|
|
80
|
+
"since": "Created",
|
|
81
|
+
"since1h": "Last hour",
|
|
82
|
+
"since24h": "Last 24 hours",
|
|
83
|
+
"since7d": "Last 7 days",
|
|
84
|
+
"since30d": "Last 30 days",
|
|
85
|
+
"sinceAll": "All time"
|
|
86
|
+
},
|
|
87
|
+
"column": {
|
|
88
|
+
"status": "Status",
|
|
89
|
+
"owner": "Owner",
|
|
90
|
+
"service": "Service / capability",
|
|
91
|
+
"playbook": "Repository / playbook",
|
|
92
|
+
"image": "Image",
|
|
93
|
+
"createdAt": "Created",
|
|
94
|
+
"duration": "Duration",
|
|
95
|
+
"errorCode": "Error",
|
|
96
|
+
"actions": "Actions"
|
|
97
|
+
},
|
|
98
|
+
"cancel": "Cancel",
|
|
99
|
+
"cancelFailed": "Job {id} could not be canceled",
|
|
100
|
+
"empty": "No jobs match the filter"
|
|
101
|
+
},
|
|
102
|
+
"operations": {
|
|
103
|
+
"counters": "Jobs by status",
|
|
104
|
+
"running": "Running",
|
|
105
|
+
"queued": "Queued",
|
|
106
|
+
"failed24h": "Failed in the last 24 hours",
|
|
107
|
+
"config": {
|
|
108
|
+
"title": "Configuration",
|
|
109
|
+
"playbookContract": "Playbook contract",
|
|
110
|
+
"defaultImage": "Default image",
|
|
111
|
+
"allowedImagePrefixes": "Allowed image prefixes",
|
|
112
|
+
"parallelism": "Parallel jobs",
|
|
113
|
+
"maxQueued": "Max. queued jobs",
|
|
114
|
+
"defaultTimeoutMinutes": "Default timeout (minutes)",
|
|
115
|
+
"maxTimeoutMinutes": "Max. timeout (minutes)",
|
|
116
|
+
"maxCpus": "Max. CPUs per job",
|
|
117
|
+
"maxMemoryMb": "Max. memory per job (MB)"
|
|
118
|
+
},
|
|
119
|
+
"links": {
|
|
120
|
+
"title": "API documentation",
|
|
121
|
+
"swagger": "Swagger UI",
|
|
122
|
+
"openapi": "OpenAPI documentation"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"images": {
|
|
126
|
+
"column": {
|
|
127
|
+
"image": "Image",
|
|
128
|
+
"present": "Available",
|
|
129
|
+
"usedByJobs": "Used by",
|
|
130
|
+
"lastUsedAt": "Last used",
|
|
131
|
+
"pulling": "Pull state",
|
|
132
|
+
"lastPullError": "Last pull error",
|
|
133
|
+
"actions": "Actions"
|
|
134
|
+
},
|
|
135
|
+
"default": "Default",
|
|
136
|
+
"present": "Present",
|
|
137
|
+
"missing": "Not present",
|
|
138
|
+
"usedByJobs": "{count} jobs",
|
|
139
|
+
"pulling": "Pulling",
|
|
140
|
+
"pullFailed": "Failed",
|
|
141
|
+
"pull": "Pull image",
|
|
142
|
+
"empty": "No images known",
|
|
143
|
+
"notice": {
|
|
144
|
+
"pull-started": "Pull of {image} started",
|
|
145
|
+
"pull-success": "Image {image} pulled successfully",
|
|
146
|
+
"pull-failed": "Pull of {image} failed: {detail}",
|
|
147
|
+
"pull-conflict": "A pull of {image} is already running",
|
|
148
|
+
"pull-not-allowed": "Image {image} is not allowed by the service configuration",
|
|
149
|
+
"pull-unavailable": "The Docker engine is not available",
|
|
150
|
+
"pull-error": "Pull of {image} could not be started"
|
|
151
|
+
}
|
|
152
|
+
}
|
|
60
153
|
}
|
|
61
154
|
}
|
|
62
155
|
}
|
package/src/main.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import App from './App.vue'
|
|
1
|
+
import {app} from '@/app/appInstance';
|
|
3
2
|
|
|
4
3
|
import router from './pages/router';
|
|
5
4
|
import 'chartist/dist/chartist.min.css';
|
|
@@ -46,8 +45,6 @@ import {useCapabilitiesStore} from "@/stores/capabilitiesStore";
|
|
|
46
45
|
|
|
47
46
|
console.log("App Mode: " + import.meta.env.MODE)
|
|
48
47
|
|
|
49
|
-
const app = createApp(App);
|
|
50
|
-
|
|
51
48
|
const pinia = createPinia();
|
|
52
49
|
pinia.use(piniaPluginPersistedstate);
|
|
53
50
|
app.use(pinia);
|
|
@@ -166,5 +163,5 @@ app.mount('#app');
|
|
|
166
163
|
|
|
167
164
|
yup.addMethod(yup.string, 'ipv4', yupValidateIPv4);
|
|
168
165
|
|
|
169
|
-
|
|
170
|
-
export { globals }
|
|
166
|
+
// Kept for backward compatibility; import `globals` from '@/app/appInstance' instead.
|
|
167
|
+
export { globals } from '@/app/appInstance'
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container
|
|
3
|
+
id="admin-ansible-service"
|
|
4
|
+
fluid
|
|
5
|
+
tag="section"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
v-if="loading"
|
|
9
|
+
class="text-center"
|
|
10
|
+
>
|
|
11
|
+
<v-progress-circular
|
|
12
|
+
:size="70"
|
|
13
|
+
:width="7"
|
|
14
|
+
color="primary"
|
|
15
|
+
indeterminate
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
<div v-if="failed">
|
|
19
|
+
Error
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<base-material-card v-if="loaded">
|
|
23
|
+
<template #heading>
|
|
24
|
+
<overview-heading :text="t(`${prefix}.title`)" />
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<v-tabs
|
|
28
|
+
v-model="tab"
|
|
29
|
+
color="primary"
|
|
30
|
+
>
|
|
31
|
+
<v-tab value="jobs">
|
|
32
|
+
{{ t(`${prefix}.tabs.jobs`) }}
|
|
33
|
+
</v-tab>
|
|
34
|
+
<v-tab value="operations">
|
|
35
|
+
{{ t(`${prefix}.tabs.operations`) }}
|
|
36
|
+
</v-tab>
|
|
37
|
+
<v-tab value="images">
|
|
38
|
+
{{ t(`${prefix}.tabs.images`) }}
|
|
39
|
+
</v-tab>
|
|
40
|
+
</v-tabs>
|
|
41
|
+
|
|
42
|
+
<v-window
|
|
43
|
+
v-model="tab"
|
|
44
|
+
class="mt-4"
|
|
45
|
+
>
|
|
46
|
+
<v-window-item value="jobs">
|
|
47
|
+
<ansible-admin-jobs @cancel-failed="onCancelFailed" />
|
|
48
|
+
</v-window-item>
|
|
49
|
+
<v-window-item value="operations">
|
|
50
|
+
<ansible-admin-operations />
|
|
51
|
+
</v-window-item>
|
|
52
|
+
<v-window-item value="images">
|
|
53
|
+
<ansible-admin-images />
|
|
54
|
+
</v-window-item>
|
|
55
|
+
</v-window>
|
|
56
|
+
</base-material-card>
|
|
57
|
+
|
|
58
|
+
<v-snackbar
|
|
59
|
+
v-model="snackbar"
|
|
60
|
+
:color="snackbarColor"
|
|
61
|
+
:timeout="6000"
|
|
62
|
+
>
|
|
63
|
+
{{ snackbarText }}
|
|
64
|
+
</v-snackbar>
|
|
65
|
+
</v-container>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script setup lang="ts">
|
|
69
|
+
import {computed, onBeforeUnmount, onMounted, ref, watch} from "vue";
|
|
70
|
+
import {useI18n} from "vue-i18n";
|
|
71
|
+
import ApiState from "@/api/apiState";
|
|
72
|
+
import OverviewHeading from "@/components/base/OverviewHeading.vue";
|
|
73
|
+
import AnsibleAdminImages from "@/components/admin/ansible/AnsibleAdminImages.vue";
|
|
74
|
+
import AnsibleAdminJobs from "@/components/admin/ansible/AnsibleAdminJobs.vue";
|
|
75
|
+
import AnsibleAdminOperations from "@/components/admin/ansible/AnsibleAdminOperations.vue";
|
|
76
|
+
import {useAnsibleAdminStore} from "@/stores/ansibleAdminStore";
|
|
77
|
+
|
|
78
|
+
const {t} = useI18n();
|
|
79
|
+
const store = useAnsibleAdminStore();
|
|
80
|
+
const prefix = 'drawer.section.admin.ansible-service';
|
|
81
|
+
|
|
82
|
+
const tab = ref('jobs');
|
|
83
|
+
const snackbar = ref(false);
|
|
84
|
+
const snackbarText = ref('');
|
|
85
|
+
const snackbarColor = ref('info');
|
|
86
|
+
|
|
87
|
+
const loaded = computed(() => store.apiState === ApiState.LOADED || store.apiState === ApiState.UPDATING);
|
|
88
|
+
const loading = computed(() => store.apiState === ApiState.LOADING || store.apiState === ApiState.INIT);
|
|
89
|
+
const failed = computed(() => store.apiState === ApiState.ERROR);
|
|
90
|
+
|
|
91
|
+
function show(text: string, color: string) {
|
|
92
|
+
snackbarText.value = text;
|
|
93
|
+
snackbarColor.value = color;
|
|
94
|
+
snackbar.value = true;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function onCancelFailed(id: string) {
|
|
98
|
+
show(t(`${prefix}.jobs.cancelFailed`, {id: id.substring(0, 8)}), 'error');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
watch(() => store.notice, (notice) => {
|
|
102
|
+
if (!notice) return;
|
|
103
|
+
const color = notice.kind === 'pull-success' ? 'success'
|
|
104
|
+
: notice.kind === 'pull-started' ? 'info'
|
|
105
|
+
: 'error';
|
|
106
|
+
show(t(`${prefix}.images.notice.${notice.kind}`, {image: notice.image, detail: notice.detail ?? ''}), color);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
onMounted(() => store.startPolling());
|
|
110
|
+
onBeforeUnmount(() => store.stopPolling());
|
|
111
|
+
</script>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container
|
|
3
|
+
id="admin-capabilities"
|
|
4
|
+
fluid
|
|
5
|
+
tag="section"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
v-if="apiStateLoading"
|
|
9
|
+
class="text-center"
|
|
10
|
+
>
|
|
11
|
+
<v-progress-circular
|
|
12
|
+
:size="70"
|
|
13
|
+
:width="7"
|
|
14
|
+
color="primary"
|
|
15
|
+
indeterminate
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
<div v-if="apiStateError">
|
|
19
|
+
Error
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div v-if="apiStateLoaded">
|
|
23
|
+
<CapabilitiesTable />
|
|
24
|
+
<CapabilityCreateDialog
|
|
25
|
+
:show="showCreateDialog"
|
|
26
|
+
@canceled="showCreateDialog = false"
|
|
27
|
+
@confirmed="showCreateDialog = false"
|
|
28
|
+
/>
|
|
29
|
+
<v-fab
|
|
30
|
+
icon="mdi-plus"
|
|
31
|
+
class="mx-4"
|
|
32
|
+
elevation="15"
|
|
33
|
+
color="primary"
|
|
34
|
+
location="right bottom"
|
|
35
|
+
:app="true"
|
|
36
|
+
@click="showCreateDialog = true"
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</v-container>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script setup lang="ts">
|
|
43
|
+
import { computed, onMounted, ref } from 'vue';
|
|
44
|
+
import ApiState from '@/api/apiState';
|
|
45
|
+
import CapabilitiesTable from '@/components/capabilities/CapabilitiesTable.vue';
|
|
46
|
+
import CapabilityCreateDialog from '@/components/capabilities/CapabilityCreateDialog.vue';
|
|
47
|
+
import { useCapabilitiesStore } from '@/stores/capabilitiesStore';
|
|
48
|
+
|
|
49
|
+
const capabilitiesStore = useCapabilitiesStore();
|
|
50
|
+
|
|
51
|
+
const showCreateDialog = ref(false);
|
|
52
|
+
|
|
53
|
+
const apiStateLoaded = computed(() => capabilitiesStore.apiState === ApiState.LOADED || capabilitiesStore.apiState === ApiState.UPDATING);
|
|
54
|
+
const apiStateLoading = computed(() => capabilitiesStore.apiState === ApiState.LOADING || capabilitiesStore.apiState === ApiState.INIT);
|
|
55
|
+
const apiStateError = computed(() => capabilitiesStore.apiState === ApiState.ERROR);
|
|
56
|
+
|
|
57
|
+
onMounted(() => {
|
|
58
|
+
capabilitiesStore.updateStore();
|
|
59
|
+
});
|
|
60
|
+
</script>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-container
|
|
3
|
+
id="admin-profilers"
|
|
4
|
+
fluid
|
|
5
|
+
tag="section"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
v-if="apiStateLoading"
|
|
9
|
+
class="text-center"
|
|
10
|
+
>
|
|
11
|
+
<v-progress-circular
|
|
12
|
+
:size="70"
|
|
13
|
+
:width="7"
|
|
14
|
+
color="primary"
|
|
15
|
+
indeterminate
|
|
16
|
+
/>
|
|
17
|
+
</div>
|
|
18
|
+
<div v-if="apiStateError">
|
|
19
|
+
Error
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div v-if="apiStateLoaded">
|
|
23
|
+
<ProfilersTable @edit="onEdit" />
|
|
24
|
+
<ProfilerDialog
|
|
25
|
+
:show="showDialog"
|
|
26
|
+
:profiler="selectedProfiler"
|
|
27
|
+
@canceled="showDialog = false"
|
|
28
|
+
@confirmed="showDialog = false"
|
|
29
|
+
/>
|
|
30
|
+
<v-fab
|
|
31
|
+
icon="mdi-plus"
|
|
32
|
+
class="mx-4"
|
|
33
|
+
elevation="15"
|
|
34
|
+
color="primary"
|
|
35
|
+
location="right bottom"
|
|
36
|
+
:app="true"
|
|
37
|
+
@click="onCreate"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
</v-container>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import { computed, onMounted, ref } from 'vue';
|
|
45
|
+
import ApiState from '@/api/apiState';
|
|
46
|
+
import type { Profiler } from '@/api/resource-management/client';
|
|
47
|
+
import ProfilerDialog from '@/components/profilers/ProfilerDialog.vue';
|
|
48
|
+
import ProfilersTable from '@/components/profilers/ProfilersTable.vue';
|
|
49
|
+
import { useProfilersStore } from '@/stores/profilersStore';
|
|
50
|
+
|
|
51
|
+
const profilersStore = useProfilersStore();
|
|
52
|
+
|
|
53
|
+
const showDialog = ref(false);
|
|
54
|
+
const selectedProfiler = ref<Profiler | null>(null);
|
|
55
|
+
|
|
56
|
+
const apiStateLoaded = computed(() => profilersStore.apiState === ApiState.LOADED || profilersStore.apiState === ApiState.UPDATING);
|
|
57
|
+
const apiStateLoading = computed(() => profilersStore.apiState === ApiState.LOADING || profilersStore.apiState === ApiState.INIT);
|
|
58
|
+
const apiStateError = computed(() => profilersStore.apiState === ApiState.ERROR);
|
|
59
|
+
|
|
60
|
+
function onCreate() {
|
|
61
|
+
selectedProfiler.value = null;
|
|
62
|
+
showDialog.value = true;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function onEdit(profiler: Profiler) {
|
|
66
|
+
selectedProfiler.value = profiler;
|
|
67
|
+
showDialog.value = true;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
onMounted(() => {
|
|
71
|
+
profilersStore.updateStore();
|
|
72
|
+
});
|
|
73
|
+
</script>
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
:footer-props="{'items-per-page-options':[jobCount]}"
|
|
119
119
|
:headers="DataTableHeaders"
|
|
120
120
|
item-key="id"
|
|
121
|
-
:items="
|
|
121
|
+
:items="latestJobs"
|
|
122
122
|
style="border-bottom:1px solid #E0E0E0"
|
|
123
123
|
>
|
|
124
124
|
<template #header.id="{ column }">
|
|
@@ -132,17 +132,17 @@
|
|
|
132
132
|
</v-icon>
|
|
133
133
|
{{ column.title }}
|
|
134
134
|
</template>
|
|
135
|
-
<template #header.
|
|
135
|
+
<template #header.startedAt="{ column }">
|
|
136
136
|
<v-icon size="small">
|
|
137
137
|
mdi-clock-start
|
|
138
138
|
</v-icon> {{ column.title }}
|
|
139
139
|
</template>
|
|
140
|
-
<template #header.
|
|
140
|
+
<template #header.finishedAt="{ column }">
|
|
141
141
|
<v-icon size="small">
|
|
142
142
|
mdi-clock-end
|
|
143
143
|
</v-icon> {{ column.title }}
|
|
144
144
|
</template>
|
|
145
|
-
<template #header.
|
|
145
|
+
<template #header.duration="{ column }">
|
|
146
146
|
<v-icon size="small">
|
|
147
147
|
mdi-alarm
|
|
148
148
|
</v-icon> {{ column.title }}
|
|
@@ -154,59 +154,25 @@
|
|
|
154
154
|
</template>
|
|
155
155
|
|
|
156
156
|
<template #item.id="{item}">
|
|
157
|
-
{
|
|
157
|
+
<router-link :to="`/jobs/${item.id}`">
|
|
158
|
+
{{ item.id.substring(0, 8) }}
|
|
159
|
+
</router-link>
|
|
158
160
|
</template>
|
|
159
161
|
|
|
160
|
-
<template #item.
|
|
161
|
-
{{ item.
|
|
162
|
+
<template #item.startedAt="{item}">
|
|
163
|
+
{{ getFormattedDate(item.startedAt) }}
|
|
162
164
|
</template>
|
|
163
165
|
|
|
164
|
-
<template #item.
|
|
165
|
-
{{ getFormattedDate(item.
|
|
166
|
+
<template #item.finishedAt="{item}">
|
|
167
|
+
{{ getFormattedDate(item.finishedAt) }}
|
|
166
168
|
</template>
|
|
167
169
|
|
|
168
|
-
<template #item.
|
|
169
|
-
{{
|
|
170
|
+
<template #item.duration="{item}">
|
|
171
|
+
{{ formatDuration(jobDurationMs(item)) }}
|
|
170
172
|
</template>
|
|
171
173
|
|
|
172
174
|
<template #item.status="{item}">
|
|
173
|
-
<
|
|
174
|
-
{{ getFormattedTime(new Date().getTime() - new Date(item.started).getTime()) }}
|
|
175
|
-
</span>
|
|
176
|
-
<span v-else>
|
|
177
|
-
{{ getFormattedTime(new Date(item.finished).getTime() - new Date(item.started).getTime()) }}
|
|
178
|
-
</span>
|
|
179
|
-
<v-tooltip location="right">
|
|
180
|
-
<template #activator="{ props }">
|
|
181
|
-
<v-icon
|
|
182
|
-
v-if="item.status === 'successful'"
|
|
183
|
-
v-bind="props"
|
|
184
|
-
>
|
|
185
|
-
mdi-check-circle-outline
|
|
186
|
-
</v-icon>
|
|
187
|
-
<v-icon
|
|
188
|
-
v-if="item.status === 'running'"
|
|
189
|
-
v-bind="props"
|
|
190
|
-
>
|
|
191
|
-
mdi-run-fast
|
|
192
|
-
</v-icon>
|
|
193
|
-
<v-icon
|
|
194
|
-
v-else-if="item.status === 'pending'"
|
|
195
|
-
v-bind="props"
|
|
196
|
-
>
|
|
197
|
-
mdi-timer-sand-empty
|
|
198
|
-
</v-icon>
|
|
199
|
-
<v-icon
|
|
200
|
-
v-else-if="item.status === 'canceled' || item.status === 'failed'|| item.status === 'error'"
|
|
201
|
-
v-bind="props"
|
|
202
|
-
>
|
|
203
|
-
mdi-alert-circle-outline
|
|
204
|
-
</v-icon>
|
|
205
|
-
</template>
|
|
206
|
-
<span>
|
|
207
|
-
{{ item.status }}
|
|
208
|
-
</span>
|
|
209
|
-
</v-tooltip>
|
|
175
|
+
<job-status-chip :status="item.status" />
|
|
210
176
|
</template>
|
|
211
177
|
</v-data-table>
|
|
212
178
|
<v-card-subtitle>Total Job Count: {{ jobs.length }}</v-card-subtitle>
|
|
@@ -232,6 +198,8 @@ import {useServiceInstancesStore} from "@/stores/serviceInstancesStore";
|
|
|
232
198
|
import {useResourceClustersStore} from "@/stores/resourceClustersStore";
|
|
233
199
|
import {useUserStore} from "@/stores/userStore";
|
|
234
200
|
import {useJobsStore} from "@/stores/jobsStore";
|
|
201
|
+
import JobStatusChip from "@/components/jobs/JobStatusChip.vue";
|
|
202
|
+
import {formatDuration, jobDurationMs} from "@/utils/jobStatus";
|
|
235
203
|
import {useResourceDevicesStore} from "@/stores/resourceDevicesStore";
|
|
236
204
|
|
|
237
205
|
export default {
|
|
@@ -239,6 +207,7 @@ export default {
|
|
|
239
207
|
components: {
|
|
240
208
|
DashboardResourceStatistics,
|
|
241
209
|
NoItemAvailableNote,
|
|
210
|
+
JobStatusChip,
|
|
242
211
|
},
|
|
243
212
|
|
|
244
213
|
setup(){
|
|
@@ -248,12 +217,12 @@ export default {
|
|
|
248
217
|
const userStore = useUserStore();
|
|
249
218
|
const jobsStore = useJobsStore();
|
|
250
219
|
const resourceDevicesStore = useResourceDevicesStore();
|
|
251
|
-
return {serviceInstancesStore, serviceOfferingsStore, resourceClustersStore, userStore, jobsStore, resourceDevicesStore};
|
|
220
|
+
return {serviceInstancesStore, serviceOfferingsStore, resourceClustersStore, userStore, jobsStore, resourceDevicesStore, formatDuration, jobDurationMs};
|
|
252
221
|
},
|
|
253
222
|
|
|
254
223
|
data () {
|
|
255
224
|
return {
|
|
256
|
-
sortBy: [{key: '
|
|
225
|
+
sortBy: [{key: 'startedAt', order: 'desc'}],
|
|
257
226
|
sortDesc: true,
|
|
258
227
|
jobCount: 5,
|
|
259
228
|
dataCompletedTasksChart: {
|
|
@@ -329,15 +298,18 @@ export default {
|
|
|
329
298
|
jobs() {
|
|
330
299
|
return this.jobsStore.jobs
|
|
331
300
|
},
|
|
301
|
+
latestJobs() {
|
|
302
|
+
return this.jobsStore.jobs.slice(0, this.jobCount)
|
|
303
|
+
},
|
|
332
304
|
|
|
333
305
|
DataTableHeaders () {
|
|
334
306
|
return [
|
|
335
|
-
{ title: 'ID',
|
|
336
|
-
{ title: 'Name',
|
|
337
|
-
{ title: 'Started at',
|
|
338
|
-
{ title: 'Finished at',
|
|
339
|
-
{ title: 'Duration',
|
|
340
|
-
{ title: 'Status',
|
|
307
|
+
{ title: 'ID', key: 'id', sortable: true },
|
|
308
|
+
{ title: 'Name', key: 'name', value: item => item.serviceName || item.playbook, sortable: true },
|
|
309
|
+
{ title: 'Started at', key: 'startedAt', sortable: true },
|
|
310
|
+
{ title: 'Finished at', key: 'finishedAt', sortable: true },
|
|
311
|
+
{ title: 'Duration', key: 'duration', sortable: false },
|
|
312
|
+
{ title: 'Status', key: 'status', sortable: true },
|
|
341
313
|
]
|
|
342
314
|
},
|
|
343
315
|
},
|