@conduction/nextcloud-vue 0.1.0-beta.4 → 0.1.0-beta.6
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/dist/nextcloud-vue.cjs +67614 -0
- package/dist/nextcloud-vue.cjs.js +9559 -8983
- package/dist/nextcloud-vue.cjs.js.map +1 -1
- package/dist/nextcloud-vue.cjs.map +1 -0
- package/dist/nextcloud-vue.css +1231 -1231
- package/dist/nextcloud-vue.esm.js +9559 -8983
- package/dist/nextcloud-vue.esm.js.map +1 -1
- package/package.json +14 -5
- package/src/components/CnActionsBar/CnActionsBar.vue +235 -235
- package/src/components/CnAdvancedFormDialog/CnAdvancedFormDialog.vue +579 -579
- package/src/components/CnAdvancedFormDialog/CnDataTab.vue +217 -217
- package/src/components/CnAdvancedFormDialog/CnMetadataTab.vue +121 -121
- package/src/components/CnAdvancedFormDialog/CnPropertiesTab.vue +418 -418
- package/src/components/CnAdvancedFormDialog/CnPropertyValueCell.vue +247 -247
- package/src/components/CnCardGrid/CnCardGrid.vue +152 -152
- package/src/components/CnCellRenderer/CnCellRenderer.vue +132 -132
- package/src/components/CnChartWidget/CnChartWidget.vue +320 -320
- package/src/components/CnConfigurationCard/CnConfigurationCard.vue +77 -77
- package/src/components/CnCopyDialog/CnCopyDialog.vue +250 -250
- package/src/components/CnDashboardGrid/CnDashboardGrid.vue +225 -225
- package/src/components/CnDashboardPage/CnDashboardPage.vue +390 -390
- package/src/components/CnDataTable/CnDataTable.vue +349 -349
- package/src/components/CnDeleteDialog/CnDeleteDialog.vue +170 -170
- package/src/components/CnDetailCard/CnDetailCard.vue +214 -214
- package/src/components/CnDetailPage/CnDetailPage.vue +285 -281
- package/src/components/CnFacetSidebar/CnFacetSidebar.vue +231 -231
- package/src/components/CnFilterBar/CnFilterBar.vue +152 -152
- package/src/components/CnFormDialog/CnFormDialog.vue +302 -11
- package/src/components/CnIcon/CnIcon.vue +89 -89
- package/src/components/CnIndexPage/CnIndexPage.vue +884 -874
- package/src/components/CnIndexSidebar/CnIndexSidebar.vue +503 -503
- package/src/components/CnItemCard/CnItemCard.vue +132 -132
- package/src/components/CnKpiGrid/CnKpiGrid.vue +89 -89
- package/src/components/CnMassActionBar/CnMassActionBar.vue +160 -160
- package/src/components/CnMassCopyDialog/CnMassCopyDialog.vue +320 -320
- package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.vue +238 -238
- package/src/components/CnMassExportDialog/CnMassExportDialog.vue +190 -190
- package/src/components/CnMassImportDialog/CnMassImportDialog.vue +491 -491
- package/src/components/CnNoteCard/CnNoteCard.vue +149 -149
- package/src/components/CnNotesCard/CnNotesCard.vue +413 -413
- package/src/components/CnObjectCard/CnObjectCard.vue +292 -292
- package/src/components/CnObjectCard/eslint-setup.md +235 -0
- package/src/components/CnObjectCard/package.json-or.json +132 -0
- package/src/components/CnObjectSidebar/CnObjectSidebar.vue +876 -876
- package/src/components/CnPageHeader/CnPageHeader.vue +57 -57
- package/src/components/CnPagination/CnPagination.vue +252 -252
- package/src/components/CnRegisterMapping/CnRegisterMapping.vue +792 -792
- package/src/components/CnRowActions/CnRowActions.vue +95 -73
- package/src/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue +226 -226
- package/src/components/CnSchemaFormDialog/CnSchemaFormDialog.vue +787 -787
- package/src/components/CnSchemaFormDialog/CnSchemaPropertiesTab.vue +305 -305
- package/src/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue +1398 -1398
- package/src/components/CnSchemaFormDialog/CnSchemaSecurityTab.vue +236 -236
- package/src/components/CnSettingsCard/CnSettingsCard.vue +92 -92
- package/src/components/CnSettingsSection/CnSettingsSection.vue +266 -266
- package/src/components/CnStatsBlock/CnStatsBlock.vue +420 -420
- package/src/components/CnStatusBadge/CnStatusBadge.vue +77 -77
- package/src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue +540 -540
- package/src/components/CnTasksCard/CnTasksCard.vue +373 -373
- package/src/components/CnTileWidget/CnTileWidget.vue +159 -159
- package/src/components/CnTimelineStages/CnTimelineStages.vue +292 -292
- package/src/components/CnUserActionMenu/CnUserActionMenu.vue +435 -435
- package/src/components/CnVersionInfoCard/CnVersionInfoCard.vue +312 -312
- package/src/components/CnWidgetRenderer/CnWidgetRenderer.vue +180 -180
- package/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +211 -211
- package/src/index.js +1 -1
- package/src/types/notification.d.ts +13 -13
- package/src/types/organisation.d.ts +15 -15
- package/src/types/schema.d.ts +13 -13
- package/src/types/task.d.ts +6 -6
- package/src/utils/headers.js +5 -3
|
@@ -1,180 +1,180 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
CnWidgetRenderer — Renders Nextcloud Dashboard API widgets (v1/v2).
|
|
3
|
-
|
|
4
|
-
Loads widget items from the Nextcloud widget API and displays them
|
|
5
|
-
using NcDashboardWidget. Supports auto-refresh for widgets that
|
|
6
|
-
define a reload interval.
|
|
7
|
-
-->
|
|
8
|
-
<template>
|
|
9
|
-
<div class="cn-widget-renderer">
|
|
10
|
-
<!-- API Widget V1 or V2 -->
|
|
11
|
-
<NcDashboardWidget
|
|
12
|
-
v-if="isApiWidget"
|
|
13
|
-
:items="widgetItems"
|
|
14
|
-
:show-more-url="widget.widgetUrl"
|
|
15
|
-
:loading="loading"
|
|
16
|
-
:item-menu="false"
|
|
17
|
-
:round-icons="widget.itemIconsRound">
|
|
18
|
-
<template #empty-content>
|
|
19
|
-
<NcEmptyContent
|
|
20
|
-
v-if="emptyMessage"
|
|
21
|
-
:description="emptyMessage">
|
|
22
|
-
<template #icon>
|
|
23
|
-
<span v-if="widget.iconClass" :class="widget.iconClass" />
|
|
24
|
-
</template>
|
|
25
|
-
</NcEmptyContent>
|
|
26
|
-
</template>
|
|
27
|
-
</NcDashboardWidget>
|
|
28
|
-
|
|
29
|
-
<!-- Loading state -->
|
|
30
|
-
<div v-else-if="loading" class="cn-widget-renderer__loading">
|
|
31
|
-
<NcLoadingIcon :size="32" />
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
<!-- Fallback for unknown widget types -->
|
|
35
|
-
<NcEmptyContent
|
|
36
|
-
v-else
|
|
37
|
-
:description="unavailableText">
|
|
38
|
-
<template #icon>
|
|
39
|
-
<AlertCircleOutline :size="48" />
|
|
40
|
-
</template>
|
|
41
|
-
</NcEmptyContent>
|
|
42
|
-
</div>
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<script>
|
|
46
|
-
import { NcDashboardWidget, NcEmptyContent, NcLoadingIcon } from '@nextcloud/vue'
|
|
47
|
-
import AlertCircleOutline from 'vue-material-design-icons/AlertCircleOutline.vue'
|
|
48
|
-
import axios from '@nextcloud/axios'
|
|
49
|
-
import { generateOcsUrl } from '@nextcloud/router'
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* CnWidgetRenderer — Renders Nextcloud Dashboard API widgets.
|
|
53
|
-
*
|
|
54
|
-
* Fetches widget items from the OCS Dashboard API and displays them
|
|
55
|
-
* using the standard NcDashboardWidget component.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* <CnWidgetRenderer :widget="ncWidget" />
|
|
59
|
-
*/
|
|
60
|
-
export default {
|
|
61
|
-
name: 'CnWidgetRenderer',
|
|
62
|
-
|
|
63
|
-
components: {
|
|
64
|
-
NcDashboardWidget,
|
|
65
|
-
NcEmptyContent,
|
|
66
|
-
NcLoadingIcon,
|
|
67
|
-
AlertCircleOutline,
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
props: {
|
|
71
|
-
/**
|
|
72
|
-
* Nextcloud widget object from the Dashboard API.
|
|
73
|
-
* @type {{ id: string, title: string, iconClass?: string, iconUrl?: string, widgetUrl?: string, itemIconsRound?: boolean, itemApiVersions?: number[], reloadInterval?: number, buttons?: Array }}
|
|
74
|
-
*/
|
|
75
|
-
widget: {
|
|
76
|
-
type: Object,
|
|
77
|
-
required: true,
|
|
78
|
-
},
|
|
79
|
-
/** Text shown when widget is not available */
|
|
80
|
-
unavailableText: {
|
|
81
|
-
type: String,
|
|
82
|
-
default: 'Widget not available',
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
data() {
|
|
87
|
-
return {
|
|
88
|
-
loading: false,
|
|
89
|
-
items: [],
|
|
90
|
-
emptyMessage: '',
|
|
91
|
-
refreshInterval: null,
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
computed: {
|
|
96
|
-
isApiWidgetV2() {
|
|
97
|
-
return this.widget?.itemApiVersions?.includes(2)
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
isApiWidgetV1() {
|
|
101
|
-
return this.widget?.itemApiVersions?.includes(1)
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
isApiWidget() {
|
|
105
|
-
return this.isApiWidgetV1 || this.isApiWidgetV2
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
widgetItems() {
|
|
109
|
-
return this.items.map(item => ({
|
|
110
|
-
id: item.sinceId || item.id || String(Math.random()),
|
|
111
|
-
targetUrl: item.link || item.targetUrl || '',
|
|
112
|
-
avatarUrl: item.iconUrl || item.avatarUrl || '',
|
|
113
|
-
avatarUsername: item.avatarUsername || '',
|
|
114
|
-
overlayIconUrl: item.overlayIconUrl || '',
|
|
115
|
-
mainText: item.title || item.mainText || '',
|
|
116
|
-
subText: item.subtitle || item.subText || '',
|
|
117
|
-
}))
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
async mounted() {
|
|
122
|
-
if (this.isApiWidget) {
|
|
123
|
-
await this.loadItems()
|
|
124
|
-
|
|
125
|
-
if (this.widget.reloadInterval && this.widget.reloadInterval > 0) {
|
|
126
|
-
this.refreshInterval = setInterval(
|
|
127
|
-
() => this.loadItems(),
|
|
128
|
-
this.widget.reloadInterval * 1000,
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
beforeDestroy() {
|
|
135
|
-
if (this.refreshInterval) {
|
|
136
|
-
clearInterval(this.refreshInterval)
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
methods: {
|
|
141
|
-
async loadItems() {
|
|
142
|
-
this.loading = true
|
|
143
|
-
try {
|
|
144
|
-
const version = this.isApiWidgetV2 ? 2 : 1
|
|
145
|
-
const url = generateOcsUrl(
|
|
146
|
-
`/apps/dashboard/api/v${version}/widget-items`,
|
|
147
|
-
)
|
|
148
|
-
const response = await axios.get(url, {
|
|
149
|
-
params: { widgets: [this.widget.id] },
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
const data = response.data?.ocs?.data
|
|
153
|
-
if (data && data[this.widget.id]) {
|
|
154
|
-
const widgetData = data[this.widget.id]
|
|
155
|
-
this.items = widgetData.items || widgetData || []
|
|
156
|
-
this.emptyMessage = widgetData.emptyContentMessage || ''
|
|
157
|
-
}
|
|
158
|
-
} catch (error) {
|
|
159
|
-
console.error(`[CnWidgetRenderer] Failed to load items for ${this.widget.id}:`, error)
|
|
160
|
-
} finally {
|
|
161
|
-
this.loading = false
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
}
|
|
166
|
-
</script>
|
|
167
|
-
|
|
168
|
-
<style scoped>
|
|
169
|
-
.cn-widget-renderer {
|
|
170
|
-
height: 100%;
|
|
171
|
-
padding: 8px;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.cn-widget-renderer__loading {
|
|
175
|
-
display: flex;
|
|
176
|
-
align-items: center;
|
|
177
|
-
justify-content: center;
|
|
178
|
-
height: 100%;
|
|
179
|
-
}
|
|
180
|
-
</style>
|
|
1
|
+
<!--
|
|
2
|
+
CnWidgetRenderer — Renders Nextcloud Dashboard API widgets (v1/v2).
|
|
3
|
+
|
|
4
|
+
Loads widget items from the Nextcloud widget API and displays them
|
|
5
|
+
using NcDashboardWidget. Supports auto-refresh for widgets that
|
|
6
|
+
define a reload interval.
|
|
7
|
+
-->
|
|
8
|
+
<template>
|
|
9
|
+
<div class="cn-widget-renderer">
|
|
10
|
+
<!-- API Widget V1 or V2 -->
|
|
11
|
+
<NcDashboardWidget
|
|
12
|
+
v-if="isApiWidget"
|
|
13
|
+
:items="widgetItems"
|
|
14
|
+
:show-more-url="widget.widgetUrl"
|
|
15
|
+
:loading="loading"
|
|
16
|
+
:item-menu="false"
|
|
17
|
+
:round-icons="widget.itemIconsRound">
|
|
18
|
+
<template #empty-content>
|
|
19
|
+
<NcEmptyContent
|
|
20
|
+
v-if="emptyMessage"
|
|
21
|
+
:description="emptyMessage">
|
|
22
|
+
<template #icon>
|
|
23
|
+
<span v-if="widget.iconClass" :class="widget.iconClass" />
|
|
24
|
+
</template>
|
|
25
|
+
</NcEmptyContent>
|
|
26
|
+
</template>
|
|
27
|
+
</NcDashboardWidget>
|
|
28
|
+
|
|
29
|
+
<!-- Loading state -->
|
|
30
|
+
<div v-else-if="loading" class="cn-widget-renderer__loading">
|
|
31
|
+
<NcLoadingIcon :size="32" />
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<!-- Fallback for unknown widget types -->
|
|
35
|
+
<NcEmptyContent
|
|
36
|
+
v-else
|
|
37
|
+
:description="unavailableText">
|
|
38
|
+
<template #icon>
|
|
39
|
+
<AlertCircleOutline :size="48" />
|
|
40
|
+
</template>
|
|
41
|
+
</NcEmptyContent>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script>
|
|
46
|
+
import { NcDashboardWidget, NcEmptyContent, NcLoadingIcon } from '@nextcloud/vue'
|
|
47
|
+
import AlertCircleOutline from 'vue-material-design-icons/AlertCircleOutline.vue'
|
|
48
|
+
import axios from '@nextcloud/axios'
|
|
49
|
+
import { generateOcsUrl } from '@nextcloud/router'
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* CnWidgetRenderer — Renders Nextcloud Dashboard API widgets.
|
|
53
|
+
*
|
|
54
|
+
* Fetches widget items from the OCS Dashboard API and displays them
|
|
55
|
+
* using the standard NcDashboardWidget component.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* <CnWidgetRenderer :widget="ncWidget" />
|
|
59
|
+
*/
|
|
60
|
+
export default {
|
|
61
|
+
name: 'CnWidgetRenderer',
|
|
62
|
+
|
|
63
|
+
components: {
|
|
64
|
+
NcDashboardWidget,
|
|
65
|
+
NcEmptyContent,
|
|
66
|
+
NcLoadingIcon,
|
|
67
|
+
AlertCircleOutline,
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
props: {
|
|
71
|
+
/**
|
|
72
|
+
* Nextcloud widget object from the Dashboard API.
|
|
73
|
+
* @type {{ id: string, title: string, iconClass?: string, iconUrl?: string, widgetUrl?: string, itemIconsRound?: boolean, itemApiVersions?: number[], reloadInterval?: number, buttons?: Array }}
|
|
74
|
+
*/
|
|
75
|
+
widget: {
|
|
76
|
+
type: Object,
|
|
77
|
+
required: true,
|
|
78
|
+
},
|
|
79
|
+
/** Text shown when widget is not available */
|
|
80
|
+
unavailableText: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: 'Widget not available',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
data() {
|
|
87
|
+
return {
|
|
88
|
+
loading: false,
|
|
89
|
+
items: [],
|
|
90
|
+
emptyMessage: '',
|
|
91
|
+
refreshInterval: null,
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
computed: {
|
|
96
|
+
isApiWidgetV2() {
|
|
97
|
+
return this.widget?.itemApiVersions?.includes(2)
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
isApiWidgetV1() {
|
|
101
|
+
return this.widget?.itemApiVersions?.includes(1)
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
isApiWidget() {
|
|
105
|
+
return this.isApiWidgetV1 || this.isApiWidgetV2
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
widgetItems() {
|
|
109
|
+
return this.items.map(item => ({
|
|
110
|
+
id: item.sinceId || item.id || String(Math.random()),
|
|
111
|
+
targetUrl: item.link || item.targetUrl || '',
|
|
112
|
+
avatarUrl: item.iconUrl || item.avatarUrl || '',
|
|
113
|
+
avatarUsername: item.avatarUsername || '',
|
|
114
|
+
overlayIconUrl: item.overlayIconUrl || '',
|
|
115
|
+
mainText: item.title || item.mainText || '',
|
|
116
|
+
subText: item.subtitle || item.subText || '',
|
|
117
|
+
}))
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
async mounted() {
|
|
122
|
+
if (this.isApiWidget) {
|
|
123
|
+
await this.loadItems()
|
|
124
|
+
|
|
125
|
+
if (this.widget.reloadInterval && this.widget.reloadInterval > 0) {
|
|
126
|
+
this.refreshInterval = setInterval(
|
|
127
|
+
() => this.loadItems(),
|
|
128
|
+
this.widget.reloadInterval * 1000,
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
|
|
134
|
+
beforeDestroy() {
|
|
135
|
+
if (this.refreshInterval) {
|
|
136
|
+
clearInterval(this.refreshInterval)
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
methods: {
|
|
141
|
+
async loadItems() {
|
|
142
|
+
this.loading = true
|
|
143
|
+
try {
|
|
144
|
+
const version = this.isApiWidgetV2 ? 2 : 1
|
|
145
|
+
const url = generateOcsUrl(
|
|
146
|
+
`/apps/dashboard/api/v${version}/widget-items`,
|
|
147
|
+
)
|
|
148
|
+
const response = await axios.get(url, {
|
|
149
|
+
params: { widgets: [this.widget.id] },
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
const data = response.data?.ocs?.data
|
|
153
|
+
if (data && data[this.widget.id]) {
|
|
154
|
+
const widgetData = data[this.widget.id]
|
|
155
|
+
this.items = widgetData.items || widgetData || []
|
|
156
|
+
this.emptyMessage = widgetData.emptyContentMessage || ''
|
|
157
|
+
}
|
|
158
|
+
} catch (error) {
|
|
159
|
+
console.error(`[CnWidgetRenderer] Failed to load items for ${this.widget.id}:`, error)
|
|
160
|
+
} finally {
|
|
161
|
+
this.loading = false
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
}
|
|
166
|
+
</script>
|
|
167
|
+
|
|
168
|
+
<style scoped>
|
|
169
|
+
.cn-widget-renderer {
|
|
170
|
+
height: 100%;
|
|
171
|
+
padding: 8px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.cn-widget-renderer__loading {
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
justify-content: center;
|
|
178
|
+
height: 100%;
|
|
179
|
+
}
|
|
180
|
+
</style>
|