splid dev and prod & change version to 0.0.0.5

This commit is contained in:
2024-08-01 14:00:26 +02:00
parent a045916868
commit 4837f1ac7c
3 changed files with 45 additions and 24 deletions

View File

@@ -29,35 +29,56 @@ class BuildFilesList extends StatefulWidget {
class _BuildFilesListState extends State<BuildFilesList> { class _BuildFilesListState extends State<BuildFilesList> {
int indexOn = 0; int indexOn = 0;
final baseAPI = AppEnviroment.baseApiUrl; final baseAPI = AppEnviroment.baseApiUrl;
final basefile = AppEnviroment.baseFileUrl;
String fileUrl = ""; String fileUrl = "";
Future<String> getFileUrlApiCall(String filePath) async { Future<String> getFileUrlApiCall(String filePath) async {
var url;
if (AppEnviroment.getEnv() == "Dev") { if (AppEnviroment.getEnv() == "Dev") {
url = "$baseAPI/minio/pull/file/$filePath/dev"; return "$basefile/mih/$filePath";
} else { } else {
url = "$baseAPI/minio/pull/file/$filePath/prod"; var url = "$baseAPI/minio/pull/file/$filePath/prod";
//print(url);
var response = await http.get(Uri.parse(url));
// print("here1");
//print(response.statusCode);
if (response.statusCode == 200) {
//print("here2");
String body = response.body;
//print(body);
//print("here3");
var decodedData = jsonDecode(body);
//print("Dedoced: ${decodedData['minioURL']}");
return decodedData['minioURL'];
//AppUser u = AppUser.fromJson(decodedData);
// print(u.email);
//return "AlometThere";
} else {
throw Exception(
"Error: GetUserData status code ${response.statusCode}");
}
} }
//print(url); //print(url);
var response = await http.get(Uri.parse(url)); // var response = await http.get(Uri.parse(url));
// print("here1"); // // print("here1");
//print(response.statusCode); // //print(response.statusCode);
if (response.statusCode == 200) { // if (response.statusCode == 200) {
//print("here2"); // //print("here2");
String body = response.body; // String body = response.body;
//print(body); // //print(body);
//print("here3"); // //print("here3");
var decodedData = jsonDecode(body); // var decodedData = jsonDecode(body);
//print("Dedoced: ${decodedData['minioURL']}"); // //print("Dedoced: ${decodedData['minioURL']}");
return decodedData['minioURL']; // return decodedData['minioURL'];
//AppUser u = AppUser.fromJson(decodedData); // //AppUser u = AppUser.fromJson(decodedData);
// print(u.email); // // print(u.email);
//return "AlometThere"; // //return "AlometThere";
} else { // } else {
throw Exception("Error: GetUserData status code ${response.statusCode}"); // throw Exception("Error: GetUserData status code ${response.statusCode}");
} // }
} }
Future<void> deleteFileApiCall(String filePath, int fileID) async { Future<void> deleteFileApiCall(String filePath, int fileID) async {

View File

@@ -68,7 +68,7 @@
<script type="text/javascript"> <script type="text/javascript">
pdfjsLib.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.worker.min.js"; pdfjsLib.GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.11.338/pdf.worker.min.js";
</script> </script>
<script src="flutter_bootstrap.js?v=0.0.0.4" async></script> <script src="flutter_bootstrap.js?v=0.0.0.5" async></script>
<div id="loading_indicator" class="main"> <div id="loading_indicator" class="main">
<div><img class="indicator" src="Logo-loading.gif" /></div> <div><img class="indicator" src="Logo-loading.gif" /></div>

View File

@@ -75,7 +75,7 @@ async def delete_File_of_user(requestItem: minioDeleteRequest, session: SessionC
path = requestItem.file_path path = requestItem.file_path
try: try:
# uploudFile(app_id, file.filename, extension[1], content) # uploudFile(app_id, file.filename, extension[1], content)
client = Minio_Storage.minioConnection.minioConnect() client = Minio_Storage.minioConnection.minioConnect("dev")
minioError = client.remove_object("mih", path) minioError = client.remove_object("mih", path)
except Exception as error: except Exception as error:
@@ -103,7 +103,7 @@ async def upload_File_to_user(requestItem: medCertUploud, session: SessionContai
return {"message": "Successfully Generated File"} return {"message": "Successfully Generated File"}
def uploudFile(app_id, fileName, extension, content): def uploudFile(app_id, fileName, extension, content):
client = Minio_Storage.minioConnection.minioConnect() client = Minio_Storage.minioConnection.minioConnect("dev")
found = client.bucket_exists("mih") found = client.bucket_exists("mih")
if not found: if not found:
client.make_bucket("mih") client.make_bucket("mih")
@@ -121,7 +121,7 @@ def uploudFile(app_id, fileName, extension, content):
#"minio""localhost:9000" #"minio""localhost:9000"
def uploudMedCert(app_id, fullName, docfname, startDate, endDate, returnDate): def uploudMedCert(app_id, fullName, docfname, startDate, endDate, returnDate):
client = Minio_Storage.minioConnection.minioConnect() client = Minio_Storage.minioConnection.minioConnect("dev")
generateMedCertPDF(fullName, docfname, startDate, endDate, returnDate) generateMedCertPDF(fullName, docfname, startDate, endDate, returnDate)
found = client.bucket_exists("mih") found = client.bucket_exists("mih")
if not found: if not found: