@@ -127,6 +127,7 @@ import ComposeLogs from '@/components/compose-log/index.vue';
127127import Config from ' @/views/website/runtime/php/config/index.vue' ;
128128import Supervisor from ' @/views/website/runtime/php/supervisor/index.vue' ;
129129import RuntimeStatus from ' @/views/website/runtime/components/runtime-status.vue' ;
130+ import { disabledButton } from ' @/utils/runtime' ;
130131
131132const paginationConfig = reactive ({
132133 cacheSizeKey: ' runtime-page-size' ,
@@ -160,7 +161,7 @@ const buttons = [
160161 openExtensionsManagement (row );
161162 },
162163 disabled : function (row : Runtime .Runtime ) {
163- return row . status != ' running ' ;
164+ return disabledButton ( row , ' extension ' ) ;
164165 },
165166 },
166167 {
@@ -169,7 +170,7 @@ const buttons = [
169170 operateRuntime (' down' , row .id );
170171 },
171172 disabled : function (row : Runtime .Runtime ) {
172- return row . status === ' recreating ' || row . status === ' stopped ' || row . status === ' building ' ;
173+ return disabledButton ( row , ' stop ' ) ;
173174 },
174175 },
175176 {
@@ -178,12 +179,7 @@ const buttons = [
178179 operateRuntime (' up' , row .id );
179180 },
180181 disabled : function (row : Runtime .Runtime ) {
181- return (
182- row .status === ' starting' ||
183- row .status === ' recreating' ||
184- row .status === ' running' ||
185- row .status === ' building'
186- );
182+ return disabledButton (row , ' start' );
187183 },
188184 },
189185 {
@@ -192,7 +188,7 @@ const buttons = [
192188 operateRuntime (' restart' , row .id );
193189 },
194190 disabled : function (row : Runtime .Runtime ) {
195- return row . status === ' recreating ' || row . status === ' building ' ;
191+ return disabledButton ( row , ' restart ' ) ;
196192 },
197193 },
198194 {
@@ -201,7 +197,7 @@ const buttons = [
201197 openDetail (row );
202198 },
203199 disabled : function (row : Runtime .Runtime ) {
204- return row . status === ' building ' ;
200+ return disabledButton ( row , ' edit ' ) ;
205201 },
206202 },
207203 {
@@ -210,7 +206,7 @@ const buttons = [
210206 openConfig (row );
211207 },
212208 disabled : function (row : Runtime .Runtime ) {
213- return row . status === ' building ' ;
209+ return disabledButton ( row , ' config ' ) ;
214210 },
215211 },
216212 {
@@ -219,14 +215,11 @@ const buttons = [
219215 openSupervisor (row );
220216 },
221217 disabled : function (row : Runtime .Runtime ) {
222- return row . status === ' building ' ;
218+ return disabledButton ( row , ' config ' ) ;
223219 },
224220 },
225221 {
226222 label: i18n .global .t (' commons.button.delete' ),
227- disabled : function (row : Runtime .Runtime ) {
228- return row .status === ' building' ;
229- },
230223 click : function (row : Runtime .Runtime ) {
231224 openDelete (row );
232225 },
0 commit comments