File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,13 @@ export default {
176176 })
177177 this .disableSettings = (this .$route .meta .name === ' vm' && this .resource .state !== ' Stopped' )
178178 },
179+ filterOrReadOnlyDetails () {
180+ for (var i = 0 ; i < this .details .length ; i++ ) {
181+ if (! this .allowEditOfDetail (this .details [i].name )) {
182+ this .details .splice (i, 1 )
183+ }
184+ }
185+ },
179186 allowEditOfDetail (name ) {
180187 if (this .resource .readonlyuidetails ) {
181188 if (this .resource .readonlyuidetails .split (' ,' ).map (item => item .trim ()).includes (name)) {
@@ -257,13 +264,16 @@ export default {
257264 }
258265 this .error = false
259266 this .details .push ({ name: this .newKey , value: this .newValue })
267+ this .filterOrReadOnlyDetails ()
260268 this .runApi ()
261269 },
262270 updateDetail (index ) {
271+ this .filterOrReadOnlyDetails ()
263272 this .runApi ()
264273 },
265274 deleteDetail (index ) {
266275 this .details .splice (index, 1 )
276+ this .filterOrReadOnlyDetails ()
267277 this .runApi ()
268278 },
269279 onShowAddDetail () {
You can’t perform that action at this time.
0 commit comments