This commit is contained in:
2020-12-30 03:10:02 +00:00
parent 0f08e5891c
commit f3943a9487
12 changed files with 34 additions and 29 deletions

View File

@ -10,8 +10,20 @@ using RestSharp;
using RestSharp.Deserializers; using RestSharp.Deserializers;
using System.Linq; using System.Linq;
namespace GoogleTranslateNET namespace GoogleTranslateNET
{ {
public class NoSevrerSideImplementationAttribute : Attribute
{
public string Reason { get ; private set; }
public NoSevrerSideImplementationAttribute(string reason) : base()
{
Reason = reason;
}
}
[NoSevrerSideImplementation("none")]
public class GoogleTranslate public class GoogleTranslate
{ {
private string _key; private string _key;
@ -193,4 +205,4 @@ namespace GoogleTranslateNET
return "There was an error. Unable to determine the cause."; return "There was an error. Unable to determine the cause.";
} }
} }
} }

View File

@ -25,7 +25,7 @@
"defaultNamespace": "Yavsc" "defaultNamespace": "Yavsc"
}, },
"dependencies": { "dependencies": {
"Newtonsoft.Json": "6.0.0", "Newtonsoft.Json": "6.0.1-beta1",
"Gapi.net45": "1.0.1", "Gapi.net45": "1.0.1",
"RestSharp": "103.4.0" "RestSharp": "103.4.0"
}, },

View File

@ -1,5 +1,5 @@
SOURCE_DIR=$(HOME)/workspace/yavsc SOURCE_DIR=$(HOME)/workspace/yavsc
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make MAKEFILE_DIR=$(SOURCE_DIR)/scripts/make
include $(MAKEFILE_DIR)/dnx.mk include $(MAKEFILE_DIR)/dnx.mk
include $(MAKEFILE_DIR)/versioning.mk include $(MAKEFILE_DIR)/versioning.mk

View File

@ -1,5 +1,5 @@
SOURCE_DIR=$(HOME)/workspace/yavsc SOURCE_DIR=$(HOME)/workspace/yavsc
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make MAKEFILE_DIR=$(SOURCE_DIR)/scripts/make
include $(MAKEFILE_DIR)/dnx.mk include $(MAKEFILE_DIR)/dnx.mk
include $(MAKEFILE_DIR)/versioning.mk include $(MAKEFILE_DIR)/versioning.mk

View File

@ -1,5 +1,5 @@
MAKEFILE_DIR=../../scripts/build/make MAKEFILE_DIR=../../scripts/make
BASERESX=Resources/Yavsc.Attributes.Validation.Resources.resx \ BASERESX=Resources/Yavsc.Attributes.Validation.Resources.resx \
Resources/Yavsc.Models.Messaging.Resources.resx \ Resources/Yavsc.Models.Messaging.Resources.resx \
Resources/Yavsc.Models.IT.Fixing.Bug.resx\ Resources/Yavsc.Models.IT.Fixing.Bug.resx\

View File

@ -1,5 +1,5 @@
SOURCE_DIR=$(HOME)/workspace/yavsc SOURCE_DIR=$(HOME)/workspace/yavsc
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make MAKEFILE_DIR=$(SOURCE_DIR)/scripts/make
BASERESX=Resources/Yavsc.Models.Relationship.HyperLink.resx \ BASERESX=Resources/Yavsc.Models.Relationship.HyperLink.resx \
Resources/Yavsc.Models.Streaming.LiveFlow.resx Resources/Yavsc.Models.Streaming.LiveFlow.resx
BASERESXGEN=$(BASERESX:.resx=.Designer.cs) BASERESXGEN=$(BASERESX:.resx=.Designer.cs)

View File

@ -9,7 +9,7 @@ using Yavsc.Models.Relationship;
namespace Yavsc.Server.Models.Access namespace Yavsc.Server.Models.Access
{ {
[Obsolete] [Obsolete("use rules from .access files")]
public class CircleAuthorizationToFile : ICircleAuthorization public class CircleAuthorizationToFile : ICircleAuthorization
{ {

View File

@ -39,9 +39,11 @@ namespace Yavsc.Controllers
return await _dbContext.Tags.Where( t=> t.Name.StartsWith(id)).Select(t=>t.Name).Take(25).ToArrayAsync(); return await _dbContext.Tags.Where( t=> t.Name.StartsWith(id)).Select(t=>t.Name).Take(25).ToArrayAsync();
} }
[HttpGet("live/{id}")] [HttpGet("live/uid-{id}")]
public async Task<IActionResult> GetLive(string id) public async Task<IActionResult> ByUserId(string id)
{ {
// TODO read access rights
// TODO multiple channel
if (!HttpContext.WebSockets.IsWebSocketRequest) return new BadRequestResult(); if (!HttpContext.WebSockets.IsWebSocketRequest) return new BadRequestResult();
var uid = User.GetUserId(); var uid = User.GetUserId();
var existent = _liveProcessor.Casters[id]; var existent = _liveProcessor.Casters[id];
@ -73,7 +75,7 @@ namespace Yavsc.Controllers
} }
[HttpGet("meta/{id}")] [HttpGet("meta/uid-{id}")]
public async Task<IActionResult> GetLiveFlow([FromRoute] long id) public async Task<IActionResult> GetLiveFlow([FromRoute] long id)
{ {
if (!ModelState.IsValid) if (!ModelState.IsValid)
@ -163,29 +165,29 @@ namespace Yavsc.Controllers
} }
// DELETE: api/LiveApi/5 // DELETE: api/LiveApi/5
[HttpDelete("meta/{id}")] [HttpDelete("meta/uid-{uid}")]
public async Task<IActionResult> DeleteLiveFlow([FromRoute] long id) public async Task<IActionResult> DeleteLiveFlow([FromRoute] long uid)
{ {
if (!ModelState.IsValid) if (!ModelState.IsValid)
{ {
return HttpBadRequest(ModelState); return HttpBadRequest(ModelState);
} }
LiveFlow liveFlow = await _dbContext.LiveFlow.SingleAsync(m => m.Id == id); LiveFlow liveFlow = await _dbContext.LiveFlow.SingleAsync(m => m.Id == uid);
if (liveFlow == null) if (liveFlow == null)
{ {
return HttpNotFound(); return HttpNotFound();
} }
var uid = User.GetUserId(); var cuid = User.GetUserId();
if (liveFlow.OwnerId!=uid) if (liveFlow.OwnerId!=cuid)
{ {
ModelState.AddModelError("id","This flow isn't yours."); ModelState.AddModelError("id","This flow isn't yours.");
return HttpBadRequest(ModelState); return HttpBadRequest(ModelState);
} }
_dbContext.LiveFlow.Remove(liveFlow); _dbContext.LiveFlow.Remove(liveFlow);
await _dbContext.SaveChangesAsync(uid); await _dbContext.SaveChangesAsync(cuid);
return Ok(liveFlow); return Ok(liveFlow);
} }

View File

@ -3,7 +3,7 @@ PRODDESTDIR=/srv/www/yavsc
HOSTING=localhost HOSTING=localhost
ASPNET_LOG_LEVEL=debug ASPNET_LOG_LEVEL=debug
SOURCE_DIR=$(HOME)/workspace/yavsc SOURCE_DIR=$(HOME)/workspace/yavsc
MAKEFILE_DIR=$(SOURCE_DIR)/scripts/build/make MAKEFILE_DIR=$(SOURCE_DIR)/scripts/make
BASERESX= Resources/Yavsc.Models.IT.Fixing.Resources.resx \ BASERESX= Resources/Yavsc.Models.IT.Fixing.Resources.resx \
Resources/Yavsc.ViewComponents.CommentViewComponent.resx \ Resources/Yavsc.ViewComponents.CommentViewComponent.resx \
Resources/Yavsc.ViewModels.FrontOffice.PerformerProfileViewModel.resx \ Resources/Yavsc.ViewModels.FrontOffice.PerformerProfileViewModel.resx \

View File

@ -285,6 +285,7 @@ namespace Yavsc.Models
public DbSet<BlogTrad> BlogTrad { get; set; } public DbSet<BlogTrad> BlogTrad { get; set; }
[Obsolete("use signaled flows")]
public DbSet<LiveFlow> LiveFlow { get; set; } public DbSet<LiveFlow> LiveFlow { get; set; }
public DbSet<ChatRoomAccess> ChatRoomAccess { get; set; } public DbSet<ChatRoomAccess> ChatRoomAccess { get; set; }

View File

@ -2,8 +2,8 @@
ViewData["Title"] = @SR["About"]+" "+@SiteSettings.Value.Title; ViewData["Title"] = @SR["About"]+" "+@SiteSettings.Value.Title;
} }
<h1>@ViewData["Title"]</h1> <h1>@ViewData["Title"]</h1>
<environment names="zicmoove,Development"> <environment names="Development">
**Version de Development**
<markdown> <markdown>
## L'objectif ## L'objectif
@ -101,8 +101,6 @@ C'est mon site pérso, une configuration de _Yavsc_ (encore une autre très peti
Autres installations: Autres installations:
</markdown> </markdown>
<markdown> <markdown>
* [Coiffure](http://coiffure.pschneider.fr)
* [ZicMoove](http://linkmuse.pschneider.fr)
* [Yavsc](http://yavsc.pschneider.fr) * [Yavsc](http://yavsc.pschneider.fr)
</markdown> </markdown>
</environment> </environment>
@ -125,8 +123,6 @@ Autres installations:
En production: En production:
* [Coiffure](https://coiffure.pschneider.fr)
* [ZicMoove](https://zicmoove.pschneider.fr)
* [Lua](https://lua.pschneider.fr) * [Lua](https://lua.pschneider.fr)
* [Yavsc](https://yavsc.pschneider.fr) * [Yavsc](https://yavsc.pschneider.fr)
@ -157,8 +153,6 @@ Veuillez excuser l'équipe de développement pour vous avoir fait part de cette
La "pré-production" affiche les sites suivants: La "pré-production" affiche les sites suivants:
* [Coiffure](https://coiffure.pschneider.fr)
* [ZicMoove](https://zicmoove.pschneider.fr)
* [Yavsc](https://yavsc.pschneider.fr) * [Yavsc](https://yavsc.pschneider.fr)
* [Lua](https://lua.pschneider.fr) * [Lua](https://lua.pschneider.fr)

View File

@ -122,8 +122,6 @@ Outras instalações:
En production: En production:
* [Coiffure](https://coiffure.pschneider.fr)
* [ZicMoove](https://zicmoove.pschneider.fr)
* [Lua](https://lua.pschneider.fr) * [Lua](https://lua.pschneider.fr)
* [Yavsc](https://yavsc.pschneider.fr) * [Yavsc](https://yavsc.pschneider.fr)
@ -154,8 +152,6 @@ Por favor, desculpe a equipe de desenvolvimento para informá-lo sobre este ende
A "pré-produção" exibe os seguintes sites: A "pré-produção" exibe os seguintes sites:
* [Coiffure](https://coiffure.pschneider.fr)
* [ZicMoove](https://zicmoove.pschneider.fr)
* [Yavsc](https://yavsc.pschneider.fr) * [Yavsc](https://yavsc.pschneider.fr)
* [Lua](https://lua.pschneider.fr) * [Lua](https://lua.pschneider.fr)