MilanM commited on
Commit
328fa9e
·
verified ·
1 Parent(s): f4b38ed

Update main_app.py

Browse files
Files changed (1) hide show
  1. main_app.py +24 -1
main_app.py CHANGED
@@ -1013,8 +1013,15 @@ def _(base_sw_spec_id, client, package_id, package_meta, uuid):
1013
  client.software_specifications.ConfigurationMetaNames.BASE_SOFTWARE_SPECIFICATION: {'guid': base_sw_spec_id},
1014
  client.software_specifications.ConfigurationMetaNames.PACKAGE_EXTENSIONS: [{'guid': package_id}]
1015
  }
 
 
1016
  ss_asset_details = client.software_specifications.store(meta_props=ss_metadata)
1017
 
 
 
 
 
 
1018
  if ss_asset_details is not None and "metadata" in ss_asset_details:
1019
  ss_asset_response = ss_asset_details["metadata"]
1020
  else:
@@ -1029,11 +1036,27 @@ def _(base_sw_spec_id, client, package_id, package_meta, uuid):
1029
 
1030
 
1031
  @app.cell
1032
- def _(client, mo, pd):
 
 
 
 
 
1033
  if client:
1034
  # First, get all specs data once
1035
  specs_df = client.software_specifications.list()
 
 
 
 
 
 
 
1036
 
 
 
 
 
1037
  # Filter the specs into two groups
1038
  base_specs = specs_df[
1039
  (specs_df['STATE'] == 'supported') &
 
1013
  client.software_specifications.ConfigurationMetaNames.BASE_SOFTWARE_SPECIFICATION: {'guid': base_sw_spec_id},
1014
  client.software_specifications.ConfigurationMetaNames.PACKAGE_EXTENSIONS: [{'guid': package_id}]
1015
  }
1016
+
1017
+
1018
  ss_asset_details = client.software_specifications.store(meta_props=ss_metadata)
1019
 
1020
+ current_status = get_selection_table_status()
1021
+ if ss_asset_details is not None:
1022
+ new_status = 1 if current_status is None else current_status + 1
1023
+ set_selection_table_status(new_status)
1024
+
1025
  if ss_asset_details is not None and "metadata" in ss_asset_details:
1026
  ss_asset_response = ss_asset_details["metadata"]
1027
  else:
 
1036
 
1037
 
1038
  @app.cell
1039
+ def _(mo):
1040
+ get_selection_table_status, set_selection_table_status = mo.state(None)
1041
+ return get_selection_table_status, set_selection_table_status
1042
+
1043
+ @app.cell
1044
+ def _(mo, client):
1045
  if client:
1046
  # First, get all specs data once
1047
  specs_df = client.software_specifications.list()
1048
+ elif if get_selection_table_status() is not None and get_selection_table_status() > 0:
1049
+ specs_df = client.software_specifications.list()
1050
+ else:
1051
+ specs_df = None
1052
+
1053
+ # ss_asset_details
1054
+ return (specs_df,)
1055
 
1056
+
1057
+ @app.cell
1058
+ def _(client, mo, pd, specs_df):
1059
+ if client:
1060
  # Filter the specs into two groups
1061
  base_specs = specs_df[
1062
  (specs_df['STATE'] == 'supported') &