@@ -16,6 +16,7 @@ import io.ktor.utils.io.charsets.Charsets
16
16
import kotlinx.html.FlowContent
17
17
import kotlinx.html.FlowOrInteractiveOrPhrasingContent
18
18
import kotlinx.html.HTML
19
+ import kotlinx.html.HTMLTag
19
20
import kotlinx.html.a
20
21
import kotlinx.html.button
21
22
import kotlinx.html.h1
@@ -26,6 +27,8 @@ import kotlinx.html.p
26
27
import kotlinx.html.script
27
28
import kotlinx.html.span
28
29
import kotlinx.html.stream.createHTML
30
+ import kotlinx.html.style
31
+ import kotlinx.html.svg
29
32
import kotlinx.html.table
30
33
import kotlinx.html.tbody
31
34
import kotlinx.html.td
@@ -34,6 +37,7 @@ import kotlinx.html.thead
34
37
import kotlinx.html.title
35
38
import kotlinx.html.tr
36
39
import kotlinx.html.unsafe
40
+ import kotlinx.html.visit
37
41
import org.modelix.authorization.hasPermission
38
42
import org.modelix.authorization.requiresLogin
39
43
import org.modelix.model.lazy.RepositoryId
@@ -112,7 +116,7 @@ class RepositoryOverview(private val repoManager: IRepositoriesManager) {
112
116
}
113
117
th { + " Branch" }
114
118
th {
115
- colSpan = " 3 "
119
+ colSpan = " 4 "
116
120
+ " Actions"
117
121
}
118
122
}
@@ -125,6 +129,7 @@ class RepositoryOverview(private val repoManager: IRepositoriesManager) {
125
129
td {
126
130
rowSpan = repoRowSpan
127
131
+ repository.id
132
+ buildPermissionManagementLink(repository.id, null )
128
133
}
129
134
td {
130
135
rowSpan = repoRowSpan
@@ -145,6 +150,7 @@ class RepositoryOverview(private val repoManager: IRepositoriesManager) {
145
150
span {
146
151
+ branch.branchName
147
152
}
153
+ buildPermissionManagementLink(repository.id, branch.branchName)
148
154
}
149
155
td {
150
156
buildHistoryLink(repository.id, branch.branchName)
@@ -177,6 +183,19 @@ internal fun FlowOrInteractiveOrPhrasingContent.buildExploreLatestLink(repositor
177
183
}
178
184
}
179
185
186
+ internal fun FlowOrInteractiveOrPhrasingContent.buildPermissionManagementLink (repositoryId : String , branchName : String? ) {
187
+ val resourceId = ModelServerPermissionSchema .repository(repositoryId)
188
+ .let { if (branchName == null ) it.resource else it.branch(branchName).resource }
189
+ .fullId
190
+ a(" ../permissions/resources/${resourceId.encodeURLPathPart()} /" ) {
191
+ svg {
192
+ style = " color: rgba(0, 0, 0, 0.87); fill: rgba(0, 0, 0, 0.87); width: 20px; height: 20px;"
193
+ attributes[" viewBox" ] = " 0 0 24 24"
194
+ HTMLTag (" path" , consumer, mapOf (" d" to " M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1s3.1 1.39 3.1 3.1z" ), null , false , false ).visit {}
195
+ }
196
+ }
197
+ }
198
+
180
199
internal fun FlowContent.buildDeleteRepositoryForm (repositoryId : String ) {
181
200
button {
182
201
name = " delete"
0 commit comments