mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
upoad test
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.gpr.gabinetedigital">
|
||||
|
||||
<!-- Required permissions -->
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
},
|
||||
{
|
||||
"path": "../sih"
|
||||
},
|
||||
{
|
||||
"path": "../Ionic-Video-Capture-Play-main"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
|
||||
@@ -12,8 +12,6 @@ export class SocketConnectionMCRService {
|
||||
|
||||
connect() {
|
||||
|
||||
console.log("SocketConnectionMCRService")
|
||||
|
||||
var connection = new signalR.HubConnectionBuilder()
|
||||
.withUrl("https://gdcmapi-dev.dyndns.info/FileHub", {
|
||||
accessTokenFactory: () => SessionStore.user.Authorization
|
||||
@@ -25,7 +23,10 @@ export class SocketConnectionMCRService {
|
||||
console.log("ReceiveMessage", message)
|
||||
})
|
||||
|
||||
|
||||
connection.onreconnected((connectionId) => {
|
||||
console.assert(connection.state === signalR.HubConnectionState.Connected);
|
||||
console.log(`Reconnected with connectionId: ${connectionId}`);
|
||||
});
|
||||
|
||||
connection.start()
|
||||
.then(() => {
|
||||
@@ -36,7 +37,8 @@ export class SocketConnectionMCRService {
|
||||
});
|
||||
|
||||
connection.onclose((error) => {
|
||||
console.log("SignalR connection closed:", error);
|
||||
connection.start()
|
||||
console.log("SignalR connection closed:", error);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -155,7 +155,7 @@ interface CreateOrganizer {
|
||||
|
||||
|
||||
export interface IuploadFileLK {
|
||||
path: string
|
||||
data: string
|
||||
}
|
||||
// ================================================ PUT =============================================
|
||||
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>SignalR Lab</title>
|
||||
<script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.12.4.min.js"></script>
|
||||
<!--<script src="//ajax.aspnetcdn.com/ajax/signalr/jquery.signalr-2.2.2.min.js"></script>-->
|
||||
<!--<script type="text/javascript" src="lib/signalr.min.js"></script>-->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/microsoft-signalr/5.0.0/signalr.min.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="col-md-7">
|
||||
<p>SignalR Messages:</p>
|
||||
<pre id="signalr-message-panel"></pre>
|
||||
</div>
|
||||
<div>
|
||||
<ul id="events"></ul>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
var connection = new signalR.HubConnectionBuilder()
|
||||
.withUrl("https://gdcmapi-dev.dyndns.info/FileHub", {
|
||||
|
||||
accessTokenFactory: () => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJTZWN1cml0eUF1dGgiOiIyZWZ3bmxzRFEyNGU0TzdVZFhPWVNFRFF1Y0NaUzNBeWJ2bjF1cG90TEUwPSIsImVtYWlsIjoiM0s1VmwwVElINjMvd3dpeVhsZXpJdXp6TUMyRVBBTWVBZ3JMUzB0dlQrSzA2Z0MxQ2pZRVRkZ0JDRGNiY2pOZ2k4bkVhRjFYWk13b28zcTZKVHVHeHc9PSIsIm5hbWVpZCI6IjE5OCIsImdyb3Vwc2lkIjoiR2FiaW5ldGUgZGUgVGVjbm9sb2dpYXMgZGUgSW5mb3JtYcOnw6NvIiwib3JnYW5pY2VudGl0eWlkRCI6IjEwNiIsIm5iZiI6MTcwNTU3ODQ2MiwiZXhwIjoxNzA1NTc5MzYyLCJpYXQiOjE3MDU1Nzg0NjIsImlzcyI6IjhiMTMwYTdmMC1jN2I3LTQ3czIzLTlhOGQtZDU5YTAxOWFmNzQ5IiwiYXVkIjoiZDI4d3cxNDUzLTNjNjgtNDFhZC04YjZjLWE1MzQ1MzgzZTBjMiJ9.jz8rjrOR91UH3W_uUw8VZm1Wbw1FBIwWJ85JfaWBrjw'
|
||||
|
||||
}).configureLogging(signalR.LogLevel.Information)
|
||||
.build();
|
||||
|
||||
|
||||
connection.on("ReceiveMessage", (message) => {
|
||||
$('#signalr-message-panel').prepend($('<div />').text(message));
|
||||
});
|
||||
connection.on("UpdatedUserList", function (ConnectionId, users) {
|
||||
$("#events").append("<li>" + ConnectionId + "</li>");
|
||||
$("#events").append("<li>" + users + "</li>");
|
||||
|
||||
});
|
||||
$('#btn-broadcast').click(function () {
|
||||
var message = $('#broadcast').val();
|
||||
connection.invoke("BroadcastMessage", message).catch(err => console.error(err.toString()));
|
||||
});
|
||||
|
||||
$('#btn-self-message').click(function () {
|
||||
var message = $('#self-message').val();
|
||||
connection.invoke("SendToCaller", message).catch(err => console.error(err.toString()));
|
||||
});
|
||||
|
||||
$('#btn-others-message').click(function () {
|
||||
var message = $('#others-message').val();
|
||||
connection.invoke("SendToOthers", message).catch(err => console.error(err.toString()));
|
||||
});
|
||||
|
||||
$('#btn-user-message').click(function () {
|
||||
var message = $('#user-message').val();
|
||||
var user = $('#user-for-message').val();
|
||||
connection.invoke("SendToUser", user, message).catch(err => console.error(err.toString()));
|
||||
});
|
||||
|
||||
$('#btn-group-message').click(function () {
|
||||
var message = $('#group-message').val();
|
||||
var group = $('#group-for-message').val();
|
||||
connection.invoke("SendToGroup", group, message).catch(err => console.error(err.toString()));
|
||||
});
|
||||
|
||||
$('#btn-group-add').click(function () {
|
||||
var group = $('#group-to-add').val();
|
||||
connection.invoke("AddUserToGroup", group).catch(err => console.error(err.toString()));
|
||||
});
|
||||
|
||||
$('#btn-group-remove').click(function () {
|
||||
var group = $('#group-to-remove').val();
|
||||
connection.invoke("RemoveUserFromGroup", group).catch(err => console.error(err.toString()));
|
||||
});
|
||||
|
||||
async function start() {
|
||||
try {
|
||||
await connection.start({ withCredentials: false });
|
||||
console.log('connected');
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
setTimeout(() => start(), 5000);
|
||||
}
|
||||
};
|
||||
|
||||
connection.onclose(async () => {
|
||||
await start();
|
||||
});
|
||||
|
||||
start();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<!-- Main jumbotron for a primary marketing message or call to action -->
|
||||
<!--<div class="jumbotron">
|
||||
<div class="container">
|
||||
<h1 class="display-3">JWT Auth Demo</h1>
|
||||
<p>This demo shows local and facebook user registration and login flow using Angular v5.2.1, ASP.NET Core 2.0 WebApi and Facebook api</p>
|
||||
<p><a class="btn btn-primary btn-lg" href="#" role="button" routerLink="/register">Signup with email</a> <a class="btn btn-primary btn-lg" href="#" role="button" routerLink="/login">Login with email</a> <a class="btn btn-primary btn-lg" href="#" role="button" routerLink="/facebook-login">Signup/login with facebook</a></p>
|
||||
</div>
|
||||
</div>-->
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- <div class="back-icon">
|
||||
<ion-icon class="font-35-rem" (click)="goBack()" slot="end" src='assets/images/icons-arrow-arrow-left.svg'></ion-icon>
|
||||
</div> -->
|
||||
<div class="div-title">
|
||||
<div class="div-title" (click)="uploadChunk()">
|
||||
<ion-label class="title">{{ publicationTitle }}</ion-label> <br>
|
||||
<i style="margin-top: -3px; font-size: 15px;"> Campos marcados com * são obrigatórios</i>
|
||||
</div>
|
||||
|
||||
@@ -85,7 +85,7 @@ export class NewPublicationPage implements OnInit {
|
||||
this.filecontent = true;
|
||||
}
|
||||
|
||||
// this.SocketConnectionMCRService.connect()
|
||||
this.SocketConnectionMCRService.connect()
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -416,8 +416,6 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
// this.publicationFormMV.setDataToFrom(this.publication)
|
||||
// this.publicationFormMV.uploadVideosFiles()
|
||||
|
||||
this.publication.Files = this.publication.Files.map( e => ({
|
||||
FileBase64: e.FileBase64,
|
||||
@@ -871,6 +869,27 @@ export class NewPublicationPage implements OnInit {
|
||||
this.seletedContent.splice(index, 1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
uploadChunk() {
|
||||
let time = new Date()
|
||||
|
||||
this.publication = {
|
||||
DateIndex: time,
|
||||
DocumentId: null,
|
||||
ProcessId: this.folderId,
|
||||
Title: this.pub.Title,
|
||||
Message: this.pub.Message,
|
||||
DatePublication: time,
|
||||
OriginalFileName: this.capturedImageTitle || 'foto',
|
||||
Files: this.seletedContent,
|
||||
}
|
||||
|
||||
|
||||
this.publicationFormMV.setDataToFrom(this.publication)
|
||||
this.publicationFormMV.uploadVideosFiles()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// class UploadFileUseCase {
|
||||
@@ -988,7 +1007,7 @@ class UploadFileUseCase {
|
||||
const blob = new Blob([chunk]);
|
||||
const blobFile = new File([blob], "test.mp4", { type: blob.type });
|
||||
|
||||
return await this.CMAPIService.FileContent({length, path, index, blobFile})
|
||||
return await this.CMAPIService.FileContent({length, path: ChucksManager.path, index, blobFile})
|
||||
}
|
||||
|
||||
if(!ChucksManager.hasPath()) {
|
||||
@@ -998,11 +1017,12 @@ class UploadFileUseCase {
|
||||
const blob = new Blob([chuck]);
|
||||
const blobFile = new File([blob], "test.mp4", { type: blob.type });
|
||||
|
||||
const uploadRequest = await this.CMAPIService.FileContent({length, path, index: initIndex, blobFile})
|
||||
const uploadRequest = await this.CMAPIService.FileContent({length, path:ChucksManager.path, index: initIndex, blobFile})
|
||||
|
||||
if(uploadRequest.isOk()) {
|
||||
|
||||
path = uploadRequest.value.path
|
||||
path = uploadRequest.value.data
|
||||
|
||||
ChucksManager.setPath(path)
|
||||
ChucksManager.setResponse(initIndex, uploadRequest.value as any)
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>SignalR CDN Example</title>
|
||||
<!-- Include SignalR from CDN -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/microsoft-signalr/5.0.0/signalr.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Your HTML content goes here -->
|
||||
|
||||
<script>
|
||||
var connection = new signalR.HubConnectionBuilder()
|
||||
.withUrl("https://gdcmapi-dev.dyndns.info/FileHub", {
|
||||
accessTokenFactory: () => "SessionStore.user.Authorization"
|
||||
})
|
||||
.configureLogging(signalR.LogLevel.Information)
|
||||
.build();
|
||||
|
||||
connection.on("ReceiveMessage", (message) => {
|
||||
console.log("ReceiveMessage", message);
|
||||
});
|
||||
|
||||
// the following lines if you want to start the connection
|
||||
connection.start()
|
||||
.then(() => {
|
||||
console.log("SignalR connection started.");
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error starting SignalR connection:", error);
|
||||
});
|
||||
|
||||
// Uncomment the following line if you want to handle connection closure
|
||||
connection.onclose((error) => {
|
||||
console.log("SignalR connection closed:", error);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>SignalR CDN Example</title>
|
||||
<!-- Include SignalR from CDN -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/microsoft-signalr/5.0.0/signalr.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Your HTML content goes here -->
|
||||
|
||||
<script>
|
||||
var connection = new signalR.HubConnectionBuilder()
|
||||
.withUrl("https://gdcmapi-dev.dyndns.info/FileHub", {
|
||||
accessTokenFactory: () => "SessionStore.user.Authorization"
|
||||
})
|
||||
.configureLogging(signalR.LogLevel.Information)
|
||||
.build();
|
||||
|
||||
connection.on("ReceiveMessage", (message) => {
|
||||
console.log("ReceiveMessage", message);
|
||||
});
|
||||
|
||||
// the following lines if you want to start the connection
|
||||
connection.start({withCredentials: false})
|
||||
.then(() => {
|
||||
console.log("SignalR connection started.");
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Error starting SignalR connection:", error);
|
||||
});
|
||||
|
||||
// Uncomment the following line if you want to handle connection closure
|
||||
connection.onclose((error) => {
|
||||
console.log("SignalR connection closed:", error);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,4 +4,4 @@ import { doneITProd } from './suport/doneIt'
|
||||
import { DevDev } from './suport/dev'
|
||||
|
||||
|
||||
export const environment: Environment = oaprProd;
|
||||
export const environment: Environment = DevDev;
|
||||
|
||||
Reference in New Issue
Block a user