File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 149149 class =" q-ml-sm"
150150 flat
151151 dense
152+ :disable =" props.row.enabled"
152153 >
153154 <q-tooltip class =" bg-indigo" :offset =" [10, 10]" >
154- Destroy: destroying will delete your instance and every bit of
155- data.
155+ <span v-if =" props.row.enabled" >
156+ Destroy: you can only destroy a disabled instance. Please
157+ disable it first.
158+ </span >
159+ <span v-else >
160+ Destroy: destroying will delete your instance and every bit of
161+ data.</span
162+ >
156163 </q-tooltip >
157164 </q-btn >
158165 </q-td >
@@ -1074,6 +1081,13 @@ export default defineComponent({
10741081 )
10751082 },
10761083 destroyInstance : function (id ) {
1084+ if (this .data .find (i => i .id === id)? .enabled ) {
1085+ return this .q .notify ({
1086+ message:
1087+ ' You can only destroy a disabled instance. Please disable it first.' ,
1088+ color: ' warning'
1089+ })
1090+ }
10771091 this .confirm (
10781092 ` Destroy ${ id} ` ,
10791093 ' Are you sure you want to destroy?' +
You can’t perform that action at this time.
0 commit comments